I'm new to GIS and wanted to start play around with some data about the appalachian trail (AT) and PostGIS.
However I already failed at the first and most simple task to calculate the length of the AT. I downloaded the data here. And imported it using the pgShapefileLoader. After loading I noticed that the srid of at_centerline wasn't set. Inspecting the table with select st_astext(geom) from at_centerline limit 1 showed that it was in lat/lon format. Therefore I updated the table with select updateGeometrySRID('at_centerline','geom',4326).
So, time to calculate the length
select sum( st_length( geography( geom ) ) ) / 1000 * 0.621371
from at_centerline
yielded 2122.61779398273 miles. However the AT currently is 2190 miles long.
I also tried to directly calculate the length in miles with this query
select sum( st_length( st_transform( geom, 2877 ) ) ) / 5280
from at_centerline;
which yielded 2126.50802521765 miles.
So how to explain the discrepancy? Is it simple the data provided by the ATC isn't accurate enough? I would rather doubt that. So what am I doing wrong here?
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]– Angelo.Hannes Jul 20 '17 at 18:40select updateGeometrySRID('at_centerline','geom',4269)and queried withselect sum(st_length(st_transform(geom, 4326)::geography))/1000*0.621371 from at_centerlineand still get 2122 miles – Angelo.Hannes Jul 20 '17 at 18:55