New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msGEOSShapeFromWKT(): GEOS library error. Error reading WKT geometry "". on request with geo filter. #6176
Comments
I'm still interested in seeing this fixed. What can I provide to help here? |
When you report a problem here, please always take the time to create a small test case (mapfile, data, commands.txt) and attach it to your ticket as a .zip. |
@autra a few steps to narrow it down:
|
I'm working on a test case. Meanwhile
Thanks |
Well, I suppose we need to intercept the WKT being generated by the WFS code and figure out where the WFS filter GML to WKT conversion is screwed up. @autra, any luck with the test case? |
Didn't get the bandwidth to finish it, but it's in progress :-) |
I've attached a test case as minimal as I could here: test_case.zip. Thanks! |
@autra that is sure an intense test case (I feel like a paid client just sent me this dump and I must spend an entire day to understand the data ha), I can imagine not many will take the time to understand your db layout like I tried (multiple schemas etc.). Your mapfile references a 'web_service' schema, but there are no tables inside that schema in your dump, I only see a 'i_pa_capt_zone2et3_area_f' table in the 'water' schema. How about this plan, can you just create one public table (no special schemas) in a new database (preferably a SpatiaLITE db, so everyone here can reproduce your problem without installing PostgreSQL/PostGIS), that causes your error, and include it in a zip archive with a mapfile, commands.txt, and your SpatiaLITE db file? |
I'm not sure why you say that. It's a bit harsh to me given the fact that I've already make it a lot simpler that it was from the beginning. Beside this db is pretty simple, it has only one table and one view (in web_service, it's not a table). But whatever, let's move on: here is another test case, with one table: I hope it's simple enough this time.
Sorry but no. I've never used spatialite db, and I'm not going to learn another sgbd, adapt my data, without even the certainty to reproduce. I understand all about maintainer fatigue (I really do!) but I just can't do that and as mapserver supports postgis, I feel like test cases with PostGIS should be accepted. Thanks. |
SQL dump as text might be even more simple https://gdal.org/drivers/vector/pgdump.html If you don't know how to do something you can ask for help. For example ogr2ogr is pretty good in converting data, not tested but probably close to working command for creating the SQLite database:
I know I could construct the WKT of the multipolygon from your filter but I also feel a bit lazy. Could you add it? I guess it is valid if QGIS accepts the filter but still. |
Thanks @autra the first test case failed with MapServer. For the second test case, I had to change the extents to the extent of the geometry, and also added a CLASS object so it displays in MapServer. I can then get a valid map image returned from MapServer. Will try a GetFeature WFS request now... |
Well, I did it anyway. It is a valid multipolygon, I guess it presents two building footprints which are about 4.8 km apart.
It seems that filter goes beyond the extent of the layer. I am not sure if it matters.
|
To Jukka's point, the more time you spend on your side making it easy to reproduce (learning the one ogr2ogr command to convert to Spatialite, and testing that, then packaging it), the more chances that you'll get a developer's free time to help you. I see that you feel that it is my job to figure out your data schema, that's an interesting view (pun intended). Ok back to testing your GetFeature request here... |
My single polygon intersect filter works fine:
results:
However a multipolygon intersects fails silently (this seems to be hinted at in #461 mentioning failing for multipoints...)
|
Actually my first test above is a MULTIPOLYGON according to OGR:
The second test I ran above was me trying to paste 2 multipolygon WKT into the same filter request, no wonder it fails ha. Note: I could not get your filter coordinates to work, so I generated my own multipolygon coordinates , that lie inside your 'test_case' table's extents. Anyway, not sure if my input helped, but i tried. Wishing all a nice weekend. |
ah my second filter was not a valid multipolgon...retrying... |
I keep failing with my Multipolygon tests here, darn. I have checked msautotest and there are no multipolygon WFS filter tests (multipoint tests do exist). |
What if you now wrap the simple polygon that works into a MultiPolygon with only one part? If it fails that might proof that MultiPolygons do not work at all in filters. I guess that for Jeff the request to use would be
|
The GML is invalid. Each gml:Polygon should be wrapped inside a gml:polygonMember </gml:polygonMember>. The OGR GML parser is lax and ignores element that it doesn't know (gml:Polygon as direct child of gml:MultiPolygon), and thus interprets this as an empty multipolygon, which mapserver can't make much use of. |
…alid geometry (relates to MapServer#6176)
FLTGetSpatialComparisonCommonExpression(): avoid nullptr deref on invalid geometry (relates to #6176)
Description
Mapserver somehow fails to call libgeos with a correct wkt, and then tries an invalid postgis request.
Steps to reproduce
Additional info
I think that for some reason, the wkt is not passed correctly to msGEOSShapeFromWKT. And then mapserver still tries to make a postgis request but fails with these error logs:
I don't know if the first error is normal or not, but the second tends to show at least that mapserver didn't recover well from the first one.
This is a test url and I can compile and install a new mapserver version if needed.
Context
Server: Debian Stretch
mapserver: v7.6.0
libgeos: 3.7.1 (but I reproduced with 3.5 as well)
Thanks!
The text was updated successfully, but these errors were encountered: