title: PostGis Distance Calculation
body: <p>I am doing a indoor map navigation application right now and what I am trying to do is to build a database of map point in the building.</p>
  
  <p>All of the coordinate I use is taken from Google Map (which means the EPSG is 3857). What I need to do now is to find distance in meters as well as use D_Within in meters</p>
  
  <p>When I try to extract out the distance between 2 point: </p>
  
  <pre><code>SELECT ST_DISTANCE(
  ST_GeomFromText('POINT(' || StartLon || ' ' || StartLat || ')',3857),
  ST_GeomFromText('POINT(' || EndLon || ' ' || EndLat || ')',3857))
  FROM i3_building.floordata;
  </code></pre>
  
  <p>For the first 2 row with: </p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Result given is: </p>
  
  <pre><code>2.59422435413724e-005
  4.11096095831604e-005
  </code></pre>
  
  <p>Even though they are in rad, the second result is only twice as high as the first one. So it makes me confuse. 
  Then I try to output it as meters:</p>
  
  <pre><code>SELECT ST_DISTANCE(
      ST_GeographyFromText('POINT(' || StartLon || ' ' || StartLat || ')'),
      ST_GeographyFromText('POINT(' || EndLon || ' ' || EndLat || ')'))
  FROM i3_building.floordata;
  </code></pre>
  
  <p>The result given for the same rows is: </p>
  
  <pre><code>2.872546829
  4.572207435
  </code></pre>
  
  <p>Which is not what I expected as well. 
  I am not very familiar with PostGis and SRID so this question might seem simple but please help me out, I am stuck no @@</p>