[fdo-trac] #767: SqlServer Spatial : Can't use SqlDataReader on Geometry

FDO trac_fdo at osgeo.org
Thu Jun 30 08:30:59 EDT 2011


#767: SqlServer Spatial : Can't use SqlDataReader on Geometry
---------------------------------+------------------------------------------
   Reporter:  bscott             |       Owner:  danstoica
       Type:  defect             |      Status:  new      
   Priority:  blocker            |   Milestone:  3.6.0    
  Component:  SQLServer Spatial  |     Version:  3.6.0    
   Severity:  3                  |    Keywords:           
External_id:                     |  
---------------------------------+------------------------------------------
 SqlDataReader throw an exception if there is a geometry column in the SQL
 statement. Exception : RDBMS(ODBC): Geometry conversion error.
 Explanation:
 When the SqlServer Spatial provider get geometries from SqlServer it
 expect to have wkb Geometry. FeatureReader concatenate the "STAsBinary()"
 function to the geometry column name before sending the query to SqlServer
 but SqlDataReader does not do that.

 My suggestion would be to remove the STAsBinary function from the
 FeatureReader and handle the convertion directly in the
 geom_convertFromSqlServer_S (Geom.c) function. I don't know exactly how to
 do that, maybe there is an internal SqlServer API that can does that for
 us?

 In the mean while i think it would be better if the provider returns null
 Geometry if it can't convert it. Actually it throws an exception and the
 SqlDataReader become useless as soon as the table has a geometry column.

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


More information about the fdo-trac mailing list