A bounding box query (matching the area the person clicked) will do.
There is an example in the user guide
http://docs.codehaus.org/display/GEOTDOC/Filter+Examples
Under "What did I click on":
ReferencedEnvelope pixels = new ReferencedEnvelope( x-1,y-1, x+1, y+1,
screenCRS );
MathTransform screen2world= CRS.findMathTransform(screenCRS, dataCRS);
ReferencedEnvelope selected = JTS.transform( pixels, null,
screen2world, 10 );
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2
( GeoTools.getDefaultHints );
Filter filter = ff.bbox( ff.property("THE_GEOM" ), ff.literal
( selected ) );
Jody
On 05/10/2009, at 4:15 PM, dadar wrote:
I need to gain data from an area in my shapefile when i clicked it
does anybody know which function and how can I get the data??
and how can I get the center point (x,y) from a polygon??
Darmawan
--
View this message in context:
http://n2.nabble.com/How-can-I-get-the-data-from-an-area-in-my-shapefile-tp3766988p3766988.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart
your
developing skills, take BlackBerry mobile applications to market and
stay
ahead of the curve. Join us from November 9-12, 2009. Register
now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users