[gdal-dev] Re: Joining a shape file with a DBF file with ogr2ogr

Yewondwossen Assefa yassefa at dmsolutions.ca
Thu Apr 30 09:29:50 EDT 2009


Stephen Woodbridge wrote:
> Yewondwossen Assefa wrote:
>> Hi,
>>
>>  I have a fairly large shape file (shp, shx, dbf) and a fairly small 
>> DBF file.  I would like to do a join on a specific field, with the 
>> expected result being a small shape file (same number of records as my 
>> small dbf file).  There are a couple of ways from what I can see that 
>> I could achieve this. one would be:
>>    - do a LEFT JOIN with the small dbf. This would result in creating 
>> a big shape file (+ attributes from the small dbf). I could then do 
>> another ogr2ogr and trim the data based on empty records.
>>  Although this works well, It is a bit slow for my needs (even if both 
>> DBFs are indexed).
>>
>>   Could some one suggest a better way of achieving this?
>>
>> Thanks
>>
> 
> How about using postGIS?
> Yeah, I know this is the gdal list, but hey ... I'm just saying!
> 
> -Steve
> 
Hi Steve,

   Thanks. In this particular case though, I am limited by the project 
to use shape files so I was just wondering if there were other tricks 
that could make this operation faster.

Best Regards,

-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the gdal-dev mailing list