ThinkGeo.com    |     Documentation    |     Premium Support

Subtract one polygon from another on the fly

I am trying to intersect polygons on two layers using a line, however I want to only select polygons from layer 2 where the area is not already covered by layer 1.
So basically imagine each layer has one polygon and they overlap, and the polygon in layer 2 is bigger than the polygon in layer 1. If I have a line running through them, I only want to intersect the bigger polygon from layer 2 if the line intersects the areas that are not overlapped by the polygon in layer 1.

Hi ITMarinePress,

If I misunderstand your question please let me know.

It looks you want to remove the polygon 1 covered part in layer 1 from the polygon 2 in layer 2, and then split the rest parts in layer 2 by a line in layer 1, does that right?

If so you can use can operate that by the follow steps:

  1. Get the line shape 0, get the polygon 1, get the polygon 2
  2. Polygon 2 remove polygon 1
  3. Polygon 2_rest split by line shape 0

You can do that by our spatial query API, if you want to directly operate them, you can try our GisEditor.

Wish that’s helpful.

Regards,

Ethan