OGR join between shapefile and DBF

Delfos, Jacob jacob.delfos at MAUNSELL.COM
Mon Dec 19 19:39:59 PST 2005


Hi List,

I need to do a join between a shapefile and a DBF. I have checked my syntax thoroughly against http://www.remotesensing.org/gdal/ogr/ogr_sql.html, but I must be missing something simple....

My syntax is:

 CONNECTIONTYPE OGR
 CONNECTION "c:/data/allGP_MGA94.shp"
 DATA "SELECT a.*,b.* FROM allGP_MGA94 a LEFT JOIN 'c:/data/descr.dbf' b ON a.CODE=b.CODE"


I have tried with/without full path to DBF (since directory is the same as the shapefile). With/without station prefix, and many more variations. I keep getting this PHP error:


[20-Dec-2005 11:30:36] PHP Warning:  [MapServer Error]: msOGRFileOpen(): ExecuteSQL(SELECT a.CODE,b.CODE FROM allGP_MGA94 a LEFT JOIN 'c:/data/descr.dbf' b ON a.CODE=b.CODE) failed.
SELECT from table c:/data/descr.dbf failed, no such table/featureclass.
 in C:\chameleon\htdocs\common\wrapper\drawmap.php on line 560

But the file is there. Can anyone see anything obvious?

Thanks in advance,

Jacob



JACOB DELFOS
GIS ANALYST
Maunsell Australia Pty Ltd
629 Newcastle Street, Leederville, WA 6007
PO Box 81, Leederville, WA 6902
Western Australia
ABN 20 093 846 925

Tel     + 61 8 9281 6185
Fax    + 61 8 9281 6297
jacob.delfos at maunsell.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051220/b4db8863/attachment.htm>


More information about the MapServer-users mailing list