OGR join between shapefile and DBF
Frank Warmerdam
warmerdam at POBOX.COM
Mon Aug 27 07:12:20 PDT 2007
Gambin Dejan wrote:
> Hi,
>
> I have read Frank's post on this subject. I am interested if there is a
> way to use relative paths in defining joins between shapefile and DBF.
>
> In my case, I have many layers using this join and suddenly they stopped
> working. Since now they worked in following way:
> ...
> CONNECTIONTYPE OGR
> CONNECTION "/var/www/demodata" //path to folder where the shapefile
> resides
> DATA "SELECT a.ID, b.NAME FROM a LEFT JOIN b ON a.ID=b.ID" //b is table
> in b.dbf
> ...
>
> But it stopped working after I changed the mapserver and p.mapper
> version. Now the only way it works is the following:
>
> ...
> CONNECTIONTYPE OGR
> CONNECTION "/var/www/demodata/a.shp" //path to the shapefile
> DATA "SELECT a.ID, b.NAME FROM a LEFT JOIN '/var/www/demodata/b.dbf'.b
> ON a.ID=b.ID"
> ...
>
> Why is that? Is there a way I don't have to enter all the full paths
> here?
Dejan,
It is not obvious to me why the behavior changed, but it is presumably
a change in the OGR Shapefile driver, not MapServer. Perhaps you could
switch to private email and let me know what "ogrinfo /var/www/demodata"
reports. The key is whether the "b" layer representing the dbf shows up
in this list or not.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo, http://osgeo.org
More information about the MapServer-users
mailing list