[Mapserver-users] simple php/mapscript questions

Murat Isik muratisik at megatek.com.tr
Fri Dec 12 07:21:50 PST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_00E3_01C3C0D4.6DF999E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Yes, off course I can.

in my php I am trying to have lines like these:

if(whatever_one)
{
$layer =3D $map->getLayerByName(lastpoint);
$layer->set("status", MS_ON);
GET DATA FROM THIS LAYER FROM lastpoint (just like "DATA lastpoint" in =
the map file)
}elseif(whatever_two)
{
$layer =3D $map->getLayerByName(lastpoint);
$layer->set("status", MS_ON);
GET DATA FROM THIS LAYER FROM firstpoint (just like "DATA firstpoint" in =
the map file)
}

I know since example just being two layers, you think I can write two =
different layers into the map file with two different names but I will =
need tens of them. Also the layer name for whatever_two condition =
doesnot have to be "lastpoint". So it's like, there will be many layers =
sharing the same specs of:

TYPE point
   CLASS
    SYMBOL 'circle'
    COLOR 102 255 36
    SIZE 20
     LABEL
      COLOR 0 0 0
     END
   END
END

These layer files will be dynamically created so their actual data will =
be different. Only their display properties will be common.=20

Any ideas?

Thank you:)

Have a nice day.

  ----- Original Message -----=20
  From: Christian Blumer=20
  To: Murat Isik=20
  Sent: Friday, December 12, 2003 5:11 PM
  Subject: Re: [Mapserver-users] simple php/mapscript questions


  Yes, just mention the full path for each layer at the data parameter:
  =20
  LAYER
  ...
      DATA /to/my/data
  ...
  END
  for the second question, can you be more explicit?
  Christian
    ----- Original Message -----=20
    From: Murat Isik=20
    To: mapserver-users at lists.gis.umn.edu=20
    Sent: Friday, December 12, 2003 3:04 PM
    Subject: [Mapserver-users] simple php/mapscript questions


    Hello,

    I have two simple questions for those who know php/mapscript:

    -actually first question more about map file. when we write =
SHAPEPATH "data" at the beginning of the file, mapserver goes into =
"data" to find all layer data. Is there a way to get the mapserver to =
retrieve data for each layer from different folders or paths?

    -I have a layer like this:

    LAYER
      NAME lastpoint
      TYPE point
      DATA lastpoint
      STATUS OFF
       CLASS
        SYMBOL 'circle'
        COLOR 102 255 36
        SIZE 20
         LABEL
          COLOR 0 0 0
         END
       END
    END

    This layer gets to be called within the php and turned ON. What I =
want to do is to use the same settings for different named layers but =
without rewriting this part multiple times. It is like: the php will get =
the layer by name (lastpoint) but for this layer it will retrieve data =
from firstpoint.shp, firstpoint.shx, firstpoint.dbf
    =20
    Is there a php code that does this?
    =20
    Have a nice day:)
    =20
    Murat Isik

------=_NextPart_000_00E3_01C3C0D4.6DF999E0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3700.6699" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Yes, off course I can.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>in my php I am trying to have lines =
like=20
these:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>if(whatever_one)<BR>{<BR>$layer =3D=20
$map->getLayerByName(lastpoint);<BR>$layer->set("status", =
MS_ON);<BR>GET=20
DATA FROM THIS LAYER FROM lastpoint (just like "DATA lastpoint" in =
the map=20
file)</FONT><FONT face=3DArial =
size=3D2><BR>}elseif(whatever_two)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>$layer =3D=20
$map->getLayerByName(lastpoint);<BR>$layer->set("status", =
MS_ON);<BR>GET=20
DATA FROM THIS LAYER FROM firstpoint (just like =
"DATA firstpoint" in=20
the map file)<FONT face=3DArial size=3D2><BR></FONT>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I know since example just being =
two layers,=20
you think I can write two different layers into the map file with two =
different=20
names but I will need tens of them. Also the layer name for whatever_two =

condition doesnot have to be "lastpoint". So it's like, there will be =
many=20
layers sharing the same specs of:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>TYPE point</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>   =
CLASS<BR>    SYMBOL=20
'circle'<BR>    COLOR 102 255 36<BR>    =
SIZE=20
20<BR>     LABEL<BR>      =
COLOR 0 0=20
0<BR>     END<BR>   =
END<BR>END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>These layer files will be dynamically =
created so=20
their actual data will be different. Only their display properties will =
be=20
common. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Any ideas?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you:)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Have a nice day.<BR></DIV></FONT>
<BLOCKQUOTE dir=3Dltr=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A href=3D"mailto:christian.blumer at epfl.ch"=20
  title=3Dchristian.blumer at epfl.ch>Christian Blumer</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  href=3D"mailto:muratisik at megatek.com.tr" =
title=3Dmuratisik at megatek.com.tr>Murat=20
  Isik</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, December 12, 2003 =
5:11=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: [Mapserver-users] =
simple=20
  php/mapscript questions</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Yes, just mention the full path for =
each layer at=20
  the data parameter:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
  <DIV><FONT face=3DArial size=3D2>LAYER</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>...</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>    DATA =
/to/my/data</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>...</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>END</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>for the second question, can you be =
more=20
  explicit?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Christian</FONT></DIV>
  <BLOCKQUOTE dir=3Dltr=20
  style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; =
MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
    <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
    <DIV=20
    style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
    <A href=3D"mailto:muratisik at megatek.com.tr"=20
    title=3Dmuratisik at megatek.com.tr>Murat Isik</A> </DIV>
    <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
    href=3D"mailto:mapserver-users at lists.gis.umn.edu"=20
    =
title=3Dmapserver-users at lists.gis.umn.edu>mapserver-users at lists.gis.umn.e=
du</A>=20
    </DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, December 12, =
2003 3:04=20
    PM</DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Mapserver-users] =
simple=20
    php/mapscript questions</DIV>
    <DIV><BR></DIV>
    <DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>I have two simple questions for =
those who know=20
    php/mapscript:</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>-actually first question more about =
map file.=20
    when we write SHAPEPATH "data" at the beginning of the file, =
mapserver goes=20
    into "data" to find all layer data. Is there a way to get the =
mapserver to=20
    retrieve data for each layer from different folders or =
paths?</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>-I have a layer like =
this:</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>LAYER<BR>  =
NAME lastpoint<BR> =20
    TYPE point<BR>  DATA lastpoint<BR>  STATUS=20
    OFF<BR>   CLASS<BR>    SYMBOL=20
    'circle'<BR>    COLOR 102 255 =
36<BR>    SIZE=20
    20<BR>     =
LABEL<BR>      COLOR=20
    0 0 0<BR>     END<BR>  =20
    END<BR>END<BR></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>This layer gets to be called within =
the php and=20
    turned ON. What I want to do is to use the same settings for =
different named=20
    layers but without rewriting this part multiple times. It is like: =
the php=20
    will get the layer by name (lastpoint) but for this layer it will =
retrieve=20
    data from firstpoint.shp, firstpoint.shx, =
firstpoint.dbf</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Is there a php code that does=20
this?</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Have a nice day:)</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Murat=20
Isik</DIV></BLOCKQUOTE></BLOCKQUOTE></FONT></BODY></HTML>

------=_NextPart_000_00E3_01C3C0D4.6DF999E0--




More information about the MapServer-users mailing list