[Mapserver-users] Joins in MapServer 3.7dev - not working yet?
Mike Leahy
mgleahy at fes.uwaterloo.ca
Fri May 16 11:20:58 PDT 2003
This is a multi-part message in MIME format.
------=_NextPart_000_0073_01C31BAE.00A1D090
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
As someone suggested to me earlier, I have the development version of
Mapserver 3.7. I am under the impression that this supports single
joins, and may soon support multiple joins.
I have the demo running, and I created a test DBF file to join to the
airports layer with a column of values named "TEST", and a column
"QUADNAME" that matches the column of the same name in the shapefile dbf
for Airports.
The syntax in the mapfile used is below - info at
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?MigrationGuide suggests
that the 'TYPE' parameter should be "ONE-TO-ONE" rather than SINGLE, but
this caused an error with MapServer, so I stuck with SINGLE.
I pretty much left the templates as is, except I added a column in the
Airports header template for the test value. In the Airports query
template, I put '[testjoin]' in the appropriate table column, then in
the template for "testjoin", I only have the text '[TEST]' named in
order to return the value from that column in the joined table.
However, the '[testjoin]' parameter is not processed, so that all I see
is [testjoin] final output where I should see the corresponding value
from the [TEST] column in the joined table.
Have I arranged the templates improperly, or am I missing some detail in
the join?
Many thanks to anyone who can help,
Mike
-------layer with join in mapfile----------------
LAYER
NAME airports
TYPE POINT
DATA airports
STATUS OFF
CLASS
NAME 'Airports'
COLOR 128 255 164
SYMBOL 'circle'
SIZE 7
TEMPLATE "airports.html"
JOIN
NAME 'testjoin'
TYPE ONE-TO-ONE
TABLE "airports_join.dbf"
FROM "QUADNAME"
TO "QUADNAME"
TEMPLATE "airports_join.html"
END
END
HEADER "airports_header.html"
FOOTER "airports_footer.html"
TOLERANCE 5
METADATA
WMS_TITLE "Airports"
WMS_ABSTRACT "Airport runways for Itasca County."
WMS_SRS "EPSG:26915"
END
END
---------------airports_header.html template------------------
<font size+1><b>Layer: airports</b> </font><p>
<table cellpadding=5 cellspacing=2 border=0>
<tr
bgcolor=#CCCCCC><th>NAME</th><th>LAT</th><th>LON</th><th>ELEVATION</th><
th>QUADNAME</th><th>TEST</th></tr>
---------------airports.html template----------------------
<tr><td>[NAME]</script></td><td>[LAT]</td><td>[LON]</td><td>[ELEVATION]<
/td><td>[QUADNAME]</td><td>[testjoin]</td></tr>
--------------airports_footer.html template----------------------
</table><p>
-------------airports_join.html template-------------------
[TEST]
-------------------------------------------------------------------
------=_NextPart_000_0073_01C31BAE.00A1D090
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;
color:windowtext;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-CA link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>As someone suggested to me earlier, I have the =
development
version of Mapserver 3.7. I am under the impression that this =
supports
single joins, and may soon support multiple joins.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I have the demo running, and I created a test DBF =
file to
join to the airports layer with a column of values named =
“TEST”,
and a column “QUADNAME” that matches the column of the same =
name in
the shapefile dbf for Airports.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The syntax in the mapfile used is below - info at <a
href=3D"http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?MigrationGuide">http=
://mapserver.gis.umn.edu/cgi-bin/wiki.pl?MigrationGuide</a>
suggests that the ‘TYPE’ parameter should be =
“ONE-TO-ONE”
rather than SINGLE, but this caused an error with MapServer, so I stuck =
with SINGLE.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I pretty much left the templates as is, except I =
added a
column in the Airports header template for the test value. In the
Airports query template, I put ‘[testjoin]’ in the =
appropriate table
column, then in the template for “testjoin”, I only have the =
text ‘[TEST]’
named in order to return the value from that column in the joined =
table.
However, the ‘[testjoin]’ parameter is not processed, so =
that all I
see is [testjoin] final output where I should see the corresponding =
value from
the [TEST] column in the joined table.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Have I arranged the templates improperly, or am I =
missing
some detail in the join?</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Many thanks to anyone who can help,</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Mike</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>-------layer with join in =
mapfile----------------</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>LAYER</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> NAME airports</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> TYPE POINT</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> DATA airports</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> STATUS OFF</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> CLASS</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> NAME 'Airports'</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> COLOR 128 255 =
164</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> SYMBOL 'circle'</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> SIZE 7</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> TEMPLATE =
"airports.html"</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> JOIN</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> NAME =
'testjoin'</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> TYPE =
ONE-TO-ONE</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> TABLE =
"airports_join.dbf"</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> FROM =
"QUADNAME"</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> TO =
"QUADNAME"</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> TEMPLATE =
"airports_join.html"</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> END</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> END</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> HEADER =
"airports_header.html"</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> FOOTER =
"airports_footer.html"</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> TOLERANCE 5</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> METADATA</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> WMS_TITLE =
"Airports"</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> WMS_ABSTRACT "Airport runways =
for </span></font><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Itasca</span></font><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> </span></font><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>County</span></font><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>."</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> WMS_SRS =
"EPSG:26915"</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> END</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>END</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>---------------airports_header.html
template------------------</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><font size+1><b>Layer: airports</b> =
</font><p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><table cellpadding=3D5 cellspacing=3D2 =
border=3D0></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><tr
bgcolor=3D#CCCCCC><th>NAME</th><th>LAT</th><=
;th>LON</th><th>ELEVATION</th><th>QUADNAME<=
/th><th>TEST</th></tr></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>---------------airports.html =
template----------------------</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><tr><td>[NAME]</script></td>&l=
t;td>[LAT]</td><td>[LON]</td><td>[ELEVATION]&l=
t;/td><td>[QUADNAME]</td><td>[testjoin]</td>&l=
t;/tr></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>--------------airports_footer.html
template----------------------</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'></table><p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>-------------airports_join.html =
template-------------------</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>[TEST]</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>------------------------------------------------------=
-------------</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
</div>
</body>
</html>
------=_NextPart_000_0073_01C31BAE.00A1D090--
More information about the MapServer-users
mailing list