#1 Mon 16 January 2012 15:36
- darksquall
- Participant occasionnel
- Date d'inscription: 27 Oct 2011
- Messages: 32
[mapserver] WFS server error. TYPENAME
Bonjour,
Je n'arrive pas à recuperer les données wfs. Un getCapabilities me renvoie un featuretypelist vide et getfeature me renvoie l'erreur
msWFSGetFeature(): WFS server error. TYPENAME 'valenciennes' doesn't exist in this server. Please check the capabilities and reformulate your request.
Mon mapfile est:
Code:
MAP
EXTENT 680404.715625186 293713.61 686466.96 299382.49
IMAGECOLOR 255 255 255
IMAGETYPE jpeg
SIZE -1 -1
STATUS ON
UNITS METERS
NAME "valenciennes map"
OUTPUTFORMAT
NAME "jpeg"
MIMETYPE "image/jpeg"
DRIVER "GD/jpeg"
EXTENSION "jpeg"
IMAGEMODE "RGBA"
TRANSPARENT FALSE
END
SYMBOL
NAME "symbolbati"
TYPE VECTOR
POINTS
0 1
1 0
END
END
PROJECTION
"init=epsg:4326"
END
LEGEND
IMAGECOLOR 255 255 255
KEYSIZE 20 10
KEYSPACING 5 5
LABEL
SIZE MEDIUM
TYPE BITMAP
BUFFER 0
COLOR 0 0 0
FORCE FALSE
MINDISTANCE -1
MINFEATURESIZE -1
OFFSET 0 0
PARTIALS TRUE
END
POSITION LL
STATUS OFF
END
QUERYMAP
COLOR 255 255 0
SIZE -1 -1
STATUS OFF
STYLE HILITE
END
SCALEBAR
ALIGN CENTER
COLOR 0 0 0
IMAGECOLOR 255 255 255
INTERVALS 4
LABEL
SIZE MEDIUM
TYPE BITMAP
BUFFER 0
COLOR 0 0 0
FORCE FALSE
MINDISTANCE -1
MINFEATURESIZE -1
OFFSET 0 0
PARTIALS TRUE
END
POSITION LL
SIZE 200 3
STATUS OFF
STYLE 0
UNITS MILES
END
WEB
IMAGEPATH "/var/www/webserver/tmpWFS/1/"
IMAGEURL "/webserver/tmpWFS/1/"
METADATA
"wfs_title" "mmap"
"wfs_onlineresource" "http://SITE/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map&?"
"wfs_enable_request" "*"
"wfs_abstract" "This text describes my WFS service." ## Recommended
"wfs_srs" "EPSG:4326"
END
QUERYFORMAT text/html
LEGENDFORMAT text/html
BROWSEFORMAT text/html
END
LAYER
NAME "vafp"
METADATA
"wfs_title" "valenciennes"
"wfs_srs" "EPSG:4326"
"gml_include_items" "all"
"gml_featureid" "ID"
"wfs_enable_request" "*"
END
PROJECTION
"init=epsg:27591"
END
STATUS ON
TYPE LINE
CONNECTION "user=USER password=PASSWORD dbname=DB host=localhost"
CONNECTIONTYPE POSTGIS
DATA "the_geom from affaire1fp "
UNITS METERS
CLASS
NAME 'valenciennes'
STYLE
ANGLE 360
BACKGROUNDCOLOR 255 0 0
COLOR 0 0 0
SIZE 1
SYMBOL 0
WIDTH 1
END
END
END
ENDMerci!
Dernière modification par darksquall (Mon 16 January 2012 15:38)
Hors ligne
#2 Mon 16 January 2012 17:43
- darksquall
- Participant occasionnel
- Date d'inscription: 27 Oct 2011
- Messages: 32
Re: [mapserver] WFS server error. TYPENAME
J'ai trouvé mon erreur, il manquait dump true. Mais maintenant je n'arrive pas à faire interfacer openlayer et mapserver en wfs... J'ai bien parmetre mon proxy. Et avec firebug je recois bien le xml correspondant. Mais rien ne s'affiche.
Dernière modification par darksquall (Mon 16 January 2012 23:40)
Hors ligne
#3 Tue 17 January 2012 14:32
- Daemons
- Participant occasionnel
- Lieu: Nice
- Date d'inscription: 15 Dec 2011
- Messages: 23
Re: [mapserver] WFS server error. TYPENAME
Peut-on voir ton code JavaScript de ta carte ?
Si ton client reçoit bien les données WFS, ce ne serait pas un problème d'affichage avec un stylemap, ou autre ? Firebug ne renvoie aucune erreur ?...
Par contre, je ne comprends pas vraiment ton code : si c'est un WFS, tu n'as pas besoin de définir de outputformat, ceci est réservé aux services WMS qui renvoient de l'image. Ici, tu veux renvoyer du vecteur ?
Hors ligne
#4 Tue 17 January 2012 15:47
- darksquall
- Participant occasionnel
- Date d'inscription: 27 Oct 2011
- Messages: 32
Re: [mapserver] WFS server error. TYPENAME
Voila mon code j'ai fais quelque modification apparement le probleme se trouve au niveau du proxy:
Code:
OpenLayers.ProxyHost ="/cgi-bin/proxy.cgi?url=";
...
that.map = new OpenLayers.Map({
projection: new OpenLayers.Projection("EPSG:4326"),
div: divMap,
allOverlays: true
});
..
var cadastre = new OpenLayers.Layer.Vector("vector", {
styleMap:styleParcelles,
strategies: [new OpenLayers.Strategy.BBOX(),saveStrategyParcelle],
projection: new OpenLayers.Projection("EPSG:4326"),
protocol: new OpenLayers.Protocol.WFS({
url: "http://localhost:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map",
version: "1.0.0",
featureType: "vafp",
featureNS: "http://localhost:8080/",
srsName: "EPSG:4326",
geometryName: "the_geom",
schema: "http://localhost:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map&service=wfs&request=DescribeFeatureType&version=1.0.0&typename=vafp",
extractAttributes: true
})
});Au debut j'avais mis l'url distant dans le protocol.WFS je pense qu'il faut mettre localhost car openlayer utilise le proxy non?
Mais maintenant j'ai une erreur:
This proxy does not allow you to access that location
Cela fais 2 jours complet que je suis dessus... Désesperant.
Hors ligne
#5 Tue 17 January 2012 17:22
- Daemons
- Participant occasionnel
- Lieu: Nice
- Date d'inscription: 15 Dec 2011
- Messages: 23
Re: [mapserver] WFS server error. TYPENAME
Je ne pense pas que l'URL distant ou local change grand chose... si tu ne l'utilises qu'en local pour l'instant. Après, il faudra mettre l'URL distante, vu que la requête partira d'un PC différent du tien, donc la requête devra se faire sur ton serveur perso.
Aussi, l'URL que tu appelles dans OpenLayers en paramètre du WFS et le paramètre "wfs_onlineresource" de ton Mapfile doivent être les mêmes. Le GetCapabilities de ton WFS marche bien ?
Teste :
http://localhost:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map?service=WFS&version=1.0.0&request=GetCapabilites
Là comme ca, je ne vois pas l'erreur, mais si tu essaie un Protocol.HTTP plutôt qu'un Protocol.WFS, est-ce que ca change quelque chose dans le comportement de ton appli ?
Code:
var cadastre = new OpenLayers.Layer.Vector("vector",
{
styleMap: styleParcelles,
strategies: [new OpenLayers.Strategy.BBOX(),saveStrategyParcelle],
protocol: new OpenLayers.Protocol.HTTP({
url: "http://localhost:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map?",
params: {
typename: "vafp",
service: "WFS",
version: "1.0.0"
request: "GetFeature",
srs: "EPSG:4326",
format: "WFS"
}
}),
}, {extractAttributes:true}
)Dernière modification par Daemons (Tue 17 January 2012 17:23)
Hors ligne
#6 Tue 17 January 2012 17:33
- darksquall
- Participant occasionnel
- Date d'inscription: 27 Oct 2011
- Messages: 32
Re: [mapserver] WFS server error. TYPENAME
getCapabilities renvoie:
Code:
<WFS_Capabilities xmlns="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" updateSequence="0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-capabilities.xsd"> <!-- 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>mmap</Title> <Abstract>This text describes my WFS service.</Abstract> <OnlineResource> http://amiciti.fr:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map& </OnlineResource> </Service> <Capability> <Request> <GetCapabilities> <DCPType> <HTTP> <Get onlineResource="http://x:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map&"/> </HTTP> </DCPType> <DCPType> <HTTP> <Post onlineResource="http://x:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map&"/> </HTTP> </DCPType> </GetCapabilities> <DescribeFeatureType> <SchemaDescriptionLanguage> <XMLSCHEMA/> </SchemaDescriptionLanguage> <DCPType> <HTTP> <Get onlineResource="http://x:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map&"/> </HTTP> </DCPType> <DCPType> <HTTP> <Post onlineResource="http://x:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map&"/> </HTTP> </DCPType> </DescribeFeatureType> <GetFeature> <ResultFormat> <GML2/> </ResultFormat> <DCPType> <HTTP> <Get onlineResource="http://x:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map&"/> </HTTP> </DCPType> <DCPType> <HTTP> <Post onlineResource="http://x:8080/cgi-bin/mapserv?map=/var/www/webserver/tmpWFS/1/carto2.map&"/> </HTTP> </DCPType> </GetFeature> </Request> </Capability> <FeatureTypeList> <Operations> <Query/> </Operations> <FeatureType> <Name>vafp</Name> <Title>valenciennes</Title> <SRS>EPSG:4326</SRS> <LatLongBoundingBox minx="-179.829" miny="-67.866" maxx="179.763" maxy="-36.074"/> </FeatureType> </FeatureTypeList> <ogc:Filter_Capabilities> <ogc:Spatial_Capabilities> <ogc:Spatial_Operators> <ogc:Equals/> <ogc:Disjoint/> <ogc:Touches/> <ogc:Within/> <ogc:Overlaps/> <ogc:Crosses/> <ogc:Intersect/> <ogc:Contains/> <ogc:DWithin/> <ogc:BBOX/> </ogc:Spatial_Operators> </ogc:Spatial_Capabilities> <ogc:Scalar_Capabilities> <ogc:Logical_Operators/> <ogc:Comparison_Operators> <ogc:Simple_Comparisons/> <ogc:Like/> <ogc:Between/> </ogc:Comparison_Operators> </ogc:Scalar_Capabilities> </ogc:Filter_Capabilities> </WFS_Capabilities>
Laltn
Hors ligne
#7 Thu 19 January 2012 11:45
- Daemons
- Participant occasionnel
- Lieu: Nice
- Date d'inscription: 15 Dec 2011
- Messages: 23
Re: [mapserver] WFS server error. TYPENAME
On dirait que la config de ton MapFile est bonne, il reconnait bien ton layer... Si tu as toujours le même message d'erreur de Firebug, le problème doit venir de la configuration du proxy, il faut voir quelles connexions il autorise ? Là par contre, je ne sais pas trop comment ca marche pour ca...
Hors ligne


