Bulk splitting of closed loops?

SeldomSeldom Global Mapper UserPosts: 46Trusted User
edited February 2012 in Technical Support
Hello Mike,
Does GM13 have a feature that would permit me to search for and split all closed loops? cgpsmapper won't permit them on a routable map, and so far I've been doing them by hand. (Hard on the arm an wrist.) Right now I'm trying to work out a PostGreSQL/PostGIS fix, but if GM did it, I'd have a much faster learning curve.
Thanks,
Hilton

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2012
    Hilton,

    There would be a way in the latest v13 builds. I have placed a new build at http://www.globalmapper.com/global_mapper13.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v13.xx installation folder to give it a try. If you are using the 64-bit v13 version there is a new build at http://www.globalmapper.com/global_mapper13_64bit.zip .

    In this build when you add measure attributes to line features if the line is closed you will also get an ENCLOSED_AREA attribute. So select your lines with the Digitizer Tool, then right-click and select the option to add measure attributes, then use Search->Search by Attributes to find all lines where ENCLOSED_AREA != '*' (i.e. find all non-empty ones). Then you can do something with them.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • SeldomSeldom Global Mapper User Posts: 46Trusted User
    edited February 2012
    Thanks, Mike.
  • tjhbtjhb Global Mapper User Posts: 454Trusted User
    edited February 2012
    The new feature Mike mentions would help with the selection of features for editing, but would leave the task of splitting (or separating) their startpoint and endpoint to be done by hand.

    FWIW Manifold System would be ideal for this task, either using SQL or the GUI. You might be able to do more or less the same in PostGreSQL/PostGIS (I don't know), so I'll mention the two ways that come to mind for Manifold in case they help.

    You'd first find all features where IsClosed() is true. Then either (a) clip each such feature with a buffer of small radius drawn around its startpoint (or endpoint), or (b) find the slope of starting and ending segments then move startpoint and endpoint away from each other along the respective slopes a fixed distance. Probably (a) is much easier, though (b) would be faster to execute.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited February 2012
    There is also a way to automate the splitting part in Global Mapper. Once you have found the closed lines via the Search tool, select on the search results dialog to select all of the matched results with the Digitizer Tool, then right-click with the Digitizer Tool active and select the Advance Feature Creation option to split the features into segments. This will give you separate lines for each segment of the closed lines.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • SeldomSeldom Global Mapper User Posts: 46Trusted User
    edited February 2012
    tjhb wrote: »
    FWIW Manifold System would be ideal for this task, either using SQL or the GUI. You might be able to do more or less the same in PostGreSQL/PostGIS (I don't know), so I'll mention the two ways that come to mind for Manifold in case they help.
    Got something working in PostGreSQL using ST_IsClosed and ST_Line_Substring(fieldname, 0.5, 1) and ST_Line_Substring(fieldname,0, 0.5).
    This splits every loop into 2 sections. But its a nuisance because I need to duplicate the loop record, and the only way I have figured to do that is to INSERT to a different table, then INSERT back. And of course there's a lot of text editing. So I'll probably stick with Mike's way.

    Thanks TJHB and Mike.
Sign In or Register to comment.