[Mapserver-users] Queries with Windows version of MapServer 4.0

tmlee1 tmlee1 at ualr.edu
Tue Sep 23 18:53:26 EDT 2003


I have managed to generate queries of census layers using the windows version 
of MapServer 4.0. The layer files do not contain enough census data; however, 
I can get the additional data from census.gov and get the data into a second 
.dbf file.

>From the archives and documentation, I believe that I can join another .dbf 
file to an existing layer's .dbf file using JOIN and display the data in my 
query results. I just can't find documentation or an example of this for 
MapServer 4.0

Here's what I have developed that works in MapServer 4.0 for a basic query:

 --- Census.map ---

LAYER # Census Tracts
  NAME "census_tracts"
  DATA census/vector/CENSUS_TRACTS2000_TIG99_area
  STATUS off
  TYPE polygon
  CLASSITEM "TRACTID"
  CLASS
    NAME "Census Tracts"
    EXPRESSION /./
    OUTLINECOLOR 255 000 000
    TEMPLATE "g:/mapserver/data/census/templates/census_tracts.html"
  END # end of class object
END # end of layer object

 --- census_tracts.html ---

<tr bgcolor="#CCCCCC">
<td align="left" colspan="9" width="75%"><b>Census Tract: </b>[TRACTID]</td>
<td align="left" colspan="3" width="25%"><b>FIPS: </b>[STFID]</td>
</tr>

<tr>
<td align="left" colspan="12" width="100%">&nbsp;</td>
</tr>

<tr>
<td align="left" colspan="1" width="10%">&nbsp;</td>
<td align="left" colspan="3" width="25%"><b>Total Persons: </b></td>
<td align="left" colspan="3" width="25%">[POP]</td>
<td align="left" colspan="3" width="25%"><b>Avg Family Income: </b></td>
<td align="left" colspan="3" width="25%">[INCOME_FAM]</td>
</tr>

<tr>
<td align="left" colspan="12" width="100%">&nbsp;</td>
</tr>

(I decided to divide my query results into 12 imaginary boxes per row, to aid 
in designing an attractive output. I also use a default layer at the front and 
end of the layers to add a query header and footer to open and close the HTML 
table.)

I would be beholding if someone would edit and repost the map file segment 
showing a working join for MapServer 4.0. Then, the example would be archived 
for others to find and use.




More information about the mapserver-users mailing list