ODBC join to shapefile
David Shorthouse
dps1 at UALBERTA.CA
Tue Mar 21 21:36:24 PST 2006
Hello folks,
Is it possible to join a column in a shapefile's dbf to a column in an
ODBC stored procedure via OGR? I'm not too concerned about performance, so
this is the idea for the mapfile syntax:
LAYER
NAME StatesProvinces
CONNECTIONTYPE OGR
CONNECTION Nearctic.shp
DATA "SELECT NAME, SpiderData.StateProvince FROM Nearctic LEFT JOIN
'<OGRVRTDataSource>
<OGRVRTLayer name="SpiderData">
<SrcDataSource>ODBC:xxxx/xxxx at xxxx</SrcDataSource>
<SrcSQL>EXEC LocalityList "%SpeciesCode%"</SrcSQL>
</OGRVRTLayer>
</OGRVRTDataSource>'.SpiderData ON NAME =
SpiderData.StateProvince"
STATUS DEFAULT
TYPE POLYGON
CLASSITEM "NAME"
CLASS
NAME "Yukon Territory"
EXPRESSION "Yukon Territory"
COLOR 210 210 210
END
CLASS
NAME "Northwest Territories"
EXPRESSION "Northwest Territories"
COLOR 205 92 92
END
etc.
What I ultimately want to do is shade a selection of whole States and
Provinces (in a shapefile) a colour different from those not chosen as a
result of a JOIN to an ODBC stored procedure. The single and double quotes
in the DATA rows above choke on one another, so this obviously doesn't work.
Anyone have any ideas?
David P. Shorthouse
------------------------------------------------------
Department of Biological Sciences
CW-403, Biological Sciences Centre
University of Alberta
Edmonton, AB T6G 2E9
Phone: 1-780-492-3080
mailto:dps1 at ualberta.ca
http://canadianarachnology.webhop.net
<http://canadianarachnology.webhop.net/>
http://arachnidforum.webhop.net <http://arachnidforum.webhop.net/>
------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060321/78af91a8/attachment.htm>
More information about the MapServer-users
mailing list