|
From: Jody G. <jga...@re...> - 2007-07-26 05:16:22
|
Oh I see ...
Expression bbox = fff.createBBoxExpression( new Envelope(new Coordinate(mapX,mapY)));
This is a very small envelope (the width and height will be zero) - can
you figure out how big a pixel is (actually 3x3 pixles is best) and use
that bounding box to do your query please. That is the approach we use
for selection in uDig.
Jody
Gabriella Turek wrote:
> Jody, I am using the following code:
> mapX and mapY are the map coordinates of the mouse click and "the_geom"
> should be the point in question.
>
> FilterFactory fff = FilterFactoryFinder.createFilterFactory();
> Expression bbox = fff.createBBoxExpression( new Envelope(new
> Coordinate(mapX,mapY)));
> Expression geometry = fff.createAttributeExpression("the_geom");
> GeometryFilter bboxFilter =
> fff.createGeometryFilter(AbstractFilter.GEOMETRY_BBOX);
> bboxFilter.addLeftGeometry(geometry);
> bboxFilter.addRightGeometry(bbox );
> FeatureCollection fc = fs.getFeatures(bboxFilter);
>
> The projection is GD49 / NZ Map Grid. If you want the data file I can
> put it on our ftp server, it's quite large.
> gaby
>
>
|