Opened 13 years ago

Closed 12 years ago

#3843 closed defect (fixed)

Join from SHP file to DBF file documentation

Reported by: are Owned by: hobu
Priority: normal Milestone:
Component: Documentation - MapServer Version: 5.6
Severity: normal Keywords: join, CSV
Cc: havatv

Description

The Mapserver Website documentation for joining data from shapefile to DBF is a bit poor (http://mapserver.org/mapfile/join.html). Please find here a working example:

LAYER

NAME "population" TYPE POLYGON STATUS DEFAULT DATA "../data/countries.shp" TEMPLATE '../data/pop.html' CLASS

NAME "pop" STYLE

OUTLINECOLOR 120 120 120 COLOR 255 255 0

END

END JOIN

NAME "pop" CONNECTIONTYPE CSV TABLE "/home/webdev/mapfiles/data/pop.csv" FROM "ISO" # Shapefile attribute TO "2" # CSV join code doesn't use the first row as column names,instead you refer to the columns by number (1, 2, 3, ..., n) TYPE ONE-TO-ONE

END

END # layer

The CSV format should look sth like this:

1,AFG,2176

2,ALA,2600

And the html template "pop.html" should include [pop_1], [pop_2], ... to access joined values.

Regards,

Juan Arevalo

Change History (2)

comment:1 by havatv, 12 years ago

Component: Documentation - mapserver.orgDocumentation - MapServer

comment:2 by havatv, 12 years ago

Cc: havatv added
Resolution: fixed
Status: newclosed

There was a note already. I have made some more changes to the join document to emphasize current behaviour (r13218). Closing.

Will CSV attribute names be handled properly in the future?

Note: See TracTickets for help on using tickets.