[Fdo-trac] [fdo-trac] #868: Avoid querying NULL values when determine CRS

FDO trac_fdo at osgeo.org
Thu Jul 18 00:04:35 PDT 2013


#868: Avoid querying NULL values when determine CRS
---------------------------------+------------------------------------------
   Reporter:  gBecker            |       Owner:  danstoica
       Type:  enhancement        |      Status:  new      
   Priority:  minor              |   Milestone:  3.8.0    
  Component:  SQLServer Spatial  |     Version:  3.8.0    
   Severity:  3                  |    Keywords:           
External_id:                     |  
---------------------------------+------------------------------------------
 When determine CRS for a table in SQL Server the provider selects the
 first row and get the SRID of the geometry.

 SELECT TOP 1 [geom].STSrid as srid from [tablename]

 If there is no geometry (=NULL) in the first row then the query return
 NULL and SRID is treated as 0. So when inserting new geometries they have
 the wrong CRS.

 In tables where we already have existing geometries it would be nice when
 we can enhance the query to avoid selecting NULLs:

 SELECT TOP 1 [geom].STSrid as srid from [tablename] WHERE [geom] IS NOT
 NULL

 I suppose there are other places where this has to be changed. For example
 when querying all the spatial indexes to get a list of CRS used in a
 FeatureSource (Autodesk Infrastructure Studio / Maestro)

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/868>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list