MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Converting points to lines

This is a discussion on Converting points to lines within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Are there any references available for converting a large number of GPS points (taken every second) into a more managable ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-19-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Converting points to lines

Are there any references available for converting a large number of GPS points (taken every second) into a more managable number of lines?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2004
Junior Member
Yellow Belt
 
Join Date: Jan 2003
Posts: 17
Send a message via ICQ to brianmcg
re: Converting points to lines

You could try something like this (pseudo VB code):

' assuming an array of your GPS latitudes 'aLat', and longitudes 'aLong'

dim aObjLocs(0 to Ubound(aLat)) as MapPoint.Location

' now create an array of location objects - one for each GPS fix

For n = 0 to Ubound(aLat)
Set aObjLocs(n) = objMap.GetLocation(aLat(n),aLong(n))
Next n

' now turn the array of locations into a polyline

objMap.Shapes.AddPolyline aObjLocs

You'd use the objMap.Shapes.Item(x).Vertices to retrieve and work with the array of locations that make up the Polyline, assuming 'x' is the item in the Shapes collection that you just added. Get this by calling objMap.Shapes.Count right after you call the AddPolyline method.

Note: Don't expect this code to work first time. I've probably left out a few things, but it gives the sense of a method that you could try.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Converting points to lines

What I really want to do is reduce the amount of data. For instance, I have a thousand points going in a line down Main Street. Because of the small errors in GPS, the points aren't mathematically in a line, but I want to save the data as a line segment, not as a thousand points. When the points make a left turn at 9th Street, I want to programatically detect that and have another line segment until the points turn or stop. I want my program to go through up to a million points and plot as few line segments on the map as possible.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2004
Winwaed's Avatar
Mapping-Tools.com
Black Belt
 
Join Date: Feb 2004
Posts: 1,142
Blog Entries: 22
How close are the points and what are the acceptable errors at turns?

If they're close and/or acceptable errors are reasonable, then you could do a simple decimation of the data - ie. only keep every other point / every third point / etc.

Snapping lines to data points is possible, but you still have to be aware of errors and tolerances. I wrote something to do this in 1d a while ago for reducing finely sampled geophysical data into "segments", based on the "method of least squares".
2d would be more complicated but do-able, and there are some nifty speedups possible if you know what you're doing.

Contact me off list (see contact form on website), if you're interested in us writing a program to do this for you.

Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
See the Geoweb Guru for online mapping
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
converting, lines, points


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
converting lat lon to x y Dazzer MapPoint 2006/2009 Discussion 7 02-10-2009 10:12 PM
Converting my Windows app. to ASP BobFromBoston MapPoint 2006/2009 Discussion 7 10-17-2005 12:43 PM
Drawing lines on the map between connected points dave murphy MapPoint 2006/2009 Discussion 2 04-14-2005 07:37 AM
Converting XY to Lat Long Anonymous MapPoint 2006/2009 Discussion 1 11-22-2004 02:35 AM
connecting points with lines robert hunter MapPoint 2006/2009 Discussion 2 09-05-2002 06:28 PM


All times are GMT -5. The time now is 11:37 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Tenerife Holiday
Find a great deal on a Tenerife holiday through UlookUbook! Check out the options online...



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59