Nous utilisons des cookies pour vous garantir la meilleure expérience sur notre site. Si vous continuez à utiliser ce dernier, nous considèrerons que vous acceptez l'utilisation des cookies. J'ai compris ! ou En savoir plus !.
banniere

Le portail francophone de la géomatique


Toujours pas inscrit ? Mot de passe oublié ?
Nom d'utilisateur    Mot de passe              Toujours pas inscrit ?   Mot de passe oublié ?

Annonce

Rencontres QGIS 2025

L'appel à participation est ouvert jusqu'au 19 janvier 2025!

#1 Tue 17 February 2009 10:52

olriche38
Juste Inscrit !
Date d'inscription: 23 Oct 2008
Messages: 3

Polygon google Maps

Hello

Je commence à faire des polygones avec google Maps et cela se passe bien^^

Cependant, j'ai des .shp et je les transforme pour les mettre dans mysql (shp2mysql).

Voici la commande SQL :

Code:

INSERT INTO toto VALUES('1','AIN','3','RHONE','GRENOBLE',GeometryFromText('MULTIPOLYGON(((6.077625878319401 46.433095154662198 ,6.069502636384584 46.436245425682941 ,6.010821796651162 46.407240452096758 ,6.001737470899402 46.395750847570895 ,5.994526480324188 46.386626605495906 ,5.986993815063554 46.377091576770646 ,5.976314749860778 46.370597456748612 ,5.955200237531735 46.357749837487837 ,5.936276109510896 46.351565265409597 ,5.929103255582708 46.325400637639454 ,5.907774340973307 46.315517684877619 ,5.908169103129908 46.304948571366211 ,5.891000409756691 46.283621029370117 ,5.869645953927336 46.272978395747622 ,5.855036661596098 46.282481374252718 ,5.837960840562708 46.287534430653288 ,5.828914828227519 46.265193127797637 ,5.812639071318471 46.265693748644672 ,5.808634501515480 46.271094608374902 ,5.795673911849779 46.289587098508719 ,5.789769011154942 46.282227199677905 ,5.772165056544559 46.278992356770814 ,5.761591509116332 46.271189915772581 ,5.751590610015896 46.263026717449911 ,5.729434120343820 46.258811443179411 ,5.720857012097098 46.257178309188781 ,5.720788198748331 46.257165430900379 ,5.720367640945557 46.250392270569478 ,5.703212520397941 46.183800883781650 ,5.694174051965375 46.178037871514462 ,5.686403909105699 46.164455372048309 ,5.675942960498179 46.146157728286958 ,5.704449830074090 46.115907423986144 ,5.682576096062045 46.112787630452388 ,5.672837117470898 46.113075673915517 ,5.647948151740715 46.113807971969123 ,5.638927083648463 46.108040556229845 ,5.639398222338134 46.096857284637949 ,5.639594860436492 46.092188394815409 ,5.641744292576023 46.083523014320903 ,5.646562429008556 46.064088702342623 ,5.637722312349961 46.043237484037732 ,5.632893027858309 46.016991132065620 ,5.634625398862195 45.999893535797895 ,5.636428641103793 45.982085124456958 ,5.637640700614771 45.970108586938686 ,5.630305105594403 45.955998674826958 ,5.595108943457491 45.927619782824024 ,5.548840753103957 45.912363733600628 ,5.519889058080386 45.897354782848332 ,5.521899282949823 45.876189325325363 ,5.511069532521166 45.856894799264396 ,5.492465964751879 45.862528129025179 ,5.478855634637460 45.866646782774787 ,5.464402390002199 45.871018036150822 ,5.460478074663790 45.877911771549073 ,5.453620019918919 45.879517698257693 ,5.434912818425135 45.883895697272493 ,5.412238043248024 45.883764008219906 ,5.404036826629773 45.891526233653877 ,5.378667764540295 45.901260822265989 ,5.359552384617346 45.926651876723120 ,5.332422270355339 45.924361737479927 ,5.286027802784002 45.905234218675567 ,5.269202152639168 45.873261165768568 ,5.262799106839954 45.813879482035262 ,5.223817534146958 45.790013713660031 ,5.178819180797098 45.794930036888204 ,5.181063889468371 45.817485584632514 ,5.202617710535098 45.838043111971693 ,5.202286972567020 45.852372912508223 ,5.217684085269837 45.858009584523863 ,5.215873172777662 45.885191436607883 ,5.218621891643303 45.896427549815279 ,5.206415532840466 45.913594298538079 ,5.199512751190028 45.923296888869544 ,5.185686051716990 45.927416378727266 ,5.164935289403674 45.964873264050048 ,5.159424007219337 45.979916145387669 ,5.165958263814118 45.999823102355386 ,5.178013817488277 46.016511204763738 ,5.196480801153830 46.017270213972701 ,5.202186484603132 45.996839771045941 ,5.229593911054673 46.001980570514782 ,5.243525632296695 46.016067522323311 ,5.260179383181693 46.031430278111159 ,5.259240598071998 46.060683506551278 ,5.289721548482857 46.069477488455128 ,5.328483626596069 46.087538414568478 ,5.340107204080426 46.110570444136570 ,5.356508051705783 46.120001315104389 ,5.345079557035327 46.136063180476235 ,5.348418810745096 46.159715401606796 ,5.346759389373648 46.213992916435856 ,5.364291006467346 46.230062620066974 ,5.378211097545245 46.249128771604099 ,5.393611681777732 46.267090654836828 ,5.401642839834653 46.295501136713796 ,5.417710815439277 46.304695611259888 ,5.410432504178468 46.323625269436214 ,5.403754261749945 46.332994646228570 ,5.397868894093519 46.342873036912721 ,5.377279105285944 46.356643913585962 ,5.387979314920178 46.375016434739535 ,5.366336943978077 46.389478491781325 ,5.373650048688009 46.404973948284933 ,5.381634441377310 46.418675558425640 ,5.390273625919066 46.440480090726297 ,5.410654885623192 46.446293543613152 ,5.402661747638687 46.463812604665414 ,5.411502026320534 46.470133508053571 ,5.425800942932483 46.474207567205063 ,5.432802262603722 46.483736677549302 ,5.451984952246182 46.501192181362605 ,5.467675767780454 46.548675289655392 ,5.526114356194060 46.536118393445363 ,5.546540970803135 46.541905850824818 ,5.545934944007497 46.564260346366218 ,5.560130897635330 46.574354561892726 ,5.575727446038691 46.578765359449434 ,5.591031571274333 46.611686280198647 ,5.639031059872880 46.614126753150046 ,5.646483369034179 46.615401472751948 ,5.654357284341604 46.615926786928242 ,5.663713349964887 46.631422632858694 ,5.663229425185330 46.640222208747204 ,5.662055165752339 46.661562732783757 ,5.688846873723222 46.666271634698951 ,5.708330470873953 46.697510348609690 ,5.723530936376088 46.697899610055948 ,5.734633245860446 46.696952837815665 ,5.763566949772081 46.729243443263456 ,5.771466030896028 46.740114004021542 ,5.803392525020016 46.774581322599055 ,5.836448950708555 46.789215220448312 ,5.861372124619116 46.787066469114073 ,5.871395362864098 46.792478933592285 ,5.870431001009573 46.811267588054662 ,5.873446806533249 46.827722210439958 ,5.873075761435947 46.834956465512349 ,5.878761829687130 46.844715890634966 ,5.888597549678115 46.853080823657258 ,5.895297879189951 46.857952822948448 ,5.916182059774983 46.870732200032975 ,5.918454342913325 46.883058988671010 ,5.917865262498143 46.894721375792216 ,5.939287009619848 46.889673945778306 ,5.965096694202950 46.864482965923635 ,5.983375968426159 46.864907838205092 ,5.999381297848728 46.836865012675922 ,6.024979391974287 46.828018961555820 ,6.050768412123425 46.817019288041621 ,6.097104189172392 46.824968774595433 ,6.110004089524168 46.834300931982831 ,6.122134781454672 46.826399910141397 ,6.118601859584802 46.807602186767227 ,6.139934082789463 46.793695926737925 ,6.151933166301546 46.783135116159549 ,6.159002953689726 46.778522348001580 ,6.164999091995170 46.773240815241380 ,6.176928081515374 46.764020129126877 ,6.177986348516640 46.740800556013888 ,6.155639321970400 46.730994721127260 ,6.115411561749251 46.715475495852402 ,6.093726776902908 46.696439933261153 ,6.116945085614112 46.688371430441791 ,6.123383487644267 46.670594918919825 ,6.133099423197763 46.664245648072892 ,6.122086939940447 46.652075021808486 ,6.111625171256927 46.641443218002841 ,6.149644239685891 46.646076218289075 ,6.156342404041113 46.650933086778302 ,6.165184608139350 46.655683027476329 ,6.177074332281428 46.654621362725173 ,6.184289839845301 46.649934258225649 ,6.189899253429079 46.639994358808757 ,6.198414088735958 46.628151695766299 ,6.140184406301790 46.596854183691299 ,6.131640773036181 46.585202094297657 ,6.085727965981006 46.546068692481946 ,6.094321777988966 46.534135524585047 ,6.092297065726012 46.523274057288525 ,6.062910397712074 46.507412679887018 ,6.064462625260832 46.474714201333526 ,6.096335487932442 46.463601043887664 ,6.092266333748701 46.441746069845216 ,6.100431780753198 46.430382949970202 ,6.097155719175009 46.425919657319284 ,6.077625878319401 46.433095154662198 )))',-1) );

Ensuite, je fais une extraction de cette donnée en php avec cette commande :

Code:

$requeteSQL = "    SELECT AsText((ogc_geom)) as poly,ogc_geom
                FROM bassin
                WHERE ID = 0";

Donc si je lis ogc_geom c des carractères illisibles, et poly me sort :
MULTIPOLYGON(((6.077625878319401 46.433095154662198 ,6.069502636384584 46.436245425682941 ,6.010821796651162 46.407240452096758 ,6.001737470899402 46.395750847570895 ,5.994526480324188 46.386626605495906 ,5.986993815063554 46.377091576770646 ,5.976314749860778 46.370597456748612 ,5.955200237531735 ...

Comment je peux utiliser ce résultat pour créer des polygones dans google maps

Code:

new GPolygon('.$bassin.', "#f33f00", 1, 1, "#ff0000", 0.2);

Hors ligne

 

Pied de page des forums

Powered by FluxBB