Split Polyline nodes

359 views
Skip to first unread message

MEG

unread,
Sep 7, 2012, 1:09:42 PM9/7/12
to mapi...@googlegroups.com
I have a polyline that was "split" using a city boundary and the Objects Split command..  Therefore, the orginal polyline was split into 2 parts.  One part within the city boundary and then the other outside the city boundary.
 
Is there a way to determine that the polyline outside the city boundary is not contiguous?  In other words split due to the segement within the city boundary?
 
Thanks,
 
MEG

MEG

unread,
Sep 12, 2012, 11:33:13 AM9/12/12
to mapi...@googlegroups.com
Wondered if anyone had any thoughts on this? 
Hopefully the visual would help.
 
Again, a polyline is split into two parts (a portion within a City Boundary and the remaining outside the City boundary) as shown below.  The County portion is the same county and therefore one polyline when the split is done.  I want to split the one COUNTY polyline into two different polylines.  How do I determine their is a "hole" in this polyline?   Certainly I could walk down the nodes, but not sure what to evaluate the polyline to determine that the COUNTY line has a "hole in it" (created by the CITY boundary).
 
 
 
--------------------.=======================.--------------------
County                        CITY                                    County
 
 
Thanks for any assistance.
 
MEG
 
-------------------------------------------------------------------------------------------------------

Nyall Dawson

unread,
Sep 12, 2012, 5:12:55 PM9/12/12
to mapi...@googlegroups.com
On Thursday, 13 September 2012 01:33:13 UTC+10, MEG wrote:
Wondered if anyone had any thoughts on this? 
Hopefully the visual would help.
 
Again, a polyline is split into two parts (a portion within a City Boundary and the remaining outside the City boundary) as shown below.  The County portion is the same county and therefore one polyline when the split is done.  I want to split the one COUNTY polyline into two different polylines.  How do I determine their is a "hole" in this polyline?   Certainly I could walk down the nodes, but not sure what to evaluate the polyline to determine that the COUNTY line has a "hole in it" (created by the CITY boundary).

If I understand what you're asking for correctly, then using Objects -> Disaggregate on your polyline table should do the trick!

HTH,
Nyall


MEG

unread,
Sep 12, 2012, 5:23:35 PM9/12/12
to mapi...@googlegroups.com
Thanks Nyall.
 
I'm trying to write some MapBasic code to handle this.
 
My issue is trying to determine that the polyline has a hole in it like in the "line" diagram I included.
 
If I walk down the nodes, I don't know how to determine that the hole is there.
 
Once I determine, there is a hole in it, I'd use the OBJECTS -> Disaggregate command to create the two segments that I want.
 
MEG 

Nyall Dawson

unread,
Sep 12, 2012, 11:04:45 PM9/12/12
to mapi...@googlegroups.com
Ok, how about ObjectInfo(obj, OBJ_INFO_NPOLYGONS)? That should return 1 for polylines without holes, and anything above 1 for these split polylines.

Nyall

 

Bill Thoen

unread,
Sep 13, 2012, 4:08:06 PM9/13/12
to mapi...@googlegroups.com
If you want to do this in MapBasic, there are a number of ways.   But I'm still not sure what sort of polylines you have. It sounds like your county lines are weird. The first thing I'd do break those combined county polylines into their original segments. Then go through each new segment and match up the end points. Then , the places where an endpoint has only one connection are the edges of your holes.
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to thisgroup, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

MEG

unread,
Sep 14, 2012, 9:31:05 AM9/14/12
to mapi...@googlegroups.com
Bill:
 
Thanks for the response and let me explain further.
 
The user will be drawing a polyline across multiple counties and/or multiple city limits.
 
The application then needs to break the line into separate segments at a County/County line, County/City line or City/City line.
 
Then the application needs to "document" the break by updating a field.  For example, City Smyth County/Davidson City Limit would be where the line goes from Smyth County into the Davidson City Limits.
 
My thoughts were to walk the nodes and extract a pair of nodes and then check it using overlay to see if that "segment" was within the same "geography boundary".  If so, nothing needs to be done.  If it is, then I'd need to split the line apart (or possibly multiple parts).
 
Hope this helps outline the challenge.
 
Any thoughts/direction would be appreciated.
 
MEG
 
 
 
Reply all
Reply to author
Forward
0 new messages