[Mapserver-users] Q: ArcIMS style dynamic layers

Smith, Michael ERDC-CRREL-NH Michael.Smith at erdc.usace.army.mil
Wed Jul 7 09:59:16 EDT 2004


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C4642A.97509060
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

You can also modify layers dynamically with the CGI version by using =
the
map_layer_ syntax, I use this to dynamically point to different oracle
spatial queries. Eduardo is correct in the a layer has to exist in the
mapfile first but they can be basically undefined until define at the =
cgi
level. Also small vector layers can be added dynamically using the =
syntax
below.=20

Finally, note the new DATAPATTERN keyword. It is a security keyword to
restrict data changes at the cgi level. You will have to specify what
changes are allowed (all is a possibility).=20

>From the Mapserver CGI Docs

Changing map file parameters via a form or a URL
Begining with version 3.3 it is now possible to change virtually any =
map
file value from a form or a URL. The syntax for this is fairly straight
forward. Any value can be expressed using the hierarchy used in a map =
file.
A map contains a layer, which contains a class, which contains a label,
which has a color. This hierarchy is expressed as a sequence of =
MapServer
keywords seperated by underscores. For example to change the color of a
layer called "lakes" with only one class defined you would use a form
variable named "map_lakes_class_color" and could assign it a color like =
"0 0
255". Layers can be referenced by index (i.e. map_layer_0...) or by =
name as
shown above. Layer classes are referenced by index value (i.e.
map_layer_0_class_2). If there is only 1 class for a layer then the =
index
should be ommited. These variables must always begin with the sequence
"map_". Values assigned must conform to the syntax of a map file.

It is also possible to define inline features using this mechanism. =
This is
the only case where you can add on to the map file. You can edit/change
layer parameters but you cannot create a new layer. With inline =
features you
have to first create a feature and then build upon it, however, the =
layer
the feature belongs to must exist. Here's a snippet from a GET request =
that
adds a feature to a webuser layer:=20

=20
...&map_webuser_feature=3Dnew&map_webuser_feature_points=3D12345.6789+1=
2345.6789
&map_webuser_feature_text=3DMy+House!&...
     =20
The "map_webuser_feature=3Dnew" creates a new feature for the webuser =
layer.
All subsequent calls to the feature object for that layer will modify =
the
new feature. You can repeat the process to create additional features. =
This
is really intended for very small (point, rectangle) amounts of data.

It's quite possible that we'll come up with some shortcuts for this
processing, but until we know how useful this is to users this is it. =
One
potentially very powerful use involves changing class expressions
on-the-fly. Anyway, try it out.

Mike Smith
GIS Specialist/Physical Scientist/Oracle Developer
Remote Sensing/GIS Center of Expertise
Army Engineer Research & Development Center=20
Hanover, NH
(603) 646-4765
michael.smith at erdc.usace.army.mil


-----Original Message-----
From: Eduardo Spremolla [mailto:edspremolla at antel.com.uy]=20
Sent: Wednesday, July 07, 2004 8:19 AM
To: bob man
Cc: mapserver
Subject: Re: [Mapserver-users] Q: ArcIMS style dynamic layers

Bob:
 You must include all the layers in the .map file, but only the ones =
you
always want with STATUS DEFAULT, the others ones may be turned on by =
adding
layer=3DLAYER_NAME to the cgi query  parameters.

LALO

El mar, 06-07-2004 a las 20:38, bob man escribi=F3:
> I've got a (what is probably a newbie) question.  I'm coming from an=20
> ArcIMS background -- after reading over the mailing list archives I'm =

> certainly not the only one ;) -- and that should explain the frame of =

> reference for this question.
>=20
> One of the things I'd like to do is generate dynamic layers.  From=20
> what I've read, it seems as though you need to use PHP (or some other =

