I wonder what the unit is of the float being returned from ST_Distance
.
In the documentation it says:
...cartesian minimum distance (based on spatial ref) between two geometries in projected units.
What are these projected units?
The geometry is stored in a field: geometry(Point,4326)
.
Answer
I think this is the most frequent question on PostGIS list over time :-)
If your data is in SRID 4326 and you use geometry
type the result will not give any meaning. It is in degrees.
To get the result in meters just cast to geography
type and ST_Distance
will calculate the distance along the great circle instead and return in meters.
geometry(Point,4326)::geography
Another option is to project your data to some local projection based on a suitable unit. Then the answer will be in that unit.
No comments:
Post a Comment