Using join for querying
cris ricana
crisricana at GMAIL.COM
Tue Aug 29 01:32:54 PDT 2006
Hello!
I'd like some help regarding my use of JOIN in my mapserver setup. I'm
using two sets of data, a base shapefile ("reg_bndary") containing
basically place information and system-generated csv files containing
all the relevant information regarding these places in the shapefiles.
Both have a common field called Place_ID to be used for the join. I
was planning to use these csv in times when the users want to query
for detailed information on these places. My map file looks like this
(the JOIN part is near the end):
NAME reg_bndary2000.map
SIZE 600 600
EXTENT 114.03 3.8315 131.33 21.1585
SHAPEPATH "data"
IMAGETYPE PNG
UNITS meters
WEB
TEMPLATE 'reg_bndary2000.html'
# IMAGEPATH '/home/mis/DIRP/maps/'
# IMAGEURL 'home/mis/DIRP/maps/'
IMAGEPATH '/home/yronald/htdocs/maps/test_map/maps/'
IMAGEURL '/test_map/maps/'
END #WEB
QUERYMAP
SIZE 600 600
STATUS ON
STYLE SELECTED
COLOR 255 0 0
END
(...)
LAYER
NAME CY_2000
TYPE polygon
STATUS ON
DATA reg_bndary
CLASSITEM COUNT
LABELITEM REGION
CLASS
NAME "443 - 688"
EXPRESSION ([COUNT]>=443 AND [COUNT]<=688)
COLOR 205 0 0
OUTLINECOLOR 0 0 0
LABEL
COLOR 0 0 255
SIZE LARGE
END
TEMPLATE "reg_bndary2000_dbf.html"
END # CLASS
CLASS
NAME "226 - 442"
EXPRESSION ([COUNT]>=226 AND [COUNT]<=442)
COLOR 255 193 193
OUTLINECOLOR 0 0 0
LABEL
COLOR 0 0 255
SIZE LARGE
END
TEMPLATE "reg_bndary2000_dbf.html"
END # CLASS
CLASS
NAME "106 - 225"
EXPRESSION ([COUNT]>=106 AND [COUNT]<=225)
COLOR 154 255 154
OUTLINECOLOR 0 0 0
LABEL
COLOR 0 0 0
SIZE LARGE
END
TEMPLATE "reg_bndary2000_dbf.html"
END # CLASS
CLASS
NAME "0 - 105"
EXPRESSION ([COUNT]>=0 AND [COUNT]<=105)
COLOR 0 100 0
OUTLINECOLOR 0 0 0
LABEL
COLOR 0 0 0
SIZE LARGE
END
TEMPLATE "reg_bndary2000_dbf.html"
END # CLASS
CLASS
NAME "No Data"
EXPRESSION ([COUNT]="")
COLOR 255 255 255
OUTLINECOLOR 0 0 0
LABEL
COLOR 0 0 0
SIZE LARGE
END
TEMPLATE "reg_bndary2000_dbf.html"
END # CLASS
HEADER "reg_bndary2000_header.html"
FOOTER "reg_bndary2000_footer.html"
JOIN
NAME "reg_join"
CONNECTIONTYPE CSV
TABLE "lgu_DB_DACCESS_PROV.csv"
FROM "Place_ID"
TO "1"
TEMPLATE "reg_bndary 2000_dbf.html"
END #join
END # LAYER
END # MAPFILE
The template file used for , "reg_bndary 2000_dbf.html", contains
simply the following:
[reg_join_REGION]<br>
[reg_join_PLACE]
When when I test this, I get the following error:
msQueryByPoint(): Search returned no results. No matching
record(s) found.
Can somebody help me tell me what is wrong in my setup?
Thanks!
Maricris
More information about the MapServer-users
mailing list