[corrigé]Affichage des multipolygones

Problèmes, bugs et difficultés rencontrés sur le site.
Avatar du membre
Dominique
Messages : 3705
Enregistré le : 08 avr. 2006, 21:58

[corrigé]Affichage des multipolygones

Message par Dominique »

c'est curieux, je ne retrouve pas ce fil sous [mc bug]
Bref, j'en crée un autre

Je regarde ton: http://www.refuges.info/nav/2740
la requête PG retourne:

"geometrie_gmlol"=>"<gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.4553731,45.813979099999997 6.456075,45.814898599999999 6.457105,45.815252700000002 6.4585623,45.815775799999997 6.4599228,45.8157079 ... 6.4560814,45.812965900000002 6.4553731,45.813979099999997</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>"

Donc 1 seul polygone ?
Où sont les autres ?
Modifié en dernier par Dominique le 17 mars 2013, 14:34, modifié 1 fois.
Avatar du membre
sly
Messages : 5041
Enregistré le : 29 févr. 2004, 17:59
Localisation : Chambéry - Savoie

Message par sly »

C'était là : http://www.refuges.info/forum/viewtopic.php?t=5147
Mais j'ai trouvé un hack pour régler le problème, on peut le considérer comme ok et continuer sur ce fil.

Pour que soit exporté un multipolygon
Ligne 40 de :
https://github.com/sletuffe/www.refuges ... fs-gml.php

tu changes "gmlol" en "gml"

le format "gmlol" n'est bien évidement pas existant au niveau postgis, c'est juste un hack que j'ai fais pour arriver à afficher quand même.
Avatar du membre
Dominique
Messages : 3705
Enregistré le : 08 avr. 2006, 21:58

Message par Dominique »

J'ai fait la modif gm

Corrigé bug supposé fonctions_polygones.php ligne 97
if ($conditions->avec_geometrie="gmlol")

if ($conditions->avec_geometrie=="gmlol")

La requête ne trouve rien

Désolé, je n'ai pas assez trempé dans les geom pour aller plus loin
Avatar du membre
sly
Messages : 5041
Enregistré le : 29 févr. 2004, 17:59
Localisation : Chambéry - Savoie

Message par sly »

Dominique a écrit :J'ai fait la modif gm

Corrigé bug supposé fonctions_polygones.php ligne 97
if ($conditions->avec_geometrie="gmlol")

if ($conditions->avec_geometrie=="gmlol")
Bien vu ! Ce bug empêchait de récupérer autre chose que du gml "tronqué pour OL" (donc geojson, kml et gml était kapout)

tu n'as pas pushé ta modif ?

J'ai passé aussi l'export polygone au format gml avec multipolygones.
Tu peux constater que OL n'affiche plus aucun massif, car ils sont renvoyé au format :

Code : Tout sélectionner

<gml&#58;featureMember>
<massif>
<nom>Chartreuse</nom>
<color>#3132c8</color>
<url>http&#58;//sly.refuges.info/nav/2/massif/Chartreuse/</url>
<gml&#58;MultiPolygon srsName="EPSG&#58;4326">
<gml&#58;polygonMember>
<gml&#58;Polygon>
<gml&#58;outerBoundaryIs>
<gml&#58;LinearRing>
<gml&#58;coordinates>5.72,45.18 5.92,45.289999999999999 6.04,45.479999999999997 5.88,45.579999999999998 5.77,45.420000000000002 5.75,45.380000000000003 5.7,45.390000000000001 5.6,45.32 5.72,45.18</gml&#58;coordinates>
</gml&#58;LinearRing>
</gml&#58;outerBoundaryIs>
</gml&#58;Polygon>
</gml&#58;polygonMember>
</gml&#58;MultiPolygon>
</massif>
</gml&#58;featureMember>
Avatar du membre
Dominique
Messages : 3705
Enregistré le : 08 avr. 2006, 21:58

Message par Dominique »

A priori, il manquait la classe MultiPolygones dans l'OL compressée
Mais : http://dev.refuges.info/exportations/ma ... assif=2740 ne sort toujours pas les polygones

<gml:featureMember>
<massif>
<nom>Réserve biologique dirigée des Merdassiers et du Nant Pareux</nom>
<color>#3132c8</color>
<url>http://dev.refuges.info/nav/2740/zone-r ... reux/</url>
</massif>
</gml:featureMember>



Alors que http://sly.refuges.info/exportations/ma ... assif=2740 le fait très bien

