Antwort: Re: [Mapserver-users] switching layers when zooming

Gunter.Rieth at stadt.mainz.de Gunter.Rieth at stadt.mainz.de
Tue Jan 28 05:20:17 PST 2003


This is a multipart message in MIME format.
------=_NextPartTM-000-3ab0aa26-329f-11d7-bc9e-0090274d4ab2
Content-Type: multipart/alternative; 
	boundary="=_alternative 004943AFC1256CBC_="


--=_alternative 004943AFC1256CBC_=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Here you can see one example still working , but you have to watch out the =

path and filename  in the TILEINDEX  file.

STATUS ON only because I switch the layers as a group from the html file

# Start of layer definitions
#
LAYER
  NAME "Stadtplan"
   DATA "stadtplan/gesamtplan.tif"
   GROUP Stadtplan
    TYPE RASTER
    STATUS ON
    MINSCALE 85000
    MAXSCALE 150000=20
=20
# TRANSPARENCY  20
END
#
#
LAYER
  NAME "stadtp=5F2x2"
     TYPE RASTER
     GROUP Stadtplan
     TILEINDEX "stadtplan/index=5F2x2.shp"
     TILEITEM "Location"
     STATUS ON
    MINSCALE 500
    MAXSCALE 85000=20
   TRANSPARENCY  75

  END


Gunter Rieth

KDZ Mainz
Hechtsheimer Stra=DFe 35
55131 Mainz

Tel:  06131 - 12 - 3557
Fax:  06131 - 12 - 2267
eMail: mailto:Gunter.Rieth at stadt.mainz.de
intern: Gunter Rieth/Dez1/Mainz




Oliver Wesp <wesp at gdv.com>
Gesendet von: mapserver-users-admin at lists.gis.umn.edu
28.01.2003 12:15

=20
        An:     Agneta Schick <schick at sdac.hannover.bgr.de>
        Kopie:  mapserver-users at lists.gis.umn.edu
        Thema:  Re: [Mapserver-users] switching layers when zooming


Maybe the identical layer name causes this effect. Maybe it's better to=20
use the group option. Should be something like this:

LAYER
NAME relief=5Fhighscale
GROUP relief
.
.
.
END

LAYER
NAME relief=5Flowscale
GROUP relief
.
.
.
END

This way you have unique layer names, but you still can handle it as one=20
layer in your application via the group name.

Agneta Schick schrieb:
> Hello,
>=20
> As long as I was only using only one layer I thought I knew what I was=20
doing.
>=20
> Apparently not... I want to show a layer (1:1000000) and after zooming
> below 1:250000 switch to a different layer.
> My solution is define two layers with the same name but different=20
MINSCALE,
> MAXSCALE:
> ...
> LAYER
>   NAME relief
>   DATA graul0.tif
>   TYPE RASTER
>   MAXSCALE 5000000
>   MINSCALE  250000
>   STATUS DEFAULT
> END
> LAYER
>   NAME relief
>   TILEINDEX index200.shp
>   TILEITEM "dtk200"
>   TYPE RASTER
>   MAXSCALE 250000
>   STATUS DEFAULT
> END
> ...
> MapScript:
>     my $layer =3D $map->getLayerByName('relief');
>     $layer->draw($map, $img);=20
>=20
> I expected Mapserver to interpret $map->{scale} and show the appropriate
> map. My result: after zooming below 250000 my layer is empty.
> Each if the two layers are ok as a single layer and I've checked the=20
contents of=20
> $map->{scale} so that's not the problem.
> Is my whole assumption wrong?
>=20
> Thank you for your help.
> Agneta Schick
>=20
>=20
>=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~
>     Agneta Schick
>=20
>     Bundesanstalt fuer Geowissenschaften und Rohstoffe
>     Federal Institute for Geosciences and Natural Resources
>     Stilleweg 2
>     D- 30655 Hannover                   Tel.: +49 511 643 3136
>     GERMANY                             FAX.: +49 511 643 3663
>=20
>     schick at sdac.hannover.bgr.de         http://www.seismologie.bgr.de
>=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~
>=20
>=20
>=20
> =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>=20
>=20
>=20


