Join points to create lines

5,974 views
Skip to first unread message

info...@btinternet.com

unread,
Nov 16, 2008, 6:22:44 PM11/16/08
to mapi...@googlegroups.com
Dear everyone

Is there a Map Basic program which will create lines out of point data. I
have some Lat/Long GPS data and I am looking to join the points up so that I
can calculate the total distance between all the points. I can see how to
create point data but not how to create line data.

Kind regards

Tim

Williams, Bill (DPS)

unread,
Nov 16, 2008, 6:24:46 PM11/16/08
to mapi...@googlegroups.com
Tim
See attached.

Bill Williams
Senior Researcher, Statistics & Mapping Section
Parliamentary Library
Department of Parliamentary Services
Parliament House
PO Box 6000
CANBERRA ACT 2600
Telephone : 02 62772513
Email: bill.w...@aph.gov.au
ConnectTheDots.MBX
ConnectTheDots.mb
ConnectTheDots.mbp

Peter Horsbøll Møller

unread,
Nov 17, 2008, 4:41:45 AM11/17/08
to mapi...@googlegroups.com
Also if you have MapInfo 9.5 the MapCAD tool has some nice tools for doing this, both for Simple lines and for Polylines
 
Peter Horsbøll Møller

Soren Lindqvist

unread,
Nov 17, 2008, 4:56:03 AM11/17/08
to mapi...@googlegroups.com
Hello,

I need to find a way to make an selection of dead end roads and update the table.
Long time ago I did see an solution on this list by using question with SQL, but can not find it.

How would I do to make this to an selection?
I have a large map with roads so doing it manually is not an option :)

Thanks
Soren

Peter Horsbøll Møller

unread,
Nov 17, 2008, 7:06:45 AM11/17/08
to mapi...@googlegroups.com
Søren,
 
Have a look at this thread. It does require that you use a MapBasic application, but the sourcecode is included in the thread:
 
Peter Horsbøll Møller

Soren Lindqvist

unread,
Nov 17, 2008, 7:20:34 AM11/17/08
to mapi...@googlegroups.com
Peter thanks,

Unfortunately I do not have the MapBasic application :(

Soren



On 11/17/08 1:06 PM, "Peter Horsbøll Møller" <mapi...@horsboll-moller.dk> wrote:

Søren,
 
Have a look at this thread. It does require that you use a MapBasic application, but the sourcecode is included in the thread:

Peter Horsbøll Møller

unread,
Nov 17, 2008, 7:58:40 AM11/17/08
to mapi...@googlegroups.com
You can build the application using the attached source code and the MapBasic compiler yiou can find here:
 
Or tell us what version of MapInfo you are running and one from the list can build it for you.
 
Seems as if I never found a proper solution for the problem I also described in this thread...
So maybe I should have a closer look at it ;-)
 
Peter Horsbøll Møller

Uffe Kousgaard

unread,
Nov 17, 2008, 8:03:13 AM11/17/08
to mapi...@googlegroups.com
Hi Peter,
 
The proper solution is called RouteFinder from www.routeware.dk and it is not that hard to find :-)
 
Regards
Uffe Kousgaard

Soren Lindqvist

unread,
Nov 17, 2008, 8:30:25 AM11/17/08
to mapi...@googlegroups.com
Uffe, is that included in the free version?
I only need the function for finding dead end links nothing more.
Or can you do one with only this function for much less?


Peter
I will have a look at it thanks..
I use version 8.5


You can build the application using the attached source code and the MapBasic compiler yiou can find here:

 
Or tell us what version of MapInfo you are running and one from the list can build it for you.
 
Seems as if I never found a proper solution for the problem I also described in this thread...
So maybe I should have a closer look at it ;-)

On 11/17/08 2:03 PM, "Uffe Kousgaard" <uf...@routeware.dk> wrote:

Hi Peter,

The proper solution is called RouteFinder from www.routeware.dk <http://www.routeware.dk>  and it is not that hard to find :-)

Regards
Uffe Kousgaard


----- Original Message -----
 
From:  Peter Horsbøll Møller <mailto:mapi...@horsboll-moller.dk>  
 
To: mapi...@googlegroups.com
 
Sent: Monday, November 17, 2008 1:58  PM
 
Subject: [MI-L] Re: To make a selection  of dead end roads
 

 
You can build the application using the  attached source code and the MapBasic compiler yiou can find here:
 

Uffe Kousgaard

unread,
Nov 17, 2008, 8:42:33 AM11/17/08
to mapi...@googlegroups.com
Hi,
 
No, that is part of the Pro version only. We'll take the other part of the question off-list.

Soren Lindqvist

unread,
Nov 17, 2008, 11:55:13 AM11/17/08
to mapi...@googlegroups.com
Hello,

> You can build the application using the attached source code and the MapBasic compiler you can find here:

The MapBasic version was for 9.5 and not the 8.5 version I have.


> Or tell us what version of MapInfo you are running and one from the list can build it for you.

If someone can do this for me I would very grateful.

Thanks
Soren



On 11/17/08 1:58 PM, "Peter Horsbøll Møller" <mapi...@horsboll-moller.dk> wrote:

You can build the application using the attached source code and the MapBasic compiler yiou can find here:

Peter Horsbøll Møller

