[mapserver-users] problem with join

mikee mikee" <mike@mikee.de
Wed, 6 Mar 2002 20:45:11 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C1C54F.CF97B9C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

1000s thanks, but i need also the temlate-files.

my old problem:

1.) i have a shapfile called "test1" with an item "nr" in the dir: =
/mapserver/data

2.) i have also a dbf called "join1.dbf" in the dir: =
"c:\inetpub\wwwroot\mapserver\data\join1.dbf" also with an item "nr" and =
"wert1" and "test2"

3.) my map-file:
LAYER
   NAME test
   TYPE POLYGON
   STATUS DEFAULT
   DATA test1
   LABELITEM NR
   CLASS
     SYMBOL 0
     COLOR 255 0 0
     OUTLINECOLOR 0 0 0
     TEMPLATE "joinx.html"
     JOIN
       NAME jj
       table "c:\inetpub\wwwroot\mapserver\data\join1.dbf"
       from nr
       to nr
       type single
     END # join
     LABEL
       COLOR 128 0 0
       ANTIALIAS TRUE
       SIZE tiny
     END
   END
  HEADER "joinx_header.html"
  FOOTER "joinx_footer.html"
END

4.) the templates
a) "joinx_header.html"
<font size+1><b>Layer: TEST</b></font><p>
<table cellpadding=3D5 cellspacing=3D2 border=3D0>
<tr bgcolor=3D#CCCCCC>
<th>NR</th><th>WERT1</th><th>TEXT2</th>
</tr>

b) "joinx_footer.html"
</table><p>

c) "joinx.html
<tr>
<td>[NR]</td>
<td>[WERT1]</td>
<td>[TEXT2]</td>
</tr>

but my query give me only this:
Layer: TEST=20
      NR WERT1 TEXT2=20
      5 [WERT1] [TEXT2]=20


:-( - where is the mistake? where are the value for "wert1" and =
"text2"??


--->    mfg mikeE. :-)
=20
--->    mail: mike@mikee.de
--->    @web: http://www.mikee.de
--->    @wap: http://www.mikee.de/wap (dinge, die die welt nicht =
braucht!)
--->    icq: 129278959
--->    siehe auch:
--->    www.hallelinks.de
--->    www.rettet-die-berliner-bruecke.de
--->    www.buergerforum-halle.de
--->    www.ohnesocken.de
--->    www.elstermanns.de
--->    www.tonart-halle.de


=20
  ----- Original Message -----=20
  From: Richard Greenwood=20
  To: Mike Elstermann=20
  Cc: mapserver-users@lists.gis.umn.edu=20
  Sent: Tuesday, March 05, 2002 5:53 AM
  Subject: Re: [mapserver-users] problem with join


  You can create a join in your map file. Here's an example:

  Class
     Join
       from PIDN
        name jointest
        table "\Tc\DATA\assessor.DBF"
        # TEMPLATE join_region.shp_query.html  # required only for =
one-to-many joins
        to        Pidn
        type  single
     End # of Join Object
     SYMBOL "Solid"              =20
    OUTLINECOLOR 0 0 0
  END # of Class

  This is pretty well documented. Be careful how much editing is done to =
the dbf - adding or deleting records will break the join.

  Also note that you can only use a join for queries, not labeling. If =
you need to label features off the dbf you are out of luck. You will =
need to create the join in ArcView or MapInfo, and save it out as a =
single, static layer.

  Rich


  At 11:54 AM 3/4/2002 +0100, you wrote:

    hi,=20
    =20
    my (little) problem:
    =20
    i have a shape and i have ab big dbf-file.
    the polys in the shape have 1 (one!)  item - the ID , all other =
dates are in the dbf (landuse, name, number, ........)
    i want to join both files to shade the poly in different views =
(first landuse, later name, ....)
    my users should only edit in the dbf-file!
    =20
    and now my problem: how must I join to shade different with datas =
from the joined dbf???
    who has an example for me (map-file?)
    =20
    great thanks.
    mikeE.:-)

  Richard W. Greenwood, PLS
  Greenwood Mapping, Inc.
  Rich@GreenwoodMap.com
  (307) 733-0203
  http://www.GreenwoodMap.com=20


------=_NextPart_000_000C_01C1C54F.CF97B9C0
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.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>1000s thanks, but i need also the=20
temlate-files.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>my old problem:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>1.) i have a shapfile called "test1" =
with an item=20
"nr" in the dir: /mapserver/data</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>2.) i have also a dbf called =
"join1.dbf" in the=20
dir: "c:\inetpub\wwwroot\mapserver\data\join1.dbf" also with an item =
"nr" and=20
"wert1" and "test2"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>3.) my map-file:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>LAYER<BR>&nbsp;&nbsp; NAME =
test<BR>&nbsp;&nbsp;=20
TYPE POLYGON<BR>&nbsp;&nbsp; STATUS DEFAULT<BR>&nbsp;&nbsp; DATA=20
test1<BR>&nbsp;&nbsp; LABELITEM NR<BR>&nbsp;&nbsp;=20
CLASS<BR>&nbsp;&nbsp;&nbsp;&nbsp; SYMBOL 0<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
COLOR 255=20
0 0<BR>&nbsp;&nbsp;&nbsp;&nbsp; OUTLINECOLOR 0 0 =
0<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
TEMPLATE "joinx.html"<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
JOIN<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NAME=20
jj<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table=20
"c:\inetpub\wwwroot\mapserver\data\join1.dbf"<BR>&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
from nr<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to=20
nr<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type=20
single<BR>&nbsp;&nbsp;&nbsp;&nbsp; END # =
join<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
LABEL<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR 128 0=20
0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ANTIALIAS=20
TRUE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE=20
tiny<BR>&nbsp;&nbsp;&nbsp;&nbsp; END<BR>&nbsp;&nbsp; END<BR>&nbsp;=20
HEADER&nbsp;"joinx_header.html"<BR>&nbsp;&nbsp;FOOTER=20
"joinx_footer.html"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>END<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>4.) the templates</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>a) "joinx_header.html"<BR></FONT><FONT =
face=3DArial=20
size=3D2>&lt;font size+1&gt;&lt;b&gt;Layer:=20
TEST&lt;/b&gt;&lt;/font&gt;&lt;p&gt;<BR>&lt;table cellpadding=3D5 =
cellspacing=3D2=20
border=3D0&gt;<BR>&lt;tr=20
bgcolor=3D#CCCCCC&gt;<BR>&lt;th&gt;NR&lt;/th&gt;&lt;th&gt;WERT1&lt;/th&gt=
;&lt;th&gt;TEXT2&lt;/th&gt;<BR>&lt;/tr&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>b) "joinx_footer.html"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;/table&gt;&lt;p&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>c) "joinx.html</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&lt;tr&gt;<BR>&lt;td&gt;[NR]&lt;/td&gt;<BR>&lt;td&gt;[WERT1]&lt;=
/td&gt;<BR>&lt;td&gt;[TEXT2]&lt;/td&gt;<BR>&lt;/tr&gt;<BR></DIV>
<DIV>but my query give me only this:</DIV>
<DIV><STRONG>Layer: TEST</STRONG> </DIV>
<P>
<TABLE cellSpacing=3D2 cellPadding=3D5 border=3D0>
  <TBODY>
  <TR bgColor=3D#cccccc>
    <TH>NR</TH>
    <TH>WERT1</TH>
    <TH>TEXT2</TH></TR>
  <TR>
    <TD>5</TD>
    <TD>[WERT1]</TD>
    <TD>[TEXT2]</TD></TR></TBODY></TABLE></P>
<DIV><STRONG>:-( - where is the mistake? where are the value for "wert1" =
and=20
"text2"??</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV></FONT></DIV>
<DIV>---&gt;&nbsp;&nbsp;&nbsp; mfg mikeE.=20
:-)<BR>&nbsp;<BR>---&gt;&nbsp;&nbsp;&nbsp; mail: <A=20
href=3D"mailto:mike@mikee.de">mike@mikee.de</A><BR>---&gt;&nbsp;&nbsp;&nb=
sp; @web:=20
<A=20
href=3D"http://www.mikee.de">http://www.mikee.de</A><BR>---&gt;&nbsp;&nbs=
p;&nbsp;=20
@wap: <A href=3D"http://www.mikee.de/wap">http://www.mikee.de/wap</A> =
(dinge, die=20
die welt nicht braucht!)<BR>---&gt;&nbsp;&nbsp;&nbsp; icq:=20
129278959<BR>---&gt;&nbsp;&nbsp;&nbsp; siehe =
auch:<BR>---&gt;&nbsp;&nbsp;&nbsp;=20
<A=20
href=3D"http://www.hallelinks.de">www.hallelinks.de</A><BR>---&gt;&nbsp;&=
nbsp;&nbsp;=20
<A=20
href=3D"http://www.rettet-die-berliner-bruecke.de">www.rettet-die-berline=
r-bruecke.de</A><BR>---&gt;&nbsp;&nbsp;&nbsp;=20
<A=20
href=3D"http://www.buergerforum-halle.de">www.buergerforum-halle.de</A><B=
R>---&gt;&nbsp;&nbsp;&nbsp;=20
<A=20
href=3D"http://www.ohnesocken.de">www.ohnesocken.de</A><BR>---&gt;&nbsp;&=
nbsp;&nbsp;=20
<A=20
href=3D"http://www.elstermanns.de">www.elstermanns.de</A><BR>---&gt;&nbsp=
;&nbsp;&nbsp;=20
<A href=3D"http://www.tonart-halle.de">www.tonart-halle.de</A></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
size=3D2></FONT><BR>&nbsp;</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=3DRich@GreenwoodMap.com =
href=3D"mailto:Rich@GreenwoodMap.com">Richard=20
  Greenwood</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dmike.elstermann@halle.de=20
  href=3D"mailto:mike.elstermann@halle.de">Mike Elstermann</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Cc:</B> <A=20
  title=3Dmapserver-users@lists.gis.umn.edu=20
  =
href=3D"mailto:mapserver-users@lists.gis.umn.edu">mapserver-users@lists.g=
is.umn.edu</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, March 05, 2002 =
5:53=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: [mapserver-users] =
problem=20
  with join</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
  size=3D2></FONT><BR></DIV>You can create a join in your map file. =
Here's an=20
  example:<BR><BR>Class<BR>&nbsp;&nbsp; Join<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
from=20
  PIDN<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name=20
  jointest<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table=20
  "\Tc\DATA\assessor.DBF"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # TEMPLATE=20
  join_region.shp_query.html&nbsp; # required only for one-to-many=20
  joins<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
to<X-TAB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</X-TAB>Pidn<BR>=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  type&nbsp; single<BR>&nbsp;&nbsp; End # of Join Object<BR>&nbsp;&nbsp; =
SYMBOL=20
  =
"Solid"<X-TAB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</X-TAB><X-TAB>&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</X-TAB><BR>&nbsp;=20
  OUTLINECOLOR 0 0 0<BR>END # of Class<BR><BR>This is pretty well =
documented. Be=20
  careful how much editing is done to the dbf - adding or deleting =
records will=20
  break the join.<BR><BR>Also note that you can only use a join for =
queries, not=20
  labeling. If you need to label features off the dbf you are out of =
luck. You=20
  will need to create the join in ArcView or MapInfo, and save it out as =
a=20
  single, static layer.<BR><BR>Rich<BR><BR><BR>At 11:54 AM 3/4/2002 =
+0100, you=20
  wrote:<BR>
  <BLOCKQUOTE class=3Dcite cite=3D"" type=3D"cite"><FONT face=3Darial =
size=3D2>hi,=20
    </FONT><BR>&nbsp;<BR><FONT face=3Darial size=3D2>my (little)=20
    problem:</FONT><BR>&nbsp;<BR><FONT face=3Darial size=3D2>i have a =
shape and i=20
    have ab big dbf-file.</FONT><BR><FONT face=3Darial size=3D2>the =
polys in the=20
    shape have 1 (one!)&nbsp; item - the ID , all other dates are in the =
dbf=20
    (landuse, name, number, ........)</FONT><BR><FONT face=3Darial =
size=3D2>i want=20
    to join both files to shade the poly in different views (first =
landuse,=20
    later name, ....)</FONT><BR><FONT face=3Darial size=3D2>my users =
should only=20
    edit in the dbf-file!</FONT><BR>&nbsp;<BR><FONT face=3Darial =
size=3D2>and now my=20
    problem: how must I join to shade different with datas from the =
joined=20
    dbf???</FONT><BR><FONT face=3Darial size=3D2>who has an example for =
me=20
    (map-file?)</FONT><BR>&nbsp;<BR><FONT face=3Darial size=3D2>great=20
    thanks.</FONT><BR><FONT face=3Darial =
size=3D2>mikeE.:-)</BLOCKQUOTE><X-SIGSEP>
  <P></X-SIGSEP><BR>Richard W. Greenwood, PLS<BR>Greenwood Mapping,=20
  Inc.<BR>Rich@GreenwoodMap.com<BR>(307) 733-0203<BR><A=20
  href=3D"http://www.greenwoodmap.com/"=20
  eudora=3D"autourl">http://www.GreenwoodMap.com</A></FONT>=20
</P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000C_01C1C54F.CF97B9C0--