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

Bob Cave bobc at bluemarblegeo.com
Wed Nov 13 13:40:50 PST 2013


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 reading the geometry_columns table, but when the
driver is not using the geometry_columns table, it does not attempt to
identify the SRID. I am trying to determine how I can do this myself.

Thanks,

Bob


Tamas Szekeres wrote
> 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 <

> bobc@

> >
> 
>> 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_GEOMETRY_COLUMNS=YES, then the SRID can be
>> identified.  This is fine for my test database, but I need to be able to
>> support databases that don't have a geometry_columns table.
>>
>> Thanks,
>>
>> Bob
>>
>>
>>
>> --
>> View this message in context:
>> http://osgeo-org.1560.x6.nabble.com/Getting-SRID-from-MS-SQL-Server-Spatial-Table-tp5089019.html
>> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>> _______________________________________________
>> gdal-dev mailing list
>> 

> gdal-dev at .osgeo

>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
> 
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> http://lists.osgeo.org/mailman/listinfo/gdal-dev





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Getting-SRID-from-MS-SQL-Server-Spatial-Table-tp5089019p5089033.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list