skeletonizing polygons using postgis · previous simplification results original different...
TRANSCRIPT
![Page 1: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/1.jpg)
Skeletonizing PolygonsUsing PostGIS
![Page 2: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/2.jpg)
● Vegetation Layer
DATA SET
● Water data extracted
1:150,000
● Snake River
![Page 3: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/3.jpg)
PreviousSimplification Results
Original
Different Algorithms = Different Results
Mapshaper 0.7%
1:150,000
QGIS, PostGIS, OpenJump
Douglas-Peucker Algorithm Visvalingam Algorithm
![Page 4: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/4.jpg)
THE GOAL
Extract the center line of a river from a polygon data set
1:34,000
![Page 5: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/5.jpg)
Tools
GRASS GIS
QGIS
![Page 6: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/6.jpg)
PostGIS/SFCGAL
SFCGAL is a C++ wrapper library around CGAL that provides 2D and 3D geometric functions.
CGAL = The Computational Geometry Algorithms Library
PostGIS is a spatial database extender for PostgreSQL object-relational database.
![Page 7: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/7.jpg)
2D Straight Skeleton and Polygon Offsetting
The straight skeleton of a polygon is defined by a continuous shrinking process in which the edges of the polygon are moved inwards parallel to themselvesat a constant speed.
As the edges move in this way, the vertices where pairsof edges meet also move.
If one of these moving vertices collides with a nonadjacentedge, the polygon is split in two by the collision.The straight skeleton is the set of curves traced out by the moving vertices in this process.
![Page 8: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/8.jpg)
ST_StraightSkeleton — Compute a straight skeleton from a geometry
CREATE TABLE snake_partskeleton AS SELECT st_straightskeleton(snake_part.wkb_geometry) AS wkb_geometry FROM snake_part;
ALTER TABLE snake_partskeleton OWNER TO postgres;GRANT ALL ON TABLE snake_partskeleton TO postgres;GRANT SELECT ON TABLE snake_partskeleton TO pgselectonly;
![Page 9: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/9.jpg)
Output Problem: Need to get rid of the dangles
![Page 10: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/10.jpg)
1. PostGIS - negative buffer and st_crosses
2. GRASS GIS – remove dangles
Possible Solutions
![Page 11: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/11.jpg)
PostGIS negative buffer and st_crosses
![Page 12: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/12.jpg)
![Page 13: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/13.jpg)
PostGIS negative buffer and st_crosses
![Page 14: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/14.jpg)
Increase buffer – loose parts
![Page 15: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/15.jpg)
Using simplified polygon layer
![Page 16: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/16.jpg)
GRASS GIS via QGIS
![Page 17: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/17.jpg)
Tool = v.clean.rmdangle
A line/boundary is considered to be a dangle if no other line of given type is on at least one end node.
The rmdangle tool deletes a dangle if the length is shorter than thresh or thresh < 0.
![Page 18: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/18.jpg)
Threshold = 200'Threshold = 100'
![Page 19: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/19.jpg)
Threshold = 200'Threshold = 100'
Using simplified polygon layer
![Page 20: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/20.jpg)
Remember THE GOALExtract the center line of a river from a
polygon data set
PostGIS
GRASS
simplified polygon
simplified polygon
![Page 21: Skeletonizing Polygons Using PostGIS · Previous Simplification Results Original Different Algorithms = Different Results Mapshaper 0.7% 1:150,000 QGIS, PostGIS, OpenJump Douglas-Peucker](https://reader031.vdocuments.site/reader031/viewer/2022022711/5c0038ad09d3f20e6b8c915e/html5/thumbnails/21.jpg)
Next Steps
● ST_ApproximateMedialAxis● Use to create a stream flow
network?● Use for labeling purposes on
maps and mapserver