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?