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

Improve error message on invalid AOI polygon input #55

Closed
SlowMo24 opened this issue Sep 29, 2020 · 8 comments · Fixed by #164
Closed

Improve error message on invalid AOI polygon input #55

SlowMo24 opened this issue Sep 29, 2020 · 8 comments · Fixed by #164
Labels
enhancement New feature or request

Comments

@SlowMo24
Copy link
Contributor

SlowMo24 commented Sep 29, 2020

More information in the error returned by the following POST request at /elements/geometry would help the user to debug the problem. The request contains an 'edge case of validity' as bpoly that our code cannot handle.

The error:

{'timestamp': '2020-09-29T07:23:30.664+0000', 'status': 500, 'error': 'Internal Server Error', 'message': 'found non-noded intersection between LINESTRING ( 5.820222602 50.508951342, 5.820318993 50.510568532 ) and LINESTRING ( 5.820319034 50.510568531, 5.820318993 50.510568532 ) [ (5.820318993, 50.510568532, NaN) ]', 'path': '/elements/geometry'}

I would expect an information like 'provided invalid input geometry' and an 'input error' rather than an internal server error.

This is the requests body (sorry, its rather long but it is the one at hand at the moment):

{'clipGeometry': False, 'properties': 'tags,metadata', 'filter': '(natural=cliff or natural=riverbank or landuse=pond or natural=bare_rock or natural=beach or natural=fell or natural=glacier or natural=grassland or natural=heath or natural=mud or natural=rock or highway=pedestrian or amenity=parking or leisure=common or leisure=garden or leisure=golf_course or leisure=marina or leisure=park or leisure=pitch or leisure=playground or leisure=sports_centre or leisure=stadium or leisure=track or landuse=farm or landuse=scrub or waterway=lock or tourism=zoo or natural=tidal or waterway=canal or landuse=greenhouse or tourism=camp_site or highway=raceway or landuse=raceway or highway=rest_area or aeroway=apron or aeroway=aerodrome or aeroway=runway or natural=marsh or landuse=allotments or landuse=basin or landuse=brownfield or landuse=cemetery or landuse=commercial or landuse=construction or landuse=farmland or landuse=logging or natural=desert or landuse=farmyard or landuse=forest or landuse=garages or landuse=grass or landuse=greenfield or landuse=greenhouse_horticulture or landuse=harbour or landuse=industrial or landuse=landfill or landuse=meadow or landuse=orchard or landuse=plant_nursery or landuse=port or landuse=quarry or landuse=railway or landuse=recreation_ground or landuse=reservoir or landuse=residential or landuse=retail or landuse=salt_pond or landuse=village_green or landuse=vineyard or natural=sand or natural=scree or natural=scrub or natural=water or natural=wetland or natural=wood or waterway=dock or waterway=riverbank) and geometry:polygon', 'time': '2017-10-15T10:40:09', 'bpolys': '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[6.191243866, 49.731255792], [6.174618051, 49.731713066], [6.175321891, 49.742489836], [6.158691981, 49.742944899], [6.142061649, 49.743397579], [6.125430898, 49.743847874], [6.126124141, 49.754625131], [6.126817801, 49.765402361], [6.110179281, 49.765850611], [6.110869681, 49.776627983], [6.111560497, 49.787405328], [6.094914201, 49.78785153], [6.09560175, 49.798629017], [6.078951356, 49.799072999], [6.079635633, 49.809850628], [6.080320324, 49.820628229], [6.063662142, 49.821070156], [6.064343555, 49.831847898], [6.047681271, 49.832287601], [6.031018578, 49.832724911], [6.014355479, 49.833159829], [5.997691975, 49.833592355], [5.998359024, 49.844370731], [5.999026475, 49.85514908], [5.982355177, 49.855579539], [5.965683479, 49.856007603], [5.966343934, 49.866786251], [5.949668138, 49.867212082], [5.932991945, 49.867635517], [5.916315357, 49.868056555], [5.899638378, 49.868475198], [5.882961009, 49.868891444], [5.866283252, 49.869305294], [5.865644999, 49.85852569], [5.848970558, 49.858936987], [5.849605109, 49.869716747], [5.832926583, 49.870125803], [5.833557814, 49.880905692], [5.816875203, 49.881312505], [5.816247677, 49.870532463], [5.799568391, 49.870936725], [5.782888729, 49.87133859], [5.783508846, 49.882118939], [5.784129336, 49.892899262], [5.784750202, 49.903679559], [5.785371443, 49.91445983], [5.78599306, 49.925240076], [5.786615052, 49.936020296], [5.78723742, 49.946800489], [5.787860165, 49.957580657], [5.788483286, 49.9683608], [5.789106784, 49.979140916], [5.78973066, 49.989921006], [5.790354913, 50.000701071], [5.790979543, 50.01148111], [5.791604552, 50.022261122], [5.79222994, 50.03304111], [5.792855706, 50.043821071], [5.793481851, 50.054601006], [5.794108376, 50.065380915], [5.79473528, 50.076160799], [5.795362564, 50.086940657], [5.795990228, 50.097720488], [5.796618273, 50.108500294], [5.797246699, 50.119280074], [5.797875506, 50.130059828], [5.798504694, 50.140839557], [5.799134264, 50.151619259], [5.799764216, 50.162398935], [5.80039455, 50.173178586], [5.801025267, 50.18395821], [5.801656367, 50.194737809], [5.80228785, 50.205517382], [5.802919717, 50.216296929], [5.803551967, 50.227076449], [5.804184602, 50.237855944], [5.804817621, 50.248635414], [5.805451025, 50.259414857], [5.806084814, 50.270194274], [5.806718989, 50.280973665], [5.807353549, 50.29175303], [5.807988495, 50.30253237], [5.808623827, 50.313311683], [5.809259546, 50.324090971], [5.809895652, 50.334870232], [5.810532145, 50.345649468], [5.811169025, 50.356428677], [5.811806293, 50.367207861], [5.81244395, 50.377987019], [5.813081995, 50.38876615], [5.813720428, 50.399545256], [5.814359251, 50.410324336], [5.814998463, 50.421103389], [5.815638065, 50.431882417], [5.815830063, 50.435116119], [5.815830022, 50.43511612], [5.816054021, 50.43888812], [5.816278057, 50.442661419], [5.816374093, 50.444277902], [5.81647013, 50.445895114], [5.816694267, 50.449667104], [5.816918439, 50.453440395], [5.817014533, 50.455056873], [5.81711063, 50.456674082], [5.817334903, 50.460446063], [5.817559212, 50.464219344], [5.817655364, 50.465835819], [5.81775152, 50.467453024], [5.817975929, 50.471224996], [5.818200375, 50.474998268], [5.818296587, 50.476614739], [5.818392801, 50.47823194], [5.818617347, 50.482003902], [5.81884193, 50.485777166], [5.8189382, 50.487393633], [5.819034473, 50.48901083], [5.819259156, 50.492782783], [5.819483876, 50.496556038], [5.819580205, 50.4981725], [5.819676537, 50.499789694], [5.819901358, 50.503561638], [5.820126215, 50.507334883], [5.820126215, 50.507334883], [5.820222602, 50.508951342], [5.820318993, 50.510568532], [5.820319034, 50.510568531], [5.820318993, 50.510568532], [5.820543951, 50.514340466], [5.820768945, 50.518113703], [5.820768986, 50.518113702], [5.820961841, 50.521347344], [5.820961841, 50.521347344], [5.821605081, 50.53212613], [5.822248715, 50.54290489], [5.822892742, 50.553683623], [5.823537162, 50.564462331], [5.824181976, 50.575241013], [5.824827184, 50.586019669], [5.825472787, 50.596798299], [5.826118785, 50.607576902], [5.826765177, 50.61835548], [5.827411965, 50.629134031], [5.828059149, 50.639912557], [5.828706729, 50.650691056], [5.829354705, 50.66146953], [5.830003078, 50.672247977], [5.830651847, 50.683026398], [5.831301015, 50.693804793], [5.831950579, 50.704583163], [5.832600542, 50.715361506], [5.833250903, 50.726139823], [5.833901663, 50.736918113], [5.834552821, 50.747696378], [5.835204379, 50.758474617], [5.835856336, 50.769252829], [5.85285243, 50.768838027], [5.869848122, 50.76842075], [5.870508272, 50.779198619], [5.887507456, 50.778778709], [5.886843409, 50.768001], [5.903838289, 50.767578776], [5.903170756, 50.756801201], [5.920161334, 50.756376665], [5.92083276, 50.767154078], [5.937826819, 50.766726906], [5.954820464, 50.766297261], [5.971813693, 50.765865143], [5.988806502, 50.765430552], [6.00579889, 50.764993488], [6.022790855, 50.764553951], [6.022096076, 50.75377753], [6.039083724, 50.753335689], [6.056070944, 50.752891377], [6.055368815, 50.742115267], [6.054667115, 50.73133913], [6.071646131, 50.730892687], [6.088624715, 50.730443774], [6.105602865, 50.729992392], [6.122580577, 50.729538541], [6.121863778, 50.718763064], [6.13883717, 50.718306918], [6.13811693, 50.707531587], [6.137397131, 50.696756229], [6.154362326, 50.696297965], [6.153639093, 50.685522754], [6.170599971, 50.685062199], [6.16987331, 50.674287136], [6.169147093, 50.663512046], [6.186099786, 50.663049379], [6.185370147, 50.652274437], [6.184640954, 50.641499468], [6.201585471, 50.641034693], [6.21852954, 50.640567457], [6.235473159, 50.640097761], [6.234732829, 50.629323298], [6.251672134, 50.628851322], [6.252416325, 50.639625605], [6.269359035, 50.639150988], [6.268610985, 50.628376886], [6.285549378, 50.627899991], [6.284797928, 50.617126042], [6.267863392, 50.617602755], [6.267116255, 50.606828597], [6.266369575, 50.59605441], [6.24944229, 50.596528304], [6.248699917, 50.585753909], [6.231776029, 50.586225167], [6.231037958, 50.575450564], [6.214117468, 50.575919188], [6.213383694, 50.565144379], [6.196466602, 50.565610371], [6.19573712, 50.554835357], [6.195008084, 50.544060315], [6.211917489, 50.543594678], [6.211185058, 50.532819786], [6.210453074, 50.522044866], [6.227354355, 50.521577134], [6.226618982, 50.510802364], [6.243515979, 50.510332361], [6.260412526, 50.509859908], [6.277308619, 50.509385007], [6.294204257, 50.508907656], [6.311099436, 50.508427858], [6.327994156, 50.50794561], [6.327501468, 50.50094205], [6.327236293, 50.497171899], [6.344126671, 50.496687389], [6.361016634, 50.496200431], [6.36051927, 50.489197093], [6.360136808, 50.483810689], [6.359754468, 50.478423706], [6.359372239, 50.473037288], [6.358990133, 50.46765029], [6.358722768, 50.463880237], [6.375600741, 50.463391392], [6.375370483, 50.460159413], [6.392246842, 50.45966818], [6.391591291, 50.45051069], [6.391205833, 50.445123851], [6.390820486, 50.439737576], [6.390435262, 50.434350722], [6.390050149, 50.428964433], [6.389395729, 50.419807604], [6.372533488, 50.420298146], [6.372303693, 50.417066136], [6.371538175, 50.406292745], [6.370773122, 50.395519325], [6.370008536, 50.384745877], [6.369244414, 50.3739724], [6.368480758, 50.363198895], [6.385322879, 50.362709339], [6.402164532, 50.362217348], [6.401393744, 50.351444188], [6.418231132, 50.350949949], [6.417457017, 50.340176948], [6.416683374, 50.329403918], [6.415910201, 50.318630859], [6.399084192, 50.319124534], [6.398315277, 50.308351259], [6.38149259, 50.308842316], [6.380727928, 50.298068825], [6.363908562, 50.298557266], [6.347088734, 50.299043276], [6.347845821, 50.309817137], [6.331021746, 50.310300901], [6.314197212, 50.310782234], [6.313447699, 50.300008007], [6.296626498, 50.300486726], [6.295881227, 50.289712288], [6.295136409, 50.278937822], [6.294392043, 50.268163328], [6.293648129, 50.257388806], [6.276841606, 50.257864372], [6.260034632, 50.25833751], [6.243227212, 50.258808221], [6.242495083, 50.248033132], [6.225690995, 50.248501238], [6.208886466, 50.248966917], [6.208162333, 50.238191444], [6.20743864, 50.227415944], [6.190641221, 50.227878845], [6.189921739, 50.217103141], [6.189202694, 50.20632741], [6.205992571, 50.205864861], [6.205270194, 50.195089278], [6.204548256, 50.184313667], [6.203826755, 50.173538028], [6.187048174, 50.17400005], [6.170269157, 50.174459652], [6.169555616, 50.163683636], [6.152779928, 50.164140643], [6.152070578, 50.153364426], [6.168842508, 50.152907592], [6.168129831, 50.142131521], [6.167417587, 50.131355422], [6.150653169, 50.131811909], [6.149945109, 50.121035609], [6.149237477, 50.110259282], [6.148530275, 50.099482927], [6.1478235, 50.088706545], [6.131073649, 50.089159926], [6.130371047, 50.078383344], [6.129668869, 50.067606736], [6.128967117, 50.056830099], [6.145705744, 50.056377235], [6.14500068, 50.045600743], [6.144296042, 50.034824224], [6.143591831, 50.024047678], [6.160318829, 50.023592921], [6.159611314, 50.01281652], [6.158904227, 50.002040091], [6.158197568, 49.991263635], [6.174912956, 49.99080699], [6.174203001, 49.98003068], [6.190914237, 49.979571805], [6.190200992, 49.968795641], [6.206908077, 49.968334536], [6.206191545, 49.95755852], [6.222894479, 49.957095188], [6.239596979, 49.956629455], [6.238873451, 49.945853763], [6.238150359, 49.935078044], [6.237427705, 49.924302296], [6.236705487, 49.913526521], [6.235983704, 49.902750718], [6.252667218, 49.90228347], [6.251942168, 49.891507817], [6.268621541, 49.89103835], [6.267893229, 49.880262846], [6.284568462, 49.879791163], [6.301243253, 49.879317084], [6.3179176, 49.87884061], [6.317178635, 49.868065618], [6.333848839, 49.867586932], [6.333106624, 49.856812093], [6.349772686, 49.856331195], [6.366438298, 49.855847905], [6.383103458, 49.855362223], [6.382350616, 49.844587905], [6.399011631, 49.844100016], [6.398255554, 49.833325854], [6.397499933, 49.822551664], [6.414153117, 49.822061756], [6.430805843, 49.821569458], [6.447458109, 49.821074771], [6.464109914, 49.820577695], [6.464880277, 49.831351137], [6.481535302, 49.830851483], [6.480761254, 49.820078231], [6.497412127, 49.819576378], [6.514062532, 49.819072137], [6.530712465, 49.818565508], [6.529927838, 49.8077928], [6.546573617, 49.807283976], [6.545785783, 49.796511431], [6.529143683, 49.797020062], [6.52836, 49.786247296], [6.52757679, 49.7754745], [6.526794051, 49.764701675], [6.526011783, 49.75392882], [6.509383906, 49.754434299], [6.508605777, 49.743661224], [6.507828117, 49.73288812], [6.524448661, 49.732383024], [6.523667805, 49.721610082], [6.522887419, 49.710837111], [6.506274201, 49.711341825], [6.505497944, 49.700568634], [6.488887918, 49.701070778], [6.488115786, 49.690297367], [6.471508954, 49.690796944], [6.470740941, 49.680023315], [6.454137304, 49.680520326], [6.453373407, 49.669746481], [6.45260997, 49.658972606], [6.451846991, 49.648198703], [6.451084471, 49.637424771], [6.434494978, 49.637918656], [6.433736562, 49.627144508], [6.432978602, 49.616370332], [6.416395943, 49.616861472], [6.415642079, 49.606087081], [6.414888669, 49.595312661], [6.398312838, 49.595801059], [6.397563518, 49.585026426], [6.396814647, 49.574251764], [6.38024564, 49.574737425], [6.379500852, 49.563962551], [6.396066226, 49.563477074], [6.395318254, 49.552702356], [6.39457073, 49.541927609], [6.378012618, 49.542412718], [6.377269171, 49.531637759], [6.360714239, 49.532120319], [6.359974863, 49.521345149], [6.343423114, 49.521825163], [6.326870923, 49.522302812], [6.327603047, 49.533078344], [6.328335611, 49.543853848], [6.329068615, 49.554629325], [6.3125051, 49.555105149], [6.313234911, 49.565880777], [6.296667324, 49.566354413], [6.297393938, 49.577130193], [6.298120989, 49.587905944], [6.298848476, 49.598681667], [6.28226954, 49.59915347], [6.265690168, 49.599622902], [6.266410808, 49.610398953], [6.249827361, 49.610866191], [6.233243483, 49.611331056], [6.216659176, 49.611793548], [6.200074442, 49.612253667], [6.183489284, 49.612711413], [6.166903704, 49.613166787], [6.167602901, 49.623943858], [6.151013253, 49.62439703], [6.151709222, 49.635174246], [6.152405609, 49.645951434], [6.135808242, 49.646402573], [6.136501394, 49.657179905], [6.137194963, 49.66795721], [6.15379964, 49.66750573], [6.154497284, 49.678282836], [6.1711052, 49.677828806], [6.171806925, 49.688605713], [6.188418078, 49.688149131], [6.189123888, 49.698925837], [6.205738278, 49.698466702], [6.206448176, 49.709243207], [6.207158502, 49.720019684], [6.223779795, 49.719557819], [6.224494216, 49.730334094], [6.207869255, 49.730796134], [6.208580436, 49.741572556], [6.191951377, 49.742032388], [6.191243866, 49.731255792]], [[5.956207606, 50.517989226], [5.973111501, 50.517558428], [5.990014982, 50.517125178], [6.006918047, 50.516689477], [6.020439428, 50.516338975], [6.006918047, 50.516689477], [5.990014982, 50.517125178], [5.973111501, 50.517558428], [5.956207606, 50.517989226], [5.939512139, 50.518412281], [5.956207606, 50.517989226]], [[5.956207606, 50.517989226], [5.956005538, 50.514755968], [5.956005538, 50.514755968], [5.956207606, 50.517989226]], [[6.104332546, 50.453138259], [6.104332546, 50.453138259], [6.104332546, 50.453138259], [6.104332546, 50.453138259]], [[6.091215776, 50.511241352], [6.091215776, 50.511241352], [6.091427051, 50.514474208], [6.091427051, 50.514474208], [6.091215776, 50.511241352]], [[5.843505076, 50.520798271], [5.854775684, 50.520522528], [5.871682011, 50.520106441], [5.854775684, 50.520522528], [5.843505076, 50.520798271]]]}}]}'}
@FabiKo117 FabiKo117 added the enhancement New feature or request label Sep 29, 2020
@tyrasd tyrasd changed the title Handle invalid AOI Polygons Improve error message on invalid AOI polygon input Sep 29, 2020
@FabiKo117 FabiKo117 modified the milestone: 1.3 Nov 10, 2020
@SlowMo24
Copy link
Contributor Author

SlowMo24 commented Feb 2, 2021

//edit: It might be common knowledge but we could update the documentation to inform the user that we apply no cleaning on geometries returned through the extraction endpoints and they might be invalid if the source OSM-data creates invalid geometries OR can we apply more cleaning methods to ensure clean geometries?

another case: geometry of relation/540344 at 2020-05-04 requested from ohsome cannot be used as bpoly with the same error message: slightlyInvalidGeojson.geojson.txt

@SlowMo24
Copy link
Contributor Author

SlowMo24 commented Feb 17, 2021

The error message is even more cryptic when supplying an invalid geojson (e.g. supllying a list of geometries instead of a list of features in the FeatureCollection):

{
  "timestamp" : "2021-02-17T16:50:56.468+0000",
  "status" : 500,
  "error" : "Internal Server Error",
  "message" : "No message available",
  "path" : "/elements/geometry"
}

@FabiKo117
Copy link
Contributor

OR can we apply more cleaning methods to ensure clean geometries?

As I remember we don't want to perform any fixing on the OSM data and try to return it as it is. This means if the data is partially broken then we still try to return it in that state, if possible.

The error message is even more cryptic when supplying an invalid geojson (e.g. supllying a list of geometries instead of a list of features in the FeatureCollection):

Can you provide such a GeoJSON? There is the following method in the ohsome API which creates the geometry out of the provided GeoJSON:

public Geometry createGeometryFromGeoJson(String geoJson, InputProcessor inputProcessor) {

I guess we would have to extend it then to a degree that also your mentioned issues are tackled there.

@SlowMo24
Copy link
Contributor Author

As I remember we don't want to perform any fixing on the OSM data and try to return it as it is. This means if the data is partially broken then we still try to return it in that state, if possible.

We should probably continue this discussion elsewhere as this issue is about query parameters. It depends on what your user-story is and what the questionnaire revealed. If you have a certain amount of users with little knowledge about OSM or even geodata in general it might be a good idea to have the option to clean geoms on the server even if that puts additional workload there. effort vs benefit ?

Can you provide such a GeoJSON? There is the following method in the ohsome API which creates the geometry out of the provided GeoJSON:

I'm surprised by all the functions that do not have a standard library in Java. Is there no geojson-validator somewhere that would prevent adding every error a user may create one by one to the function? Anyway, here is my invalid geojson-request: https://api.ohsome.org/v1/elements/geometry?bpolys=%7B%22type%22%3A%20%22FeatureCollection%22%2C%22features%22%3A%5B%7B%22type%22%3A%22MultiPolygon%22%2C%22coordinates%22%3A%5B%5B%5B%5B8.2944706%2C49.4313443%5D%2C%5B8.2943343%2C49.4311946%5D%2C%5B8.2942287%2C49.4313051%5D%2C%5B8.2942929%2C49.4313993%5D%2C%5B8.2940648%2C49.4314931%5D%2C%5B8.2931602%2C49.4328216%5D%2C%5B8.2933214%2C49.4329125%5D%2C%5B8.2936734%2C49.4330121%5D%2C%5B8.2940745%2C49.4331354%5D%2C%5B8.2950478%2C49.4317345%5D%2C%5B8.2944706%2C49.4313443%5D%5D%5D%5D%7D%2C%20%7B%22type%22%3A%22MultiPolygon%22%2C%22coordinates%22%3A%5B%5B%5B%5B8.6443522%2C49.2438179%5D%2C%5B8.6441312%2C49.2438131%5D%2C%5B8.6434492%2C49.2438202%5D%2C%5B8.6423608%2C49.2434818%5D%2C%5B8.6425289%2C49.243249%5D%2C%5B8.6405498%2C49.242607%5D%2C%5B8.640069%2C49.2432412%5D%2C%5B8.6386152%2C49.2427742%5D%2C%5B8.6381527%2C49.2433773%5D%2C%5B8.6360569%2C49.2426706%5D%2C%5B8.6344032%2C49.2442307%5D%2C%5B8.6365708%2C49.2449252%5D%2C%5B8.6364907%2C49.2450645%5D%2C%5B8.6365532%2C49.2452128%5D%2C%5B8.6366379%2C49.2452715%5D%2C%5B8.6362567%2C49.2458452%5D%2C%5B8.6452563%2C49.2487619%5D%2C%5B8.6470862%2C49.2465849%5D%2C%5B8.6477825%2C49.2457103%5D%2C%5B8.6479716%2C49.2459392%5D%2C%5B8.6481604%2C49.2460716%5D%2C%5B8.648617%2C49.2457949%5D%2C%5B8.6486802%2C49.2457566%5D%2C%5B8.6489228%2C49.24563%5D%2C%5B8.6475336%2C49.2453271%5D%2C%5B8.646905%2C49.2451635%5D%2C%5B8.6443679%2C49.2451713%5D%2C%5B8.6443522%2C49.2438179%5D%5D%5D%5D%7D%5D%7D&clipGeometry=true&filter=type%3Away%20and%20natural%3D*&properties=tags&time=2016-01-01%2C2017-01-01

@FabiKo117
Copy link
Contributor

FabiKo117 commented Mar 25, 2021

We should probably continue this discussion elsewhere as this issue is about query parameters. It depends on what your user-story is and what the questionnaire revealed. If you have a certain amount of users with little knowledge about OSM or even geodata in general it might be a good idea to have the option to clean geoms on the server even if that puts additional workload there. effort vs benefit ?

Yes, that discussion should probably be continued in a separate issue in the OSHDB repository. I've created one here: GIScience/oshdb#367. Feel free to add further info there.

Regarding the remarked issue with the error response: I am using a JSON library to validate the JSON conformity, but I could not find yet any GeoJSON equivalent for it. If you know of something, please let me know too. The fix in #164 should at least help for now.

@SlowMo24
Copy link
Contributor Author

these are the two I know of: https://www.npmjs.com/package/geojson-validation and https://geojsonlint.com/ (are they the same?) but at least the latter one is extremely strict (e.g. right hand rule) and I don't know if that can be adapted, I have not used them

@FabiKo117
Copy link
Contributor

FabiKo117 commented Mar 25, 2021

Ah yeah maybe I did not write it explicitly: I mean Java libraries of course :D

I know of geojsonlint.com or geojson.io and also use them regularly, but I don't know of a Java library that I can easily use to check GeoJSON validity. We use org.geojson in the code to create the respective objects.

@tyrasd
Copy link
Member

tyrasd commented Mar 25, 2021

these are the two I know of: https://www.npmjs.com/package/geojson-validation and https://geojsonlint.com/ (are they the same?)

If I remember correctly, geojsonlint.com uses https://www.npmjs.com/package/@mapbox/geojsonhint, so no, they are probably not the same.

e.g. right hand rule

why do you find that to be extremely strict when the standard defines this as a MUST (“A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.”)?

FabiKo117 added a commit that referenced this issue Apr 8, 2021
better handling of geojson parsing exceptions
closes issue #55
fix of not properly working GetControllerTest class in case port1 parameter was omitted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants