[mapserver-users] JOIN Does Not Appear To Work in Ver. 3.5

Steve Lime steve.lime at dnr.state.mn.us
Wed Mar 20 13:31:10 EST 2002


This has come up in the past few weeks but here goes again. Joins are
busted in 3.5. This is mainly due to the fact that I wasn't quite sure
how to continue developing them given that so many new datasources are
supported. Ideally one would use ODBC to do this but there hasn't been
time nor support for doing it. I may simply get the old DBF code working
(should be easy) and worry about other types of data later. Joins were
the only main feature not to have carried through from 3.4 to 3.5.
Sorry.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Tom Cadman" <Tom.Cadman at region.durham.on.ca> 03/20/02 11:40AM >>>
I have had no problem using JOINS and complex query templates in
version 3.4 but have had no luck in getting anything to display in
version 3.5.  I've checked the users list and tried the advice given -
with no luck.  All I've been able to display is either the JOIN variable
name "[subdjoin]" in my template or the following message:
"msQueryByPoint(): Search returned no results. No matching record(s)
found"

I'm using the demo 35 interface and the same data files I used in
Version 3.4 ... so I know there is a match in the files and the JOIN
works there fine. Is there something additional I have to do for version
3.5 -  i.e. set a filter and filteritem? Below is a copy of the map
file, header, footer and template file code I'm using. 

Maybe someone send me a sample of the map file and template files they
use with thier joins. Thanks.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
MAP FILE:

NAME DEMO
STATUS ON
SIZE 600 600
UNITS METERS

EXTENT 621658.000091 4845664.964209 707750.058591 4936873.000506

SHAPEPATH "data"
SYMBOLSET symbols/symbols.sym
FONTSET fonts/fonts.list
........
......
...
..
.
QUERYMAP
  SIZE 200 200
  STATUS ON
  STYLE HILITE
  COLOR 255 0 0
END
........
....
.

################ LAYERS  #############

LAYER  # subdivision plans
  NAME "subdivisions"
  TYPE POLYGON
  DATA subdivision_condo_plans_region
  STATUS default #OFF
  CLASS
   JOIN
     TYPE single
     TEMPLATE "subd_query_result.html"
     NAME  subdjoin
     TABLE "subcondo.dbf" # filename of.dbf to be joined with shapefile
.dbf
     FROM  SUBDIVISIO     # field in shapefile .dbf file
     TO TFILE             # field to join on in lookup .dbf file
   END
   OUTLINECOLOR 0 81 255
   COLOR 76 163 255   
  END # end class

  HEADER "subd_header.html"
  FOOTER "subd_footer.html"
END
::::::::::::::::

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
SUBD_HEADER FILE:

<html>
<head><title>MapSurfer Header Page</title>
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0">
  <font size+1><b>Layer: subdivisions</b></font><p>
  <TABLE cellpadding=5 cellspacing=2 border=0>
     <TR bgcolor=#CCCCCC>
        <th>File Number</th>
     </TR>
    <!--[subdjoin]-->  <!-- Tried it here! ...doesn't work--> 
::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::::::::::::::::
TEMPLATE FILE:

[subdjoin] <!-- tried it here! ...won't work -->

<TR>
<!-- [subdjoin] -->  <!-- tried it here! ...doesn't work -->
<td>[SUBDIVISIO]</td> <!-- field in shape file .dbf ... won't even
display it-->
</TR>
<TR>
<td>[TFILE</td><td>[APPLICANT]</td> <!-- fields from joined .dbf -- >
</TR>
::::::::::::::::

::::::::::::::::::::::::::::::::::::::::
SUBD_FOOTER FILE:

  </TABLE>
</body>
</html>




More information about the mapserver-users mailing list