Noding PlugIn for OpenJUMP 1.6

Apr 19, 2012 - conforming a fixed-point precision geometry model. ... Warning : if the input dataset is based on floating point model, using snap-rounding can ...
231KB taille 4 téléchargements 308 vues
Noding PlugIn for OpenJUMP 1.6 (2012-04-19 by Michaël Michaud)

History : OpenJUMP 1.5.1 (svn2011-12-31) updates written in brown OpenJUMP 1.5.2 (svn2012-02-22) updates written in red OpenJUMP 1.6.0 (svn2012-04-19) updates written in red

1 Presentation The new Noding PlugIn is a powerful plugin taking full advantage of the Java Topology Suite noding package. Its main capabilities are : •

noding features of the input layer (preserving attributes and interpolating z values)



splitting features of the input layer (preserving attributes and interpolating z values)

2 Input Options Noding PlugIn can process : •

an entire Layer



a Selection of features

There has been a big change from Noder for OpenJUMP 1.5 to Noder for OpenJUMP 1.6. Before, the user could choose to node a whole layer or selected features in this layer. Now, the user interface automatically switch to "Use selected features" if some features are selected, and the plugin can node features belonging to different layers. In this case, features are always updated. Note : in the "selected features" mode, features belonging to uneditable layers can be used as input geometries for the noding of other features, but they will not be modified.

Michaël Michaud on 2012-04-19 ([email protected])

1/8

3 Output Options From OpenJUMP 1.6, the option to put result in a new layer or to update features in current layers is automatically set : •

if no feature is selected, a layer must be choosen and the result will go in a new layer.



if at least one feature is selected, the plugin use the update mode and will update selected features in all editable layers.

Note : updating features in the selected layer is an undoable action.

Warning : OpenJUMP feature id is lost during update operation. So be careful if you have some processes relying on this feature id (which is generally not a good idea).

4 Processing Options 4.1 Detection of missing intersections First option, selected by default, is to find missing nodes. This option depends on Line and Polygon options in the following way : •

If neither line option nor polygon option is set to "split", find intersection will only find INTERIOR nodes, that means nodes that are interior to at least one segment. This options has been broken since 2011-12-31 because of a accidental switch to IteratedNoder. Now, the default noder is back to MCIndexNoder, and intersections are computed again (2012-02-22)



If either line option or polygon option is set to split, find intersection will find intersections located in the INTERIOR of a segment or on a VERTEX which is not a LineString end point.

Detection of intersection points can be used to process intersections manually or to check how intersections have been processed by the program. Select the corresponding checkbox option produce a Layer with intersection points.

to

Here after, Find intersections has created the red Layer containing intersection points between linear and polygonal geometries of the blue layer.

4.2 Processing LineStrings and Polygons It may be convenient to process Linear features and Polygonal features in a different way. For example, a common use case is to want to split lines at each intersection with a polygon, and to node the polygon, e.g. to add intersection points along its boundary.

Michaël Michaud on 2012-04-19 ([email protected])

2/8

Output LineStrings and Polygons will have the same attributes as their parent features. Be careful, some attributes may loose their original meaning after a split operation (ex. length, population...).

4.2.1 Processing lines Linestring elements may be processed the following way •

Do not process : Input LineStrings will not be modified in the output. However, they contribute to the noding process by adding intersectin points in other elements.



Node lines : intersection points will be inserted into LineStrings and MultiLineStrings where

necessary. •

Split lines : linear geometries will be splitted, so that a linestring will never intersect another feature but at its end points.

Combining line processing and polygon processing options Do not process lines Do not polygons

Node lines

Split lines(1)

process

Node polygons

Split polygons

Michaël Michaud on 2012-04-19 ([email protected])

3/8

(1) Until the end of 2011 (version 4.3alpha until end of 2011), if crossing LineStrings were already noded (existing vertex on both lines), there were not splitted. The bug is fixed, and now, there should be no more interection but on LineString end points after a "Split Lines" operation.

4.2.2 Processing polygons Polygon elements may be processed the following way •

do not process : polygons will not be included in the output (new layer option) and will not be modified (update layer option)



node polygons : intersection points will be inserted into polygon and multipolygons boundaries where necessary.



split polygons : polygonal geometries will be split along every edge of the input features, so that an output polygon will be composed of a single face in the planar graph made of input features.

5 Advanced Options 5.1.1 Noding using snap-rounding technic Noding is a complex operation which is not guaranteed to succeed when used on floating-point coordinate geometries. The Snap-Rounding process can be used : •

to preserve rounded coordinates on computed intersection when the input dataset itself is conforming a fixed-point precision geometry model.



to guarantee that the noding process will produce a correct result on a dataset where floating-point precision model can be an issue.

