Skip to content
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

Large WKT polygons fail #16

Open
salvafern opened this issue Apr 29, 2022 · 3 comments
Open

Large WKT polygons fail #16

salvafern opened this issue Apr 29, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@salvafern
Copy link
Collaborator

e.g. not working with eurobis_occurrences()

POLYGON ((2.543611 51.093611, 2.390278 51.269167, 2.23811855 51.55776895, 2.253333 51.613056, 2.481667 51.805, 2.539444 51.87, 3.081389 51.551667, 3.212222 51.484722, 3.296389 51.45, 3.353889 51.379444, 3.364722 51.373611, 3.36682961 51.36894745, 3.3665 51.36885, 3.36584 51.36914, 3.36505 51.36941, 3.36353 51.36942, 3.36195 51.36915, 3.36062 51.36896, 3.35921 51.36863, 3.35703 51.36786, 3.35148 51.36664, 3.34813 51.36672, 3.33294 51.3635, 3.3291 51.36277, 3.30399 51.35858, 3.30227 51.35817, 3.29866 51.35744, 3.29613 51.3571, 3.29377 51.35677, 3.29101 51.35615, 3.28798 51.35538, 3.28498 51.35459, 3.27734 51.35228, 3.27287 51.35081, 3.26886 51.3498, 3.26175 51.34822, 3.25726 51.34734, 3.2554 51.34713, 3.25375 51.34685, 3.24777 51.34576, 3.24527 51.34559, 3.24194 51.34557, 3.23869 51.34544, 3.23595 51.34557, 3.23067 51.34604, 3.22604 51.34672, 3.22572 51.34694, 3.22575 51.34715, 3.22707 51.34945, 3.22724 51.34986, 3.22727 51.35026, 3.22712 51.35084, 3.22465 51.35751, 3.2243 51.35787, 3.22416 51.35833, 3.22386 51.35893, 3.22327 51.35954, 3.22251 51.36, 3.22161 51.36041, 3.22089 51.36068, 3.20199 51.36386, 3.20183 51.36352, 3.20837 51.36238, 3.20777 51.36049, 3.20787 51.36041, 3.20807 51.36043, 3.20867 51.3623, 3.22042 51.36037, 3.22111 51.36016, 3.22184 51.35986, 3.22273 51.35938, 3.2233 51.3588, 3.22359 51.3582, 3.22374 51.35775, 3.22385 51.35753, 3.21738 51.35663, 3.21755 51.35631, 3.2186 51.3534, 3.2195 51.35099, 3.21979 51.35036, 3.22011 51.35003, 3.22051 51.34984, 3.22098 51.34982, 3.22163 51.34982, 3.22256 51.34993, 3.22308 51.34982, 3.22328 51.34951, 3.22443 51.34621, 3.21818 51.34524, 3.21717 51.3451, 3.21563 51.3443, 3.2155 51.34415, 3.21557 51.34396, 3.21564 51.34386, 3.21586 51.34381, 3.21607 51.34383, 3.21669 51.3442, 3.2175 51.34463, 3.21827 51.34479, 3.22323 51.34553, 3.22479 51.34105, 3.2194 51.34025, 3.21832 51.34228, 3.21847 51.34117, 3.21885 51.33992, 3.21843 51.33927, 3.2177 51.33938, 3.21555 51.33967, 3.21564 51.3403, 3.20769 51.34342, 3.20704 51.34294, 3.21396 51.33978, 3.21368 51.33967, 3.21515 51.33677, 3.21509 51.33674, 3.21439 51.33648, 3.21285 51.33614, 3.20457 51.34114, 3.20349 51.34032, 3.20355 51.34014, 3.20776 51.3374, 3.20623 51.33653, 3.2022 51.3391, 3.20184 51.33909, 3.2008 51.33834, 3.20078 51.33794, 3.19994 51.33736, 3.1996 51.33718, 3.19803 51.33583, 3.19759 51.33513, 3.19737 51.33409, 3.19753 51.33299, 3.19775 51.33224, 3.19799 51.33168, 3.19813 51.33153, 3.19834 51.33144, 3.19872 51.33149, 3.19914 51.33159, 3.19926 51.33175, 3.19922 51.3319, 3.19915 51.33202, 3.19954 51.3326, 3.20025 51.33305, 3.20046 51.33305, 3.20719 51.33475, 3.20763 51.33395, 3.20067 51.33221, 3.20077 51.33198, 3.20172 51.33219, 3.20221 51.33031, 3.19995 51.33008, 3.19973 51.330329999999996, 3.19953 51.33034, 3.19949 51.3309, 3.19905 51.3311, 3.19844 51.33097, 3.1982 51.33078, 3.19867 51.32893, 3.19803 51.32886, 3.1974 51.32882, 3.19681 51.33123, 3.19664 51.33122, 3.19631 51.33233, 3.19588 51.33239, 3.19499 51.33231, 3.19483 51.33243, 3.19414 51.33222, 3.194 51.33237, 3.19412 51.33247, 3.19383 51.33246, 3.1935 51.3326, 3.19314 51.33266, 3.19264 51.33404, 3.19382 51.33442, 3.19578 51.33967, 3.19316 51.34045, 3.18836 51.33389, 3.18743 51.33384, 3.18511 51.33373, 3.18527 51.33552, 3.18611 51.33595, 3.18621 51.33643, 3.18738 51.33863, 3.19015 51.34142, 3.19244 51.34304, 3.19621 51.34491, 3.20035 51.34625, 3.20025 51.34639, 3.19998 51.34681, 3.20312 51.34757, 3.20294 51.34782, 3.2021 51.3476, 3.20156 51.34793, 3.1998 51.3484, 3.1969 51.34863, 3.19522 51.3484, 3.19287 51.34775, 3.19089 51.34686, 3.18582 51.34399, 3.18473 51.34365, 3.18332 51.3434, 3.1822 51.34345, 3.18131 51.34379, 3.17982 51.345, 3.17986 51.3457, 3.18036 51.34626, 3.18789 51.35063, 3.18923 51.35193, 3.18961 51.35295, 3.18918 51.35448, 3.18831 51.35485, 3.18679 51.35485, 3.18369 51.3542, 3.1805 51.35314, 3.17984 51.35311, 3.17901 51.35337, 3.17811 51.3542, 3.17658 51.35654, 3.17802 51.35743, 3.18364 51.36101, 3.1866 51.36232, 3.18662 51.36263, 3.18619 51.36278, 3.18303 51.36144, 3.17684 51.35736, 3.17015 51.35298, 3.16911 51.35162, 3.16895 51.35024, 3.16926 51.34904, 3.17568 51.33876, 3.17761 51.33621, 3.17739 51.33593, 3.17697 51.33531, 3.17611 51.33473, 3.17513 51.33392, 3.17373 51.33301, 3.17258 51.33242, 3.17063 51.33157, 3.16797 51.33069, 3.16553 51.32984, 3.16382 51.32907, 3.1592 51.32772, 3.15423 51.32635, 3.14922 51.32496, 3.14816 51.32463, 3.14564 51.32369, 3.14434 51.32327, 3.13889 51.3221, 3.13727 51.32171, 3.13546 51.32118, 3.13107 51.31981, 3.12791 51.31889, 3.12332 51.31774, 3.11955 51.31683, 3.11682 51.31606, 3.11167 51.31471, 3.10982 51.31427, 3.1094 51.31418, 3.10442 51.31271, 3.10307 51.31225, 3.09867 51.31102, 3.09325 51.30929, 3.08845 51.30767, 3.08265 51.30544, 3.07784 51.30349, 3.07404 51.30182, 3.07276 51.30122, 3.06963 51.29955, 3.06643 51.29792, 3.06359 51.29653, 3.0605 51.29514, 3.05631 51.29328, 3.04879 51.29004, 3.0441 51.2879, 3.04083 51.28646, 3.03755 51.28511, 3.03673 51.28475, 3.03527 51.28398, 3.03366 51.28335, 3.03101 51.28227, 3.029 51.28134, 3.02776 51.28075, 3.0262 51.27985, 3.02487 51.27901, 3.02418 51.27866, 3.02351 51.27842, 3.00998 51.27278, 3.00854 51.27203, 2.99343 51.26538, 2.98897 51.26375, 2.98549 51.26242, 2.98489 51.26216, 2.98367 51.26165, 2.98206 51.26103, 2.9763 51.25902, 2.97238 51.25755, 2.97112 51.257, 2.96689 51.25525, 2.96553 51.25459, 2.96142 51.25301, 2.95825 51.25185, 2.95682 51.25128, 2.95407 51.25011, 2.95237 51.24948, 2.95185 51.24932, 2.95056 51.24903, 2.94977 51.24883, 2.94551 51.24727, 2.9428 51.24617, 2.94098 51.24545, 2.93681 51.24381, 2.93097 51.24149, 2.93027 51.24118, 2.92938 51.24071, 2.92709 51.23847, 2.92515 51.23803, 2.924 51.2377, 2.91886 51.23975, 2.91883 51.23957, 2.91825 51.23922, 2.91812 51.23914, 2.91792 51.23902, 2.91732 51.23867, 2.91727 51.23852, 2.92046 51.23705, 2.91739 51.23671, 2.91621 51.23647, 2.909 51.2331, 2.89868 51.22823, 2.89475 51.22624, 2.8902 51.2244, 2.88195 51.22079, 2.87487 51.21784, 2.8654 51.21358, 2.86294 51.21243, 2.8584 51.20977, 2.85659 51.20909, 2.85248 51.20748, 2.85062 51.20658, 2.84833 51.20524, 2.83891 51.20096, 2.83045 51.19714, 2.82658 51.19558, 2.82279 51.19447, 2.81522 51.19165, 2.81268 51.19075, 2.81068 51.18968, 2.80811 51.18852, 2.80336 51.18643, 2.79982 51.18504, 2.79384 51.18206, 2.7913 51.18062, 2.79014 51.18009, 2.78717 51.17918, 2.78564 51.17863, 2.78446 51.17808, 2.77832 51.17449, 2.77655 51.17394, 2.77052 51.17278, 2.76571 51.17091, 2.7617 51.16917, 2.75932 51.16831, 2.75588 51.16711, 2.75278 51.16605, 2.74927 51.16497, 2.74692 51.16414, 2.74344 51.16291, 2.74093 51.16204, 2.73648 51.16066, 2.73453 51.16013, 2.73323 51.15982, 2.73051 51.15921, 2.72811 51.15863, 2.72678 51.15828, 2.72584 51.15798, 2.72395 51.15733, 2.72216 51.15664, 2.72037 51.15573, 2.71804 51.157, 2.71781 51.15686, 2.7168 51.15598, 2.71666 51.15586, 2.71787 51.15543, 2.71908 51.1548, 2.71874 51.15451, 2.71824 51.15418, 2.7174 51.15372, 2.71602 51.15306, 2.71455 51.15241, 2.71107 51.1509, 2.70448 51.14865, 2.70118 51.14766, 2.69296 51.14526, 2.68493 51.14295, 2.68222 51.14226, 2.67457 51.14045, 2.67263 51.14003, 2.67099 51.13961, 2.66943 51.13921, 2.66751 51.1386, 2.66575 51.13803, 2.66059 51.13631, 2.65879 51.13567, 2.65614 51.13466, 2.65323 51.13366, 2.64775 51.13146, 2.64574 51.13061, 2.64379 51.1299, 2.64172 51.12907, 2.63721 51.12731, 2.63649 51.127, 2.63578 51.12662, 2.63527 51.12631, 2.63479 51.12594, 2.63396 51.12525, 2.63307 51.12461, 2.63033 51.12244, 2.62943 51.12179, 2.62758 51.12075, 2.62691 51.12042, 2.62499 51.11968, 2.62277 51.11905, 2.62074 51.11842, 2.61965 51.11805, 2.61835 51.1175, 2.61727 51.11713, 2.61311 51.11547, 2.61069 51.11474, 2.60593 51.11317, 2.60422 51.11262, 2.60298 51.11227, 2.59881 51.11102, 2.59533 51.11018, 2.59251 51.10946, 2.59112 51.109, 2.58923 51.10839, 2.58746 51.10784, 2.5861 51.10733, 2.58413 51.10655, 2.58148 51.10561, 2.57576 51.10322, 2.57256 51.10208, 2.56971 51.10083, 2.56486 51.09854, 2.56066 51.09659, 2.55466 51.09319, 2.54788 51.08992, 2.54669869 51.08947047, 2.543611 51.093611))

This is probably a problem at ows4R, but I doubt it will be solved anytime soon. A quick solution would be:

  • On the client side, get BBOX of the polygon
  • Query the server on the BBOX
  • Intersect the response with the original polygon on the client side

Other way: test cql_filters instead of using viewParams for the intersection - but it will probably painfully slow.

@salvafern salvafern added the bug Something isn't working label Apr 29, 2022
@salvafern salvafern self-assigned this Apr 29, 2022
@salvafern
Copy link
Collaborator Author

Another idea: send the WKT polygon via POST:

Transform the geometry into gml, pass the a XML with the query and send via POST.

But not sure this will work fine as also relies on OGC filters instead of the geoserver viewParams. Might be to slow.

salvafern added a commit that referenced this issue May 2, 2022
@salvafern
Copy link
Collaborator Author

Added a quick fix. But I just thought that this will be also a problem if many species or traits are requested. We have to look into sending viewParams via POST by default instead.

@salvafern
Copy link
Collaborator Author

Actually removed the exception cause it made the requests fail all the time: ab64304
Also mentioned this issue in EMODnet/emodnet.wfs#115
To be continued

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant