There's more to experience when you log in!
I have a process that works with line and polygon data that compares the data to the municipality that is encompassed inside. This means, I take a large line segment, and I break it apart into several line segments, and apply the necessary data attributes depending on where the line segment exists. (i.e. Segment 1 is in Muni #1, Segment 2 is in Muni #2, Segment #3 is in Muni #3)
In one specific case, the supplied data (in .SHP format) is from an ESRI Geodatabase. (below)
Therefore, it has a much higher level of node density (see image below where MI Pro puts the nodes in blue)
After doing my object manipulation to clip objects to the bounds of the municipality they reside, MI Pro generates a new POLYGON object that basically encompasses all of the line objects. (see image below I made the newly created polygon objects RED to stand out for you to see)
This transformation into creating a polygon does not happen everywhere; however, it does happen in sporadic places. I almost feel like the MI Pro engine gets confused by the complexity of node points, and just defaults to generating a polygon somehow of all the objects.
See a wider view of my example below where the aqua polygons were generated by MI Pro and not a part of the original dataset (red lines)
Has anyone else encountered this? Or, can anyone help me understand how to eliminate this from happening? I am completely stuck and was hoping this post will help me find a resolution.
Thank you in advance. Happy Holidays!
I may be overlooking something in your post but I don't understand how you go from polylines to polygons in the process above.
As I understand it, you select all your polylines, make the layer editable, and sets these as your target.
You then select your polygons and use Split Target to split all your polylines where they cross a polygon.
This should generate new polylines in your original polyline table.
What have I missed?
And is the main purpose here to create a polyline dataset where you enrich the polylines with the name/id of the polygon they lie inside?
Thanks for the quick reply. I do not separate my splits by object type. Instead, I just do the split based on selecting the entire dataset (in this case it is a combination of: polygons, lines and/or polylines, and potentially points in there as well).
Could this be my issue? Are you saying that I should specifically only select out similar objects types first and foremost, do the set target, then split. And then after that is complete, proceed with the next object type (i.e. region), etc.?
These are the map basic commands I am telling MapInfo Pro to execute start (top) to finish (bottom):
ObjectsTab = the mixture of lines/polylines/polygonsMunis = municipality layer (polygon boundaries)
Map From ObjectsTab, munisSet Map Layer 1 Editable OnSelect * from ObjectsTabSet Target OnSelect * From munisObjects Split Into Target Data
* I can confirm that after these steps run, is when I notice the object manipulation where polygons are generated.Further, how would I query my single dataset to only SELECT the "lines" first, set as target, and do the split? I was trying to use the "ObjectInfo" function; however, I am not having any luck using that in the WHERE clause. (see image below that I can't get qualified to execute in MapInfo Pro)
I appreciate your help & time. Thank you.
str$(obj)="region" in the Where clause will give you all polygons, likewise str$(obj) in ("line", "polyline") for the lines.
This is the complete list of object types you can use with this function: Arc, Ellipse, Frame, Line, Point, Polyline, Rectangle, Region, Rounded Rectangle, or Text.
However, are you attempting the split directly on a Shape file? If so, I'd try saving as Native-MapInfo first.
Thank you for the reply. I apologize for the delay in writing back to you; however, with the holiday season, I have been on vacation (still am). I am already working with a native MapInfo .TAB file format.
I have taken into account what you recommended. My code was modified to use the str$(obj) function in a WHERE clause to help seperate the SPLIT functionality done within MI Pro to only do the following:
First - SELECT only the WHERE str$(obj) IN ("line", "polyline")
Second - SELECT only WHERE str$(obj) IN ("region")
What I found, was that in MI Pro v 15....the inversion regions DO appear....in MI Pro v 17.0.1...the inversion regions DOES NOT appear. Please see the image below as a reference (the red "B" label & orange shading fill of the region in the v 15 are the bad inversion regions created during the SPLIT operation) and as you can see, those are NOT created on the right-side.
Both use the same mapbasic execution lines to run and generate the results:
Does this make sense to you James because the MI Pro engine probably had evolved between v 15 to v 17? (That is the best answer I could come up with at this late hour) Your thoughts?
It seems that the split operation is misinterpreting closed lines as polygons, probably, as you said, due to the complexity of your lines or issues with your data. It is interesting that it seems that even lines that do not cross a border (and therefore do not need to be split) are forming polygons. There are various things you could try before the split operation, to see if you can prevent the polygons from forming. However, if the splitting is successful in v17, can you just stick with that version?