Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Unlike this thread I actually need to split the polygons into several hole-less polygons. I'm not sure on how to approach to this problem.

I have polygons with holes of many diferent shapes, like buildings, esplanades, rivers, etc. And I need to split them in a coherent way (if the polygon is a river it should be splitted perpendiculary to his axis) and with less splits as possible.

I need to do it programatically. I'm using ArcObjects 9.3, but if there is no other way I could try to use a specific algorithm to solve this problem.

share|improve this question
1  
adding a picture would help! –  vinayan May 18 '12 at 5:09

3 Answers 3

Are you always going to split using a straight line?

If so, you could try something like:

  1. Find the center point of the hole.
  2. Determine the orientation of the splitting line through that point (i.e. based on whatever rules you have for building, rivers, etc.) -- this might required other algorithms based on polygon type.
  3. Split the polygon.
share|improve this answer
    
There's no need to be straight lines, but it's an option. Anyway the tricky part is the second point, that's what I really need. For some type of polygons I can cut it by the smallest line intersecting the label point of the hole, but for other types the splitting lines can cross each other. I hope that there is an efficient algorithm(s) that could do the job. –  cag May 14 '12 at 14:33
    
Does it matter if splitting lines cross? Wouldn't you just do one split at a time? I think maybe you need to provide some examples to the original question to clarify. –  Anthony -GISCOE- May 15 '12 at 13:57

I didn't quite understand your requirement for splitting in a coherent way. However, if you're okay with severe fragmentation, you can just triangulate/tessellate your data.

share|improve this answer

"I have polygons with holes of many diferent shapes, like buildings, esplanades, rivers, etc. And I need to split them in a coherent way (if the polygon is a river it should be splitted perpendiculary to his axis) and with less splits as possible."

You don't give anywhere near enough information as to your requirements for all cases; The desired result is non-obvious. I suggest making a question for each category of thing you'd like to do. Include a picture in each case.

For simple rivers that don't begin or end in the frame, at least, here is an algorithm for finding the center-line... is that what you're asking for?

  • Draw end lines where you'd like to slice the river
  • Where those ends intersect the river polygons, identify intersecting vertices.
  • Split the river by end lines
  • Eliminate topological holes in the river polygon
  • Convert river polygon to polylines
  • Split lines by intersecting vertices
  • Select lines which touch each pair of intersecting vertices (your riverbanks)
  • Depending on what you're able to do in your environment, either:
  • Create thiessen polygons from those lines

or

  • Mark each line with a different attribute (bankid=1,2)
  • Feature vertices to point (all)
  • Create thiessen polygons from points
  • Dissolve thiessen polygons by attribute
  • Split by end lines
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.