[gdal-dev] RE [Polluriel potentiel] Re: ogr ODBC problem

2012-05-31 Thread Steve . Toutant
Thanks Brent for your answer.

But view's primary key?
I'm missing something here...What do you mean by that? Do you mean a 
column with a unique id in the view?
There is no such column in my view. Is ogr now needs a unique id in a 
view? Because it was working before I migrate to linux with a recent 
vertsion of gdal.

Also, My problem is before using CONNECTIONTYPE OGR
CONNECTION "

A simple ogrinfo like this
ODBC:username/password@WebMapDSN,v_MyPoints

Gives me the error OGR_ODBC: Table ?s???s!.? has no identified FID 
column. 

Thanks in advance
Steve






Brent Fraser  
2012-05-31 10:49

A
steve.tout...@inspq.qc.ca
cc
gdal-dev@lists.osgeo.org
Objet
[Polluriel potentiel]  Re: [gdal-dev] ogr ODBC problem








Steve,

  Here's a snippet from a MapServer map file I used to access a 
non-spatial MS SQL server via OGR+VRT+ODBC:

TYPE POINT
CONNECTIONTYPE OGR
CONNECTION "

 
ODBC:username/password@WebMapDSN,v_MyPoints
   
SELECT * FROM  v_MyPoints 
WHERE  PropertyID=%PropertyID%

PointID
wkbPoint

NAD83

"

PROCESSING "CLOSE_CONNECTION=DEFER"

DATA "v_MyPoints"

In my case I was able to use the view's primary key as the FID.  Hope this 
helps...
Best Regards,
Brent Fraser

On 5/31/2012 7:48 AM, steve.tout...@inspq.qc.ca wrote: 

Thanks Jeff 
I got now OGR_ODBC: Table ?s???s!.? has no identified FID column. 

I found that several users had this problem but found no solution. I don't 
have write access to this MSSQL server. 

I'm connecting via ODBC to a non spatial table, but it contains latitude 
and longitude information. I will use it to define a OGRVRTDataSource and 
create geometry from point. 

Any clue on what I can do? 
thanks 
steve 




Jeff McKenna @lists.osgeo.org 
Envoyé par : gdal-dev-boun...@lists.osgeo.org 
2012-05-30 17:06 


A
gdal-dev@lists.osgeo.org 
cc

Objet
Re: [gdal-dev] ogr ODBC problem










On 12-05-30 5:09 PM, steve.tout...@inspq.qc.ca wrote:
> 
> Hi!
> I use this command to get the tables from an ODBC connection
> ogrinfo ODBC:User/Pwd@DNS
> 
> The connection is succesful but I get this error several times
> ERROR 1: No column definitions found for table '?s???s!.???',
> layer not usable.
> 
> I used OGR ODBC for several months from a Windows server to a MSSQL 
server
> Now I'm migrating to linux and accessing the same MSSQL SERVER and I get
> this error.
> 
> Note that if I connect with isql, I can connect and query the database
> without problem.
> So the problem really seems to be with OGR
> 
> What can cause this No column definitions found for table error
> And why the table name looks like this  '?s???s!.???',

Hi Steve,

I was just debugging an ogrinfo command for MS4W/Oracle, and was
reminded of the trick to show more debug info at the commandline:

  set CPL_DEBUG=on

I'm going to keep that one in my back pocket from now on.

-jeff




-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev 




___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] RE [Polluriel potentiel] Re: ogr ODBC problem

2012-05-31 Thread Brent Fraser

Steve,

  In my case I was getting OGR to get data from a database view, but it 
could have been a table.  I think OGR needs (would like?) to know which 
column it can use for unque id.  I would expect your view (or table) 
would have a unique key column otherwise relation operations (like 
joins) can be a problem (the db admin should be able to tell you).


Perhaps the ODBC system on Linux doesn't give OGR enough info about the 
columns to automatically identify the Primary Key column.  If you are 
testing with ogrinfo you could user the "-fid" option after you've 
identified the Primary Key column?


Best Regards,
Brent Fraser


