Jump to content

 
Photo

Triangulate a Polygon Shapefile with Holes

- - - - -

  • Please log in to reply
7 replies to this topic

#1
Simmer

Simmer

    Contributor

  • Validated Member
  • PipPip
  • 31 posts
  • Trinidad and Tobago

Hi!

I'm trying for 2 days to find a tool that can triangulate shapefile areas/polygons with holes but can't find anything that gets me even close. What I need are convex polygons without any holes.
Any idea if GlobalMapper or other tools can do this?

Bests,
Simmer

#2
canvas101

canvas101

    Contributor

  • Validated Member
  • PipPip
  • 37 posts
  • United States

Hello Simmer,

If I understand you correctly, GlobalMapper will indeed perform the process you need. For example, if you create a hexagon in a GIS application and export it with or without Z values GlobalMapper will allow you to triangulate the polygon and create a TIN file. If there is Z values skip to “STEP 2”.

STEP 1. If there is no Z values in the GIS file you will need to add those in GlobalMapper via the Feature Info Tool. Click on the object and select vertices at the bottom of the Feature Information window and add the Z values here. Close that window and proceed to the next step.

STEP 2. Open the Control Center window and right click the vector file and a sub menu will appear under which you will select Create Elevation Grid from 3D Vector Data. Review the settings carefully. After executing the commands you will have a surface created from a vector file. Hope this helps.

Regards

#3
Simmer

Simmer

    Contributor

  • Validated Member
  • PipPip
  • 31 posts
  • Trinidad and Tobago

Hi!

Again and again I'm amazed on what GlobalMapper can do. If you have many polygons selected you can also do this instead of step one (so you won't have to add altitudes/Z values to every single polygon manually):

Select polygons, right click, Edit Selected Features, Feature Attributes, New:
Attribute Name: Altitude
Attribute Value: 0

There's one problem left now: I have about 200k polygons here, some with holes, some without. The triangulation only works, when the hole polygons do NOT have a Z value/elevation assigned to them. Problem is: The there any automatized way to select the actual polygons only, but not the hole polygons assigned to them?

Bests,
Simmer

#4
canvas101

canvas101

    Contributor

  • Validated Member
  • PipPip
  • 37 posts
  • United States

Hi!

Again and again I'm amazed on what GlobalMapper can do. If you have many polygons selected you can also do this instead of step one (so you won't have to add altitudes/Z values to every single polygon manually):

Select polygons, right click, Edit Selected Features, Feature Attributes, New:
Attribute Name: Altitude
Attribute Value: 0


Hello Simmer,

I'm glad this worked for you. On to the second problem. Can you provide an example file or screen capture of the problem? Sometimes it is easier to visualize when you can see it for yourself. Thanks.

Regards

#5
Simmer

Simmer

    Contributor

  • Validated Member
  • PipPip
  • 31 posts
  • Trinidad and Tobago

I'm glad this worked for you. On to the second problem. Can you provide an example file or screen capture of the problem? Sometimes it is easier to visualize when you can see it for yourself. Thanks.


I managed to add a Z value to the non-hole polygons by exporting them to a XYZ file and adding 0 values to each non-hole polygon using TextPad and Excel. Then I brought it back in GlobalMapper and created the Elevation Grid.

Problem now is that the triangulated polygons don't stay within the originally existing polygon areas (the polygons are supposed to be water), but also extend to the land areas. Even though "Fill Entire Bounding Box Instead of Just Inside Convex Hull" is not activated. Strange.

Attached is a sample file that doesn't have Z values added yet.

Bests,
Simmer

Attached Files



#6
canvas101

canvas101

    Contributor

  • Validated Member
  • PipPip
  • 37 posts
  • United States

Hello Simmer,

What is your final output for the data, e.g., graphic presentation, terrain model or data query?

Regards

#7
canvas101

canvas101

    Contributor

  • Validated Member
  • PipPip
  • 37 posts
  • United States

Problem now is that the triangulated polygons don't stay within the originally existing polygon areas (the polygons are supposed to be water), but also extend to the land areas. Even though "Fill Entire Bounding Box Instead of Just Inside Convex Hull" is not activated. Strange.

Attached is a sample file that doesn't have Z values added yet.

Bests,
Simmer


Hello Simmer,

Once you have selected Create Elevation Grid from 3D Vector Data be sure and set the grid Spacing to something like 0.0005 arc deg and you should achieve the desired results. Please remember when creating a high resolution grid it will task your computer and you may have to play with the resolution to find the best solution for your computer. I have attached a screen shot to see if this is your goal? Let me know your thoughts.

Regards

Attached Files

  • Attached File  Grid.jpg   608.79KB   18 downloads


#8
Simmer

Simmer

    Contributor

  • Validated Member
  • PipPip
  • 31 posts
  • Trinidad and Tobago

What is your final output for the data, e.g., graphic presentation, terrain model or data query?


My final output is a terrain model together with elevation data and landclasses in a Flight Simulator.
Anyway, looks like I solved the problem now with a friend's help. Somewhere in the process the topology of the holes and parent polys got totally mixed up. They look fine in Global Mapper, but they aren't. Usually it would be an endless task to fix all that (easier to re-draw everything from hand then) but Manifold offers a nice selection to clean up corrupted topologies using their "Traditional Topology Tools". Don't know if GlobalMapper offers that function too, couldn't even find the word "topology" in its help files.

Bests,
Simmer




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->