Hi Jody, thanks for your answers. I really appreciate it!
"Question - why do you need to know the number of features? You were not
planning on putting them into an array were you?"
No, I want to know the # of features so that I can display a progress
bar to the user while I am iterating through them all and doing some
processing. Obviously if I have to iterate through them first, this
sort of defeats the purpose of the progress bar.
"FeatureCollection collection = fs.getFeatures();
I'll try this out, thanks.
> I've been able to get at the bounding box by instantiating a
> FeatureSource through the following declaration:
> org.geotools.data.FeatureSource fs = wfs.getView(query);
> com.vividsolutions.jts.geom.Envelope env = fs.getBounds(query);
"Yep that is about right - those methods return an optimized answer
I'm having a problem with my bounding box though. I can successfully
get the bounds using the above code, however these bounds are off by
quite a bit. I posted this question to the GeoServer list, but maybe
you know why I am getting the incorrect bounds. There seems to be 2
different BBoxes returned to me depending on the type of WFS query I
am making. One is correct and the other is the one the above code
returns. Here is the examples I posted to the GeoServer list.
I was wondering if anyone might know why my boundingboxes differ for
the following 2 WFS requests:
<Abstract>Generated from localPostgis</Abstract>
<LatLongBoundingBox minx="-2.18033504486084" miny="44.5143013000488"
<gml:coordinates decimal="." cs="," ts=" ">-3.03163004,51.38572693
Any ideas would be greatly appreciated. I'm attempting to
programmatically get my BB using GeoTools on the client side and the
BB I am able to get is the incorrect one in the 2nd example above.