ogr2ogr for extracting non-spatial data from ODBC datasource

View: New views
3 Messages — Rating Filter:   Alert me  

ogr2ogr for extracting non-spatial data from ODBC datasource

by Simon O'Keefe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@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'm running FWTools 2.4.3 on Windows XP Pro SP3

Cheers,

Simon
_______________________________________
Simon O'Keefe
Geospatial Systems Developer
Groundtruth Mapping Systems
Level 2, 140 Queen Street
Melbourne VIC 3000 Australia
mobile: +61 409 413 890
office: +61 3 9017 6850
email:  simon.okeefe@...
web:    http://www.groundtruth.com.au
_______________________________________
_______________________________________________
FWTools mailing list
FWTools@...
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/

Re: ogr2ogr for extracting non-spatial data from ODBC datasource

by Richard Greenwood :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Thu, Sep 3, 2009 at 7:58 PM, Simon O'Keefe <simon.okeefe@...> 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@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@...
www.greenwoodmap.com

_______________________________________________
FWTools mailing list
FWTools@...
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/

Re: ogr2ogr for extracting non-spatial data from ODBC datasource

by Simon O'Keefe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@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@...>:

>
>
> On Thu, Sep 3, 2009 at 7:58 PM, Simon O'Keefe
> <simon.okeefe@...> 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@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@...
> www.greenwoodmap.com
>
_______________________________________________
FWTools mailing list
FWTools@...
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/