From: Chris H. <ch...@op...> - 2003-04-29 21:39:31
|
I'm looking to improve the PostgisDataSource, and since it looks like FeatureCollections are here to stay, I'd like to start using the Extent of the FeatureCollection for the bounding box of my return feature feature collections. I have been just hacking it out when printing, but that's obviously not ideal. I'd like to set the extent when the featurecollection is made in PostgisDataSource. But looking at the code has lead me to a few questions. 1. Why is EnvelopeExtent in core? It implements org.geotools.data.Extent, and lives in core/src/org/geotools/datasource/extents. It has code, so it seems like it should go in defaultcore. Should I change this? Or is it going away with the new geoapi interfaces? 2. Is a setExtent method really appropriate in the FeatureCollection interface? It seems to me that there could be a featureCollection implementation that figures out its own extent as new features are added. I guess the drawback is that it would be computationally more expensive, but it does make the datasource set the extent by default. Perhaps there should be some way to control this behaviour, if the DataSource implementor knows that he can figure out the extent faster than just looking at the features as they are added. Of course, if he knows how to make the extent query faster, he's probably already providing his own FeatureCollection implementation with a customized iterator, so he wouldn't be using the FeatureCollectionDefault anyways. 3. Is the getBbox(boolean speed) useful at all? What datasources have cases where there is a fast way and a slow way to figure out the bbox? 4. I think a getBbox(Filter filter) method could be more useful than just getBbox(). For example, if I'm going to set the extent of the feature collection I'm returning in postgis, I could just call getBbox(filter) with the filter that was passed into the getFeature method. I guess it doesn't really matter, as I can just have a private method, and the public one that takes no filter can just call the private one with a null filter. But it seems like that would be more useful. Ok, that's all for now, but I'm probably going to have more questions, as I'm figuring out all that I need to do to get shapefile support into geoserver. Chris |