Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

deduplication of repeated points #1521

Open
jeroenk1 opened this issue May 23, 2023 · 1 comment
Open

deduplication of repeated points #1521

jeroenk1 opened this issue May 23, 2023 · 1 comment
Labels
needs discussion requires discussion with contributor question user question

Comments

@jeroenk1
Copy link

jeroenk1 commented May 23, 2023

Hi

Here I have a GML file with an endpoint of the first posList corresponding with the startpoint of the second posList. Designating the starting and ending points of two curveMembers as "repeated points" is not correct. Instead, the idea of a Ring with curveMembers is that the end point of the previous curveMember connects to (has the same coordinates as) the start point of the next curveMember. The GML schema (geometryPrimitives.xsd) says: "The sequence of curves shall be contiguous and connected in a cycle."

<gml:geometrie>
<gml:MultiSurface gml:id="id-43a57b71-e62f-4acf-8b66-900059a964b5" srsName="urn:ogc:def:crs:EPSG::28992" srsDimension="2">
<gml:surfaceMember>
<gml:Surface>
<gml:patches>
<gml:PolygonPatch>
<gml:exterior>
<gml:Ring>
<gml:curveMember>
<gml:LineString>
<gml:posList>186687.621 504331.73 186685.817 504331.007 186682.924 504330.117 186678.036 504329.302</gml:posList>
</gml:LineString>
</gml:curveMember>
<gml:curveMember>
<gml:LineString>
<gml:posList>186678.036 504329.302 186677.068 504329.237 186676.099 504329.204 186675.129 504329.202</gml:posList>
</gml:LineString>
</gml:curveMember>

By conversion to JTS the two posList are just stuck together and results in one posList with repeated points (check the 186678.036 504329.302 pair in both posLists).

This is done in the org.deegree.geometry.standard.primitive.DefaultRing --> buildJTSGeometry() and the getCoordinates() in the same class.
In the for loop of buildJTSGeometry()

for ( final CurveSegment segment : getCurveSegments() ) {
     LineStringSegment lsSegment = linearizer.linearize( segment, crit );
     coords.addAll( getCoordinates( lsSegment ) );
}

A deduplication should be added here.

@tfr42
Copy link
Member

tfr42 commented May 24, 2023

Thank you for your feedback and the effort you put in the investigation. Can you describe in more detail what is the expected behaviour? Is there a visible (wrong) output of the current implementation? Feel free to create a pull request with the changes you want to propose.

@tfr42 tfr42 added question user question needs discussion requires discussion with contributor labels May 24, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
needs discussion requires discussion with contributor question user question
Projects
None yet
Development

No branches or pull requests

2 participants