unread,
Nov 17, 2008, 2:27:21 PM11/17/08
to mapi...@googlegroups.com
Søren,
 
I have fixed the application now to find polylines with one or two dead ends.
In order to make this work, the table will need a column with a unique ID. In my application this column is called ID.
Please let me know if you would prefer a different name.
 
I'll test it with some real data now, and then publish the appliation with sourcecode.
 
Uffe, I know it can be done with your application, but that is just to easy ;-)
I must say I wonder how quick my SQL is when I run it again a couple of hundred thousand roads... I'll let you know.
Peter Horsbøll Møller

info...@btinternet.com

unread,
Nov 17, 2008, 5:01:40 PM11/17/08
to mapi...@googlegroups.com
Dear Bill

Thank you for sending the MapBasic programs through. I will check them out
over the next few days.

Regards

Tim

info...@btinternet.com

unread,
Nov 17, 2008, 5:04:20 PM11/17/08
to mapi...@googlegroups.com
Dear everyone

Thank you for your replies. Someone sent through some MapBasic programs
which will be useful.

Regards

Tim

----- Original Message -----
From: "Peter Horsbøll Møller" <mapi...@horsboll-moller.dk>
To: <mapi...@googlegroups.com>

Williams, Bill (DPS)

unread,
Nov 17, 2008, 5:30:33 PM11/17/08
to mapi...@googlegroups.com
Tim
You're welcome.
A few words about the program though.
1. It will connect the dots in the order they were digitised.
2. The program will give you the option of removing the dots once you
have created the polyline. Remember, if the dots are removed they have
been deleted from the base file.
Always perform the connection on a copy of the original file.
3. The polyline or polygon that is created during the process will be
added to the dots file (as the last record). So if you want to isolate
and save the line or the shape on its own, you must perform a SAVE copy
AS function and then delete the relevant record from the file or close
without saving. You can of course retain the line or shape in the same
file, it depends on your own circumstances.
Hope this helps.
Regards

Soren Lindqvist

unread,
Nov 18, 2008, 2:39:06 AM11/18/08
to mapi...@googlegroups.com
Peter,
Sounds great, my first column is named “LINK_ID” but there are many with blanks. Will that be a problem? If so how should it be solved?

Soren

Peter Horsbøll Møller

unread,
Nov 18, 2008, 3:20:24 AM11/18/08
to mapi...@googlegroups.com
Hej Søren (- or is it really Soren ?)
I have attached the compiled version of the application and the sourecode as well.
 
The program requires a column called ID that contains unique values for each record.
So I would recommend that you add a new Integer column called ID to your table and update this with the ROWID.
You can do this by running this statement in the MapBasic window:
 
Update MYTABLE Where ID = ROWID
 
where MYTABLE should be replaced with the name of your table ;-)
 
I also must admit that this application isn't very fast... In my test example with 1100 records it took 3 minutes to complete. There is a pregressbar and you can also see the progress in the Message window.
 
Also note that it will only find the polylines that has a end or start point that doesn't intersect any other record in the selection.
 
Here is how it works:
1. Make sure your table has an ID column updated with a unique values, could be the ROWID
2. Make sure all records are polylines
3. Select the records to check for dead ends
4. Run the application
5. The application will now check each record to see if it intersects other objects in the selection at the start or end point. There will be a tolerance buffer of 0.5 meter.
6. The application inserts the number of dead ends on each record into a temporary table (it's called __DUMMY and is created in the Windows temp folder)
7. The application will select the records from the selection that has on or more dead ends (using the temporary table as a look up table thru a sub select)
 
Have fun
 
Peter Horsbøll Møller
GetDeadEndObjects.mb
GetDeadEndObjects.MBX

Soren Lindqvist

unread,
Nov 18, 2008, 5:18:34 AM11/18/08
to mapi...@googlegroups.com
Thanks Peter,

It’s actually Sören ;)
I am testing now but ohhh!!! this will take a long time and I am running a very small set of data compare to what I want to use
I wonder... I have a mbx that pick out “DingleNodes” and create marks (points) on them (on layer 0), this works very fast. I wonder if this can be another way to do it.
Can you make a selection to the polylines in the layer below by using the points as a direction? Something like > If point is on top (same coordinates as of polyline) If YES then make selection of polyline<

I attach the mbx

Regards
Soren
DingleNodes2007.MBX

Peter Horsbøll Møller

unread,
Nov 18, 2008, 6:47:40 AM11/18/08
to mapi...@googlegroups.com
Sören,
 
Yeah, you are right my application is very slow. Uffe told me that he could do the same in a split second with his tool. And he could also find more tricky dead ends as well. Of course his tool is dedicated to this kind of thing, mine was just using the SQL of MapInfo in an advanced way. I'm sure mine could be optimized a bit as well, if someone has the time ;-)
 
If you can create the points on the dead ends with a faster application, then you should be able to find the polylines that "intersects" these points.
 
Select * From MYPOLYLINETABLE
   Where OBJ Intersects (Select OBJ From MYPOINTTABLE)
 
If you want to add a search tolerance to the query you can create a buffer around the points:
 
Select * From MYPOLYLINETABLE
   Where OBJ Intersects (Select CartesianBuffer(OBJ, 4, 0.5, "m") From MYPOINTTABLE)

Peter
Reply all
Reply to author
Forward
0 new messages