[OpenLayers-Users] Fwd: On SHP files, projections and SRS

Christopher Schmidt crschmidt at crschmidt.net
Mon Jul 24 06:38:44 CDT 2006


On Mon, Jul 24, 2006 at 10:32:48AM +0200, Marcos Cobeña wrote:
> Hi Chris,
> 
> First of all, really thanks for your effort helping us, thanks mate.
> 
> Asking for the extent using ogrinfo, and changing WMS query to fit my
> requirements:
> 
> "
> http://localhost:8080/cgi-bin/DGIS/mapserv.exe?MAP=DGIS_12c.map&LAYERS=12c_linea&TRANSPARENT=true&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=191237.676635,4092673.220195,196695.233917,4099589.678689&width=256&HEIGHT=256
> "
> 
> , MapServer returns the expected image, as you can see attached.
> 
> Then, I have to change *something* (maxResolution maybe) in OpenLayers
> to properly build WMS queries, any hint? :-)
> 
> Again, really thanks in advance, OL is really really *coo*l, :-)

Marcos: 

Your data is still not in the WGS-84 projection. The extent that you've
specified looks like the units are in meters or feet, not degrees, which
means that the SRS="EPSG:4326" is not correct.

You should be able to see your data by adding the following to your map
constructor:

{ maxResolution: 'auto', maxExtent: new OpenLayersBounds(191237,4092673,196695,4099589) }

This will set your maxExtent to be the size of your bounds, and your
maxResolution to be automatically determined from that.

However, you should still figure out what projection your data is
actually in, but this shouldn't affect OpenLayers, so long as it
displays correctly with the URL you gave above.

Regards,
-- 
Christopher Schmidt
Web Developer


More information about the Users mailing list