Fw: [Mapserver-users] ArcView created layer not working in mapscript

Stephen Clark stephen.clark at focus.ca
Thu Dec 18 11:51:42 PST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_0015_01C3C55D.4DAFC0A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


----- Original Message -----=20
From: Juan Carlos Fuchs=20
To: Stephen Clark=20
Sent: Thursday, December 18, 2003 10:52 AM
Subject: Re: [Mapserver-users] ArcView created layer not working in =
mapscript


Hi:
Just try to keep names in double quotes
I mean LABELITEM 'NAME' has to be LABELITEM "NAME"
and CLASS
   NAME 'NAME' has to be NAME "NAME"
Also check that in the DBF the column names are tiped in the same way =
you do in the map file.

I give you a part of the code who works ok for me.
Its a bit longer , I have classified the points by the population so 1 =
means capitols
2 Deparment Headers, 3 Towns, and so on
I you pay attention LABELITEM is Doblequoted and write exactly like the =
way ArcView shows it in the Table.--->Properties

Good Luck
JC.

#************************************************************************=
***
#*****  LAYER DE PUNTOS DE: Localidades, Cabeceras de Departamento y =
Capitales de Provincia  *****
#************************************************************************=
***

LAYER=20
  NAME loc42
  TYPE POINT
  DATA loc42
  STATUS OFF
  LABELITEM "nomloc"

CLASSITEM 'Cabe'
CLASS
     NAME "Capital de Provincia"
     EXPRESSION /1/
     COLOR 165 065 065
     MAXSCALE 15000000=20
     SYMBOL 'circle'
     SIZE 9

 LABEL
    TYPE BITMAP
    SIZE MEDIUM
    COLOR 0 0 0
    POSITION auto
 END

     TEMPLATE "loc42.html"
  END

   CLASS
     NAME "Cabeceras de Departamento"
     EXPRESSION /5/
     COLOR 065 165 065
     MAXSCALE 5000000
     SYMBOL 'circle'
     SIZE 7

 LABEL
    TYPE BITMAP
    SIZE tiny
    COLOR 50 150 50
    POSITION auto
    WRAP " "
    FORCE false
    BUFFER 2
    OFFSET -2 1
 END

     TEMPLATE "loc42.html"
  END

CLASS
     NAME "Localidades"
     EXPRESSION /0/
     COLOR 065 065 165
     MAXSCALE 900000
     SYMBOL 'circle'
     SIZE 5

 LABEL
    TYPE BITMAP
    SIZE tiny
    COLOR 50 50 250
    POSITION UC
    WRAP " "
    FORCE false
    BUFFER 2
    OFFSET -2 1
 END

     TEMPLATE "loc42.html"
  END

  HEADER "loc42_header.html"
  FOOTER "loc42_footer.html"




  TOLERANCE 5

  METADATA
    WMS_TITLE "Localidades"
    WMS_ABSTRACT "Localidades de la Provincia de La Pampa."
    WMS_SRS "EPSG:22193"
  END
END


  ----- Original Message -----=20
  From: Stephen Clark=20
  To: Murat Isik ; mapserver-users at lists.gis.umn.edu=20
  Sent: Thursday, December 18, 2003 1:26 PM
  Subject: Re: [Mapserver-users] ArcView created layer not working in =
mapscript


  Try this:



  LAYER
    NAME proposed_point
    STATUS OFF
    DATA "d:/folder/to/point_symbol/point"
    TYPE POINT
    LABELITEM "DESCRIPT"
    CLASS
      NAME 'Name'  # the field in the DBF file to use to display as a =
label
      COLOR 0 255 0
      SYMBOL 'circle'
      SIZE 10
      LABEL
        MINFEATURESIZE 100
        MINDISTANCE 150
        POSITION CC
        SIZE TINY
        COLOR 255 0 0
      END
    END
     =20
    METADATA
      WMS_TITLE "Point Labelled"
      WMS_ABSTRACT "N/A "
      #WMS_SRS "EPSG:26910"
    END
  END=20





    ----- Original Message -----=20
    From: Murat Isik=20
    To: mapserver-users at lists.gis.umn.edu=20
    Sent: Thursday, December 18, 2003 2:46 AM
    Subject: [Mapserver-users] ArcView created layer not working in =
mapscript


    Hello,
    I am trying to make my own tiny, amatuer layer in ArcView 3.x and =
display it in mapscript but I am failing, I will be very glad if anyone =
can help...

    This alyer of mine is just a single point at a certain coordinate, =
with a single label. I had learned how to make point layers from this =
list before but when it comes to adding label, I am stuck.

    What I do in ArcView 3.x is:

    1. Export data into a textfile
    2. Choose Table->Add and select your Textfile
    3. Choose View->Add Event Theme and select txt-table, the X- and=20
    the Y-field.
    4. Choose Theme->Convert to shapefile

    My text file is:

    "X","Y","NAME"
    29.0708,40.9678,HELLO

    So it is supposed to print thi point at the X and Y and also label =
