Splitting polygon into multiple polygons using MapInfo

mapinfo

I have in a Mapinfo tab file multiple areas represented as some polygon lines. As you can see, the lines are now merged together as a unique polygon.

What I would like to do is to separate all those lines into single polygon and then check if one of the region in background covers more than 50% of this line.

Is it possible to do that with MapInfo?

Polygon

Best Answer

Disaggregate the polylines

  1. Make the layer with the polyline editable via the Explorer window or the Statusbar
  2. Select the polyline that you want to separate into individual polylines
  3. From the Spatial tab, select Disaggregate in the Edit group

This will separate the polyline into individual polylines where they don't touch.

Calculate Overlapping Percentage

  1. Use the SQL Window and write the following query:

Select l.ID, r.ID, ObjectLen(Overlap(l.obj, r.obj), "m") / ObjectLen(l.obj, "m") "Percentage" From Polygons As "r", Polylines As "l" Where l.obj Intersects r.obj

The resulting query will show you all the polygons that intersect any polyline. For each of these, it will return the ID of the polyline and the polygons (you can of course change this to a name instead) and how big a percentage of the polyline is within the polygon.

You can also include the percentage calculation in the Where clause to only return the polygons that overlap more than 50% of the polyline:

Select l.ID, r.ID, ObjectLen(Overlap(l.obj, r.obj), "m") / ObjectLen(l.obj, "m") "Percentage" From Polygons As "r", Polylines As "l" Where l.obj Intersects r.obj And ObjectLen(Overlap(l.obj, r.obj), "m") / ObjectLen(l.obj, "m") > 0.5

Related Question