#1 Mon 06 December 2010 22:29
- geobrie
- Participant actif
- Date d'inscription: 31 Jan 2010
- Messages: 120
Problème de connexion ?
Bonjour,
Je poste ce petit message car je suis perdus. Depuis environ 6 mois je travail sur la mise en place de serveur dédié au web mapping. Aujourd'hui j'en suis à mon deuxième serveur, mais malheureusement il m'est impossible de le faire fonctionner correctement. Ça bloque au niveau de Mapserver/Openlayer. Je pensais avoir reproduit exactement les même manipulations mais malheureusement l'écran bleu persiste. Je pense avoir besoin d'aide pour identifier le problème car je suis complétement perdus !!!!.
Le premier serveur était sous debian avec postgreSQL 8.3/Postgis 1.3, la nouveau est sous Ubuntu avec PosgreSQL 8.4/Postgis 1.4. Je penses que c'est un problème de droit. Sous le server fonctionnel les mêmes couche avec les mêmes mapfil et les même script Openlayer, tout fonctionne correvctement. Je ne sais plus où chercher, pour information ma couche geosignal s'affiche donc je pense que ça doit venir de la connexion postgresql/postgis.
Voici mon Mapfil :
Code:
MAP
NAME "DOC_MAP"
IMAGETYPE PNG24
EXTENT 519556 2384371 811130 2611375
SIZE 100 100
UNITS meters
IMAGECOLOR 255 255 255
IMAGEQUALITY 95
FONTSET './fonts.txt'
SYMBOLSET './symbols.txt'
WEB
IMAGEPATH "/var/www/site/htdocs/tmp/"
IMAGEURL 'tmp/'
# WMS server settings
METADATA
'wms_title' "doc"
'wms_onlineresource' "http://www.site-db.fr/cgi-bin/mapserv?map=/var/www/site/htdocs/psg.map&"
'wms_srs' "EPSG:27582"
"wfs_title" "doc"
"wfs_onlineresource" "http://www.site-db.fr/cgi-bin/mapserv?map=/var/www/site/htdocs/psg.map&"
"wfs_srs" "EPSG:27582"
END###### Fin de METADATA ######
END###### Fin de WEB######
PROJECTION
"init=epsg:27582"
END###### Fin de PROJECTION ######
OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
END###### Fin de OUTPUTFORMAT ######
###### Layer 1 #######################
LAYER
NAME psg
STATUS ON
TYPE POINT
DUMP TRUE
CONNECTIONTYPE postgis
CONNECTION "dbname='base' host=192.168.0.14 port=5432 user='user' password='pass' sslmode=disable"
DATA "the_geom FROM doc"
LABELITEM "foret"
METADATA
### WMS
"wms_title" "doc"
### WFS
"wfs_title" "doc"
"gml_featureid" "gid"
"gml_include_items" "all"
END###### Fin de METADATA ######
CLASS
NAME "psg"
LABEL
COLOR 150 150 150
OUTLINECOLOR 255 255 255
FONT arial
TYPE truetype
SIZE 6
ANGLE [MYANGLE]
POSITION AUTO
PARTIALS FALSE
END
STYLE
SYMBOL "circle"
SIZE 7.0
OUTLINECOLOR 0 0 0
COLOR 255 255 255
END
END
END###### Fin de Layer 1 ######
END###### Fin de Map File ######Mon script :
Code:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html, body {
font: normal 12px verdana;
margin: 0;
padding: 0;
border: 0 none;
overflow: hidden;
height: 100%;
background-color:#d2d9df;
}
#header{
background:url(./img/GeoExt.png) no-repeat;
margin : 0;
background-color:#12395F;
height : 100%;
width :100%;
}
#header p{
color : white;
text-align : right;
font-size: 1.2em;
font-weight: bold;
padding-right : 20px;
padding-top : 10px;
}
#header a{
color : white;
}
</style>
<head>
<link rel="stylesheet" type="text/css" href="../ext-3.3.1/resources/css/ext-all.css"></link>
<link rel="stylesheet" type="text/css" href="../GeoExt/resources/css/geoext-all-debug.css"></link>
<link rel="stylesheet" type="text/css" href="../GeoExt/resources/css/popup.css"></link>
<link rel="stylesheet" type="text/css" href="./css/ext-carto.css"></link>
<script type="text/javascript" src="../ext-3.3.1/adapter/ext/ext-base.js" ></script>
<script type="text/javascript" src="../ext-3.3.1/ext-all.js"></script>
<script type="text/javascript" src="../OpenLayers/lib/OpenLayers.js"></script>
<script type="text/javascript" src="../GeoExt/lib/GeoExt.js"></script>
<script type="text/javascript">
var map= new OpenLayers.Map('map');
var rowCliked = false;
Ext.QuickTips.init();
Ext.onReady(function() {
var geosignal = new OpenLayers.Layer.WMS( "geosignal",
"http://www.geosignal.org/cgi-bin/wmsmap?",
{layers: 'RASTER1000k', }
);
var style = new OpenLayers.Style({
strokeColor: "green",
strokeWidth: 2,
strokeOpacity: 0.5,
fillColor : "red",
pointRadius : 5
});
var StyleMap = new OpenLayers.StyleMap({'default': style});
var doc = new OpenLayers.Layer.WFS( "doc",
"http://192.168.0.14/cgi-bin/mapserv?map=/var/www/site/htdocs/doc.map&",
{typename: 'doc'}, { extractAttributes: true, styleMap: StyleMap
});
// [1] - ZoomSlider
var zSlider = new GeoExt.ZoomSlider({
vertical: true
,height: 110
,x: 18
,y: 85
,map: mapPanel
,plugins: new GeoExt.ZoomSliderTip({
template: '<div>Zoom Level: <b>{zoom}</b></div>'
})
});
//MapPanel
var mapPanel = new GeoExt.MapPanel({
map : {
maxExtent: new OpenLayers.Bounds(519556, 2384371, 811130, 2611375),
projection: new OpenLayers.Projection("EPSG:27582"),
displayProjection: new OpenLayers.Projection("EPSG:27582"),
maxResolution: 400,
numZoomLevels: 2,
units: 'meters',
controls: [
new OpenLayers.Control.Navigation()
,new OpenLayers.Control.PanPanel()
,new OpenLayers.Control.ZoomPanel()
]
,allOverlays : false
}
,region : 'center'
,title : 'Localisation des forets'
,layers : [geosignal,doc]
,items : [zSlider]
});
/* tree layer */
var treeConfig = new OpenLayers.Format.JSON().write([
{
nodeType : 'gx_baselayercontainer'
,expanded : true
,allowDrag : false
,allowDrop : false
,draggable : false
,icon : './img/map.png'
},{
text : 'Couches'
,icon : './img/maps-stack.png'
,expanded : true
,children : [
{
nodeType : 'gx_layer'
,draggable : false
,layer : 'doc'
,qtip : "Villes"
,icon : './img/markers.png'
}
]
}
], true);
var layerTree = new Ext.tree.TreePanel({
title : "Couches(pour ouvrir cliquer ici)"
,root: {
nodeType : "async"
,expanded : true
,children : Ext.decode(treeConfig)
}
,loader: new Ext.tree.TreeLoader({
applyLoader: false
})
,animate : true
,enableDD : true
,useArrows : true
,rootVisible: false
});
/* GRID */
// create feature store, binding it to the vector layer
store = new GeoExt.data.FeatureStore({
layer : doc
,fields : [
{name: 'gid', type: 'string'}
,{name: 'lieu', type: 'string'}
]
});
// create grid panel configured with feature store
gridPanel = new Ext.grid.GridPanel({
store: store
,columns : [{
header : "doc"
,width : 30
,dataIndex : "gid"
}, {
header : "lieu"
,width : 100
,dataIndex : "lieu"
}
]
,sm: new GeoExt.grid.FeatureSelectionModel()
});
var grid = new Ext.Panel({
title : 'Données (pour ouvrir cliquer ici)'
,layout :'fit'
,items : [gridPanel]
});
doc.events.on({
featureselected: function(e) {
if(typeof(popup) != "undefined"){
popup.destroy();
}
var content = "<b>Doc :"+e.feature.attributes.gid+"</b><br /> Lieu : "+e.feature.attributes.lieu;
popup = new GeoExt.Popup({
title : 'psg'
,feature : e.feature
,width : 150
,html : content
,collapsible: true
,anchored : true
});
popup.show();
}
});
var accordion = new Ext.Panel({
margins : '5 0 5 5'
,split : true
,width : 300
,layout :'accordion'
,items : [grid, layerTree]
});
//Data Panel
var dataPanel = new Ext.Panel({
title : 'Legende & couche'
,region : 'west'
,layout : 'fit'
,width : 300
,items : [accordion]
});
//Final User Interface
new Ext.Viewport({
layout: "border"
,items: [ mapPanel,dataPanel ]
});
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>Même un début de piste serait extra.
Merci
Dernière modification par geobrie (Mon 06 December 2010 22:37)
Hors ligne
#2 Mon 06 December 2010 23:11
Re: Problème de connexion ?
Bonsoir,
Si tout était identique, ça fonctionnerait ![]()
Côté serveur, as-tu testé tes services web en utilisant par exemple Qgis ou Udig pour te connecter dessus? Ou en faisant une requête manuelle du type http://tonUrlMapserverOuTonIp/mapserv?map=/home/tonUtilisateur/tonMapfile.map&request=getCapabilities&service=WFS&version=1.0.0 ?
Tu as pensé à utiliser le debug dans Mapserver? Voir http://mapserver.org/optimization/debugging.html
Je suis un peu surpris de voir une adresse www.site-db.fr (donc internet) avec une adresse de sous-réseau (192.168.0.14), normal?
Sinon côté client, écran bleu c'est sous Windows, donc tu as quoi comme retour quand tu ouvres ta page qui contient ton code Openlayers et avec Firebug activé?
Tu as pensé à copier le proxy.cgi entre les serveurs (bloquant, au moins pour le WFS)?
Cordialement
ThomasG
Hors ligne
#3 Mon 06 December 2010 23:36
- geobrie
- Participant actif
- Date d'inscription: 31 Jan 2010
- Messages: 120
Re: Problème de connexion ?
Bonsoir,
Côté serveur, as-tu testé tes services web en utilisant par exemple Qgis ou Udig pour te connecter dessus?
ThomasG
Sous QGIS le service web fonctionne correctement.
Ou en faisant une requête manuelle du type http://tonUrlMapserverOuTonIp/mapserv?map=/home/tonUtilisateur/tonMapfile.map&request=getCapabilities&service=WFS&version=1.0.0 ?
ThomasG
Je ne sais pas trop quel type de résultat je doit obtenir voici le résultat :
<WFS_Capabilities version="1.0.0" updateSequence="0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WF … ">
−
<!--
MapServer version 5.6.5 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
-->
−
<Service>
<Name>MapServer WFS</Name>
<Title>psg</Title>
−
<OnlineResource>
http://www.site-db.fr/cgi-bin/mapserv?m … g.map&
</OnlineResource>
</Service>
−
<Capability>
−
<Request>
−
<GetCapabilities>
−
<DCPType>
−
<HTTP>
<Get onlineResource="http://www.site-db.fr/cgi-bin/mapserv?map=/var/www/site/htdocs/psg.map&"/>
</HTTP>
</DCPType>
−
<DCPType>
−
<HTTP>
<Post onlineResource="http://www.site-db.fr/cgi-bin/mapserv?map=/var/www/site/htdocs/psg.map&"/>
</HTTP>
</DCPType>
</GetCapabilities>
−
<DescribeFeatureType>
−
<SchemaDescriptionLanguage>
<XMLSCHEMA/>
</SchemaDescriptionLanguage>
−
<DCPType>
−
<HTTP>
<Get onlineResource="http://www.site-db.fr/cgi-bin/mapserv?map=/var/www/site/htdocs/psg.map&"/>
</HTTP>
</DCPType>
−
<DCPType>
−
<HTTP>
<Post onlineResource="http://www.site-db.fr/cgi-bin/mapserv?map=/var/www/site/htdocs/psg.map&"/>
</HTTP>
</DCPType>
</DescribeFeatureType>
−
<GetFeature>
−
<ResultFormat>
<GML2/>
</ResultFormat>
−
<DCPType>
−
<HTTP>
<Get onlineResource="http://www.site-db.fr/cgi-bin/mapserv?map=/var/www/site/htdocs/psg.map&"/>
</HTTP>
</DCPType>
−
<DCPType>
−
<HTTP>
<Post onlineResource="http://www.site-db.fr/cgi-bin/mapserv?map=/var/www/site/htdocs/psg.map&"/>
</HTTP>
</DCPType>
</GetFeature>
</Request>
</Capability>
−
<FeatureTypeList>
−
<Operations>
<Query/>
</Operations>
Sinon côté client, écran bleu c'est sous Windows, donc tu as quoi comme retour quand tu ouvres ta page qui contient ton code Openlayers et avec Firebug activé?
ThomasG
layer.map is null
http://www.site-db.fr/GeoExt/lib/GeoExt … onModel.js
Line 153
Tu as pensé à utiliser le debug dans Mapserver? Voir http://mapserver.org/optimization/debugging.html
Tu as pensé à copier le proxy.cgi entre les serveurs (bloquant, au moins pour le WFS)?
ThomasG
Pour le reste je ssuis un peu perdus.
Merci
Hors ligne
#4 Tue 07 December 2010 12:44
Re: Problème de connexion ?
Bonjour,
Votre problème est côté client ,il suffit presque de lire le chemin renvoyé par le bug pour comprendre.
FeatureSelectionModel.js fait référence à la synchronisation entre la sélection sur la carte et celle sur le tableau ("grid")
Commentez votre gridPanel et vous devriez avoir la carte au minimum.
Pour régler le problème du "grid", il faudra à priori bien voir ce que proxy.cgi fait.
La documentation est abondante à ce propos :
*le premier résultat de recherche http://georezo.net/resultatrecherche.ph … 69089#1312
*ou sur http://www.geotribu.net/node/264
*ou bien encore sur http://trac.osgeo.org/openlayers/wiki/F … #ProxyHost
Cordialement
ThomasG
PS: Pensez à regarder la documentation que constitue les autres réponses du forum en utilisant un peu plus la recherche, svp.
Hors ligne


