Can I join two DBF's spatially?
Kirk Johnson
kjohnson at CDAID.ORG
Tue Oct 19 15:18:18 PDT 2004
Hello everyone,
I'm attempting to build a map that will allow users to enter in their
address, and it will report back their coresponding local zoning information.
I can only get the text query to return information from the Addresses
layer, and none from the desired zoning layer.
(an NQuery will successfully return info from both layers)
The addresses are contained in a shapefile/dbf combo named kcstruCDA.shp and
kcstruCDA.dbf.
The Zoning information is in a separate layer (shape file/dbf) named
zone2004.dbf and zone2004.shp.
My html to trigger the search is as follows:
<form method="GET" action="[program]" name="address">
Find your Address
<input type="hidden" name="map" value="C:\inetpub\wwwroot\cdagis\addressq.map">
<input type="hidden" name="map_web_imagepath" value="[map_web_imagepath]">
<input type="hidden" name="map_web_imageurl" value="[map_web_imageurl]">
<input type="hidden" name="slayer" value="R-8">
<input type="hidden" name="mode" value="itemnquery">
<input type="hidden" name="qlayer" value="ADDRESS">
<input type="hidden" name="qitem" value="Address">
<INPUT TYPE="text" NAME="qstring" SIZE="30">
<input type="hidden" name="map_web_template" value="[map_web_template]">
<input type="hidden" name="savequery" value="true">
<input type="submit" value="Go!">
height="[mapheight]" border="0" alt="this is the map"> -->
</form>
My results template is as follows:
(attempting to get zoning to display from a Join....)
<tr><td>[lrn]</td><td>[ADDRESS]</td><td>[SERIAL]</td><td>[PARCEL_ID]</td></tr>
<tr><td>[lrn]</td><td>[ZONING]</td><td></td><td></td></tr>
[zonejoin]: [zonejoin_ZONING]
<table cellpadding="5">
<tr>
<td><img border="2" src="[img]" height="200" width="200"></td>
<td><img border="2"
src="/cgi-bin/mapserv.exe?map=[map]&layer=BASE&mode=itemnquerymap&mapext=shape&slayer=R-8&qlayer=[qlayer]&qitem=[qitem]&qstring=[qstring]"
height="400" width="400"></td>
</tr>
And lastly, my mapfile is as follows:
MAP
NAME "zonequery"
STATUS ON
# EXTENT 2340177.48963 2183849.25496 2395237.64752 2220590.24535
EXTENT 2350177.48963 2193849.25496 2386237.64752 2210590.24535
SIZE 600 600
SHAPEPATH "C:\Inetpub\wwwroot\cdagis\zoning2004"
SYMBOLSET "C:\Inetpub\wwwroot\cdagis\tutorial\etc\symbols.sym"
FONTSET "C:\Inetpub\wwwroot\cdagis\tutorial\etc\fonts.txt"
IMAGETYPE PNG
IMAGECOLOR 255 255 255
UNITS Meters
WEB
# IMAGEPATH "c:\inetpub\wwwroot\tmp\"
# IMAGEURL "c:\inetpub\wwwroot\tmp\"
TEMPLATE "C:\Inetpub\wwwroot\cdagis\zonebasic.html"
ERROR "c:\inetpub\wwwroot\tmp\zonequeryerr.log"
LOG "c:\inetpub\wwwroot\tmp\zonequery.log"
EMPTY "http://localhost/cdagis/zoning2004/templates/noresults.html"
MINSCALE 1000
MAXSCALE 1550000
END
OUTPUTFORMAT
NAME "png"
MIMETYPE "image/png"
DRIVER "GD/PNG"
EXTENSION "png"
IMAGEMODE PC256
TRANSPARENT FALSE
END
QUERYMAP
STATUS ON
STYLE HILITE
COLOR 255 0 51
END
LAYER
NAME "BASE"
STATUS ON
DATA "./basemap"
TYPE LINE
UNITS METERS
SIZEUNITS PIXELS
TOLERANCE 0
TOLERANCEUNITS PIXELS
CLASS
NAME "Basemap"
STYLE
SYMBOL 0
COLOR 220 230 240
SIZE 1
# MINSIZE 1
# MAXSIZE 100
END
END
END
LAYER
NAME "ADDRESS"
STATUS ON
DATA "./kcstruCDA"
TYPE POINT
SIZEUNITS PIXELS
TOLERANCE 10
TOLERANCEUNITS PIXELS
CLASS
NAME 'ADDRESS'
# EXPRESSION "Address"
TEMPLATE "C:\Inetpub\wwwroot\cdagis\zoning2004\templates\addressq.html"
# END # class
STYLE
SYMBOL 'circle'
COLOR 1 1 1
SIZE 15
END # style
END
HEADER "C:\Inetpub\wwwroot\cdagis\zoning2004\templates\addressq_header.html"
FOOTER "C:\Inetpub\wwwroot\cdagis\zoning2004\templates\addressq_footer.html"
JOIN
NAME "zonejoin"
TABLE "C:\Inetpub\wwwroot\cdagis\zoning2004\r-8a.dbf"
FROM ADDRESS
TO ZONING
# TEMPLATE "C:\Inetpub\wwwroot\cdagis\zoning2004\templates\addressq.html"
TYPE SINGLE
END # join
END
LAYER
NAME "R-8"
STATUS ON
DATA "./r-8a"
TYPE POLYGON
UNITS METERS
SIZEUNITS PIXELS
TOLERANCE 0
TOLERANCEUNITS PIXELS
CLASS
NAME "R-8"
TEMPLATE "C:\Inetpub\wwwroot\cdagis\zoning2004\templates\zone2004.html"
STYLE
SYMBOL 0
COLOR 000 255 000
SIZE 1
# MINSIZE 1
# MAXSIZE 100
END
END
HEADER "C:\Inetpub\wwwroot\cdagis\zoning2004\templates\zone2004_header.html"
FOOTER "C:\Inetpub\wwwroot\cdagis\zoning2004\templates\zone2004_footer.html"
END
END
Thank you for any input
Kirk Johnson
More information about the MapServer-users
mailing list