it with HELLO

    The shapefile I create works in Arcview itself but not under =
php/mapscript with this layer definition in the mapfile:

    LAYER
      NAME mylayer
      TYPE point
      STATUS ON
      DATA mylayer
      LABELCACHE ON
      LABELITEM 'NAME'
      CLASS
       NAME 'NAME'
       SYMBOL 'circle'
       SIZE 5
       COLOR 64 0 64
        LABEL
          TYPE truetype
    #      FORCE true
          FONT arial
          COLOR 64 0 64
          ANGLE AUTO
          POSITION AUTO
          MINSIZE 2
          SIZE 6
       END
      END
    END

    It gives an error about the NAME column.=20

    Any ideas on creating a simple, labelled point layer?

    Have a nice day.

    Murat Isik
------=_NextPart_000_0015_01C3C55D.4DAFC0A0
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 http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV> </DIV>
<DIV style=3D"FONT: 10pt arial">----- Original Message -----=20
<DIV style=3D"BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A=20
title=3Djfuch at indec.mecon.gov.ar =
href=3D"mailto:jfuch at indec.mecon.gov.ar">Juan=20
Carlos Fuchs</A> </DIV>
<DIV><B>To:</B> <A title=3Dstephen.clark at focus.ca=20
href=3D"mailto:stephen.clark at focus.ca">Stephen Clark</A> </DIV>
<DIV><B>Sent:</B> Thursday, December 18, 2003 10:52 AM</DIV>
<DIV><B>Subject:</B> Re: [Mapserver-users] ArcView created layer not =
working in=20
mapscript</DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT size=3D2>Hi:</FONT></DIV>
<DIV><FONT size=3D2>Just try to keep names in double quotes</FONT></DIV>
<DIV><FONT size=3D2>I mean LABELITEM 'NAME' has to be LABELITEM=20
"NAME"</FONT></DIV>
<DIV><FONT size=3D2>and CLASS<BR>   NAME 'NAME' has to =
be NAME=20
"NAME"<BR>Also check that in the DBF the column names are tiped in the =
same way=20
you do in the map file.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I give you a part of the code who works ok for=20
me.</FONT></DIV>
<DIV><FONT size=3D2>Its a bit longer , I have classified the points by =
the=20
population so 1 means capitols</FONT></DIV>
<DIV><FONT size=3D2>2 Deparment Headers, 3 Towns, and so on</FONT></DIV>
<DIV><FONT size=3D2>I you pay attention LABELITEM is Doblequoted and =
write exactly=20
like the way ArcView shows it in the =
Table.--->Properties</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Good Luck</FONT></DIV>
<DIV><FONT size=3D2>JC.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT=20
size=3D2>#***************************************************************=
************<BR>#***** =20
LAYER DE PUNTOS DE: Localidades, Cabeceras de Departamento y Capitales =
de=20
Provincia =20
*****<BR>#***************************************************************=
************</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>LAYER <BR>  NAME loc42<BR>  TYPE =
POINT<BR> =20
DATA loc42<BR>  STATUS OFF<BR>  LABELITEM =
"nomloc"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>CLASSITEM =
'Cabe'<BR>CLASS<BR>     NAME=20
"Capital de Provincia"<BR>     EXPRESSION=20
/1/<BR>     COLOR 165 065 =
065<BR>    =20
MAXSCALE 15000000 <BR>     SYMBOL=20
'circle'<BR>     SIZE 9</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2> LABEL<BR>    TYPE=20
BITMAP<BR>    SIZE MEDIUM<BR>    COLOR 0 0 =

0<BR>    POSITION auto<BR> END</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>     TEMPLATE =
"loc42.html"<BR> =20
END</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>   CLASS<BR>     NAME =
"Cabeceras=20
de Departamento"<BR>     EXPRESSION=20
/5/<BR>     COLOR 065 165 =
065<BR>    =20
MAXSCALE 5000000<BR>     SYMBOL=20
'circle'<BR>     SIZE 7</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2> LABEL<BR>    TYPE=20
BITMAP<BR>    SIZE tiny<BR>    COLOR 50 =
150=20
50<BR>    POSITION auto<BR>    WRAP "=20
"<BR>    FORCE false<BR>    BUFFER=20
2<BR>    OFFSET -2 1<BR> END</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>     TEMPLATE =
"loc42.html"<BR> =20
END</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>CLASS<BR>     NAME=20
"Localidades"<BR>     EXPRESSION=20
/0/<BR>     COLOR 065 065 =
165<BR>    =20
MAXSCALE 900000<BR>     SYMBOL=20
'circle'<BR>     SIZE 5</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2> LABEL<BR>    TYPE=20
BITMAP<BR>    SIZE tiny<BR>    COLOR 50 50 =

