Wednesday 27 May 2015

qgis - Finding centerline of peninsula?



Given a peninsula stretching north south and the two coast lines connecting in the south, I want to find out which is the place, or rather line, which is furthest away from both coastlines on the peninsula? What I am looking for is the red line in the below image. The black and pink lines are the eastern and western coastlines.


enter image description here


One way could be to generate a polygon and do a negative buffer. An other one could be to add the longitudinal values, and divide by two. The latter one seems more rational - still it demands some programming and coordinate handling.


But perhaps there is a third way? Any suggestions? ArcGIS and QGIS are both relevant tools of the trade here.




Answer




I want to find out which is the place, or rather line, which is furthest away from both coastlines on the peninsula?



Almost by definition, this is the medial axis of the peninsula. Quoting wikipedia



The medial axis of an object is the set of all points having more than one closest point on the object's boundary.



which means that a point on the medial axis is indeed furthest away from both boundary lines. For otherwise, one would be closer than the other.


See the example from the PostGIS ST_ApproximateMedialAxis function's documentation. enter image description here



(This means also that the function is available to QGIS users via connection to PostGIS.)


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...