You may want to try specifying your EPSG in your Polygon and getFeature request
Dominique Bessette Senior Software Engineer From: Oscar Wu <oscar...@crmltd.ca> Sent: Wednesday, March 23, 2022 1:02 PM To: geoserver-users@lists.sourceforge.net Subject: [Geoserver-users] WPS gs:Clip Topology Exception [External: Use caution with links & attachments] Hi everyone, First time posting here, thank you for your understanding if I am not explaining my situation well. I've been trying to use the built-in gs:Clip to extract some public layers based on a polygon defined by coordinates. The process seemed to work well with a couple of layers until I tried it with one particular layer. Here's the xml in the POST request: <?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"<https://urldefense.us/v3/__http:/www.opengis.net/wps/1.0.0*22__;JQ!!JRQnnSFuzw7wjAKq6ti6!lWi8-ZpfeBpVXzABGU-5yNnZNU21PJH7Uuw1mhAHL4oaSnQZGvwCFV3FQ_4yHdJ6SAxCew$> 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: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"><https://urldefense.us/v3/__http:/schemas.opengis.net/wps/1.0.0/wpsAll.xsd*22*3E__;JSU!!JRQnnSFuzw7wjAKq6ti6!lWi8-ZpfeBpVXzABGU-5yNnZNU21PJH7Uuw1mhAHL4oaSnQZGvwCFV3FQ_4yHdLoTCpOtw$> <ows:Identifier>gs:Clip</ows:Identifier> <wps:DataInputs> <wps:Input> <ows:Identifier>features</ows:Identifier> <wps:Reference mimeType="application/json" xlink:href="http://openmaps.gov.bc.ca/geo/pub/ows?service=WFS&version=2.0.0&request=GetFeature&typeName=WHSE_CADASTRE.PMBC_PARCEL_FABRIC_POLY_SVW&outputFormat=json&bbox=715319.37219999917,1028613.3681000005,735025.99269999936,1041407.1950000003" method="GET"/> </wps:Input> <wps:Input> <ows:Identifier>clip</ows:Identifier> <wps:Data> <wps:ComplexData mimeType="application/json"><![CDATA[{"type":"Polygon","coordinates":[[[715354.52820000052,1040603.9793999996],[715319.37219999917,1028613.3681000005],[734339.38680000044,1027297.6436000001],[735025.99269999936,1041407.1950000003],[715354.52820000052,1040603.9793999996]]]}]]></wps:ComplexData> </wps:Data> </wps:Input> </wps:DataInputs> <wps:ResponseForm> <wps:RawDataOutput mimeType="application/json"> <ows:Identifier>result</ows:Identifier> </wps:RawDataOutput> </wps:ResponseForm> </wps:Execute> In this case, a TopologyException was thrown (the stack trace is attached in the email): org.locationtech.jts.geom.TopologyException: found non-noded intersection between LINESTRING ( 737930.4267 1033205.5095, 737925.915 1033208.5901 ) and LINESTRING ( 737933.8941 1033203.0284, 737930.4267 1033205.5095 ) [ (737930.4267, 1033205.5095, NaN) ] I'm using Geoserver 2.20.2, GeoTools 26.2 and WPS 1.0.0. I have searched about this issue and learned that this is caused by invalid geometry which was explained here: https://locationtech.github.io/jts/jts-faq.html#D1<https://urldefense.us/v3/__https:/locationtech.github.io/jts/jts-faq.html*D1__;Iw!!JRQnnSFuzw7wjAKq6ti6!lWi8-ZpfeBpVXzABGU-5yNnZNU21PJH7Uuw1mhAHL4oaSnQZGvwCFV3FQ_4yHdLUVD9nQw$> Then I tried to create a customized WPS that 'clean' the input either using buffer(0) or the GeometryFixer in JTS before sending it to the clip process but neither of them solved the issue. I have exhausted my solutions to this problem and I'm wondering if anyone have encountered a similar issue before? May I have some suggestions about what to look for next? Thank you very much! Regards, Oscar
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users