Problem with shape file rendering

Benoît Andrieu bea at IXSEA.COM
Thu Jan 31 09:25:10 PST 2008


Oh shit !!

You're right !

By not providing a bounding box in the url, I think that mapserver is doing 
a mistake and takes the coordinates of the extent present in the map file 
and converts them into the srs of the request !
So by simply puting -180,-90,180,90 in the url as the bounding box, I now 
see my points !!!!

Really sorry for those unnecessary emails !

Thank you for having helped me ! ;)

Benoît

----- Original Message ----- 
From: "Rahkonen Jukka" <Jukka.Rahkonen at MMMTIKE.FI>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Thursday, January 31, 2008 6:11 PM
Subject: Re: [UMN_MAPSERVER-USERS] Problem with shape file rendering


Benoît Andrieu wrote:


> Given all this, I first tried to render this with a web browser by writing 
> directly my request :
> http://acquisitiontest/CGI/bin/mapserv.exe?request=GetMap&map=C:/temp/bch/Shell.map&request=GetMap&layers=Vector&srs=EPSG:4326&version=1.1.1&styles=
> By not giving the extent nor width and height, I am expecting to take the 
> full bounding box of the map file as width and height. > I am already 
> doing this for raster layers so I won't be surprised to make it work for 
> shape files.

> But, unfortunately, the result  remains empty whatever I try.



Hi,

This is mostly guessing, but could it be that there is some conflict due to 
that you are using epsg:4326 in your request but mapfile extents are in some 
other projection?  What happens if you change the SRS in the request to suit 
the map level projection?              Of course it must be added to wms_srs 
list first.

-Jukka-

MAP
 Name"Shell"
 CONFIG "PROJ_LIB" "c:\Inetpub\wwwroot\Cgi\proj_lib\"
 EXTENT 277486 5873890 691772 6823080

 SIZE 512 512
 IMAGETYPE PNG24
 IMAGECOLOR 255 255 255
 UNITS METERS
 OUTPUTFORMAT NAME PNG24 DRIVER "GD/PNG" MIMETYPE "image/png" EXTENSION PNG 
IMAGEMODE RGBA  TRANSPARENT ON  END

 PROJECTION    "+proj=tmerc +lat_0=0 +lon_0=0 +k=0.999600 +x_0=500000 +y_0=0 
+ellps=intl +units=m +no_defs"   END

 WEB
  IMAGEPATH  "c:\ms_tmp\"
  IMAGEURL  "http://ACQUISITIONTEST/ms_tmp"
  METADATA
   "wms_title" "Ob135_200"
   "wms_srs" "epsg:4326"
   "wms_onlineresource" "http://ACQUISITIONTEST/WMS/Default.aspx?MapId=8"
  END
 END

 SYMBOL
  NAME "quadrat"
  TYPE VECTOR
  POINTS
   0 0
   0 1
   1 1
   1 0
  END
  FILLED TRUE
 END

 LAYER
    NAME "Vector"
  TYPE POINT
  STATUS ON
  CONNECTIONTYPE OGR
  CONNECTION "C:/temp/bch/gbr_rigs.shp"
  PROJECTION "+proj=tmerc +lat_0=0 +lon_0=0 +k=0.999600 +x_0=500000 +y_0=0 
+ellps=intl +units=m +no_defs" END
  DATA "gbr_rigs"
  CLASS
   SYMBOL "quadrat"
   COLOR 255 0 0
   OUTLINECOLOR 0 0 0
   SIZE 6
  END
 END
END

--------------------------------------------------------------------------------


Given all this, I first tried to render this with a web browser by writing 
directly my request :
http://acquisitiontest/CGI/bin/mapserv.exe?request=GetMap&map=C:/temp/bch/Shell.map&request=GetMap&layers=Vector&srs=EPSG:4326&version=1.1.1&styles=
By not giving the extent nor width and height, I am expecting to take the 
full bounding box of the map file as width and height. I am already doing 
this for raster layers so I won't be surprised to make it work for shape 
files.

But, unfortunately, the result  remains empty whatever I try.

So, I remembered to use the shp2img to make a render and there I have a 
correct result.


More information about the MapServer-users mailing list