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

Printemps des cartes 2024

#1 Wed 23 July 2008 16:23

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

mapserver Server WMS

Bonjour,

J'essaye de me servir de Mapserver comme server WMS. J'ai écumé les nombreux forums et je ne suis malheureusement pas arrivé à produire ma couche WMS. Je travail sur MS4W.
Voici mon Mapfile

Code:

MAP
    SIZE 600 300
    EXTENT 549178.24 1703195.74 1031181.00 2360005.00
    IMAGECOLOR 180 180 250
    UNITS METERS
    PROJECTION
       "init=epsg:4326"
        END

    END
    WEB 
        METADATA
            "wms_title" "essai_wms"
            "wms_onlineresource"  "http://127.0.0.1/cgi-bin/mapserv.exe&map=C:/ms4w/Apache/htdocs/global.map"
            "wms_srs" "EPSG:4326"
        END
    END
    
    LAYER
        NAME SSBV
        TYPE POLYGON
        STATUS DEFAULT
        DATA ssbv1
        MINSCALE 1000
        MAXSCALE 1000000
            CLASS
                OUTLINECOLOR 100 100 100
                COLOR 255 255 150
            END
            METADATA
                "wms_title" "SSBV"
            END
            PROJECTION
                "EPSG:4326"    
            END    
    END
END

Et voici mon URL http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/apache/htdocs/global.map&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetCapabilities

donc il y a un blocage mais je ne sais pas où

Si quelqu'un pouvait m'aiguiller merci

Dernière modification par paulcarrot (Wed 23 July 2008 16:28)

Hors ligne

 

#2 Wed 23 July 2008 16:48

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

J'ai modifié mon mapfile et j'ai une erreur
loadWeb(): Unknown identifier. Parsing error near (PROJECTION):(line 14)

Code:

MAP
    NAME DEMO
    SIZE 600 300
    EXTENT 549178.24 1703195.74 1031181.00 2360005.00
    IMAGECOLOR 180 180 250
    UNITS METERS

    WEB 
        METADATA
            "wms_title" "essai_wms"
            "wms_onlineresource"  "http://127.0.0.1/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/global.map&"
            "wms_srs" "EPSG:4326"
        END
        PROJECTION
       "init=epsg:4326"
    END
    END
    
    LAYER
        NAME SSBV
        TYPE POLYGON
        STATUS DEFAULT
        DATA ssbv1
        MINSCALE 1000
        MAXSCALE 10000000000
            CLASS
                OUTLINECOLOR 100 100 100
                COLOR 255 255 150
            END
            METADATA
                "wms_title" "SSBV"
            END
            PROJECTION
                "EPSG:4326"    
            END    
    END
END

j'ai donc un problème de projection mais je ne vois pas d'où cela peut venir

Hors ligne

 

#3 Wed 23 July 2008 16:49

Yves
Membre du bureau
Lieu: Aix-les-Bains
Date d'inscription: 22 Mar 2006
Messages: 9855
Site web

Re: mapserver Server WMS

Paul,

Que donne l'!url que tu as mise ? Un message d'erreur ? Une page d'erreur 404 ?

Il semble déjà qu'il y ait un soucis au niveau de l'Extent : elle est en lambert 2 mais ta carte est  définie en latlong (WGS84).

Deuxième problèmes : l'objet PROJECTION doit être au niveau MAP, tu l'as mis dans un objet WEB.

Code:

MAP
  WEB
       ...
  END
 
  PROJECTION
         "init=epsg:4326"
  END
END

Y.


Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !!  - GeoRezo vous aide ? Aidez GeoRezo !

Hors ligne

 

#4 Wed 23 July 2008 17:21

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

J'ai changé la projection EPSG:27582 Lambert 2 étendu

Donc mon mapfile ressemble maintenant à ça:

Code:

MAP
    NAME DEMO
    SIZE 600 300
    EXTENT 549178.24 1703195.74 1031181.00 2360005.00
    IMAGECOLOR 180 180 250
    UNITS METERS
    PROJECTION
       "init=epsg:27582"
    END
    WEB 
        METADATA
            "wms_title" "essai_wms"
            "wms_onlineresource"  "http://127.0.0.1/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/global.map&"
            "wms_srs" "EPSG:27582"
        END
        
    END
    
    
    LAYER
        NAME SSBV
        TYPE POLYGON
        STATUS DEFAULT
        DATA SSBV12
        MINSCALE 1000
        MAXSCALE 10000000000
            CLASS
                OUTLINECOLOR 100 100 100
                COLOR 255 255 150
            END
            METADATA
                "wms_title" "SSBV"
            END
            PROJECTION
                "EPSG:27582"    
            END    
    END
END

et l'erreur affichée est la suivante :
msProcessProjection(): Projection library error. projection not named

La projection n'existerait pas?

Hors ligne

 

#5 Wed 23 July 2008 17:30

Yves
Membre du bureau
Lieu: Aix-les-Bains
Date d'inscription: 22 Mar 2006
Messages: 9855
Site web

Re: mapserver Server WMS

Le code EPSG 27582 est déprécié, il ne faut plus l'utiliser wink le nouveau est 27572. Je ne pense pas que ce soit la cause de l'erreur.

Par contre il dit qu'il ne trouve pas la bibliothèque de projection ce qui est étonnant puisqu'elle est censé être installé dans MS4W. Quelle version de mapserver est installée ?

Y.
PS : si la projection de la carte et de la couche est la même, inutile de définir l'objet PROJECTION dans l'objet LAYER.


Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !!  - GeoRezo vous aide ? Aidez GeoRezo !

Hors ligne

 

#6 Wed 23 July 2008 17:37

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

La version MS4W

Code:

Contents
========

The following are included in the base package:

- Apache version 2.2.4

- PHP version 5.2.4 (MS4W 2.x) or 4.4.4 (MS4W 1.x)

- MapServer 5.0.0 CGI and MapScript (CSharp, Java, PHP, 
  Python)
  
    - support GD 2.0.33, FreeType 2.1.10, GDAL/OGR 1.4.2, 
      PROJ, WMS/WFS, Flash, PDF, ECW3.1, PostGIS, GEOS, 
      libcurl 7.15.1, FastCGI, AGG 2.4
    
- mapserver utilities

- gdal/ogr utilities

- proj.4 utilities

- shp2tile utility

- shapelib utilities

- shpdiff utility

- avce00 utilities
    
- PHP_OGR Extension 1.1.1
    
- OWTChart 1.2.0

J'ai changé la projection mais rien n'y fait

Si ça ne marche pas j'essayerais en WGS!! 84 avec une couche projetée de ce système de projection

Dernière modification par paulcarrot (Thu 24 July 2008 08:19)

Hors ligne

 

#7 Wed 23 July 2008 17:54

Yves
Membre du bureau
Lieu: Aix-les-Bains
Date d'inscription: 22 Mar 2006
Messages: 9855
Site web

Re: mapserver Server WMS

Tu veux dire WGS84 wink mais ce n'est pas un système de projection, c'est uns système cartographique :p

Plus sérieusement, l'erreur n'est pas normale, tente éventuellement avec une autre version de MS4W. Il semble qu'il y ait une version avec MapServer 5.2.0.

Y.


Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !!  - GeoRezo vous aide ? Aidez GeoRezo !

Hors ligne

 

#8 Wed 23 July 2008 18:08

Guillaume Sueur
Participant assidu
Lieu: Toulouse
Date d'inscription: 23 Sep 2005
Messages: 331
Site web

Re: mapserver Server WMS

regarde tes deux blocs projection : ils ne sont pas renseignés de la
même manière.
et puis pour afficher une carte en 27572 (le 27582 est déprécié) avec
une couche en 27572, tu peux tout simplement supprimer les deux blocs ;-)