On 5/31/2012 10:11 AM, steve.tout...@inspq.qc.ca wrote:


Thanks Brent for your answer.

But view's primary key?
I'm missing something here...What do you mean by that? Do you mean a 
column with a unique id in the view?
There is no such column in my view. Is ogr now needs a unique id in a 
view? Because it was working before I migrate to linux with a recent 
vertsion of gdal.


Also, My problem is before using CONNECTIONTYPE OGR
   CONNECTION "

A simple ogrinfo like this
ODBC:username/password@WebMapDSN,v_MyPoints

Gives me the error OGR_ODBC: Table ?s???s!.? has no identified 
FID column.


Thanks in advance
Steve





*Brent Fraser *

2012-05-31 10:49


A
steve.tout...@inspq.qc.ca
cc
gdal-dev@lists.osgeo.org
Objet
[Polluriel potentiel]  Re: [gdal-dev] ogr ODBC problem











Steve,

 Here's a snippet from a MapServer map file I used to access a 
non-spatial MS SQL server via OGR+VRT+ODBC:


   TYPE POINT
   CONNECTIONTYPE OGR
   CONNECTION "

ODBC:username/password@WebMapDSN,v_MyPoints

   SELECT * FROM  v_MyPoints
   WHERE  PropertyID=%PropertyID%

*PointID*
wkbPoint
 x='SurfaceLongitude'/>

NAD83

"

   PROCESSING "CLOSE_CONNECTION=DEFER"

   DATA "v_MyPoints"

In my case I was able to use the view's primary key as the FID.  Hope 
this helps...

Best Regards,
Brent Fraser

On 5/31/2012 7:48 AM, _steve.tout...@inspq.qc.ca_ 
wrote:


Thanks Jeff
I got now OGR_ODBC: Table ?s???s!.? has no identified FID column.

I found that several users had this problem but found no solution. I 
don't have write access to this MSSQL server.


I'm connecting via ODBC to a non spatial table, but it contains 
latitude and longitude information. I will use it to define a 
OGRVRTDataSourceand create geometry from point.


Any clue on what I can do?
thanks
steve



*Jeff McKenna **__* 
*@lists.osgeo.org*
Envoyé par : _gdal-dev-bounces@lists.osgeo.org_ 



2012-05-30 17:06


A
_gdal-dev@lists.osgeo.org_ 
cc

Objet
Re: [gdal-dev] ogr ODBC problem













On 12-05-30 5:09 PM, _steve.tout...@inspq.qc.ca_ 
wrote:

>
> Hi!
> I use this command to get the tables from an ODBC connection
> ogrinfo ODBC:User/Pwd@DNS
>
> The connection is succesful but I get this error several times
> ERROR 1: No column definitions found for table '?s???s!.???',
> layer not usable.
>
> I used OGR ODBC for several months from a Windows server to a MSSQL 
server

> Now I'm migrating to linux and accessing the same MSSQL SERVER and I get
> this error.
>
> Note that if I connect with isql, I can connect and query the database
> without problem.
> So the problem really seems to be with OGR
>
> What can cause this No column definitions found for table error
> And why the table name looks like this  '?s???s!.???',

Hi Steve,

I was just debugging an ogrinfo command for MS4W/Oracle, and was
reminded of the trick to show more debug info at the commandline:

 set CPL_DEBUG=on

I'm going to keep that one in my back pocket from now on.

-jeff




--
Jeff McKenna
MapServer Consulting and Training Services_
__http://www.gatewaygeomatics.com/_


___
gdal-dev mailing list_
__gdal-dev@lists.osgeo.org_ _
__http://lists.osgeo.org/mailman/listinfo/gdal-dev_



___
gdal-dev mailing list
_gdal-dev@lists.osgeo.org_ 
_http://lists.osgeo.org/mailman/listinfo/gdal-dev_


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] RE [Polluriel potentiel] Re: ogr ODBC problem [SOLVED]

