Monday, July 29, 2013

Use Saga GIS to create Voronoi or Thiessen polygons

The new version of Saga GIS 2.1 has a functional Thiessen polygon command. Previously, a bug in the function creates erroneous polygons. Here is an example of using the command to create Voronoi or Thiessen polygons from discrete points with some polygon clipping thrown in for aesthetic effects. The example shows how to create polygons of cities in the great State of Texas.



  1. Start SAGA GIS. Load and display the cities and the state boundary polygon in a map view.


  2. Select Modules | Shapes | Points | Thiessen Polygons.

    The Thiessen Polygons dialog box appears.

  3. In the input Points field, choose the point layer, e.g. 01. cities_in_texas.
  4. In the output Polygons field, select create. Click Okay.

    The Thiessen polygons layer (02. cities_in_texas [Thiessen Polygons] is created. The polygons are spread out over some arbitrary four points.

  5. Select Modules | Shapes | Polygons | Polygon Clipping.

    The Polygon Clipping dialog box appears.

  6. In the Clip Features field, select the State boundary polygon layer, e.g. 01. texas.
  7. Select the Input Features field and click the [...] button.

    The Input Features dialog box appears.

  8. In the left list, select the Thiessen Polygons layer, e.g. 02. cities_in_texas [Thiessen Polygons]. Click the > button. Click Okay.

    The Input Features dialog box is closed.
  9. Click the Okay button.

    The Thiessen polygons are nicely clipped to the State polygon
    .

4 comments:

David Mason said...

Once you have a tessellation like this, can you export it as a collection of polygon boundaries, preferably as a text file?

I want to add tessellations to a .KML for Google Earth. Oddly, I've found no simple .EXE utility to accomplish this, at least not in 2D. although there may be for 3D tessellation. All I've been able to find has been source code in C or Java. I don't speak either language, so if SAGA can export something I can use, it's probably the easiest path.

Great blog, BTW!
David

dominoc925 said...

David, you could do this right within SAGA by selecting the polygon layer, then choosing Geoprocessing > File > GDAL/OGR > OGR Export to KML. Before this, make sure your polygon layer is in lat, lon otherwise your KML would not overlay correctly in Google Earth. Cheers.

David Mason said...

Now I'm thinking about staying inside SAGA and saving maps to PDF. This assumes SAGA has adequate support for assigning colors or a greyscale to the values of a variable.

If I export tessellation polygons to KML, I would still need to manually edit in those color/greyness representations. With 48 polygons and ~10 variables to map, that's a fair amount of tedious work. To me, the big advantage of Google Earth is just being able to "helicopter" in a circle, getting an impressive 3D impression of terrain as perspective shifts.

In my application, I'm mapping timber parameters over a hilly lot, so seeing the interaction between timber variables and terrain is all good. Nevertheless there must be ways to do this in SAGA too.

Best,
David

dominoc925 said...

You'd be better off saving the tessellation as a shapefile, then use a GIS software like ArcGIS, Global Mapper to generate a thematic map based on the tessellation attributes. Then export out the thematic map as KML. Having said that, QGIS export to KML doesn't seem to preserve the thematic symbology. I was successful with Global Mapper though.

Related Posts with Thumbnails