[Chameleon] Using and display JOIN's with Chameleon
Delfos, Jacob
jacob.delfos at maunsell.com
Tue Jan 10 19:32:49 EST 2006
Jonathon,
I don't think those type of joins can do what you want it to do in
Chameleon. You would not get access to the attributes. I tried it the
other day, without success. However, you could try an OGR join. That
should work with CSV as well (or you could convert to DBF). This allows
for querying and labelling using the joined information.
This is the layer definition I used:
------------------------------------------------------------------------
------------
LAYER
NAME 'Geology'
CONNECTIONTYPE OGR
CONNECTION "c:/data/gp.shp"
DATA "SELECT a.*,b.* FROM gp a LEFT JOIN 'c:/data/descr.dbf'.descr b ON
a.CODE=b.CODE"
LABELITEM 'a.CODE'
DUMP TRUE
TEMPLATE "ttt" # this isn't used, but needs to be here for queries
TOLERANCE 3
TOLERANCEUNITS PIXELS
[...]
END #LAYER
------------------------------------------------------------------------
-----------
The documentation for OGR is at
http://mapserver.gis.umn.edu/docs/howto/ogr_howto
Be aware that an OGR join is a bit slower. You may want to consider
permanently joining the information to the dataset.
Regards,
Jacob
> On 10-Jan-06, at 4:14 PM, Jonathon Coombes wrote:
>
> > Hi All,
> >
> > I am trying to combine shapefile attributes with a CSV file, but
> > cannot see what is the best way to do it. I have my layer definition
> > as follows:
> >
> > LAYER
> > NAME "LayerName"
> > TYPE POINT
> > DATA layerdata
> > STATUS ON
> > TEMPLATE "ttt_query.html"
> >
> > JOIN
> > CONNECTIONTYPE CSV
> > TABLE "datafile.csv"
> > TO "ID"
> > NAME "csvlayerjoin"
> > FROM "InfoID"
> > TEMPLATE "ttt_join.html"
> > END
> > END
> >
> > My question is - does Chameleon support JOIN's and what is the best
> > method to display the results? They do not seem to come up in the
> > Query results, so I presume it is with MapTips or LayerAttributes?
> > Has anyone done this before?
> >
> > Regards
> > Jonathon
> >
> > _______________________________________________
> > Chameleon mailing list
> > Chameleon at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/chameleon
> >
>
> +-----------------------------------------------------------------+
> |Paul Spencer pspencer at dmsolutions.ca |
> +-----------------------------------------------------------------+
> |Applications & Software Development |
> |DM Solutions Group Inc http://www.dmsolutions.ca/|
> +-----------------------------------------------------------------+
>
>
>
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
>
More information about the Chameleon
mailing list