<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>Is it NOW possible to join (Postgres-)Tables via WFS-Requests ?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hello,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I try to join two postgis-tables and I want to display the result via a WFS-request.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I have found a discussion from May 2005, that is is not working (Title: "JOIN object and WMS/WFS" ).</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">But is this working NOW, </FONT>
<BR><FONT SIZE=2 FACE="Arial">or does anybody know a workaround ?</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">I try to do this (a sequence of the mapfile):</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">------------------------------------</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CONNECTIONTYPE postgis</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CONNECTION "user=xxx dbname=yyy host=zzz password=vvvv"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> DATA "the_geom from (SELECT fid, the_geom, …., wahlb_nummer_int FROM table_1 ORDER by wahlb_nummer_int) as foo USING UNIQUE fid USING SRID=31468"</FONT></P>
<P><FONT SIZE=2 FACE="Arial">….</FONT>
<BR><FONT SIZE=2 FACE="Arial"> HEADER ".../wahlen1_header.html"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> TEMPLATE ".../wahlen1.html"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> FOOTER ".../wahlen1_footer.html"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> </FONT>
<BR><FONT SIZE=2 FACE="Arial"> JOIN</FONT>
<BR><FONT SIZE=2 FACE="Arial"> NAME "bereiche"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CONNECTIONTYPE ogr</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CONNECTION "user=xxx dbname=yyy host=zzz password=vvv"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> TABLE "table_2"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> FROM "wahlb_nummer_int"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> TO "wahlb_nummer_int2"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> TYPE ONE-TO-MANY</FONT>
<BR><FONT SIZE=2 FACE="Arial"> TEMPLATE ".../wahlen1_join_adressbereiche.html"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> END</FONT>
<BR><FONT SIZE=2 FACE="Arial">------------------------------------</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The map is drawn correctly, the WFS responds with all attributes of table_1.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">ogrinfo recognizes and describes the table_2 correctly.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Producing errors (for example giving a wrong field-name in the TO-parameter of the JOIN-object), mapserver answers with an error-massage (field not recognized …). So I think, the join definition is correct. </FONT></P>
<P><FONT SIZE=2 FACE="Arial">But the template TEMPLATE ".../wahlen1_join_adressbereiche.html" is NEVER put into the WFS-answer.</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">greetings</FONT>
<BR><FONT SIZE=2 FACE="Arial">Herbert</FONT>
</P>
<BR>
</BODY>
</HTML>