Skip to content

importing geojson in profiletool generates wrong linestring #9914

@landryb

Description

@landryb

Description

the code in the profile tool generates wonky LINESTRING coordinates from regular geojson

How to reproduce

with such geojson:

{
"type": "FeatureCollection",
"name": "test2",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::3857" } },
"features": [
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ 327691.077272970229387, 5814954.333092866465449 ], [ 328134.133446227526292, 5814802.898720778524876 ], [ 328220.435447908530477, 5814998.050545761361718 ], [ 328112.231606393354014, 5815247.273160547018051 ], [ 328025.732677087304182, 5815344.766806700266898 ], [ 327766.407082348188851, 5815377.104877015575767 ], [ 327561.180022588465363, 5815301.083452751860023 ] ] } }
]
}

the generated ewkt in the POST has NaN entries, and crazy coordinates:

<wps:ComplexData mimeType="application/ewkt">SRID=3857;LINESTRING(36438328842.84073 NaN,36487649630.44055 17730059.715392854,36497256725.32212 -16927493.588548213,36485211528.78277 NaN,36475582512.018265 NaN,36446714518.862236 -9074580.894592712,36423868747.072784 NaN)</wps:ComplexData>

with the same geojson as EPSG:2154:

{
"type": "FeatureCollection",
"name": "test2",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::2154" } },
"features": [
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ 695659.767537201987579, 6568409.332257196307182 ], [ 695966.518963297014125, 6568304.587867798283696 ], [ 696026.372900096001104, 6568439.259225595742464 ], [ 695951.555479097296484, 6568611.339293892495334 ], [ 695891.70154229819309, 6568678.674972792156041 ], [ 695712.139731901115738, 6568701.120199091732502 ], [ 695569.986632003332488, 6568648.748004392720759 ] ] } }
]
}

the ewkt in the POST is also wrong:

<?xml version="1.0" encoding="UTF-8"?><wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:dwn="http://geoserver.org/wps/download" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
<ows:Identifier>gs:LongitudinalProfile</ows:Identifier><wps:DataInputs>
<wps:Input><ows:Identifier>geometry</ows:Identifier><wps:Data>
<wps:ComplexData mimeType="application/ewkt">SRID=3857;LINESTRING(77400416070.9228 NaN,77434563483.47581 NaN,77441226393.24225 NaN,77432897756.03421 6681531.760654547,77426234846.26776 NaN,77406246116.96844 NaN,77390421706.27313 28807465.4448577)</wps:ComplexData>
</wps:Data></wps:Input><wps:Input><ows:Identifier>targetProjection</ows:Identifier><wps:Data><wps:LiteralData>EPSG:3857</wps:LiteralData></wps:Data></wps:Input><wps:Input><ows:Identifier>distance</ows:Identifier><wps:Data><wps:LiteralData>10</wps:LiteralData></wps:Data></wps:Input><wps:Input><ows:Identifier>layerName</ows:Identifier><wps:Data><wps:LiteralData>geor:rgealti_region_5m_mnt_2021</wps:LiteralData></wps:Data></wps:Input></wps:DataInputs><wps:ResponseForm><wps:RawDataOutput><ows:Identifier>result</ows:Identifier></wps:RawDataOutput></wps:ResponseForm></wps:Execute>

Expected Result
the coordinates should be properly reprojected

Current Result
user gets an error message:
Error The provided line is outside the profile coverage

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions