<!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 viaWFS-Requests ?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hello,</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">I try to join two postgis-tables and I want to display the result via a WFS-request.</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><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><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">But is this working NOW,</FONT><BR>
<FONT SIZE=2 FACE="Arial">or does anybody know a workaround ?</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">I try to do this (a sequence of the mapfile):</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">------------------------------------</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">CONNECTIONTYPE postgis</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">CONNECTION "user=xxx dbname=yyy host=zzz password=vvvv"</FONT><FONT FACE="Times New Roman"><BR>
</FONT><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><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">HEADER ".../wahlen1_header.html"</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">TEMPLATE ".../wahlen1.html"</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">FOOTER ".../wahlen1_footer.html"</FONT><FONT FACE="Times New Roman"><BR>
<BR>
</FONT><FONT SIZE=2 FACE="Arial">JOIN</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">NAME "bereiche"</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">CONNECTIONTYPE ogr</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">CONNECTION "user=xxx dbname=yyy host=zzz password=vvv"</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">TABLE "table_2"</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">FROM "wahlb_nummer_int"</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">TO "wahlb_nummer_int2"</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">TYPE ONE-TO-MANY</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">TEMPLATE ".../wahlen1_join_adressbereiche.html"</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">END</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">------------------------------------</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">The map is drawn correctly, the WFS responds with all attributes of table_1.</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">ogrinfo recognizes and describes the table_2 correctly.</FONT><FONT FACE="Times New Roman"> </FONT>
<BR><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><FONT FACE="Times New Roman"> </FONT>
<BR><FONT SIZE=2 FACE="Arial">greetings</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">Herbert</FONT><FONT FACE="Times New Roman"></FONT>
</P>
</BODY>
</HTML>