Hi Kevin, Kevin Neufeld wrote: > Hi all, > > I'm trying to add basic indexing support for the SQLServer jdbc project. > > Currently queries that hit the database always perform full table scans and > are of the form: > > SELECT "ID",CAST("geom".STSrid as VARCHAR) + ':' + "geom".STAsText() as "geom" > FROM "Roads" > > It obviously needs a WHERE filter added to make use of any server-side > indexing support, something like: > > WHERE geom.Filter(geometry::Parse( > 'POLYGON ((5 5, 10 5, 10 10, 5 5))')) = 1; > > Can anyone point me in the right direction? > > It looks like the main class (org.geotools.data.sqlserver.SQLServerDialect) > extends BasicSQLDialect. I'm assuming I > need to override "public FilterToSQL createFilterToSQL()" and return a new > class SQLServerFilterToSQL that extends > FilterToSQL. .. But this method never seems to get called.
Yup, that is the basic approach. In your subclass you need to also declare that it can handle spatial filters. See OracleFilterToSQL for an example of this. You also need to extend the visitBinarySpatialOperator() method to actual do the encoding. Again see oracle for a template. As for the createFilterToSQL() method not getting called on the dialect... not sure about that one. What is the case you running and not seeing it called? A simple query against the datastore? Hope that helps. I look forward to your patch :) -Justin > > Ideas? > > Cheers, > Kevin > > ------------------------------------------------------------------------------ > Are you an open source citizen? Join us for the Open Source Bridge conference! > Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. > Need another reason to go? 24-hour hacker lounge. Register today! > http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org > _______________________________________________ > Geotools-devel mailing list > Geotools-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-devel -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. ------------------------------------------------------------------------------ Are you an open source citizen? Join us for the Open Source Bridge conference! Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel