'geography' spatial column type not supported in SQL Server 2008
----------------------------------------------------------------

                 Key: GEOT-3155
                 URL: http://jira.codehaus.org/browse/GEOT-3155
             Project: GeoTools
          Issue Type: Bug
          Components: data sqlserver
    Affects Versions: 2.7-M0, 2.6.4
         Environment: SQL Server 2008 (only tested on R2, not sure if it's 
important)
            Reporter: Shaun Forbes


It appears that SQL Server 2008 has two types of spatial columns, geometry and 
geography, but there is no mapping setup for the geography column type in the 
SQL Server dialect so tables with geography columns types are not being noticed 
as containing geometry.

Updating the registerSqlTypeNameToClassMappings method in the SQLServerDialect 
class fixes the problem

    @Override
    public void registerSqlTypeNameToClassMappings(
            Map<String, Class<?>> mappings) {
        super.registerSqlTypeNameToClassMappings(mappings);
        
        
        mappings.put( "geometry", Geometry.class );
        mappings.put( "geography", Geometry.class );

        // also add support nchar and nvarchar
        mappings.put( "nchar", String.class);
        mappings.put( "nvarchar", String.class);
    }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to