Warning : if the input dataset is based on floating point model, using snap-rounding can snap some nodes to neighbour segments.

Warning : noding using snap-rounding technique currently looses z values of all geometries. It is a problem in JTS which should be solved in next JTS library (1.13)

Using Snap-Rounding option Without Snap-Rounding

Michaël Michaud on 2012-04-19 ([email protected])

Snap-Rounding = map unit

4/8

Input coordinates are based on a fixed-precision model, but data is not noded. New intersection coordinates are rounded according to precision parameter.

Input data includes coordinates based on a floating-point precision model. Nodes located near a segment (according to snap-rounding parameter) are snapped on this segment before the dataset is fully noded.

Noding operation is guaranteed to suceed in the integer domain. To achieve this without loosing too much precision, the noder scales input geometries so that it can be processed in the integer precision model while preserving the desired number of decimal digits. Why should I use the snap-rounding technique ? Snap-rounding modifies coordinates of input geometries and currently loose the z-ordinate. So why should I consider using it ? Snap-rounding noder avoids some pitfalls inherent to the floating-point calculations, which can lead to weird or inconsistent results. Here is an example of two polygons which produce erroneous results with the default noder and exact results with the snap-rounding noder. POLYGON ((200.4 215.5, 201.4 215.5, 201.3 215.4, 201.1 215.2, 200.8 214.9, 200.4 214.5, 200.4 215.5)) POLYGON ((200.4 214.5, 200.5 214.6, 200.7 214.8, 201 215.1, 201.4 215.5, 201.4 214.5, 200.4 214.5))

5.1.2 Z interpolation Interpolating Z values is not a native option of noding package. So, the z value of intersection points have to be evaluated in a post-process operation. Here is a brief description of how it is achieved. During noding operation, a reference to the source feature is kept on each segment string. If "Preserve Z value" is selected, after noding process, the algorithm will loop through each end point of each computed segment string, and will interpolate a z value on the source feature geometry. If noding option is selected, z evaluation takes place before the final geometry is computed from its

Michaël Michaud on 2012-04-19 ([email protected])

5/8

segment string elements. If splitting option is selected, the algorithm will have to build noded geometries for z interpolation, even if they are not kept in the final result. Interpolated Z (right geometries are shifted for readability reasons) Z coordinates of intersection points are interpolated on the source feature. LineString/LineString node : we get two different z values.

Polygon/LineString : interpolation on the polygon new vertices.

Polygon/LineString : interpolation on the LineString new vertices.

The most difficult case is the polygon splitting one. Resulting polygons may be composed of segment strings coming from polygon boundaries or from linestrings. Intersection nodes may have different interpolated z values in the linestring and in the polygon case. When it is possible, the algorithm preserve the z interpolated on the source polygon.

Michaël Michaud on 2012-04-19 ([email protected])

6/8

Interpolated Z (right geometries are shifted for readability reasons) If polygon is splitted, new coordinates are still interpolated on the source polygon... for edges issued from the polygon boundary.

Interpolation mode The intersection node may be a point of source geometry A, a point of source geometry B, a point belonging to both geometries or to none of them (or proper intersection). Final z calculation is done independantly on each source geometry : •

If the point was part of the geometry, its z is preserved,



If the point was not part of this geometry, its z is interpolated

Warning : in the particular case where a LineString is non-simple, interpolation can give strange result. This is because in this case, the new noded linestring o the new splitted LineStrings can be build in a different order from the original (ex. A-B-C-D-B-E --> A-B-D-C-B-E).

6 Derived PlugIns (OpenJUMP 1.6) In OpenJUMP 1.6, six derived plugins are added in the LayerView context menu to improve productivity. These plugin do not open any dialog box, and to be even more efficient, you can associate their action to a key with the Custom > EZPlugIn. To access these new plugins : - at least one feature must be selected - at least one layer must be editable After you have selected features to be processed, right-click in the map and choose : Noder > Node lines : node selected lines of editable layers (use also selected lines and polygons of uneditable layers to node editable features). Noder > Node polygons : node selected polygons of editable layers (use also selected lines and polygons of uneditable layers to node editable features). Noder > Node features : node selected lines and polygons of editable layers (use also selected lines and polygons of uneditable layers to node editable features). Noder > Split lines : split selected lines and node selected polygons of editable layers (use also

Michaël Michaud on 2012-04-19 ([email protected])

7/8

selected lines and polygons of uneditable layers to split editable features). Noder > Split polygons : split selected polygons and node selected lines of editable layers (use also selected lines and polygons of uneditable layers to node editable features). Noder > Split features : split selected lines and polygons of editable layers (use also selected lines and polygons of uneditable layers to split editable features).

Michaël Michaud on 2012-04-19 ([email protected])

8/8