[FWTools] ogr2ogr for extracting non-spatial data from ODBC datasource
Simon O'Keefe
simon.okeefe at groundtruth.com.au
Mon Sep 7 05:27:57 EST 2009
Hi,
Thanks to Richard for his encouragement. I've now got ogr2ogr to
successfully extract data from a non-spatial ODBC datasource into a
CSV file. I managed to get it to work on an MS SQL Server datasource,
but I didn't end up figuring out why the Oracle one I mentioned in the
first email wasn't working (I now longer have access to that client's
database).
Here's the syntax I used at my most recent client site (this one did
not require a password):
ogr2ogr -f CSV C:\Temp\Property -overwrite ODBC:Property at Property,Parcel
So it's similar to the example in the ODBC RDBMS documentation, but
simply without the brackets for specifying a geometry column.
I hope this helps other dummies like me.
Cheers,
Simon
2009/9/4 Richard Greenwood <richard.greenwood at gmail.com>:
>
>
> On Thu, Sep 3, 2009 at 7:58 PM, Simon O'Keefe
> <simon.okeefe at groundtruth.com.au> wrote:
>>
>> Hi,
>>
>> I'm attempting to use ogr2ogr to extract data from a non-spatial
>> Oracle database and output to a CSV file.
>>
>> When I enter:
>> ogr2ogr -f CSV C:\Temp\CGData
>> ODBC:gissvr/gis123 at pth_prod,gissvr.COMMONGROUND_ADDRESS
>>
>> I get:
>> ERROR 1: No column definitions found for table
>> 'gissvr.COMMONGROUND_ADDRESS', layer not usable.
>>
>> I'm trying to follow the syntax example on the ODBC RDBMS page
>> (http://www.gdal.org/ogr/drv_odbc.html), but it says I need to put the
>> name of a geometry column in brackets after the table name. How can I
>> get ogr2ogr to recognise the data source as a non-spatial table (ie,
>> no geometry column)?
>
> I use ogr2ogr on non-spatial database w/o taking any special steps to
> identify them as non-spatial. Your syntax looks generally correct to me. The
> error "No column definitions found" is pretty general. I'd try using ogrinfo
> to test the ODBC connection. Try leaving off the schema name, try defining
> the user/pwd in the ODBC connection, etc.
>
> Soory not to offer any more specific advise, but ogr2ogr is an awesome tool
> for non-spatial data conversion and transfer, so it's worth the effort to
> get it figured out.
>
> Rich
>
> --
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
>
More information about the FWTools
mailing list