Jump to content

 
Photo

choosing parameters for an equidistant projection

- - - - - projection PostGIS

  • Please log in to reply
8 replies to this topic

#1
chris henrick

chris henrick

    Contributor

  • Validated Member
  • PipPip
  • 46 posts
  • Gender:Male
  • Location:Brooklyn, NY
  • Interests:cartography, graphic design, geography, urban studies, political ecology, cycling, percussion
  • United States

Greetings,

I'm new to PostGIS and looking to measure the distance of the Pacific Crest Trail which spans western North America from Canada to Mexico.

I have a data set containing the lat lon and dates from GPX data taken on the trail from a hiker. I also have a shapefile of the entire trail that's fairly high resolution. What I'd like to do is to extract the total mileage gained for each of the GPS locations from computing the length of the trail data and then intersecting the two.

 

I think the steps to doing this as are follows:

  1. process the GPS location data to get lat lon positions at weekly intervals with additional special events like summiting Mt Whitney, trail start, end, etc.(this part is finished)

  2. snap the lat lon GPS points to the nearest PCT shapefile nodes.

  3. split the PCT shapefile into segments based on an intersection with the GPS points.

  4. convert the total mileage from meters to miles.

  5. total the distance gained by each GPS point as the dates increase.

 

Some questions I have are:

What projection or method of measuring distance would be most accurate for such a large north - south distance? I'm thinking of transforming the data into a custom equidistant projection but am unsure about setting the parameters for yielding the most accurate distance measurement. Or does PostGIS have other functionality that would yield accurate distance measurements without having to transform the data?

Does this sound like a reasonable approach? Would you have any suggestions or tips that might help? Any advice you might have would be appreciated.

Thanks in advance,

-Chris


-Chris

#2
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,882 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

So if I read this correctly you're only going to use the parts of the GPX that are reasonably close to the trail? I'm confused...


Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#3
chris henrick

chris henrick

    Contributor

  • Validated Member
  • PipPip
  • 46 posts
  • Gender:Male
  • Location:Brooklyn, NY
  • Interests:cartography, graphic design, geography, urban studies, political ecology, cycling, percussion
  • United States

Hi Hans,

 

Yes I will be snapping the GPX point data to the line trail data, splicing the line based on the intersections of those points, then calculating the distance for each segment.

 

So I'm wondering how to set parameters for a projection to accurately measure each of these line segments.


-Chris

#4
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,882 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

I think any equidistant projection would do. That's why they're called equidistant.

 

Perhaps another thing to consider is not calculate horizontal distance, but the slope distance. That's a bit trickier to do.


Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#5
Strebe

Strebe

    Key Contributor

  • Validated Member
  • PipPipPip
  • 82 posts
  • Gender:Male
  • Interests:Map projections. Snobby chocolate. Science in general.
  • United States

Why would you use a projection to measure distance instead of using the GPS coordinates? A projection won't give correct results everywhere.

--daan Strebe

#6
chris henrick

chris henrick

    Contributor

  • Validated Member
  • PipPip
  • 46 posts
  • Gender:Male
  • Location:Brooklyn, NY
  • Interests:cartography, graphic design, geography, urban studies, political ecology, cycling, percussion
  • United States

@Daan I'd like to use a KML of the Pacific Crest Trail which spans Mexico to Canada to calculate the distance of GPX points along that trail. Each point is about a week apart in date and spans several hundred miles along the trail. I'm not trying to calculate distance "as the crow flies" but rather the distance of each trail segment between the points so that I can total the distance chronologically for each point.

 

From what I understand distance cannot be calculated accurately with data in a geographic coordinate system such as WGS84 which is why I'm looking to use an equidistant projection but am unsure of how to set the parameters for such a large area. PostGIS has an option of using the Geography type to calculate distance in WGS84 but I'm running into some hiccups with it. So, I'm looking for an open-source solution to my GIS problem as I don't have access to ESRI products.


-Chris

#7
chris henrick

chris henrick

    Contributor

  • Validated Member
  • PipPip
  • 46 posts
  • Gender:Male
  • Location:Brooklyn, NY
  • Interests:cartography, graphic design, geography, urban studies, political ecology, cycling, percussion
  • United States

@Hans yes that would be great to calculated elevation gain, though I'm leaving that for next :)


-Chris

#8
Michael Schmeling

Michael Schmeling

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 206 posts
  • Gender:Male
  • Location:Kassel, Germany
  • Germany

Couldn't you calculate the great circle distance between your points in geographical coordinates? There are open source programming libraries for this out there, e.g. for Python.


Michael Schmeling
Kassel, Germany
Arid Ocean Map Illustrations
http://maps.aridocean.com
Indie Cartographer
http://www.indiecartographer.com

#9
Strebe

Strebe

    Key Contributor

  • Validated Member
  • PipPipPip
  • 82 posts
  • Gender:Male
  • Interests:Map projections. Snobby chocolate. Science in general.
  • United States

"From what I understand distance cannot be calculated accurately with data in a geographic coordinate system such as WGS84"

You have it backward. You cannot compute distance accurately on a projection, but you can with direct coordinates. A projection is just a bunch of math. If a projection could yield accurate distances given geographic coirdinates then of course computing directly on the original coordinates could, and with less effort.

While it's true that long distances are hard to compute on the ellipsoid, very short distances of the sort you are dealing with are just a few multiplies, adds, square roots, and a sine or cosine or two.

-- daan Strebe
  • chris henrick likes this





Also tagged with one or more of these keywords: projection, PostGIS

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->