I'm trying to understand the data conversions that happen in PostGIS when calculating distances in SRID 4326.
Why is it that when I run on my marin_jobs points table:
select cast (the_geom as geography), the_geom from marin_jobs where blockid10 = '060411141001010' limit 1;
the_geom the_geom geography geometry 010100.... 010100....
And the wkt output values are exactly the same?
I came to this question because when I run a distance query (see below for code) on two points in my dataset, if I don't use
cast () as geography I get out degrees, just like the Boundless Geography tutorial said I would. http://postgis.net/workshops/postgis-intro/geography.html
But I don't understand how if the inputs are (seem to be anyway) exactly the same, the outputs are different. Or should I ask...are the outputs really different?
Does that mean that the value of
0.0616262566763201 degrees and
6007.875564598 meters are the same, but just in different units?
But this doesn't jive with what the Boundless Tutorial says,
"On a sphere, the size of one “degree square” is quite variable, becoming smaller as you move away from the equator. Think of the meridians (vertical lines) on the globe getting closer to each other as you go towards the poles. So, a distance of 121 degrees doesn’t mean anything. It is a nonsense number."
Any plain English claficiation would be really helpful. This is keeping me up at night.
select st_distance ( (select the_geom from marin_jobs where blockid10 = '060411141001010' limit 1), (select the_geom from marin_jobs where blockid10 = '060411070005007' limit 1) );
select st_distance ( (select cast (the_geom as geography) from marin_jobs where blockid10 = '060411141001010' limit 1), (select cast (the_geom as geography) from marin_jobs where blockid10 = '060411070005007' limit 1) );