2012-05-31 Thread Steve . Toutant
for ogrinfo we were using, as explained here, 
http://mapserver.org/input/vector/VirtualSpatialData.html#steps-for-display
ogrinfo ODBC:User/Pwd@mssql__archives msStatut_station2002_2006
That was working on windows
Though, That doesn't work on our linux distro linux sles 11 sp1. It as to 
be (comma instead of space)
ogrinfo ODBC:User/Pwd@mssql__archives,msStatut_station2002_2006
But, For some reasons, this still doesn't work to get the list of tables 
on our linux distro
ogrinfo ODBC:User/Pwd@mssql__archives
But it is useless in my case.

Also, our virtual data file looks like this on windows


ODBC:User/Pwd@mssql__archives 
dbo.msStatut_station2002_2006 
wkbPoint 
WGS84
 



That is working on windows

For our distro linux We need to add the table name
ODBC:User/Pwd@mssql__archives,msStatut_station2002_2006
 


Perhaps it is not a windows vs linux issue but an OGR version issue.
Thanks for your help
Steve




Brent Fraser  
2012-05-31 10:49

A
steve.tout...@inspq.qc.ca
cc
gdal-dev@lists.osgeo.org
Objet
[Polluriel potentiel]  Re: [gdal-dev] ogr ODBC problem








Steve,

  Here's a snippet from a MapServer map file I used to access a 
non-spatial MS SQL server via OGR+VRT+ODBC:

TYPE POINT
CONNECTIONTYPE OGR
CONNECTION "

 
ODBC:username/password@WebMapDSN,v_MyPoints
   
SELECT * FROM  v_MyPoints 
WHERE  PropertyID=%PropertyID%

PointID
wkbPoint

NAD83

"

PROCESSING "CLOSE_CONNECTION=DEFER"

DATA "v_MyPoints"

In my case I was able to use the view's primary key as the FID.  Hope this 
helps...
Best Regards,
Brent Fraser

On 5/31/2012 7:48 AM, steve.tout...@inspq.qc.ca wrote: 

Thanks Jeff 
I got now OGR_ODBC: Table ?s???s!.? has no identified FID column. 

I found that several users had this problem but found no solution. I don't 
have write access to this MSSQL server. 

I'm connecting via ODBC to a non spatial table, but it contains latitude 
and longitude information. I will use it to define a OGRVRTDataSource and 
create geometry from point. 

Any clue on what I can do? 
thanks 
steve 




Jeff McKenna @lists.osgeo.org 
Envoyé par : gdal-dev-boun...@lists.osgeo.org 
2012-05-30 17:06 


A
gdal-dev@lists.osgeo.org 
cc

Objet
Re: [gdal-dev] ogr ODBC problem










On 12-05-30 5:09 PM, steve.tout...@inspq.qc.ca wrote:
> 
> Hi!
> I use this command to get the tables from an ODBC connection
> ogrinfo ODBC:User/Pwd@DNS
> 
> The connection is succesful but I get this error several times
> ERROR 1: No column definitions found for table '?s???s!.???',
> layer not usable.
> 
> I used OGR ODBC for several months from a Windows server to a MSSQL 
server
> Now I'm migrating to linux and accessing the same MSSQL SERVER and I get
> this error.
> 
> Note that if I connect with isql, I can connect and query the database
> without problem.
> So the problem really seems to be with OGR
> 
> What can cause this No column definitions found for table error
> And why the table name looks like this  '?s???s!.???',

Hi Steve,

I was just debugging an ogrinfo command for MS4W/Oracle, and was
reminded of the trick to show more debug info at the commandline:

  set CPL_DEBUG=on

I'm going to keep that one in my back pocket from now on.

-jeff




-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev 




___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] RE [Polluriel potentiel] Re: ogr ODBC problem [SOLVED]

2012-05-31 Thread Brent Fraser

Steve,

That's good news.

  I did run into the "spaces" problems on Windows (I had a space 
between the comma and the table name).  It caused the connection to fail.


Best Regards,
Brent Fraser


On 5/31/2012 12:14 PM, steve.tout...@inspq.qc.ca wrote:


for ogrinfo we were using, as explained here, 
http://mapserver.org/input/vector/VirtualSpatialData.html#steps-for-display

