16

I would like to simplify some polygons that represent rivers into linestrings. I assume that holes in polygons can be omitted. Anybody has some good idea how to simply do it?

It would be nice, if it was possible to be done directly in postgis or by another open source tool, but brief algorithm description will be sufficient.

13

What you need is called "skeletisation algorithm".

Have a look at this article:

Haunert, J.-H., Sester, M., Jun. 2008. Area collapse and road centerlines based on straight skeletons. GeoInformatica 12 (2), 169-191. URL http://dx.doi.org/10.1007/s10707-007-0028-x

Some of these algorithms are developped in the CGAL library.

  • Neither link works any more, Julien: do you think you could supply a summary of the algorithms or at least formal references to allow people to look up the papers? – whuber Aug 5 '13 at 20:35
  • Yes, I have updated the answer with a proper reference to a more recent article. – julien Aug 5 '13 at 20:50
  • 2
    Thank you! (Can't add another upvote though--I only had one to give. :-) – whuber Aug 5 '13 at 20:54
4

In PostGIS 2.2 with SFCGAL, this can be done with ST_StraightSkeleton or ST_ApproximateMedialAxis, depending on your criteria.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

2

the JUMP skeletonizer plugin is available as part of openjump http://www.openjump.org

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

1

Just as a warning, I've never tried this before. Your success will depend on the quality of the data you currently have.

So, think of the polygon as a strip of triangles. Each triangle connects to a vertex on the opposite side of the corridor with an edge. Now, for each of the edges in the corridor, simply place a vertex right smack in the center. These new vertices are the points of your linestring. You can probably fiddle with how you select the middle point on the edge for greater accuracy.

0

Once again, ET GeoWizards might be the answer. Try the Create Centerlines from Polygons tool.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.