MapInfo Pro

Expand all | Collapse all

MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

  • 1.  MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

    Posted 12-22-2020 17:02

    Hello,

    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)

    Line-Data-Before

    Therefore, it has a much higher level of node density (see image below where MI Pro puts the nodes in blue)

    Line-Data-Node-Points-Zoomed-In-Before

    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)

    Line-Data-Node-Points-After

    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)

    Line-Data-Compare-Red-Lines-And-After-MIPro-Work--Aqua-Polygons

    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!



    ------------------------------
    Nicholas Evanish
    ------------------------------


  • 2.  RE: MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

    Posted 12-23-2020 05:19

    Hi Nicholas

    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



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 3.  RE: MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

    Posted 12-23-2020 10:26
    Edited by Nicholas Evanish 12-23-2020 12:00

    Peter,

    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/polygons
    Munis = municipality layer (polygon boundaries)


    Map From ObjectsTab, munis
    Set Map Layer 1 Editable On
    Select * from ObjectsTab
    Set Target On
    Select * From munis
    Objects 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)

    Query-ObjectInfo-Capture

    I appreciate your help & time.  Thank you.

    ------------------------------
    Nicholas Evanish
    ------------------------------



  • 4.  RE: MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

    Posted 12-23-2020 18:12

    Hi Nicholas,

    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.



    ------------------------------
    James Nolet
    Dooley Mitchell & Morrison Pty Ltd
    Mentone, VIC, Australia
    ------------------------------



  • 5.  RE: MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

    Posted 26 days ago

    James,

    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") 

    • Next, do the make only those lines/polyines editable, and set target, select municipal boundaries, and then do the SPLIT

    Second - SELECT only WHERE str$(obj) IN ("region")

    • Next, do the make only those region(s) editable, and set target, select municipal boundaries, and then do the SPLIT

    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:

    Same Set Target Then Split in MIPro 15 versus 17

    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?



    ------------------------------
    Nicholas Evanish
    ------------------------------



  • 6.  RE: MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

    Posted 25 days ago

    Hi Nicholas,

    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?



    ------------------------------
    James Nolet
    Dooley Mitchell & Morrison Pty Ltd
    Mentone, VIC, Australia
    ------------------------------



  • 7.  RE: MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

    Posted 19 days ago
    James,

    Yes.  I ended up having to redo the process I have using MI Pro v 17  to get the correct SPLIT results.

    I have to switch between MI Pro v 15 for the first part of my processing which does intensive object manipulation which leaves MI Pro v 17 with a memory leak.  (After about 15 minutes of running, the memory usage is over 1.5GB; whereas, with v 15, not even over 150MB)  I have made a note now, to just return to v 17 in order to perform the SPLIT functionality.

    The bug # MapInfo support gave me back in October of 2012 was "The bug number is MIPRO-17149."

    I've never received any further update from MapInfo which was unfortunate; therefore, I have to keep both versions 15 & 17 running on my workstation and server.

    Thanks again for your suggestions.


    ------------------------------
    Nicholas Evanish
    ------------------------------



  • 8.  RE: MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

    Posted 19 days ago
    Hi Nicholas

    I looked into this and we had a support case around "MapInfo Pro 17.0 object processing issue regarding memory usage compared to same code with Pro 15.0 32-bit", case MIPRO-102490. This one was created back in Sept 2018.

    It also seems that we have fixed a number of memory leaks in MapInfo Pro v2019.3. Would you be able to test this?

    MIPRO-17149 was from back in 2011 and was for an issue around opening an ESRI Shape file. I guess there must have been some mixup from your or our side here.


    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 9.  RE: MIPro Object Manipulate with Dense Nodes of Line Objects That Invert Into Polygon Object

    Posted 19 days ago
    Hi Peter,

    Thanks for the quick response.  I will have to get the time set aside to upgrade my local workstation to the latest MI Pro 2019.3, re-run my processes with the exact same datasets, and report back.

    Unfortunately, I won't be able to do the upgrade for a little while due to some other projects claiming higher priority (I'm sure we've all been there).  But, I will report back once I can on how things go at that point.

    Thanks again. Happy New Year

    ------------------------------
    Nicholas Evanish
    ------------------------------