250<BR>    POSITION UC<BR>    WRAP "=20
"<BR>    FORCE false<BR>    BUFFER=20
2<BR>    OFFSET -2 1<BR> END</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>     TEMPLATE =
"loc42.html"<BR> =20
END</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>  HEADER "loc42_header.html"<BR>  FOOTER=20
"loc42_footer.html"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT size=3D2><BR>  TOLERANCE 5</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>  METADATA<BR>    WMS_TITLE=20
"Localidades"<BR>    WMS_ABSTRACT "Localidades de la =
Provincia de=20
La Pampa."<BR>    WMS_SRS "EPSG:22193"<BR>  =
END<BR>END</DIV>
<DIV><BR></DIV></FONT>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-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 title=3Dstephen.clark at focus.ca =
href=3D"mailto:stephen.clark at focus.ca">Stephen=20
  Clark</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dmuratisik at megatek.com.tr=20
  href=3D"mailto:muratisik at megatek.com.tr">Murat Isik</A> ; <A=20
  title=3Dmapserver-users at lists.gis.umn.edu=20
  =
href=3D"mailto:mapserver-users at lists.gis.umn.edu">mapserver-users at lists.g=
is.umn.edu</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, December 18, =
2003 1:26=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: [Mapserver-users] =
ArcView=20
  created layer not working in mapscript</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Try this:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
  <DIV> </DIV>
  <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
  <DIV><FONT face=3DArial size=3D2>LAYER<BR>  NAME =
proposed_point<BR> =20
  STATUS OFF<BR>  DATA "d:/folder/to/point_symbol/point"<BR>  =
TYPE=20
  POINT<BR>  LABELITEM "DESCRIPT"<BR>  =
CLASS<BR>   =20
  NAME 'Name'  # the field in the DBF file to use to=20
  display as a label<BR>    COLOR 0 255=20
  0<BR>    SYMBOL 'circle'<BR>    SIZE=20
  10<BR>    LABEL<BR>     =20
  MINFEATURESIZE 100<BR>      MINDISTANCE=20
  150<BR>      POSITION=20
  CC<BR>      SIZE=20
  TINY<BR>      COLOR 255 0 =
0<BR>   =20
  END<BR>  END<BR>    <BR> =20
  METADATA<BR>    WMS_TITLE "Point=20
  Labelled"<BR>    WMS_ABSTRACT "N/A =
"<BR>   =20
  #WMS_SRS "EPSG:26910"<BR>  END<BR>END <BR></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
  <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
  <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
  <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
  <BLOCKQUOTE dir=3Dltr=20
  style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-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 title=3Dmuratisik at megatek.com.tr=20
    href=3D"mailto:muratisik at megatek.com.tr">Murat Isik</A> </DIV>
    <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
    title=3Dmapserver-users at lists.gis.umn.edu=20
    =
href=3D"mailto:mapserver-users at lists.gis.umn.edu">mapserver-users at lists.g=
is.umn.edu</A>=20
    </DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, December 18, =
2003 2:46=20
    AM</DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Mapserver-users] =
ArcView=20
    created layer not working in mapscript</DIV>
    <DIV><BR></DIV>
    <DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>I am trying to make my own tiny, =
amatuer layer=20
    in ArcView 3.x and display it in mapscript but I am failing, I will =
be very=20
    glad if anyone can help...</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>This alyer of mine is just a single =
point at a=20
    certain coordinate, with a single label. I had learned how to make =
point=20
    layers from this list before but when it comes to adding label, I am =

    stuck.</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>What I do in ArcView 3.x =
is:</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>1. Export data into a =
textfile<BR>2. Choose=20
    Table->Add and select your Textfile<BR>3. Choose View->Add =
Event Theme=20
    and select txt-table, the X- and <BR>the Y-field.<BR>4. Choose=20
    Theme->Convert to shapefile</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>My text file is:</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial=20
    size=3D2>"X","Y","NAME"<BR>29.0708,40.9678,HELLO</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>So it is supposed to print thi =
point at the X=20
    and Y and also label it with HELLO</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>The shapefile I create works in =
Arcview itself=20
    but not under php/mapscript with this layer definition in the=20
    mapfile:</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>LAYER<BR>  =
NAME mylayer<BR> =20
    TYPE point<BR>  STATUS ON<BR>  DATA mylayer<BR>  =
LABELCACHE=20
    ON<BR>  LABELITEM 'NAME'<BR>  CLASS<BR>   NAME=20
    'NAME'<BR>   SYMBOL 'circle'<BR>   SIZE=20
    5<BR>   COLOR 64 0 64<BR>   =20
    LABEL<BR>      TYPE=20
    truetype<BR>#      FORCE=20
    true<BR>      FONT=20
    arial<BR>      COLOR 64 0=20
    64<BR>      ANGLE=20
    AUTO<BR>      POSITION=20
    AUTO<BR>      MINSIZE=20
    2<BR>      SIZE 6<BR>   =
END<BR> =20
    END<BR>END<BR></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>It gives an error about the NAME =
column.=20
    </FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>Any ideas on creating a simple, =
labelled point=20
    layer?</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>Have a nice day.</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>Murat=20
Isik</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0015_01C3C55D.4DAFC0A0--




More information about the MapServer-users mailing list