--=20
Dipl.-Geogr. Oliver Wesp
Gesellschaft f=FCr geografische Datenverarbeitung
Binger Strasse 49-51
D-55218 Ingelheim
fon: +49 6132 714818
fax: +49 6132 714828
http: www.gdv.com

=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



--=_alternative 004943AFC1256CBC_=
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


<br><font size=3D2 face=3D"sans-serif">Here you can see one example still w=
orking , but you have to watch out the path and filename  in the TILEI=
NDEX  file.</font>
<br>
<br><font size=3D2 face=3D"sans-serif">STATUS ON only because I switch the =
layers as a group from the html file</font>
<br>
<br><font size=3D2 face=3D"sans-serif"># Start of layer definitions</font>
<br><font size=3D2 face=3D"sans-serif">#</font>
<br><font size=3D2 face=3D"sans-serif">LAYER</font>
<br><font size=3D2 face=3D"sans-serif">  NAME "Stadtplan"</f=
ont>
<br><font size=3D2 face=3D"sans-serif">   DATA "stadtplan/ge=
samtplan.tif"</font>
<br><font size=3D2 face=3D"sans-serif">   GROUP Stadtplan</font>
<br><font size=3D2 face=3D"sans-serif">    TYPE RASTER</font>
<br><font size=3D2 face=3D"sans-serif">    STATUS ON</font>
<br><font size=3D2 face=3D"sans-serif">    MINSCALE 85000</font>
<br><font size=3D2 face=3D"sans-serif">    MAXSCALE 150000 </font>
<br><font size=3D2 face=3D"sans-serif">    </font>
<br><font size=3D2 face=3D"sans-serif"># TRANSPARENCY  20</font>
<br><font size=3D2 face=3D"sans-serif">END</font>
<br><font size=3D2 face=3D"sans-serif">#</font>
<br><font size=3D2 face=3D"sans-serif">#</font>
<br><font size=3D2 face=3D"sans-serif">LAYER</font>
<br><font size=3D2 face=3D"sans-serif">  NAME "stadtp=5F2x2"=
</font>
<br><font size=3D2 face=3D"sans-serif">     TYPE RASTER</fon=
t>
<br><font size=3D2 face=3D"sans-serif">     GROUP Stadtplan<=
/font>
<br><font size=3D2 face=3D"sans-serif">     TILEINDEX "=
stadtplan/index=5F2x2.shp"</font>
<br><font size=3D2 face=3D"sans-serif">     TILEITEM "L=
ocation"</font>
<br><font size=3D2 face=3D"sans-serif">     STATUS ON</font>
<br><font size=3D2 face=3D"sans-serif">    MINSCALE 500</font>
<br><font size=3D2 face=3D"sans-serif">    MAXSCALE 85000 </font>
<br><font size=3D2 face=3D"sans-serif">   TRANSPARENCY  75</=
font>
<br>
<br><font size=3D2 face=3D"sans-serif">  END</font>
<br>
<br>
<br><font size=3D2 face=3D"sans-serif">Gunter Rieth<br>
<br>
KDZ Mainz<br>
Hechtsheimer Stra=DFe 35<br>
55131 Mainz<br>
<br>
Tel:  06131 - 12 - 3557<br>
Fax:  06131 - 12 - 2267<br>
eMail: mailto:Gunter.Rieth at stadt.mainz.de<br>
intern: Gunter Rieth/Dez1/Mainz</font>
<br>
<br>
<br>
<table width=3D100%>
<tr valign=3Dtop>
<td>
<td><font size=3D1 face=3D"sans-serif"><b>Oliver Wesp <wesp at gdv.com><=
/b></font>
<br><font size=3D1 face=3D"sans-serif">Gesendet von: mapserver-users-admin@=
lists.gis.umn.edu</font>
<p><font size=3D1 face=3D"sans-serif">28.01.2003 12:15</font>
<br>
<td><font size=3D1 face=3D"Arial">        </font>
<br><font size=3D1 face=3D"sans-serif">        An: &nbs=
p;      Agneta Schick <schick at sdac.hannover.bgr.de></f=
ont>
<br><font size=3D1 face=3D"sans-serif">        Kopie: &=
nbsp;      mapserver-users at lists.gis.umn.edu</font>
<br><font size=3D1 face=3D"sans-serif">        Thema: &=
nbsp;      Re: [Mapserver-users] switching layers when zoomi=
ng</font></table>
<br>
<br>
<br><font size=3D2 face=3D"Courier New">Maybe the identical layer name caus=
es this effect. Maybe it's better to <br>
use the group option. Should be something like this:<br>
<br>
LAYER<br>
NAME relief=5Fhighscale<br>
GROUP relief<br>
.<br>
.<br>
.<br>
END<br>
<br>
LAYER<br>
NAME relief=5Flowscale<br>
GROUP relief<br>
.<br>
.<br>
.<br>
END<br>
<br>
This way you have unique layer names, but you still can handle it as one <b=
r>
layer in your application via the group name.<br>
<br>
Agneta Schick schrieb:<br>
> Hello,<br>
> <br>
> As long as I was only using only one layer I thought I knew what I was=
 doing.<br>