<gml:featureMember>
<massif>
<nom>Réserve biologique dirigée des Merdassiers et du Nant Pareux</nom>
<color>#3132c8</color>
<url>http://sly.refuges.info/nav/2740/zone-r ... reux/</url>
<gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.4553731,45.813979099999997 6.456075,45.814898599999999 6.457105,45.815252700000002 6.4585623,45.815775799999997 6.4599228,45.8157079 6.4603328,45.8159451 6.4634709,45.813780100000002 6.4635615,45.813700300000001 6.4636022,45.81362 6.4636129,45.813549700000003 6.4635584,45.813454900000004 6.4634712,45.8133883 6.4633117,45.813313100000002 6.463183,45.813270500000002 6.4630082,45.813238699999999 6.4628993,45.813213400000002 6.4628037,45.813185400000002 6.4626884,45.813173800000001 6.4626084,45.813136200000002 6.4625022,45.813072599999998 6.4623866,45.813045299999999 6.4622909,45.813026299999997 6.4621585,45.812999599999998 6.4620037,45.812953499999999 6.4618249,45.812921799999998 6.4616739,45.812904799999998 6.4615593,45.812794099999998 6.4615478,45.812727000000002 6.4616232,45.812562100000001 6.4617408,45.812402300000002 6.4617962,45.812260700000003 6.4618436,45.812044999999998 6.4619285,45.811620699999999 6.4619697,45.811418699999997 6.4619574,45.811191700000002 6.4619012,45.8110541 6.4618369,45.8109483 6.4617387,45.810830299999999 6.4616258,45.810775900000003 6.4614377,45.8107355 6.4612428,45.810693100000002 6.4610381,45.810646599999998 6.4608139,45.810609800000002 6.4606942,45.810548900000001 6.460032,45.810158800000004 6.4596845,45.809916999999999 6.4595427,45.809883900000003 6.4593711,45.809838300000003 6.4592699,45.8097566 6.4591405,45.809673500000002 6.4579821,45.8101056 6.4563892,45.810177600000003 6.4563524,45.810309500000002 6.4563413,45.810397700000003 6.456359,45.810451200000003 6.4564092,45.810507899999998 6.4565132,45.810585199999998 6.4566498,45.810668 6.4567837,45.810777999999999 6.4568445,45.810847799999998 6.4569018,45.8109246 6.4569652,45.8109538 6.4570491,45.811020499999998 6.4571262,45.811114500000002 6.457231,45.811214300000003 6.4573057,45.8113399 6.4573406,45.8114287 6.4574089,45.811534299999998 6.457448,45.811636499999999 6.4574619,45.811800400000003 6.4574414,45.8120422 6.4574211,45.812297399999999 6.4573926,45.812465099999997 6.4573257,45.812562200000002 6.4572696,45.812692599999998 6.457206,45.812823299999998 6.4570184,45.812886499999998 6.4568819,45.812934300000002 6.4567248,45.812955799999997 6.4565053,45.812990900000003 6.4563281,45.8129907 6.4560814,45.812965900000002 6.4553731,45.813979099999997</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.4353679,45.807264400000001 6.4357507,45.8081423 6.4366291,45.809015700000003 6.4378009,45.8094301 6.438612,45.809240500000001 6.4390439,45.809794500000002 6.4387165,45.809928200000002 6.4388696,45.810177099999997 6.4386455,45.810270799999998 6.4387435,45.810409100000001 6.4392986,45.810035300000003 6.4395023,45.809345399999998 6.4397193,45.808941099999998 6.4399803,45.809201700000003 6.4410446,45.809027800000003 6.442075,45.808411300000003 6.4424011,45.808746200000002 6.4422013,45.808895399999997 6.4419462,45.808778500000003 6.441828,45.8087807 6.4414362,45.809096799999999 6.4419326,45.809393999999998 6.4405665,45.8098606 6.4405701,45.810349199999997 6.4410565,45.810727800000002 6.4402124,45.810853100000003 6.4396289,45.8108565 6.4391952,45.810807099999998 6.4388207,45.8109131 6.4389489,45.811077300000001 6.4379519,45.811613700000002 6.4373388,45.812018999999999 6.4375315,45.812259699999998 6.4380815,45.812271199999998 6.4386295,45.812300700000002 6.4387838,45.812596900000003 6.4384484,45.813086599999998 6.4385218,45.813185199999999 6.43834,45.813383299999998 6.4384765,45.813635099999999 6.4388743,45.813958399999997 6.4390798,45.813347200000003 6.4391752,45.813330200000003 6.4395943,45.813260900000003 6.439832,45.8131463 6.4402808,45.813147999999998 6.44037,45.81362 6.4407493,45.8138358 6.4408547,45.8135865 6.4413447,45.813570900000002 6.4449196,45.812152099999999 6.4446125,45.812046000000002 6.4425836,45.8121674 6.4420127,45.811972099999998 6.4417304,45.811525199999998 6.4417053,45.811488199999999 6.4417389,45.811443799999999 6.4420668,45.8109836 6.4431833,45.810776199999999 6.443476,45.810328499999997 6.4431374,45.809853400000001 6.4427815,45.809353899999998 6.4430072,45.808043900000001 6.4426823,45.807607500000003 6.4421531,45.807559900000001 6.4420863,45.807546299999998 6.4417614,45.807480099999999 6.4414837,45.807391500000001 6.4413872,45.807407099999999 6.4406397,45.807596500000002 6.4401225,45.807669500000003 6.4395216,45.807696 6.4386108,45.807684299999998 6.4379622,45.807665200000002 6.4372586,45.8075805 6.4365685,45.807470600000002 6.4361426,45.807395999999997 6.4353679,45.807264400000001</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.4465823,45.819291499999999 6.4493532,45.821030100000002 6.4500657,45.8212203 6.4506857,45.821251500000002 6.4521434,45.821682500000001 6.4521385,45.821833400000003 6.452182,45.8220144 6.4522306,45.822233300000001 6.4523072,45.822417399999999 6.4524925,45.822482700000002 6.4534488,45.822938700000002 6.4548533,45.823432199999999 6.4557222,45.822699900000003 6.4570356,45.823257599999998 6.4578487,45.823757100000002 6.4596665,45.823971800000002 6.4602667,45.8237922 6.4599888,45.821700999999997 6.4596431,45.820614599999999 6.459586,45.820636999999998 6.4594654,45.820693200000001 6.459348,45.8207065 6.459158,45.820717999999999 6.458952,45.820752599999999 6.4587301,45.820832799999998 6.4582754,45.820901300000003 6.458118,45.820895800000002 6.4579514,45.820940200000003 6.4578635,45.820972699999999 6.4576024,45.821011599999999 6.4573238,45.821055600000001 6.4571849,45.821017900000001 6.4565647,45.821027100000002 6.456411,45.821039499999998 6.4562252,45.821107099999999 6.4561305,45.821133099999997 6.4559407,45.821158099999998 6.4557141,45.821143900000003 6.4555654,45.821115599999999 6.4554291,45.821037199999999 6.4553342,45.820921300000002 6.4551989,45.820748399999999 6.4550959,45.820556199999999 6.4549911,45.820319099999999 6.4548491,45.820132800000003 6.4546898,45.8200711 6.4545407,45.820015699999999 6.4544366,45.819904700000002 6.4543178,45.819749100000003 6.4540472,45.819696 6.4538693,45.819524600000001 6.4534553,45.819738000000001 6.4531481,45.819915899999998 6.4529567,45.820026499999997 6.4527447,45.8201964 6.4525715,45.8203672 6.4524509,45.820531500000001 6.4523443,45.820720100000003 6.4522411,45.821040699999998 6.452117,45.820945899999998 6.4519116,45.820604199999998 6.4517649,45.820246400000002 6.4516968,45.8198717 6.4515878,45.819749899999998 6.4512134,45.819819500000001 6.4508568,45.819860499999997 6.450515,45.819831100000002 6.449889,45.819476899999998 6.4496028,45.819389600000001 6.4491823,45.819377000000003 6.448896,45.819289699999999 6.4482963,45.819018300000003 6.4479711,45.818946400000002 6.4475318,45.818948499999998 6.4470221,45.819078900000001 6.4465823,45.819291499999999</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>
</massif>
</gml:featureMember>


As tu tout uploadé en GIT ?
Avatar du membre
sly
Messages : 5041
Enregistré le : 29 févr. 2004, 17:59
Localisation : Chambéry - Savoie

Message par sly »

Dominique a écrit : As tu tout uploadé en GIT ?
Oups, mes excuses, j'ai dis que je le faisais et j'ai oublié, c'est pour ça que ça n'était présent que chez moi. Voilà qui est fait
Avatar du membre
Dominique
Messages : 3705
Enregistré le : 08 avr. 2006, 21:58

Message par Dominique »

Et voilà le travail : http://dev.refuges.info/nav/2740 :D :D
Avatar du membre
sly
Messages : 5041
Enregistré le : 29 févr. 2004, 17:59
Localisation : Chambéry - Savoie

Message par sly »

super !

Et une simplification de plus au niveau du code