<div dir="ltr">The driver is doing something like:<div><br></div><div>select top 1 ogr_geometry.STSrid from [mytable]<br></div><div><br></div><div>Best regards,</div><div><br></div><div>Tamas</div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/11/13 Bob Cave <span dir="ltr"><<a href="mailto:bobc@bluemarblegeo.com" target="_blank">bobc@bluemarblegeo.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Tamas,<br>
<br>
Thank you for the quick reply.<br>
<br>
My code is reading a table, so I am trying to identify the SRID that was<br>
used when the table was created and the geometries were added to the table.<br>
How do I query the SRID from the geometry in the table?  The MS SQL Server<br>
driver does this when it is reading the geometry_columns table, but when the<br>
driver is not using the geometry_columns table, it does not attempt to<br>
identify the SRID. I am trying to determine how I can do this myself.<br>
<br>
Thanks,<br>
<br>
Bob<br>
<br>
<br>
Tamas Szekeres wrote<br>
<div class="im">> Bob,<br>
><br>
> You should specify the SRID as the attribute in the geometries in the<br>
> database table, which should also set the spatial reference of the layer.<br>
><br>
> Best regards,<br>
><br>
> Tamas<br>
><br>
><br>
><br>
</div>> 2013/11/13 Bob Cave &lt;<br>
<br>
> bobc@<br>
<br>
> &gt;<br>
<div class="im">><br>
>> Hello,<br>
>><br>
>> I am using the MS SQL Server driver (1.10.1) with<br>
>> MSSQLSPATIAL_USE_GEOMETRY_COLUMNS=NO.  When I attempt to read a table, I<br>
>> find that the driver does not identify the spatial reference the table is<br>
>> using.  Is there a way to get the driver to query for the SRID?<br>
>><br>
>> When I use MSSQLSPATIAL_USE_GEOMETRY_COLUMNS=YES, then the SRID can be<br>
>> identified.  This is fine for my test database, but I need to be able to<br>
>> support databases that don't have a geometry_columns table.<br>
>><br>
>> Thanks,<br>
>><br>
>> Bob<br>
>><br>
>><br>
>><br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://osgeo-org.1560.x6.nabble.com/Getting-SRID-from-MS-SQL-Server-Spatial-Table-tp5089019.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Getting-SRID-from-MS-SQL-Server-Spatial-Table-tp5089019.html</a><br>

>> Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
>> _______________________________________________<br>
>> gdal-dev mailing list<br>
>><br>
<br>
</div>> gdal-dev@.osgeo<br>
<br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
>><br>
><br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
<br>
> gdal-dev@.osgeo<br>
<br>
> <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Getting-SRID-from-MS-SQL-Server-Spatial-Table-tp5089019p5089033.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Getting-SRID-from-MS-SQL-Server-Spatial-Table-tp5089019p5089033.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</div></div></blockquote></div><br></div>