MapInfo Pro

 View Only
  • 1.  Splitting an Irregular Shape polygon into two equal Parts

    Posted 02-20-2020 07:18
    Hi 

    I need to Split an irregular shape polygon into exact two halves. The one of the sides of the polygon is straight however the other one is curved around an existing track as can be seen below. I need to carve a track of 5 feet wide through the middle which should split the polygon into two equal parts. Any ideas would be very much appreciated. 


    ------------------------------
    Kind Regards,

    Fiaz Hussain
    ------------------------------


  • 2.  RE: Splitting an Irregular Shape polygon into two equal Parts

    Moderator
    Posted 02-21-2020 14:27
    Edited by Susan Bardet 02-21-2020 18:40
    Hi Fiaz,

    One way to do this is, you could try using the 5 feet wide track as a cutter object to cut the irregular polygon​ along the centre. The result would be a polygon with a gap in the centre, then explode this polygon into 2 separate polygons. I do not know what the shape of the track is which you want to carve through the middle, and therefore I am not sure if my suggestion works well in your case. 
    I hope this helps. 
    ------------------------------
    Susan Bardet
    Software & Data support EMEA
    susan.bardet@pb.com

    Pitney Bowes
    Davidson House, Forbury Square
    Reading RG1 3EU
    Berkshire, United Kingdom
    pitneybowes.com
    ------------------------------



  • 3.  RE: Splitting an Irregular Shape polygon into two equal Parts

    Employee
    Posted 02-24-2020 00:11
    Hi Fiaz, 

    You could also try  using the  'Split ' function in the Spatial ribbon to cut the Polygon. Try the below steps and see if it helps.

    1. Draw a polyline to cut the target polygon
    2. Make the polygon layer editable
    3. Select the polygon and click on the "Set Target" in the Spatial ribbon
    4. Select the polyline to cut the area
    5. The Split function in the Spatial Ribbon gets enabled
    6. To split the polygon equally choose the middle point on the straight line using the Ruler tool in Map ribbon > Map Tools drop-down
    7. You could use a couple of points on the other side to snap(Press S to enable Snap) to which would help to get an accurate split 
    8. You will have to calculate to determine the correct start and end coordinates of your polyline being used to split. Double clicking on the polyline will give you the details.


    ------------------------------
    Shweta Shukla
    Pitney Bowes Software India
    Noida
    ------------------------------



  • 4.  RE: Splitting an Irregular Shape polygon into two equal Parts

    Posted 02-25-2020 21:27
    Hi Fiaz,

    I've come up with the following.  This could probably be done more accurately programmatically or using an alternative but see what you think.

    1. Rotate the polygon so that the polygon is on its side (with its straight edge running east-west). I did this by trial and error but you could calculate the angle beforehand.  Use the Rotate Object that comes with the Map Cad tool.
      Track_Rotate1
      Track_PolyRotated

    WARNING: choose the anchor point carefully when rotating; you will use this same anchor point later when reversing the rotation.

    1. Use Grid Maker to create very small grid regions that cover your polygon – the smaller the more accurate.
    2. Delete grid regions that are outside your region.
      Track_Grid
    3. Perform a group by to find the min and max row value of each column:

     Select Col_Name, Min(Row_Name) "MinRow", Max(Row_Name) "MaxRow" from Grid group by Col_Name into GridRowMinMax 

    1. Perform a query that returns the middle row value: 

    Select Col_Name, MinRow, MaxRow, Int((MaxRow-MinRow)/2)+MinRow "MidRow" from GridRowMinMax into GridRowMinMaxMid 

    1. Save this query and open as a new table 
    1. Join this query to the Grid table:

    Select * from Grid, GridRowMinMaxMid where Grid.Col_Name=GridRowMinMaxMid.Col_Name And Val(Grid.Row_Name)=GridRowMinMaxMid.MidRow into MiddleGrids

    1. Save the results and open as a new table
      Track_created 
    1. You might then convert these to points perhaps (for greater accuracy)

                     Update MiddleGrids Set obj = CreatePoint(CentroidX(obj),CentroidY(obj))


    1. Then buffer the points to create your 5-foot-wide track:

     

    Track_buffered
    1. Erase Outside to straighten the end points if desired:

     

    Track_eraseOutside
    1. Finally, return the object to the correct rotation (using the same anchor point as that used in step 1):

     

    Track_Rotated2

     



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



  • 5.  RE: Splitting an Irregular Shape polygon into two equal Parts

    Posted 02-26-2020 04:00
    Hi James,
    Thank you very much. This is exactly the type of solution I was looking for and going forward in the next step I have to further split the both new regions into two different sizes of grids. Actually this is a land for an extension of the existing cemetery and the two areas are to be divided equally among two different faiths. The land area available is too tight for any miscalculations that's why a solution is required which will use the maximum available area for each polygon along with other constraints.

    ------------------------------
    Fiaz Hussain
    ------------------------------



  • 6.  RE: Splitting an Irregular Shape polygon into two equal Parts

    Posted 02-26-2020 06:10
    Hi Fiaz,
    Sounds interesting.  It was a nice challenge and I'm glad I could help.

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



  • 7.  RE: Splitting an Irregular Shape polygon into two equal Parts

    Employee
    Posted 02-27-2020 08:24
    James,

    Your solution is as close to spatial magic as one can get.
    Nice one!

    ------------------------------
    Peter Horsbøll Møller
    Distinguished Engineer
    Pitney Bowes Software & Data
    ------------------------------



  • 8.  RE: Splitting an Irregular Shape polygon into two equal Parts

    Posted 02-27-2020 18:50
    Thanks Peter!

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