> scripting language) to do so.  With ArcIMS, you can create a ".axl"=20
> file (a map file, more or less).  Then, when querying a map service,=20
> you can include additional layers inside the ArcXML request.  Does=20
> mapserv (the CGI app) have support for a similar request mechanism? =20
> Based on what I've read the answer is no, but I'd like to confim =
that.
>=20
> Thanks,
>=20
> Dave
>=20
>=20
>=20
> 	=09
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
--
Eduardo Spremolla <edspremolla at antel.com.uy> Antel I+D


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

------_=_NextPart_001_01C4642A.97509060
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2655.35">
<TITLE>RE: [Mapserver-users] Q: ArcIMS style dynamic layers</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>You can also modify layers dynamically with the CGI =
version by using the map_layer_ syntax, I use this to dynamically point =
to different oracle spatial queries. Eduardo is correct in the a layer =
has to exist in the mapfile first but they can be basically undefined =
until define at the cgi level. Also small vector layers can be added =
dynamically using the syntax below. </FONT></P>

<P><FONT SIZE=3D2>Finally, note the new DATAPATTERN keyword. It is a =
security keyword to restrict data changes at the cgi level. You will =
have to specify what changes are allowed (all is a possibility). =
</FONT></P>

<P><FONT SIZE=3D2>From the Mapserver CGI Docs</FONT>
</P>

<P><FONT SIZE=3D2>Changing map file parameters via a form or a =
URL</FONT>
<BR><FONT SIZE=3D2>Begining with version 3.3 it is now possible to =
change virtually any map file value from a form or a URL. The syntax =
for this is fairly straight forward. Any value can be expressed using =
the hierarchy used in a map file. A map contains a layer, which =
contains a class, which contains a label, which has a color. This =
hierarchy is expressed as a sequence of MapServer keywords seperated by =
underscores. For example to change the color of a layer called =
&quot;lakes&quot; with only one class defined you would use a form =
variable named &quot;map_lakes_class_color&quot; and could assign it a =
color like &quot;0 0 255&quot;. Layers can be referenced by index (i.e. =
map_layer_0...) or by name as shown above. Layer classes are referenced =
by index value (i.e. map_layer_0_class_2). If there is only 1 class for =
a layer then the index should be ommited. These variables must always =
begin with the sequence &quot;map_&quot;. Values assigned must conform =
to the syntax of a map file.</FONT></P>

<P><FONT SIZE=3D2>It is also possible to define inline features using =
this mechanism. This is the only case where you can add on to the map =
file. You can edit/change layer parameters but you cannot create a new =
layer. With inline features you have to first create a feature and then =
build upon it, however, the layer the feature belongs to must exist. =
Here's a snippet from a GET request that adds a feature to a webuser =
layer: </FONT></P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
...&amp;map_webuser_feature=3Dnew&amp;map_webuser_feature_points=3D1234=
5.6789+12345.6789&amp;map_webuser_feature_text=3DMy+House!&amp;...</FONT=
></P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>The &quot;map_webuser_feature=3Dnew&quot; creates a =
new feature for the webuser layer. All subsequent calls to the feature =
object for that layer will modify the new feature. You can repeat the =
process to create additional features. This is really intended for very =
small (point, rectangle) amounts of data.</FONT></P>

<P><FONT SIZE=3D2>It's quite possible that we'll come up with some =
shortcuts for this processing, but until we know how useful this is to =
users this is it. One potentially very powerful use involves changing =
class expressions on-the-fly. Anyway, try it out.</FONT></P>

<P><FONT SIZE=3D2>Mike Smith</FONT>
<BR><FONT SIZE=3D2>GIS Specialist/Physical Scientist/Oracle =
Developer</FONT>
<BR><FONT SIZE=3D2>Remote Sensing/GIS Center of Expertise</FONT>
<BR><FONT SIZE=3D2>Army Engineer Research &amp; Development Center =
</FONT>
<BR><FONT SIZE=3D2>Hanover, NH</FONT>
<BR><FONT SIZE=3D2>(603) 646-4765</FONT>
<BR><FONT SIZE=3D2>michael.smith at erdc.usace.army.mil</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Eduardo Spremolla [<A =
HREF=3D"mailto:edspremolla at antel.com.uy">mailto:edspremolla at antel.com.uy=
</A>] </FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, July 07, 2004 8:19 AM</FONT>
<BR><FONT SIZE=3D2>To: bob man</FONT>
<BR><FONT SIZE=3D2>Cc: mapserver</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [Mapserver-users] Q: ArcIMS style =
dynamic layers</FONT>
</P>

