You would do better to go the other way, grab the shape of your suburb and
create a query asking for the buildings that fall within that polygon.
jody
--
Jody Garnett
On 3 February 2015 at 11:59, Gabriella Turek <gabriella.tu...@niwa.co.nz>
wrote:
> Hi all I am currently using CQL to find buildings that fall within a
> suburb as follows"
>
> SimpleFeatureCollection suburbs;
>
> SimpleFeatureCollection fc = buildings.getFeaturesInBoundingBox(null);
> SimpleFeatureIterator it = fc.features();
> try {
>
> while (it.hasNext()) {
>
> SimpleFeature assetShape = it.next();
> Point theGeom = (Point) assetShape.getDefaultGeometry();
> Filter filter = CQL.toFilter("CONTAINS(the_geom, POINT(" + pt.getX() +
> " " + pt.getY() + "))”)
> SimpleFeatureCollection sfc = aggfc.subCollection(filter);
> } finally {
> it.close();
> }
>
>
> I don’t think this is the best way to do this, it seems very slow.
> Additionally, I would like to make it shape agnostic, so it also handles
> more complex shapes. not just points.
> What is the best way to make this generic and faster?
> Thanx
> gaby
>
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users