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

GEODATA DAYS 2024

#1 Sat 27 November 2010 16:56

mfvallet
Juste Inscrit !
Lieu: Lanton
Date d'inscription: 24 Sep 2006
Messages: 2

Mapserver/ openlayers : erreur d'affichage d'une couche WFS

Bonjour,

Je suis en train de mettre en place un site utilisant mapserver (MS4W), openlayers, postgresql.
J'ai mis en place une vue dans postgresql pour récupérer un ensemble  de mailles en lambert 93

J'arrive à les visualiser en WMS mais impossible de le faire en WFS.

Affichage dans Firebug :

Code:

http://localhost/cgi-bin/mapserv.exe?map=chemin-vers-mapfile/monmap.map&typeName=mon-layer&srsName=EPSG%3A2154&extractAttributes=true&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A2154&BBOX=-1491848.9541556,5635344.8768792,2381648.9541556,7236955.1231208

Unsupported geometry type: Box
http://localhost/openlayers/lib/OpenLayers/Format/XML.js
Line 83

Voici le fichier php

Code:

var wfsF = new OpenLayers.Layer.WFS(
            "wfs","http://localhost/cgi-bin/mapserv.exe?map=chemin-vers-mapfile/monmap.map&",
         {
                typeName: 'mon-layer', 
                srsName: "EPSG:2154",                                
                extractAttributes: true
            },
            {'reproject': true}

        );

et une partie du mapfile

Code:

MAP
    NAME ma_carte
    SIZE 600 518
    IMAGETYPE PNG
    STATUS ON
    EXTENT -97900 1726600 893200 2274800
    UNITS METERS
    ...    
    CONFIG "CGI_CONTEXT_URL" "1"
    CONFIG "MS_ERRORFILE" "chemin-vers/ms_error.txt"
    OUTPUTFORMAT ... END
    PROJECTION 
        "init=epsg:2154"
    END #projection
     
    WEB
        IMAGEPATH "chemin-vers/tmp/"
        imageurl "chemin-vers/tmp/"
        TEMPLATE  "chemin-vers/template/template.htm"
        METADATA
            ### WMS
            "wms_title"            "wms test"
            "wms_onlineresource"      "http://localhost/cgi-bin/mapserv.exe?map=chemin-vers/mapfile/monmap.map"
            "wms_srs"                "EPSG:2154"
            "wms_format"            "image/png"
            
            ### WFS
            "wfs_title"                    "wfs test"
            "wfs_onlineresource"      "http://localhost/cgi-bin/mapserv.exe?map=chemin-vers/mapfile/monmap.map&"
            "wfs_version"             "1.0.0"
            "wfs_abstract"            "Carte"
            "wfs_srs"                      "EPSG:2154"
            "wfs_format"                  "image/png" 
            "wfs_filter"               "GET"
        END # METADATA
    END # WEB
    LAYER
        NAME "mon-layer"
        CONNECTIONTYPE POSTGIS
        CONNECTION "host=localhost dbname=### user=### password=### port=5432"
        DATA "geom_the FROM mon-layer as foo using unique gid using SRID=2154"
        TYPE POLYGON
        STATUS ON
        METADATA
            ### WMS 
            "wms_title"            "mon-layer"
                    "wms_include_items"         "all" 
            ### WFS 
            "wfs_title"                "mon-layer" 
            "wfs_typename"            "mon-layer" 
            "wfs_version"             "1.0.0"
            "wfs_connectiontimeout"     "60 "
            "wfs_maxfeatures"           "100"
            "wfs_srs"                      "EPSG:2154"
            "gml_featureid"             "pt_gid"
            "gml_include_items"         "all"
            "gml_geometries"        "geom_the"            
        END # METADATA
        PROJECTION
            "init=epsg:2154"
        END # PROJECTION
        DUMP TRUE 
        CLASS ... END # class
    END # layer
END

Je n'arrive pas à voir ce qui ne va pas.
Mon objectif est de pouvoir ensuite appliquer une requête sur la couche WFS et ne montrer qu'une partie des données.

Merci d'avance pour votre aide.

Dernière modification par mfvallet (Sat 27 November 2010 16:58)

Hors ligne

 

Pied de page des forums

Powered by FluxBB