PDA

View Full Version : Extracting GPS Coordinates from a Route



ejcarp
02-19-2012, 11:20 PM
Hello! I know this has been discussed a few times before:
http://www.mapforums.com/how-get-gps-coordinates-interval-route-mappoint-15120.html
http://www.mapforums.com/extracting-coordinates-route-16777.html
http://www.mapforums.com/possible-export-mappoint-route-polyline-wkt-18727.html

but I was just wondering if anyone could point me in the right direction based on my project. I am an engineering student working on a GPS-based project. I am looking for a way to scan a route for grades(hills). I was planning on doing this by extracting the GPS data from points along a route at a fixed interval. I would then use an elevation API (USGS has one, but maybe this is available in MapPoint too?) to scan for grades. I was just wondering if anything like this was possible or if I should be going in a different direction in my attempts to scan for grades. Thanks for the help!

-Emily

Mattys Consulting
02-20-2012, 08:01 AM
Hi Emily,

I think that you can do this by using shapes of different colors for different degrees of grade/depths.
It would require importing the USGS .shp files over the range of the plotted route.
This sort of project could get rather extensive; If you require further help, I'd need the .shp files.

ejcarp
02-20-2012, 02:22 PM
Hi Emily,

I think that you can do this by using shapes of different colors for different degrees of grade/depths.
It would require importing the USGS .shp files over the range of the plotted route.
This sort of project could get rather extensive; If you require further help, I'd need the .shp files.

Thanks for the reply! Just to let you know I am very much a beginner. I am a third-year student in computer science so I know how to program, but working with map information is new to me. The USGS API I was referencing: http://gisdata.usgs.net/XMLWebServices/TNM_Elevation_Service.php will return only the elevation for a given latitude-longitude pair. So I am unsure how to get a .shp file. Also how would using shapes of different color help me scan for these grades? I do not need a visual map for my project, only the GPS information about where the grades will be along the route. For example, I was planning on storing the GPS point of the beginning of the grade (uphill), the GPS point of the end of the grade, the length of the grade, and the total elevation increase. The main things I was hoping to get out of MapPoint are the route data from point A to point B and interval GPS data all along this route.

I guess the two questions I have for you are 1) How do I get/generate a .shp file? 2) What is a shape in the context of MapPoint and how could it help me find a grade?

Thanks so much for your help!

-Emily

Mattys Consulting
02-20-2012, 02:38 PM
Good questions, Emily.

Where to get the .shp files is a matter of a search.
I'm fairly certain that I've looked at them in the last 2 years.

In any case, I am *speculating* that you'll be able to

- plot a route
- find the nearest shapes
- examine the color property of each shape

I've never heard of this being done in MapPoint, but it just might be possible.

ejcarp
02-20-2012, 02:42 PM
Good questions, Emily.

Where to get the .shp files is a matter of a search.
I'm fairly certain that I've looked at them in the last 2 years.

In any case, I am *speculating* that you'll be able to

- plot a route
- find the nearest shapes
- examine the color property of each shape

I've never heard of this being done in MapPoint, but it just might be possible.

Ahh okay, I think I know what you are saying. The .shp files of the US exist and are available somewhere on the web and it is just a matter of finding them? Also could you clarify what shapes are?

Thanks!

Mattys Consulting
02-20-2012, 02:52 PM
Shapes in MapPoint are simply drawing shapes as seen on the drawing toolbar.
If you are able to find the elevation .shp files and convert them to MapPoint drawings
(there are tools to do this, in particular, http://www.mapping-tools.com/mpsupershape/index.shtml),
then you'll be able to make 1-2 ft Red, 3-4 ft Yellow, 5-6 ft green, and so on.

Get the coordinate of the shape as it meets the route and you'll have a color to tell you your elevation.
Again, speculation ... :nuke:

Eric Frost
02-21-2012, 07:40 AM
I think Emily can get the elevation from the USGS web service, i.e. just pass in a lat/lon and it returns the elevation, so all she really needs is the coordinates along the route?

Eric

ejcarp
02-21-2012, 07:45 AM
I think Emily can get the elevation from the USGS web service, i.e. just pass in a lat/lon and it returns the elevation, so all she really needs is the coordinates along the route?

Eric

Yes, that is exactly what I meant. Is that possible? Actually I think MapPoint could give me the elevation as well.

-Emily

Eric Frost
02-21-2012, 08:01 AM
It is! Using the articles you referenced above.

MapPoint has an "altitude" property that might be misleading.

Altitude refers to how zoomed in or out you are on the map -- i.e. sort of like how high your airplane or hot air balloon is up in the air looking down on the Earth.

But MapPoint does not have elevation. For elevation, the USGS web service sounds like a good fit.

hope this helps!

Mattys Consulting
02-21-2012, 08:05 AM
Yes, I think that's correct.
See this address: Elevation_Service Web Service (http://gisdata.usgs.net/xmlwebservices2/elevation_service.asmx?op=getElevation)
I don't believe that MapPoint is able to return precise elevations, though.
I would write a program to get the coords from the route and then query the webservice ...

ejcarp
02-21-2012, 08:06 AM
It is! Using the articles you referenced above.

MapPoint has an "altitude" property that might be misleading.

Altitude refers to how zoomed in or out you are on the map -- i.e. sort of like how high your airplane or hot air balloon is up in the air looking down on the Earth.

But MapPoint does not have elevation. For elevation, the USGS web service sounds like a good fit.

hope this helps!

Okay, thanks for the clarification. Is there a way to get those GPS coordinates from an even interval? It seemed like in the other discussions you could only do it at a fixed time interval. I think I tried to download what you posted here: http://www.mapforums.com/extracting-coordinates-route-16777.html but I could not because I am not a member. Is that the tool I need to use or are there other options that follow a fixed interval?

Thanks!
Emily

ejcarp
02-21-2012, 08:09 AM
Yes that is exactly what I want to do! My question is on the step of writing the program to get the coordinates from the route. Any tips?

Mattys Consulting
02-21-2012, 12:45 PM
I think the best use of your time would be to add rest-stops at 1 minute intervals on your route and then get the coordinates for each pushpin location.
You can simply write them to a column in an Excel file and then get the related elevations from the USGS site for the next column.