ogrinfo ODBC:User/Pwd@mssql__archives msStatut_station2002_2006
That was working on windows

Though, That doesn't work on our linux distro linux sles 11 sp1. It as 
to be (comma instead of space)

ogrinfo ODBC:User/Pwd@mssql__archives,msStatut_station2002_2006

But, For some reasons, this still doesn't work to get the list of 
tables on our linux distro

ogrinfo ODBC:User/Pwd@mssql__archives
But it is useless in my case.

Also, our virtual data file looks like this on windows


ODBC:User/Pwd@mssql__archives
dbo.msStatut_station2002_2006
wkbPoint
WGS84




That is working on windows

For our distro linux We need to add the table name
ODBC:User/Pwd@mssql__archives,msStatut_station2002_2006 



Perhaps it is not a windows vs linux issue but an OGR version issue.
Thanks for your help
Steve




*Brent Fraser *

2012-05-31 10:49


A
steve.tout...@inspq.qc.ca
cc
gdal-dev@lists.osgeo.org
Objet
[Polluriel potentiel]  Re: [gdal-dev] ogr ODBC problem











Steve,

 Here's a snippet from a MapServer map file I used to access a 
non-spatial MS SQL server via OGR+VRT+ODBC:


   TYPE POINT
   CONNECTIONTYPE OGR
   CONNECTION "

ODBC:username/password@WebMapDSN,v_MyPoints

   SELECT * FROM  v_MyPoints
   WHERE  PropertyID=%PropertyID%

*PointID*
wkbPoint
 x='SurfaceLongitude'/>

NAD83

"

   PROCESSING "CLOSE_CONNECTION=DEFER"

   DATA "v_MyPoints"

In my case I was able to use the view's primary key as the FID.  Hope 
this helps...

Best Regards,
Brent Fraser

On 5/31/2012 7:48 AM, _steve.tout...@inspq.qc.ca_ 
wrote:


Thanks Jeff
I got now OGR_ODBC: Table ?s???s!.? has no identified FID column.

I found that several users had this problem but found no solution. I 
don't have write access to this MSSQL server.


I'm connecting via ODBC to a non spatial table, but it contains 
latitude and longitude information. I will use it to define a 
OGRVRTDataSourceand create geometry from point.


Any clue on what I can do?
thanks
steve



*Jeff McKenna **__* 
*@lists.osgeo.org*
Envoyé par : _gdal-dev-bounces@lists.osgeo.org_ 



2012-05-30 17:06


A
_gdal-dev@lists.osgeo.org_ 
cc

Objet
Re: [gdal-dev] ogr ODBC problem













On 12-05-30 5:09 PM, _steve.tout...@inspq.qc.ca_ 
wrote:

>
> Hi!
> I use this command to get the tables from an ODBC connection
> ogrinfo ODBC:User/Pwd@DNS
>
> The connection is succesful but I get this error several times
> ERROR 1: No column definitions found for table '?s???s!.???',
> layer not usable.
>
> I used OGR ODBC for several months from a Windows server to a MSSQL 
server

> Now I'm migrating to linux and accessing the same MSSQL SERVER and I get
> this error.
>
> Note that if I connect with isql, I can connect and query the database
> without problem.
> So the problem really seems to be with OGR
>
> What can cause this No column definitions found for table error
> And why the table name looks like this  '?s???s!.???',

Hi Steve,

I was just debugging an ogrinfo command for MS4W/Oracle, and was
reminded of the trick to show more debug info at the commandline:

 set CPL_DEBUG=on

I'm going to keep that one in my back pocket from now on.

-jeff




--
Jeff McKenna
MapServer Consulting and Training Services_
__http://www.gatewaygeomatics.com/_


___
gdal-dev mailing list_
__gdal-dev@lists.osgeo.org_ _
__http://lists.osgeo.org/mailman/listinfo/gdal-dev_



___
gdal-dev mailing list
_gdal-dev@lists.osgeo.org_ 
_http://lists.osgeo.org/mailman/listinfo/gdal-dev_


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev