Closed niconoe closed 1 year ago
Note to self: still needs proper testing once the interface is confirmed/stabilized.
@niconoe: Thanks for this, I just made a few tests this morning and the computation seems to work as expected, except with the province of Liège which gives an error. I'm also afraid that the URL will be a little short to encode big geometries...
If I get, for example, the province of Liège with its geometry simplified at 1km precision, here's the request that should be made :
p=MULTIPOLYGON%28%28%286.120273673002623%2050.1619257548964%2C6.0841880676960916%2050.17197763297901%2C6.0837011333094555%2050.171929062578954%2C6.078599709445645%2050.156997705770834%2C6.078783734653217%2050.15653525093492%2C6.064063246239979%2050.153353462365175%2C6.063569039916557%2050.15329770407422%2C6.030775824622578%2050.16454679516232%2C6.02954771912905%2050.165919246577346%2C6.020912275812882%2050.191054010240975%2C6.0203648684785%2050.19173429060953%2C6.034370091272459%2050.205928460210856%2C6.0343889390256695%2050.20595054457215%2C6.013063263275692%2050.206250395883245%2C6.012363976922016%2050.206008142741496%2C6.008790378935758%2050.23771770777208%2C6.0086934063709085%2050.23813789514503%2C6.017260290313371%2050.30009254253744%2C6.017285045771381%2050.30018915027904%2C5.980178916511405%2050.329749303824826%2C5.980171145774727%2050.32982862525725%2C5.960769272780707%2050.32738374355293%2C5.960751546376589%2050.327380749255724%2C5.937448050158327%2050.33834148173747%2C5.937398199104118%2050.3383485753765%2C5.924091985030513%2050.33249632024942%2C5.923999124896709%2050.33248794113757%2C5.8622126865771795%2050.348183799114054%2C5.862010772387942%2050.34829516984064%2C5.850323239271785%2050.3273088946367%2C5.850416189400701%2050.326809717837364%2C5.869085195011671%2050.31426562171896%2C5.869076609066899%2050.314155409822945%2C5.84544299543103%2050.281700335603574%2C5.845028762003789%2050.28063425179158%2C5.881194157037048%2050.27857132573982%2C5.881187902011759%2050.27851142821004%2C5.84041508416157%2050.26147821722711%2C5.840108738922591%2050.26139740745404%2C5.810243053822181%2050.264314549516484%2C5.809870385965776%2050.26431709401561%2C5.807780861672479%2050.25455189326095%2C5.807710326402204%2050.25420274514039%2C5.799981208989532%2050.264904705664605%2C5.799871948527476%2050.2650184000735%2C5.7212052618252125%2050.26213411507783%2C5.721081647251591%2050.26219792610439%2C5.7486104689318935%2050.30085871287844%2C5.748769264929468%2050.30090037496717%2C5.722520227321971%2050.30175405638161%2C5.722453060889151%2050.30174370345193%2C5.706579921033064%2050.31923203454505%2C5.70648419528087%2050.31938011182547%2C5.720282830274652%2050.3581329107443%2C5.720259125536504%2050.35818723349885%2C5.673332066948973%2050.35632000953302%2C5.673086844646791%2050.35625991524145%2C5.674940055130957%2050.367871565219644%2C5.675577771043545%2050.36844658496253%2C5.646339551353748%2050.36579056926121%2C5.645823947048959%2050.36594789643539%2C5.58718213232019%2050.39939174905939%2C5.587125714009207%2050.39941702653849%2C5.553825738568483%2050.388518489725385%2C5.553808136157296%2050.388510902128075%2C5.536241410403029%2050.39204624620973%2C5.536018069629345%2050.39205983240237%2C5.536116149211026%2050.402124236773346%2C5.535882473301223%2050.402331163816285%2C5.510053351583808%2050.41362710480885%2C5.5093626655254%2050.41452070161563%2C5.512662713569118%2050.42512856518789%2C5.512533809147101%2050.42515958896851%2C5.467490222835951%2050.40755987643473%2C5.467403012959129%2050.40753610799135%2C5.4534446523788995%2050.421243100760876%2C5.4532918464974784%2050.42144227736293%2C5.419278982784678%2050.430123565555306%2C5.418691450517023%2050.429978372003205%2C5.408743091141515%2050.414975218139546%2C5.40589727318859%2050.41378709110458%2C5.429387243013605%2050.40283001829789%2C5.429413946423122%2050.40280266337899%2C5.3971343954336835%2050.38100356386968%2C5.39712745415786%2050.3809748537266%2C5.351467489688484%2050.388358552659696%2C5.351394468039965%2050.38836598751206%2C5.297492547387965%2050.365150315014915%2C5.297165428666971%2050.364949267488214%2C5.281205050433842%2050.378131552366085%2C5.281052898494597%2050.37823727974268%2C5.2873397049308535%2050.39447769475228%2C5.287411180585774%2050.394508085551564%2C5.2371923084896785%2050.40296216434069%2C5.236931602821846%2050.40301571390145%2C5.22129763588373%2050.417151046746284%2C5.221179357131589%2050.41727573401417%2C5.236442931877142%2050.43827605603951%2C5.2364512877656155%2050.43833807697072%2C5.198692648394046%2050.47791359150685%2C5.19893226152181%2050.47881985067812%2C5.165046396111546%2050.46779939708776%2C5.163951886124015%2050.46760636925288%2C5.149704637168706%2050.48229528216939%2C5.1493138853345926%2050.48246143315839%2C5.157387346242162%2050.489313958741434%2C5.157430481711932%2050.489405128779936%2C5.132910120331741%2050.490304918710194%2C5.132857154502954%2050.49037629365856%2C5.142208370795014%2050.51202817508491%2C5.142181749527087%2050.51213912760383%2C5.115055979190897%2050.50368438148425%2C5.114903015732849%2050.50367131955508%2C5.092361137039205%2050.529302496134505%2C5.092360104630513%2050.529303865637814%2C5.036588026096489%2050.5316723724128%2C5.034244997546399%2050.53177981149011%2C5.053754134173902%2050.54087758089028%2C5.0542419990382035%2050.54112151101495%2C5.044316100910966%2050.55772347158239%2C5.048567698785942%2050.561108258587495%2C5.0280934562651725%2050.587540602571835%2C5.028671878277177%2050.588702610969705%2C4.979387636712882%2050.61851602674932%2C4.979299914543024%2050.61859481993767%2C5.001943782655941%2050.66454487503154%2C5.0026512460030945%2050.664990820913374%2C5.0013157461781255%2050.69373441876024%2C5.001129068627752%2050.6937780222232%2C5.017303122742352%2050.70217602675504%2C5.017311493337954%2050.70223631419316%2C4.992550628003609%2050.72362471128196%2C4.992525101655171%2050.72363171787231%2C5.016647447002821%2050.732697955776985%2C5.016921234173539%2050.73283235833057%2C5.019557866650282%2050.75074960695056%2C5.019566463032489%2050.75076537201264%2C5.047877004724982%2050.73914289110712%2C5.048130705831668%2050.73904900808995%2C5.044033954116311%2050.72348970179493%2C5.0440094735508625%2050.72347074081725%2C5.070109785322192%2050.70669403431148%2C5.070375095284441%2050.706473002103365%2C5.1189398263337385%2050.707921993500804%2C5.1193350619482425%2050.70827886589535%2C5.147652896336149%2050.69588395365321%2C5.148641508283578%2050.69543394099097%2C5.180822717561769%2050.704782459688914%2C5.18087316283492%2050.70480125534368%2C5.169382189956366%2050.72178210167496%2C5.169840755270365%2050.722496203553646%2C5.227537758864619%2050.718008208578226%2C5.227856062264478%2050.71764769064043%2C5.23672687398831%2050.7267979306329%2C5.236909650992274%2050.72722361862151%2C5.241065584333087%2050.71680938100192%2C5.241133366269172%2050.716725032458044%2C5.257386764515486%2050.71512823809934%2C5.257450190219283%2050.71512303030562%2C5.276302025171505%2050.72867636722276%2C5.276306497303081%2050.729034845982454%2C5.303781609194582%2050.7160632231994%2C5.3039035351477395%2050.71594168234472%2C5.350271263376532%2050.74637869301179%2C5.350293953106084%2050.7463936409149%2C5.389580141960213%2050.74796555944141%2C5.389589325918949%2050.74796949737063%2C5.402380938751911%2050.72831698753424%2C5.402287784177666%2050.72805447099785%2C5.432286377274013%2050.718184272279416%2C5.432344971000535%2050.71810120779148%2C5.454714659026277%2050.721657785730116%2C5.454837353575745%2050.72172101984762%2C5.462276907706369%2050.73823163531685%2C5.462078164334275%2050.7388126042228%2C5.4784428121836175%2050.723634172925046%2C5.478620719996067%2050.72354046580929%2C5.490748532247357%2050.7273633649076%2C5.490885959988186%2050.727397540135485%2C5.522547102255044%2050.74147768087752%2C5.524360256897432%2050.7423515863581%2C5.522484902033136%2050.75845951675649%2C5.522584155655402%2050.7586517515212%2C5.607530063178915%2050.77683984415671%2C5.610224651666091%2050.775134257444336%2C5.652348200040456%2050.80443006430673%2C5.653193736976973%2050.805444596950196%2C5.685021108146498%2050.80403032869316%2C5.685942477235407%2050.803882310542434%2C5.687420441365835%2050.810861506901006%2C5.687876816170534%2050.81192377814796%2C5.698823016509905%2050.78165236191771%2C5.698743240122889%2050.779619722052104%2C5.683048525093655%2050.755033184961974%2C5.683234667706078%2050.754815307642616%2C5.721942559183699%2050.745770191399856%2C5.722277041027575%2050.74571044147973%2C5.732884475409241%2050.75524333038578%2C5.732980112162465%2050.75530558689914%2C5.748880503685967%2050.745263399879434%2C5.7488972726402325%2050.74524288916294%2C5.770620457169354%2050.751349019977454%2C5.7707108436568255%2050.751332590397766%2C5.801819631555263%2050.73653135908128%2C5.802407339122858%2050.736323445928605%2C5.812949752102623%2050.715325383910425%2C5.813096253225867%2050.71528874727173%2C5.86089550401683%2050.71744721072179%2C5.861287959125353%2050.717436538658006%2C5.882892907084523%2050.70997921146932%2C5.883366502319323%2050.70986503875815%2C5.911031526751649%2050.735094163115576%2C5.911109397979484%2050.735145309689585%2C5.891910970566545%2050.75506907098128%2C5.892109138964216%2050.755219452156666%2C5.915819998437887%2050.75040992563842%2C5.916217295339397%2050.75044935748576%2C5.96037684572684%2050.76236620078325%2C5.96066008193539%2050.76247420344819%2C6.040294181470327%2050.74558276220134%2C6.040439310565824%2050.74550353034806%2C6.039566881187753%2050.71833215367357%2C6.039695086548092%2050.718282270201314%2C6.044273368634708%2050.727917124943986%2C6.044460632893926%2050.72843397118507%2C6.113803772080171%2050.72251187608529%2C6.1146922068748815%2050.72227598979845%2C6.16489774483237%2050.6631291532845%2C6.165834337462258%2050.662139327017655%2C6.194436674690632%2050.66333682268842%2C6.194746210331107%2050.663048354453394%2C6.186407863328212%2050.64080315735441%2C6.186674640659731%2050.640650694936056%2C6.2210546410911665%2050.64062116142941%2C6.221602238342875%2050.64072380751972%2C6.229796980423434%2050.64923266110972%2C6.230386759290029%2050.6492896672147%2C6.266377926785759%2050.64207662344353%2C6.26678707928974%2050.641591393938654%2C6.27406911321833%2050.62963777161585%2C6.273938386607597%2050.629206932206046%2C6.248169011624942%2050.60423119533763%2C6.2479542856695%2050.603917639220896%2C6.236221784716135%2050.56650745498803%2C6.236015593785272%2050.566162796185694%2C6.2104511375709075%2050.55404590605988%2C6.2103898662185015%2050.553996397572604%2C6.196963164528447%2050.53098982477769%2C6.197057647439617%2050.53040570965322%2C6.226295466497684%2050.494604378613246%2C6.226618090672518%2050.494349888713685%2C6.26964756862122%2050.504529563469106%2C6.269664271003047%2050.50454446201661%2C6.351218449079099%2050.4882903756677%2C6.351289798913107%2050.4882881011076%2C6.340381002222641%2050.46244035850543%2C6.340406506990761%2050.46226265738798%2C6.369934772638367%2050.4551414070184%2C6.371816849063502%2050.45550730980736%2C6.377449366553313%2050.43954904972597%2C6.377465833177325%2050.438807216080875%2C6.36768655295297%2050.404872720450726%2C6.366221985957305%2050.402337390642685%2C6.343178816605285%2050.38053572471679%2C6.342942715893247%2050.380249537253974%2C6.408088022354873%2050.335581312202464%2C6.4081001020426305%2050.33541426430389%2C6.405541208304883%2050.323367593165386%2C6.405534354001432%2050.323335515726626%2C6.358949056914505%2050.31339476481551%2C6.358853348249346%2050.31346035389265%2C6.3639209015456295%2050.305497252918855%2C6.3639571474604395%2050.305393920728335%2C6.333441950043589%2050.323270450803335%2C6.332994326741193%2050.32347791177125%2C6.307361638109793%2050.32017137842365%2C6.306407283108229%2050.32015729904623%2C6.278308770729938%2050.26632947006263%2C6.278307532035536%2050.266312672588896%2C6.217429048792155%2050.25660568351674%2C6.215784681886543%2050.25693329519956%2C6.19630056073405%2050.237398440722245%2C6.196233830210697%2050.23735848115541%2C6.174007087182697%2050.23355003697057%2C6.1738595079396275%2050.23346663586108%2C6.166514866780981%2050.21969580820695%2C6.1664962225985%2050.219595284602406%2C6.188548925579048%2050.20541394221982%2C6.188891035585917%2050.205283819657694%2C6.19230849465296%2050.18209082085866%2C6.192508686772159%2050.18206661991425%2C6.160430789389469%2050.17253773047881%2C6.160401896666216%2050.171560527798874%2C6.146533173365308%2050.177406439209705%2C6.146290352294287%2050.17727149929459%2C6.147591348736041%2050.16059965992258%2C6.147634212862854%2050.16047642718527%2C6.131866666842278%2050.15413582804669%2C6.131884292527196%2050.15389336983591%2C6.152968849005709%2050.15016414113211%2C6.153067148220805%2050.15013186684868%2C6.1509215152130725%2050.13765112629696%2C6.150922382643649%2050.13764665216647%2C6.13355866429733%2050.129554660941295%2C6.13337053744667%2050.12951749160891%2C6.112489829124471%2050.136024390225316%2C6.112312253637743%2050.136016604865745%2C6.120273673002623%2050.1619257548964%29%2C%286.206644805808512%2050.52164617235067%2C6.196192266551476%2050.531072296453715%2C6.19618836602034%2050.531106449747966%2C6.1872183479767395%2050.526301794881675%2C6.187188791471705%2050.526114076703294%2C6.206644805808512%2050.52164617235067%29%2C%286.183550737385095%2050.541355692797396%2C6.196899865568133%2050.536110836514894%2C6.197437948794198%2050.53626255978236%2C6.210469716632805%2050.554683711938765%2C6.210542612081412%2050.55474712848232%2C6.225379304594919%2050.555633749707795%2C6.22558880848129%2050.555800223894465%2C6.2403464674807445%2050.58668297470794%2C6.240574946647858%2050.58706215214386%2C6.225339689414248%2050.59046495804779%2C6.22526222071754%2050.59046004632083%2C6.174684395642003%2050.55793404505661%2C6.174660850075981%2050.557925332555044%2C6.183550737385095%2050.541355692797396%29%2C%286.2474024957415875%2050.59702042963718%2C6.2474024957415875%2050.59702042963718%29%2C%286.259040164508199%2050.62789004465452%2C6.273192005252023%2050.62860160809413%2C6.273462460675287%2050.62899583272733%2C6.2660613989302245%2050.64162415719139%2C6.265634424500936%2050.64200327793861%2C6.232561348681383%2050.64876583746869%2C6.232049143944965%2050.64887367285104%2C6.221153177475692%2050.64032530027433%2C6.220752875904041%2050.64027898300924%2C6.167238952054238%2050.64380339008159%2C6.166686161505419%2050.643621874457125%2C6.181669896358082%2050.62384616585305%2C6.181798430805268%2050.623797223261874%2C6.194152008467546%2050.63387895402789%2C6.194205789489785%2050.63389790990959%2C6.259040164508199%2050.62789004465452%29%2C%286.182879239426674%2050.65237247467667%2C6.194066920428672%2050.6631489210842%2C6.193621061545324%2050.66346121706127%2C6.166619804573516%2050.66195490973388%2C6.166034327583498%2050.66186332483676%2C6.182879239426674%2050.65237247467667%29%29%29
That's way too long. It must be simplified at a 5km precision to fit in the 4096 characters allowed by the querystring :
p=MULTIPOLYGON%28%28%286.120273673002623%2050.1619257548964%2C6.030775824622578%2050.16454679516232%2C6.02954771912905%2050.165919246577346%2C5.980178916511405%2050.329749303824826%2C5.980171145774727%2050.32982862525725%2C5.8622126865771795%2050.348183799114054%2C5.862010772387942%2050.34829516984064%2C5.881194157037048%2050.27857132573982%2C5.881187902011759%2050.27851142821004%2C5.807780861672479%2050.25455189326095%2C5.807710326402204%2050.25420274514039%2C5.7212052618252125%2050.26213411507783%2C5.721081647251591%2050.26219792610439%2C5.720282830274652%2050.3581329107443%2C5.720259125536504%2050.35818723349885%2C5.512662713569118%2050.42512856518789%2C5.512533809147101%2050.42515958896851%2C5.297492547387965%2050.365150315014915%2C5.297165428666971%2050.364949267488214%2C4.979387636712882%2050.61851602674932%2C4.979299914543024%2050.61859481993767%2C5.019557866650282%2050.75074960695056%2C5.019566463032489%2050.75076537201264%2C5.147652896336149%2050.69588395365321%2C5.148641508283578%2050.69543394099097%2C5.350271263376532%2050.74637869301179%2C5.350293953106084%2050.7463936409149%2C5.432286377274013%2050.718184272279416%2C5.432344971000535%2050.71810120779148%2C5.687420441365835%2050.810861506901006%2C5.687876816170534%2050.81192377814796%2C5.683048525093655%2050.755033184961974%2C5.683234667706078%2050.754815307642616%2C5.812949752102623%2050.715325383910425%2C5.813096253225867%2050.71528874727173%2C5.96037684572684%2050.76236620078325%2C5.96066008193539%2050.76247420344819%2C6.113803772080171%2050.72251187608529%2C6.1146922068748815%2050.72227598979845%2C6.186407863328212%2050.64080315735441%2C6.186674640659731%2050.640650694936056%2C6.266377926785759%2050.64207662344353%2C6.26678707928974%2050.641591393938654%2C6.196963164528447%2050.53098982477769%2C6.197057647439617%2050.53040570965322%2C6.351218449079099%2050.4882903756677%2C6.351289798913107%2050.4882881011076%2C6.343178816605285%2050.38053572471679%2C6.342942715893247%2050.380249537253974%2C6.408088022354873%2050.335581312202464%2C6.4081001020426305%2050.33541426430389%2C6.307361638109793%2050.32017137842365%2C6.306407283108229%2050.32015729904623%2C6.174007087182697%2050.23355003697057%2C6.1738595079396275%2050.23346663586108%2C6.1509215152130725%2050.13765112629696%2C6.150922382643649%2050.13764665216647%2C6.120273673002623%2050.1619257548964%29%2C%286.206644805808512%2050.52164617235067%2C6.206644805808512%2050.52164617235067%29%2C%286.183550737385095%2050.541355692797396%2C6.2403464674807445%2050.58668297470794%2C6.240574946647858%2050.58706215214386%2C6.183550737385095%2050.541355692797396%29%2C%286.2474024957415875%2050.59702042963718%2C6.2474024957415875%2050.59702042963718%29%2C%286.259040164508199%2050.62789004465452%2C6.167238952054238%2050.64380339008159%2C6.166686161505419%2050.643621874457125%2C6.259040164508199%2050.62789004465452%29%2C%286.182879239426674%2050.65237247467667%2C6.182879239426674%2050.65237247467667%29%29%29
This particular request gives an Internal Server Error. This is certainly linked to the peculiarities of, for example, the Vennbahn:
I wouldn't care too much if this was the only case, but we also have the same phenomenon at the RBSU level which will be used more often in practice:
To get something which seems to work perfectly, here's the Walloon Brabant simplified at 5km precision :
p=MULTIPOLYGON%28%28%284.643117955930783%2050.56422187277607%2C4.5164522364866%2050.52641430124527%2C4.512713467725316%2050.52540465897522%2C4.417383324681747%2050.56430679714734%2C4.417121205322217%2050.56456716523641%2C4.332131229270496%2050.54353744781318%2C4.331434382359527%2050.54341277947955%2C4.18408523773542%2050.66122449766738%2C4.183878881375125%2050.66135415537204%2C4.132857745689844%2050.62934571587488%2C4.132699882633656%2050.629320352097466%2C4.091475378475329%2050.66928868262343%2C4.091298784199342%2050.669419784485314%2C4.142212273783705%2050.728877461991374%2C4.142389297339594%2050.72896947722302%2C4.246335056480897%2050.68952426025152%2C4.246538038735837%2050.68951934380266%2C4.461119029771895%2050.75409278868685%2C4.463602852511018%2050.755119549460176%2C4.634277869471912%2050.74270420254334%2C4.63444728167669%2050.74262236904005%2C4.64338623569758%2050.79908567470579%2C4.643466605988409%2050.79936210314466%2C4.758311161725476%2050.80671299044002%2C4.760080496194996%2050.80668230506947%2C4.925445185819522%2050.74273220982218%2C4.92549170938519%2050.742692832884046%2C4.987429193014037%2050.76914996341995%2C4.987615324897882%2050.76911555891314%2C4.9826963433248626%2050.64167440652247%2C4.982501319748261%2050.6415512639837%2C4.79163755114042%2050.589658551110205%2C4.791308679357509%2050.58955642129297%2C4.672772913188452%2050.607983924884564%2C4.672618422231949%2050.608126678277785%2C4.643117955930783%2050.56422187277607%29%29%29
Here's the West-Flanders working too :
p=MULTIPOLYGON%28%28%283.381250724790808%2051.274441462695364%2C3.4108845531745193%2051.15991996522891%2C3.41098562268364%2051.15986300126397%2C3.333466903549493%2051.10066638249964%2C3.3313592284859617%2051.09887701633741%2C3.4459469741771303%2051.047441119827965%2C3.4459824374528054%2051.0474029933213%2C3.4153540901926505%2050.90446914395608%2C3.415329750617247%2050.904421396563265%2C3.522857535149327%2050.80576744750468%2C3.523349933760742%2050.805340676527805%2C3.3608441967252194%2050.710311973092985%2C3.3605985241715177%2050.70957441593049%2C3.150866674361343%2050.78991806872861%2C3.1503696817889213%2050.790103688514165%2C3.0249485914035197%2050.77076139868802%2C3.0244714959180703%2050.77087523590532%2C3.0000410315450305%2050.810769442837994%2C3.0000175170167904%2050.810793041642654%2C2.842184855667771%2050.75147286217461%2C2.8421193120284856%2050.75144042477831%2C2.8634019412632856%2050.70840850805814%2C2.8630975327090553%2050.708283440822896%2C2.7906766179553104%2050.72559164024611%2C2.7901191191741197%2050.72575856901446%2C2.725179435310269%2050.80957937658775%2C2.7241077479087203%2050.81058473826175%2C2.5990781296678596%2050.84891054494233%2C2.5990307570011106%2050.848931846824%2C2.6329008814066546%2050.94615756981386%2C2.6329267220350077%2050.94618639027422%2C2.5456705459738163%2051.08880478914105%2C2.541329219627225%2051.09388319515023%2C3.1861235750943733%2051.36264117566586%2C3.1862512754655192%2051.36268617644669%2C3.3575625402826077%2051.370442345196466%2C3.362898761561352%2051.37300120780958%2C3.381250724790808%2051.274441462695364%29%29%29
Whether a 5km precision will be enough or not should be asked to Sonia or someone else involved at the decision-taking level.
The query length problem also occurs when multiple provinces are taken at the same time, but this can easily be avoided by doing multiple queries and merging the results afterwards.
Thanks @sronveaux to have already quite extensively tested this. If I understand correctly we have two issues here:
Concerning the first error, I found the following message in the logs Invalid number of points in LinearRing found 2 - must be 0 or >= 4
. I guess one of the feature is indeed weird. Should we investigate deeper and tackle this case? (I personally don't know, but I think I'd go with the URL length issue first)
Concerning the issue length, I am thinking of the following possible solutions:
4.6431 50.5642
instead of 4.643117955930783 50.56422187277607
). According to wikipedia, you'd only lose a few meters of precision for this point, which should be good enough). That approach might be more efficient (or complementary?) to the simplification that just removes some edges of the polygon.GET
request, but pass the parameters in the body rather than the URL. That's a bit unorthodox/nonstandard, but apparently not that rare. We can always make a quick test to see how convenient or painful that would be on both sides (JS + Django), if you want!Just tell me your preferred approach and we'll try it!
Hello @sronveaux, I am back in the game and working on RIPARIAS again. Do you still need improvements on this issue?
You can also open new issues if you have other needs in terms of APIs.
Hi @niconoe, good news that you are back on this!
Thanks for proposing opening new issues in case of needs, I'll keep that in mind!
Concerning this particular problem, the API was used at a certain point of our workflow to give a hint to the user on which species were present in the area they were managing. However we had to change this workflow and we are now working the other way which means people already have selected the species they will manage before choosing the area. This is unfortunately less useful now...
It's still used to get some approximative answers at another place which doen't require to send such detailed geometries. The problem never occured in this situation.
Thanks again for all, Cheers
@sronveaux: I've implemented a basic endpoint as we discussed yesterday. Maybe you can test and we refine from there?
It's only available at the dev website for now, example:
https://dev-alert.riparias.be/api/species-per-polygon?p=POLYGON%28%285.078306143426343%2050.50393045913468%2C5.122938101434156%2050.50393045913468%2C5.122938101434156%2050.479030635204346%2C5.078306143426343%2050.479030635204346%2C5.078306143426343%2050.50393045913468%29%29
So, the endpoint is at /api/species-per-polygon and takes a single parameter:
p
: the polygon/feature you want to filter with, as an URL-encoded WKT string in the EPSG:4326/WGS84 reference system.The output currently looks like this:
I'm open to all comments and suggestions: bugs, URL name, parameter, projection, output format ... As far as I understand, for long filters we can probably assume an URL will work fine everywhere as long as it's limited to around 2000 chars.