[Geoserver-devel] geoserver datastore...

Hi,

I'm trying to implement a new DataStore for Geoserver. When I start to
look at example of DataStore: gt-property project (Reading data from
Java properties files) I notice that on each request all data are read
from particular layer (because hasNext() and next() has no information
about BBOX) and my question is:

Is there a possible to pass BBOX from request to DataStore to avoid
unnecessary iteration over all data in DataStore?

Regards,

Rafal O.

Hi,

I have found answer, and I would like to share with you

It is only need to override getFeatureReader( String typeName, Query
query) from AbstractDataStore (you may do it in gt-property GeoTools
project in PropertyDataStore class)
and just add:

   Filter filter = query.getFilter();
      if (filter instanceof org.geotools.renderer.lite.FastBBOX) {
         FastBBOX filterBBox = (FastBBOX)filter;
         ...
      }

of course it is need to change FastBBOX visibility to public
and after this you can:
filterBBox.getMinX();
filterBBox.getMaxX();
filterBBox.getMinY();
filterBBox.getMaxY();

Is there a way to do this without changing FastBBOX class?

Regards,

Rafal O.

2010/2/8 RafaƂ Otwinowski <rafal.otwinowski@anonymised.com>:

Hi,

I'm trying to implement a new DataStore for Geoserver. When I start to
look at example of DataStore: gt-property project (Reading data from
Java properties files) I notice that on each request all data are read
from particular layer (because hasNext() and next() has no information
about BBOX) and my question is:

Is there a possible to pass BBOX from request to DataStore to avoid
unnecessary iteration over all data in DataStore?

Regards,

Rafal O.

I know this is an old thread but I just stumble upon this exact situation.

Instead of :

Filter filter = query.getFilter();
      if (filter instanceof org.geotools.renderer.lite.FastBBOX) {
         FastBBOX filterBBox = (FastBBOX)filter;

You can cast directly to :

(org.opengis.filter.spatial.BBOX) filter

which has .getMaxX, .getMaxY, etc ...

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html