Guillaume

Hors ligne

 

#9 Thu 24 July 2008 14:10

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

Merci pour toutes vos réponse.
Je vais essayer d'installer une version de MS4W plus récente.

Hors ligne

 

#10 Fri 25 July 2008 12:15

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

bonjour,

j'ai réinstallé la dernière version de MS4W.
J'ai désinstallé apache de mon ancienne version puis réinstallé la dernière version d'apache fournie avec le pack.
j'ai également refait un .map qui est le suivant.

Code:

MAP
NAME MONDE
EXTENT -180 -90 180 90
STATUS ON

PROJECTION
  "init=epsg:4326"
END
WEB
  METADATA
    "wms_title"           "WMS_MONDE"
    "wms_onlineresource"  "http://localhost/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map"
    "wms_srs"             "EPSG:4326"
  END
END

 
LAYER
    NAME "monde"   
    DATA countries_simpl
    STATUS DEFAULT
    TYPE RASTER
    PROJECTION
       "init=epsg:4326"
    END   
    METADATA
        wms_title "pays"
    END
END
END

Mes fichiers shape sont situés dans le répertoire htdocs

Dans la ligne de commande j'ai tapé la ligne suivante et j'ai obtenu ceci

Code:

C:\Documents and Settings\PCA>C:\ms4w\apache\cgi-bin\mapserv.exe -v
MapServer version 5.0.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF
 OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=WMS
_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS
_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPU
T=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

donc le serveur en mode WMS est bien actif

Je fait la requête suivante à mapserver

http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/monde.map&version=1.1.1&service=WMS&request=GetCapabilities

Et là cela ne marche carrément pas car une boîte de dialogue s'ouvre en me demandant de télécharger l'exécutable??

Hors ligne

 

#11 Fri 25 July 2008 12:24

Yves
Membre du bureau
Lieu: Aix-les-Bains
Date d'inscription: 22 Mar 2006
Messages: 9855
Site web

Re: mapserver Server WMS

Paul,

Si tu sauves ce fichier, est ce un fichier texte ou binaire ? Le nom du fichier ne veut pas dire forcément que c'est le script mapserver.exe wink

Y.


Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !!  - GeoRezo vous aide ? Aidez GeoRezo !

Hors ligne

 

#12 Fri 25 July 2008 13:31

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

Le fichier monde.map est dans un fichier txt et le "http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/monde.map&version=1.1.1&service=WMS&request=GetCapabilitie" est mis dans l'url.

c'était ce que tu demandais?

Dernière modification par paulcarrot (Fri 25 July 2008 15:17)

Hors ligne

 

#13 Fri 25 July 2008 15:26

Guillaume Sueur
Participant assidu
Lieu: Toulouse
Date d'inscription: 23 Sep 2005
Messages: 331
Site web

Re: mapserver Server WMS

Il faut mettre des droits en exécution pour cgi-bin, dans le httpd.conf

Hors ligne

 

#14 Mon 28 July 2008 09:02

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

Merci pour cette réponse, je regarde ça dans la journée

Hors ligne

 

#15 Mon 28 July 2008 10:43

freesnowpetrel
Participant assidu
Lieu: Pretoria, Afrique du Sud
Date d'inscription: 1 Mar 2007
Messages: 222

Re: mapserver Server WMS

Bonjour,

Si en reponse as ta requete WMS getcapabilities ton serveur te renvoie un fichier, cela me semble fonctionner et surtout parfaitement normal. Ce fichier n'est pas un executable mais un fichier xml renvoye suite a ta requete et qui si tu le sauves et l'ouvres avec un editeur de texte contient les informations sur les couches disponibles via ton WMS si tout fonctionne bien.
Tous les serveurs WMS repondent a cette requete de cette maniere en renvoyant un xml qui decrit le service afin de permettre au client de savoir ce qu'il contient.
Si ce que tu souhaites faire, c'est visualiser tes donnees servies en WMS par Mapserver il te faut un client WMS comme QGIS par exemple.

Rodolphe

Hors ligne

 

#16 Mon 28 July 2008 11:21

Yves
Membre du bureau
Lieu: Aix-les-Bains
Date d'inscription: 22 Mar 2006
Messages: 9855
Site web

Re: mapserver Server WMS

paulcarrot a écrit:

Le fichier monde.map est dans un fichier txt et le "http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/monde.map&version=1.1.1&service=WMS&request=GetCapabilitie" est mis dans l'url.

c'était ce que tu demandais?


Non, quand tu appelles cette requête : "http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/monde.map&version=1.1.1&service=WMS&request=GetCapabilitieS" tu dis qu'il te renvoi un fichier, qu'est ce qu'il y a dedans ?


Y.
Ps : conf le message précédent de freesnowpetrel.


Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !!  - GeoRezo vous aide ? Aidez GeoRezo !

Hors ligne

 

#17 Tue 29 July 2008 11:48

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

bonjour à tous,

effectivement j'ai activé le cgi-bin comme il suit:

Code:

<Directory "/ms4w/Apache/cgi-bin">
    AllowOverride All
    Options ExecCGI 
    Order allow,deny
    Allow from all
</Directory>

Ensuite J'ai bien ouvert le fichier mapserv.exe envoyé, et à ma grande surprise ce fichier est un fichier xml qui correspondrait à ma requête GetCapabilities.

Code:

<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd"
 [
 <!ELEMENT VendorSpecificCapabilities EMPTY>
 ]>  <!-- end of DOCTYPE declaration -->

<WMT_MS_Capabilities version="1.1.1">

<!-- MapServer version 5.0.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE -->

<Service>
  <Name>OGC:WMS</Name>
  <Title>WMS_MONDE</Title>
  <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/>
  <ContactInformation>
  </ContactInformation>
</Service>

<Capability>
  <Request>
    <GetCapabilities>
      <Format>application/vnd.ogc.wms_xml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Post>
        </HTTP>
      </DCPType>
    </GetCapabilities>
    <GetMap>
      <Format>image/gif</Format>
      <Format>image/png</Format>
      <Format>image/png; mode=24bit</Format>
      <Format>image/jpeg</Format>
      <Format>image/wbmp</Format>
      <Format>image/tiff</Format>
      <Format>image/svg+xml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Post>
        </HTTP>
      </DCPType>
    </GetMap>
    <GetFeatureInfo>
      <Format>text/plain</Format>
      <Format>application/vnd.ogc.gml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Post>
        </HTTP>
      </DCPType>
    </GetFeatureInfo>
    <DescribeLayer>
      <Format>text/xml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Post>
        </HTTP>
      </DCPType>
    </DescribeLayer>
    <GetLegendGraphic>
      <Format>image/gif</Format>
      <Format>image/png</Format>
      <Format>image/png; mode=24bit</Format>
      <Format>image/jpeg</Format>
      <Format>image/wbmp</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Post>
        </HTTP>
      </DCPType>
    </GetLegendGraphic>
    <GetStyles>
      <Format>text/xml</Format>
      <DCPType>
        <HTTP>
          <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Get>
          <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map&amp;"/></Post>
        </HTTP>
      </DCPType>
    </GetStyles>
  </Request>
  <Exception>
    <Format>application/vnd.ogc.se_xml</Format>
    <Format>application/vnd.ogc.se_inimage</Format>
    <Format>application/vnd.ogc.se_blank</Format>
  </Exception>
  <VendorSpecificCapabilities />
  <UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1" RemoteWFS="0"/>
  <Layer>
    <Name>MONDE</Name>
    <Title>WMS_MONDE</Title>
    <SRS>EPSG:4326</SRS>
    <LatLonBoundingBox minx="-180" miny="-90" maxx="180" maxy="90" />
    <BoundingBox SRS="EPSG:4326"
                minx="-180" miny="-90" maxx="180" maxy="90" />
<!-- WARNING: This layer has its status set to DEFAULT and will always be displayed when doing a GetMap request even if it is not requested by the client. This is not in line with the expected behavior of a WMS server. Using status ON or OFF is recommended. -->
    <Layer queryable="0" opaque="0" cascaded="0">
        <Name>monde</Name>
        <Title>pays</Title>
        <SRS>EPSG:4326</SRS>
    </Layer>
  </Layer>
</Capability>
</WMT_MS_Capabilities>

En tout cas merci à yves, freesnowpetrel et guillaume Sueur pour vos indications et votre patience.

PC

Dernière modification par paulcarrot (Tue 29 July 2008 11:49)

Hors ligne

 

#18 Thu 31 July 2008 14:58

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

bonjour,

Avec l'url:

Code:

http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/Apache/htdocs/monde.map&version=1.1.1&service=WMS&request=GetMap&LAYERS=monde&STYLES=&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=800&HEIGHT=600&FORMAT=image/png

si j'ai bien compris je devrais voir apparaitre une image. Mais je n'ai qu'une image blanche!? Sans message d'erreur. Je n'ai pas défini de SLD, donc mapserver devrait me produire la carte avec le style défini dans mon .map que voici:

Code:

MAP
NAME MONDE
EXTENT -180 -90 180 90
IMAGECOLOR     255 255 255


PROJECTION
  "init=epsg:4326"
END
WEB
  METADATA
    "wms_title"           "WMS_MONDE"
    "wms_onlineresource"  "http://127.0.0.1/cgi-bin/mapserv.exe?map=C:\ms4w\Apache\htdocs\monde.map"
    "wms_srs"             "EPSG:4326"
  END
END

 
LAYER
    NAME "monde"   
    DATA countries_simpl
    STATUS DEFAULT
    TYPE RASTER
    CLASS
        STYLE
            COLOR 151 221 87
            OUTLINECOLOR 54 94 19
        END
    END
    PROJECTION
       "init=epsg:4326"
    END   
    METADATA
        wms_title "monde"
        wms_srs "EPSG:4326"
    END
END


END

PC

Hors ligne

 

#19 Thu 31 July 2008 15:13

Yves
Membre du bureau
Lieu: Aix-les-Bains
Date d'inscription: 22 Mar 2006
Messages: 9855
Site web

Re: mapserver Server WMS

Bonjour,

Généralement une image blanche est généralement dû à un problème d'étendue ou de projection.

Dans ton mapfile je vois quelques problèmes :
* STATUS DEFAULT : utilise OFF plutôt que DEFAULT, sinon ta couche sera toujours affichée
* wms_title "monde" : "wms_title" "monde" plutot, pareil pour "wms_srs"
* si tu utilises que COLOR et OUTLINECOLOR, pas besoin d'utiliser l'objet STYLE :

Code:

    CLASS
           COLOR 151 221 87
            OUTLINECOLOR 54 94 19
    END

Enfin, il y a un problème : pourquoi définir une couche de type RASTER et modifier le style ? Ta couche c'est un raster ou un vecteur ?

Y.


Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !!  - GeoRezo vous aide ? Aidez GeoRezo !

Hors ligne

 

#20 Thu 31 July 2008 15:28

paulcarrot
Participant occasionnel
Lieu: saint-etienne
Date d'inscription: 14 Nov 2005
Messages: 42

Re: mapserver Server WMS

Merci Yves,

Tout fonctionne, il fallait bien mettre "wms_title" et "wms_srs". De plus tu as raison, à force de copier coller des morceaux de code j'ai laissé le TYPE RASTER alors que c'est TYPE POLYGON.

PC

Hors ligne

 

Pied de page des forums

Powered by FluxBB