Is there a ST_Distance_Sphere, ST_Distance_Spheroid equivalent function in MySQL's GeoSpatial Support?
If not, any way to emulate this?
What is the metric used in return type of GLength (length of the LineString)?
The manual for GLength says that GLength() is a nonstandard name. It corresponds to the OpenGIS Length() function. But I couldn't find any Docs for OpenGIS Length(). All I found was for ST_Length are they the same?
Also for accuracy do I need to specify the SRID(4326)? How Do I do this in MySQL?
|
|
|||
|
|
|
In a nutshell, you need to use a projection library. PostGIS uses one (PROJ.4), but MySQL doesn't. The "ST_Distance_Sphere" like functions are much easier to implement, since the math is simpler (see Great-circle distance formulas, or other good examples). The "ST_Distance_Spheroid" like functions are more accurate (the shape of the earth is closer to a spheroid than a sphere), but are much more complicated. GLength returns the length of the linestring, where the units are the same as the input. So if you have long/lat in degrees, then your length is in degrees, which is usually meaningless. This is typically only meaningful with a projected geometry, using something like UTM where the length units are metres. If your mapping area is small, then you should store everything in projected units, not long/lat. As for accuracy, it is good as you want it to be (e.g., your GPS equipment). The coordinate geometry storage used with MySQL, as with most other GIS, is double precision, which should preserve any coordinate on earth within a small fraction of a millimetre. |
|||||||||||
|