[Mapserver-users] How to use 2 layers with different extend

Stephen Woodbridge woodbri at swoodbridge.com
Fri Jul 23 17:18:38 EDT 2004


thomas at redmilenio.com wrote:

> Hello, I need to know how do I use for example, a shp file of a country
> and then add a new layer that was originally created in Cad(dwg), and then
> I converted it to shp. This new layer is a city that I have to add to the
> country layer, so I can have first a country view and zooming until I view
> the streets of that city. The problem I see here is that both layers have
> different extends, eventhough both are in the same coordinate system, I
> heard somewhere that I need to use projections. I 'll appreciate a lot if
> you can help me with this.

If your data is in the same projections then it does not matter what the 
extents are. The extents are only user by mapserver to decide if the 
shape file needs to be looked at. If the extents of my map image are 
like a one mile square around Boston, MA, then I don't need to look at 
the data in shapefiles that do not overlap the one mile square.

So you mapfile should just have two layers in it. the first is the 
country, and then city layer should be drawn on top of that. You can 
control when the city layer starts displaying by setting the MAXSCALE 
value at the scale you want it to turn on. i.e.: if the scale is larger 
than MAXSCALE is will not show.

Hope this helps,
   -Steve W.




More information about the mapserver-users mailing list