[mapserver-users] OGR shapefile w/MySQL Join

Greg Luker gluker at scu.edu.au
Thu Sep 3 02:15:09 EDT 2009


Hi mapservers,

At 12:47 AM 3/09/2009, Steve Lime wrote:
>Hi all: Anyone have a sample configuration for creating an OGR layer 
>joined to a MySQL table? The
>MySQL table has no spatial component. I believe it's possible but 
>haven't stumbled upon a concrete
>example showing how. Figured better just to ask... Thanks.

I'd be really interested to see how you get this to work, Steve. I 
cannot get the JOIN command to work, even on a simple csv file.

Here's what I have tried:
         LAYER
                 NAME "squares"
                 TYPE POLYGON
                 STATUS ON
                 DATA "squares"
                 CLASS
                         ...
                 END
                 TOLERANCE 20
                 TEMPLATE "testm_template.html"
                 HEADER "testm_header.html"
                 FOOTER "testm_footer.html"
                 JOIN
                         NAME "jointest"
                         TABLE "testm.csv"
                         FROM "IDENT"
                         TO "id"
                 END
         END #of layer

testm.csv is in the same directory as the mapfile. The shapefile 
(squares) shows up fine, but querying it gives this message:

Status: 302 Found Uri: http://.../errors/errors.html Location: 
http://.../errors/errors.html Content-type: text/html

and this debug message:

[Thu Sep  3 15:37:43 2009].493754 msDBFJoinConnect(): Unable to 
access file. (testm.csv)

Commenting out the JOIN lines gives correct expected results, so I 
assume everything else is in the right place (including template 
files). I've tried a few variations of "testm.csv" - like 
"'testm.csv'" and "/full/pathname/to/testm.csv" but still no luck. I 
tried JOINing a shape to an OGR MySQL table, but that didn't work, 
which is why I dropped back to testing with a simple csv JOIN.

Any ideas?

Thanks,
Greg.


Greg Luker
GIS Lab Manager, Southern Cross University
Lismore, AUSTRALIA.
gluker at scu.edu.au
phone 61 2 66203026





More information about the mapserver-users mailing list