Now I am making a closed navigation application, and I am trying to create a map point database in a building.
All used coordinate is taken from Google Map (this means that EPSG is 3857). Now I need to find the distance in meters, and also use D_Within in meters
When I try to extract the distance between two points:
SELECT ST_DISTANCE( ST_GeomFromText('POINT(' || StartLon || ' ' || StartLat || ')',3857), ST_GeomFromText('POINT(' || EndLon || ' ' || EndLat || ')',3857)) FROM i3_building.floordata;
For the first 2 lines with:
Start: 103.776047 1.292149; End: 103.77607 1.292212 (3 meters away) Start: 103.776070 1.292212; End: 103.77554 1.292406 (50 meters away)
The result obtained:
2.59422435413724e-005 4.11096095831604e-005
Despite the fact that they are in parliament, the second result is only two times higher than the first. Therefore, it confuses me. Then I try to output it as counters:
SELECT ST_DISTANCE( ST_GeographyFromText('POINT(' || StartLon || ' ' || StartLat || ')'), ST_GeographyFromText('POINT(' || EndLon || ' ' || EndLat || ')')) FROM i3_building.floordata;
Result for the same lines:
2.872546829 4.572207435
This is not what I expected. I am not very familiar with PostGis and SRID, so this question may seem simple, but please help me, I am stuck without @@
source share