Divide polygon into smaller

Hi,

Is there a function to split a polygon into several polygons with a given number of vertices? My problem is that I have to spend a Complex over 101 simple polygonal vertices less than 101 vertices.

I'm programming in VBA

Regards

Parents
  • Good illustration!

    Unknown said:
    Is there a function to split a polygon into several polygons with a given number of vertices?

    There is no function that does exactly what you want.  There are algorithms that will triangulate a polygon, but that isn't what you want either.

    You must write your own algorithm:

    1. Extract a list of vertices from your polygon (complex shape element)
    2. Iterate the vertex list  in chunks, 100 vertices at a time
      1. Close the chunk (insert new last.point = first.point)
      2. Construct a new shape element from each chunk of vertices
      3. Add the shape to your DGN model
    3. Delete the original complex shape

     
    Regards, Jon Summers
    LA Solutions

  • Hi Jon,

    Thanks for your reply. The theory is easy but there is a problem. Your solution is good for regular polygon. But if the polygon is irregular the areas are incorrect. You can see in the picture.

    Is there some algorithm or function that triangulates the polygon? I need it is divided into smaller areas and the sum of these is the total area.

    Best Regards

  • Unknown said:
    But if the polygon is irregular the areas are incorrect

    Well, you'll have to work on that.  As I wrote, there's no VBA method that does what you want.  I suggest that you search the web for similar solutions.  There are plenty of suggestions for simplifying polygons (which means reducing the number of vertices) but that is not what you are asking.  Equally, triangulation is a popular topic.  In the general domain of GIS analysis your request is unusual.

    Another approach could be to triangulate your complex polygon, then reassemble groups of triangles into polygons having no more than 101 vertices.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • Unknown said:
    But if the polygon is irregular the areas are incorrect

    Well, you'll have to work on that.  As I wrote, there's no VBA method that does what you want.  I suggest that you search the web for similar solutions.  There are plenty of suggestions for simplifying polygons (which means reducing the number of vertices) but that is not what you are asking.  Equally, triangulation is a popular topic.  In the general domain of GIS analysis your request is unusual.

    Another approach could be to triangulate your complex polygon, then reassemble groups of triangles into polygons having no more than 101 vertices.

     
    Regards, Jon Summers
    LA Solutions

Children