Re: [gdal-dev] Getting SRID from MS SQL Server Spatial Table

2013-11-14 Thread Bob Cave
Hi Tamas, It looks like I misunderstood what you were saying. Thank you for the clarification. Cheers, Bob Tamas Szekeres wrote > Bob, > > I did not mention to use exactly the same select, just a similar effect > when reading the geometries. > In > ogrmssqlspatiallayer.cpp

Re: [gdal-dev] Getting SRID from MS SQL Server Spatial Table

2013-11-14 Thread Tamas Szekeres
Bob, I did not mention to use exactly the same select, just a similar effect when reading the geometries. In ogrmssqlspatiallayer.cppsee the function OGRMSSQLSpatialLayer::GetNextRawFeature() nSR

Re: [gdal-dev] Getting SRID from MS SQL Server Spatial Table

2013-11-14 Thread Bob Cave
Hi Tamas, I looked through the source code for the MS SQL Server Spatial driver, version 1.10.1 and in the latest trunk download, and was unable to find that query. Is that something that you have added but not checked in yet? In any case, I will give try that query myself. Thanks. Cheers, Bo

Re: [gdal-dev] Getting SRID from MS SQL Server Spatial Table

2013-11-13 Thread Tamas Szekeres
The driver is doing something like: select top 1 ogr_geometry.STSrid from [mytable] Best regards, Tamas 2013/11/13 Bob Cave > Tamas, > > Thank you for the quick reply. > > My code is reading a table, so I am trying to identify the SRID that was > used when the table was created and the geom

Re: [gdal-dev] Getting SRID from MS SQL Server Spatial Table

2013-11-13 Thread Bob Cave
Tamas, Thank you for the quick reply. My code is reading a table, so I am trying to identify the SRID that was used when the table was created and the geometries were added to the table. How do I query the SRID from the geometry in the table? The MS SQL Server driver does this when it is readin

Re: [gdal-dev] Getting SRID from MS SQL Server Spatial Table

2013-11-13 Thread Tamas Szekeres
Bob, You should specify the SRID as the attribute in the geometries in the database table, which should also set the spatial reference of the layer. Best regards, Tamas 2013/11/13 Bob Cave > Hello, > > I am using the MS SQL Server driver (1.10.1) with > MSSQLSPATIAL_USE_GEOMETRY_COLUMNS=NO.

[gdal-dev] Getting SRID from MS SQL Server Spatial Table

2013-11-13 Thread Bob Cave
Hello, I am using the MS SQL Server driver (1.10.1) with MSSQLSPATIAL_USE_GEOMETRY_COLUMNS=NO. When I attempt to read a table, I find that the driver does not identify the spatial reference the table is using. Is there a way to get the driver to query for the SRID? When I use MSSQLSPATIAL_USE_G