Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| 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. |
| |||
| 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. |
| ||||
|
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 Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| converting lat lon to x y | Dazzer | MapPoint 2006/2009 Discussion | 6 | 1 Week Ago 05:03 AM |
| 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 |
Rome Flights
Rome flights can be costly flights if you don't know where to book. You can find the latest deals from the leading UK Tour Operators at Holiday Hypermarket.
Flights to Spain
Find and book flights to Spain. Travel Counsellors can help with travel to Spain including flights and accommodation.
Cheap Holidays to Turkey
If you’re looking for cheap holidays to Turkey then dealchecker.co.uk is the place for you! Our search helps you see real prices from the UK’s top holiday companies all in one go.
Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!
Cheap Spain Holidays
Stay well informed when you are searching for cheap holidays online. For useful advice on when to book cheap Spain holidays make sure you look on ulookubook.com
Travel Deals
Click here and read up on the travel deals available online.
Holidays to Goa
Golden beaches, coconut trees. Visit On The Beach for holidays to Goa, and experience India!