MySQL Forums
Forum List  »  GIS

Metric used in MYSQL Spatial
Posted by: AJAY WARRIER
Date: July 16, 2013 08:56AM

I am trying to determine the metric system for MySQL Spatial 5.6.12.

For example, I have the following table that created to store point geometry for multiple records.

CREATE TABLE POINTS_DATA(
RECORD_ID INT(15),
STREET_ADDRESS VARCHAR(50),
CITY VARCHAR(50),
STATE VARCHAR(25),
ZIPCODE VARCHAR(11),
LOCATION_GEO_CODES_SDO POINT NOT NULL,
SPATIAL INDEX(LOCATION_GEO_CODES_SDO),
PRIMARY KEY(RECORD_ID)
) ENGINE=MyISAM;

After the table was created , I inserted some records into the table successfully.

Now I have constructed the following query to fetch all the records that are within one mile from a specified LAT/LONG. Here is the query I run for that.

SELECT RECORD_ID, STREET_ADDRESS, CITY, STATE, ZIPCODE
, GLength(LineStringFromWKB(LineString(LOCATION_GEO_CODES_SDO
, POINT(-85.123,39.113))) AS DISTANCE
FROM POINTS_DATA
HAVING DISTANCE < 1 ORDER BY DISTANCE;

After running this query, I do get some records, but the distance does not seem to be in Miles or meters. ..its some fractional value like 0.0123, 0.0145...etc

I could not find any documentation on this anywhere in MySQL?. Does anyone know what metric system is in use in MySQL?..and if there is , how can I convert it into miles?

That means, if I need to run the query above to fetch all records within one mile, how do I reconstruct it?. Thanks in advance.

Options: ReplyQuote


Subject
Views
Written By
Posted
Metric used in MYSQL Spatial
5055
July 16, 2013 08:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.