> <br>
> Apparently not... I want to show a layer (1:1000000) and after zooming=
<br>
> below 1:250000 switch to a different layer.<br>
> My solution is define two layers with the same name but different MINS=
CALE,<br>
> MAXSCALE:<br>
> ...<br>
> LAYER<br>
>   NAME relief<br>
>   DATA graul0.tif<br>
>   TYPE RASTER<br>
>   MAXSCALE 5000000<br>
>   MINSCALE  250000<br>
>   STATUS DEFAULT<br>
> END<br>
> LAYER<br>
>   NAME relief<br>
>   TILEINDEX index200.shp<br>
>   TILEITEM "dtk200"<br>
>   TYPE RASTER<br>
>   MAXSCALE 250000<br>
>   STATUS DEFAULT<br>
> END<br>
> ...<br>
> MapScript:<br>
>     my $layer =3D $map->getLayerByName('relief');<br>
>     $layer->draw($map, $img); <br>
> <br>
> I expected Mapserver to interpret $map->{scale} and show the approp=
riate<br>
> map. My result: after zooming below 250000 my layer is empty.<br>
> Each if the two layers are ok as a single layer and I've checked the c=
ontents of <br>
> $map->{scale} so that's not the problem.<br>
> Is my whole assumption wrong?<br>
> <br>
> Thank you for your help.<br>
> Agneta Schick<br>
> <br>
> <br>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~<br>
>     Agneta Schick<br>
>     <br>
>     Bundesanstalt fuer Geowissenschaften und Rohstoffe<br>
>     Federal Institute for Geosciences and Natural Resources<=
br>
>     Stilleweg 2<br>
>     D- 30655 Hannover           &nb=
sp;       Tel.: +49 511 643 3136<br>
>     GERMANY              =
               FAX.: +49 511 643 3663<br>
> <br>
>     schick at sdac.hannover.bgr.de         =
http://www.seismologie.bgr.de<br>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~<br>
> <br>
> <br>
> <br>
> =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>
> Mapserver-users mailing list<br>
> Mapserver-users at lists.gis.umn.edu<br>
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users<br>
> <br>
> <br>
> <br>
<br>
<br>
-- <br>
Dipl.-Geogr. Oliver Wesp<br>
Gesellschaft f=FCr geografische Datenverarbeitung<br>
Binger Strasse 49-51<br>
D-55218 Ingelheim<br>
fon: +49 6132 714818<br>
fax: +49 6132 714828<br>
http: www.gdv.com<br>
<br>
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>
Mapserver-users mailing list<br>
Mapserver-users at lists.gis.umn.edu<br>
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users<br>
</font>
<br>
<br>
--=_alternative 004943AFC1256CBC_=--

------=_NextPartTM-000-3ab0aa26-329f-11d7-bc9e-0090274d4ab2--




More information about the MapServer-users mailing list