It's not a one-liner, if that's what you mean by "easy"...  8^(

There's two main parts to this problem:
1. Ensuring that the linework is correctly noded and snapped (so that both the river line and the mapsheet boundary contain the same node points). 2. Building the polygonal topology for the line-polygon overlay and extracting the relevant resultant polygons

For the sake of simplicity I'm going to assume you already have #1  8^)

The formal, rigorous way to do #2 is to build a topology with the edges labelled with the river side information (e.g. which side of the line is water). You can then label the topology faces from that information and extract river polygons.

The cheesy, fast way to do #2 is to toss your noded linework into the Polygonizer and get a bunch of polygons back. Then determine a point which lies on the river inside the mapsheet (for instance, offset a point a very small amount from the midpoint of the river line on the water side). Use a point-in-polygon test to find the polygon which corresponds to the river.

Paul Austin wrote:
I have a data set which uses line strings to represent polygons. In some cases these line strings do not form a closed ring directly, instead it uses the neatline of a mapsheet to virtually close the polygon within that sheet (the full polygon would be across multiple sheets).

In the following example there is a line for river that goes from the bottom to the top of the sheet with the river on the right.

+---------+----------+
|               \            |
|                 \          |
|                   \        |
|                     \      |
|                       \    |
+------------------+-+


Is there an easy way given a line string geometry and a polygon neatline to create a new polygon for the river portion on the right?

Cheers,
Paul
_______________________________________________
jts-devel mailing list
jts-devel@lists.jump-project.org
http://lists.refractions.net/mailman/listinfo/jts-devel


--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
jts-devel@lists.jump-project.org
http://lists.refractions.net/mailman/listinfo/jts-devel

Reply via email to