Précédent   Forum des professionnels en informatique > Applications > SIG : Système d'information Géographique > IGN API Géoportail
IGN API Géoportail Forum d'entraide sur l'API Géoportail développé par IGN
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 03/01/2012, 11h38   #1
Invité de passage
 
Homme
Inscription : mai 2011
Messages : 7
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations forums :
Inscription : mai 2011
Messages : 7
Points : 2
Points : 2
Par défaut Calque IGN sur fond GoogleMap/OpenStreetMap - Mauvaise superposition

Bonjour à tous,


J'ai un petit soucis depuis hier matin, que je n'arrive pas à résoudre :

J'essaye d'afficher un calque avec une carte IGN (GEOGRAPHICALGRIDSYSTEMS.MAPS) sur un fond de carto GoogleMap ou OpenStreetMap.

Ma carte est faite à partir de OpenLayers 2.10, avec la visionneuse de GeoExt.MapPanel. J'inclue l'API IGN v1.2-m.

Le soucis, c'est que mon fond s'affiche bien, mon calque semble se positionner au bon endroit, sauf qu'il se dédouble. Voici une petite image pour exposer le problème :

Quand je charge la carte, j'arrive sur Bordeaux avec le fond GoogleMap


Quand j'affiche le calque, la zone Bordeaux est dédoublée




Il me semble avoir lu quelque part que pour afficher du WMS sur un Fond GoogleMap avec sphericalMercator, il faut redimensionner les images (les étirer). Le problème c'est qu'il me semble que ça devrait être automatique avec proj4js.

Voici quelques extraits de mon code :

La carte :
Code :
1
2
3
4
5
6
7
8
9
10
11
this.map = new GeoExt.MapPanel({
	    	map: new OpenLayers.Map(Ext.id(null, 'map_'), {
	            displayProjection: new OpenLayers.Projection('EPSG:4326'),
		    	projection: new OpenLayers.Projection('EPSG:900913'),
	            units: 'm',
	            numZoomLevels: 22,
	            maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)
			}),
	    	region: 'center'
	    });
Le fond GoogleMap :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
var gphy = new OpenLayers.Layer.Google(
            "Google Physical",
            {
            	type: G_PHYSICAL_MAP
            	,isBaseLayer: true
    			,projection: new OpenLayers.Projection('EPSG:900913')
            	,units: 'm'
    			,sphericalMercator: true
    			,maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)
            	,maxResolution: 156543.0339
            }
        );
Le calque IGN :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var cat = new Geoportal.Catalogue(this.getOLMap(), gGEOPORTALRIGHTSMANAGEMENT);
        var zon = cat.getTerritory('FXX');
        var ignOpts = cat.getLayerParameters(zon, 'GEOGRAPHICALGRIDSYSTEMS.MAPS');
        if (cat != null && zon != null && ignOpts != null){
	        ignOpts.options.resolutions = Geoportal.Catalogue.RESOLUTIONS.slice(
	        	ignOpts.options.minZoomLevel, 
	        	ignOpts.options.maxZoomLevel
			); 
	
	        ignOpts.options.isBaseLayer = false;
	        ignOpts.options.opacity = 0.7;
	
	        ignOpts.options['GeoRM'] = Geoportal.GeoRMHandler.addKey(
				gGEOPORTALRIGHTSMANAGEMENT.apiKey,
				gGEOPORTALRIGHTSMANAGEMENT[gGEOPORTALRIGHTSMANAGEMENT.apiKey].tokenServer.url,
				gGEOPORTALRIGHTSMANAGEMENT[gGEOPORTALRIGHTSMANAGEMENT.apiKey].tokenServer.ttl,
				this.getOLMap()
			);
	        
	        return new ignOpts.classLayer(
	            OpenLayers.i18n(ignOpts.options.name),
	            ignOpts.url,
	            ignOpts.params,
	            ignOpts.options);
Et pour finir, voici les requetes envoyées :

Par GoogleMap :
Code :
http://mt0.google.com/vt/lyrs=t@128,r@169000000&hl=fr&src=api&x=506&y=368&z=10&s=Galile
Par IGN :
Code :
http://wxs.ign.fr/geoportail/wmsc?LAYERS=GEOGRAPHICALGRIDSYSTEMS.MAPS&EXCEPTIONS=text/xml&FORMAT=image/jpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=IGNF:GEOPORTALFXX&BBOX=32768,4949896.612773,65536,4973240.076337&WIDTH=256&HEIGHT=256&TILED=true&gppkey=**mykey**

Je suis complètement bloqué, si quelqu'un a une idée géniale, ça serait super
Images attachées
Type de fichier : png bordeauxgmap.PNG (213,7 Ko, 61 affichages)
Type de fichier : png bordeauxign.PNG (587,9 Ko, 60 affichages)
pouniok est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/01/2012, 10h07   #2
Expert Confirmé

 
Homme Didier Richard
Ingénieur cartographe
Inscription : avril 2009
Messages : 2 734
Détails du profil
Informations personnelles :
Nom : Homme Didier Richard
Localisation : France, Val de Marne (Île de France)

Informations professionnelles :
Activité : Ingénieur cartographe
Secteur : Service public

Informations forums :
Inscription : avril 2009
Messages : 2 734
Points : 3 502
Points : 3 502
Globalement, ceci a été mis en place pour la prochaine version 1.3 de l'API - Cf. ... Cela a nécessité de grosses modifications dans OpenLayers.Layer.Grid pour arriver à ce résultat probant
dgrichard est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/01/2012, 10h47   #3
Invité de passage
 
Homme
Inscription : mai 2011
Messages : 7
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations forums :
Inscription : mai 2011
Messages : 7
Points : 2
Points : 2
Ah, super !


Je commençais à me demander si c'était possible

J'avais vu l'api 1.3 en navigant sur le depot ign, et fait quelques tests avec, mais je n'avais pas trouvé les bons paramétrages.


Savez-vous quand la version 1.3 sera officielle, et si elle utilisera OpenLayers 2.11 ?



Merci pour le retour,
Pouniok.
pouniok est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/01/2012, 10h55   #4
Expert Confirmé

 
Homme Didier Richard
Ingénieur cartographe
Inscription : avril 2009
Messages : 2 734
Détails du profil
Informations personnelles :
Nom : Homme Didier Richard
Localisation : France, Val de Marne (Île de France)

Informations professionnelles :
Activité : Ingénieur cartographe
Secteur : Service public

Informations forums :
Inscription : avril 2009
Messages : 2 734
Points : 3 502
Points : 3 502
Citation:
Envoyé par pouniok Voir le message
Savez-vous quand la version 1.3 sera officielle, et si elle utilisera OpenLayers 2.11 ?
J'avais prévu mi-décembre, mais comme on travaille aussi sur l'API 2.0, on a pris du retard, donc : entre mi et fin janvier

Et oui, c'est OpenLayers 2.11 (Cf. les exemples pour les mobiles)
dgrichard est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 06h09.


 
 
 
 
Partenaires

Hébergement Web