<P><FONT SIZE=3D2>Bob:</FONT>
<BR><FONT SIZE=3D2>&nbsp;You must include all the layers in the .map =
file, but only the ones you always want with STATUS DEFAULT, the others =
ones may be turned on by adding layer=3DLAYER_NAME to the cgi =
query&nbsp; parameters.</FONT></P>

<P><FONT SIZE=3D2>LALO</FONT>
</P>

<P><FONT SIZE=3D2>El mar, 06-07-2004 a las 20:38, bob man =
escribi=F3:</FONT>
<BR><FONT SIZE=3D2>&gt; I've got a (what is probably a newbie) =
question.&nbsp; I'm coming from an </FONT>
<BR><FONT SIZE=3D2>&gt; ArcIMS background -- after reading over the =
mailing list archives I'm </FONT>
<BR><FONT SIZE=3D2>&gt; certainly not the only one ;) -- and that =
should explain the frame of </FONT>
<BR><FONT SIZE=3D2>&gt; reference for this question.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; One of the things I'd like to do is generate =
dynamic layers.&nbsp; From </FONT>
<BR><FONT SIZE=3D2>&gt; what I've read, it seems as though you need to =
use PHP (or some other </FONT>
<BR><FONT SIZE=3D2>&gt; scripting language) to do so.&nbsp; With =
ArcIMS, you can create a &quot;.axl&quot; </FONT>
<BR><FONT SIZE=3D2>&gt; file (a map file, more or less).&nbsp; Then, =
when querying a map service, </FONT>
<BR><FONT SIZE=3D2>&gt; you can include additional layers inside the =
ArcXML request.&nbsp; Does </FONT>
<BR><FONT SIZE=3D2>&gt; mapserv (the CGI app) have support for a =
similar request mechanism?&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; Based on what I've read the answer is no, but =
I'd like to confim that.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Thanks,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Dave</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; __________________________________</FONT>
<BR><FONT SIZE=3D2>&gt; Do you Yahoo!?</FONT>
<BR><FONT SIZE=3D2>&gt; Yahoo! Mail - Helps protect you from nasty =
viruses.</FONT>
<BR><FONT SIZE=3D2>&gt; <A =
HREF=3D"http://promotions.yahoo.com/new_mail" =
TARGET=3D"_blank">http://promotions.yahoo.com/new_mail</A></FONT>
<BR><FONT SIZE=3D2>&gt; =
_______________________________________________</FONT>
<BR><FONT SIZE=3D2>&gt; Mapserver-users mailing list</FONT>
<BR><FONT SIZE=3D2>&gt; Mapserver-users at lists.gis.umn.edu</FONT>
<BR><FONT SIZE=3D2>&gt; <A =
HREF=3D"http://lists.gis.umn.edu/mailman/listinfo/mapserver-users" =
TARGET=3D"_blank">http://lists.gis.umn.edu/mailman/listinfo/mapserver-us=
ers</A></FONT>
<BR><FONT SIZE=3D2>--</FONT>
<BR><FONT SIZE=3D2>Eduardo Spremolla &lt;edspremolla at antel.com.uy&gt; =
Antel I+D</FONT>
</P>
<BR>

<P><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>Mapserver-users mailing list</FONT>
<BR><FONT SIZE=3D2>Mapserver-users at lists.gis.umn.edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://lists.gis.umn.edu/mailman/listinfo/mapserver-users" =
TARGET=3D"_blank">http://lists.gis.umn.edu/mailman/listinfo/mapserver-us=
ers</A></FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C4642A.97509060--



More information about the mapserver-users mailing list