<font color='black' size='2' face='arial'>
<div>Hi all,</div>

<div><br>
</div>

<div>I'm trying to color polygons based on a value in another dbf file.  The temp.dbf/shp contains my geometries, while the mine.dbf contains the same polygon_id field, as well as a field 'color'. However, the join itself is already failing.<br>
</div>

<div><br>
</div>

<div>Here's what i'm doing:</div>

<div><br>
</div>

<div>C:\DEVELOPMENT&gt;shp2img -m train.map -o test.png -all_debug 5</div>

<div><br>
OGR: OGROpen(C:\DEVELOPMENT/.\data/temp.dbf/033B5A88) succeeded as ESRI Shapefile.<br>
OGR: OGROpen(data/mine.dbf/03DF3EC0) succeeded as ESRI Shapefile.<br>
OGR: ReleaseDataSource(data/mine.dbf/03DF3EC0) dereferenced and now destroying.<br>
msDrawMap(): Image handling error. Failed to draw layer named 'MyJoins'. &lt;br&gt;</div>

<div><br>
msOGRFileOpen(): OGR error. ExecuteSQL(SELECT * FROM temp LEFT JOIN 'data/mine.dbf'.mine ON mine.POLYGON_ID = 'temp.POLYGON_ID' ) failed.<br>
SQL: Unrecognised primary field mine.POLYGON_ID in JOIN clause.. &lt;br&gt;<br>
</div>

<div><br>
</div>

<div><br>
</div>

<div>Here's my OGR section in the mapfile:</div>

<div><br>
</div>

<div>CONNECTIONTYPE OGR<br>
CONNECTION "data/temp.dbf"   <br>
DATA "SELECT * FROM temp LEFT JOIN 'data/mine.dbf'.mine ON mine.POLYGON_ID = 'temp.POLYGON_ID' "<br>
</div>

<div><br>
</div>

<div>I tried all variants with quotes, and also switching the mine.polygonid with the temp.polygonid, but they keep failing.</div>

<div><br>
</div>

<div>I've seen examples on this mailing list and on the web, and as far as I can tell, this is all correct and should work. But perhaps I'm in need of glasses :o)</div>

<div><br>
</div>

<div><br>
</div>

<div>As for version information, I'm using the latest version of MS4W.</div>

<div><br>
</div>

<div>C:\ms4w&gt;ogr2ogr --version<br>
GDAL 1.7.1, released 2010/02/08<br>
</div>

<div><br>
</div>

<div>MapServer version 5.6.3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICO<br>
NV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUP<br>
PORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG SUPPORTS=TILECACHE INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE<br>
</div>

<div><br>
</div>

<div>If i load the shapefiles without the join, everything works ok. So it is safe to assume that the problem does not reside in my shapefiles or my mapfile.</div>

<div><br>
</div>

<div>dbfdump clearly shows the field POLYGON_ID in both dbf files.</div>

<div><br>
</div>

<div>Thanks.</div>
</font>