This is another case where reading the javadocs should I hope help?
- http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html

Both contain and within have some funny language about if the linestring touches the "edge" of your polygon.

You may want to try the jts coveredBy as an alternative? (and are you sure you are not trying to test intersects? - ie test if any part of the linestring is inside the polygon?)

Finally if none of the out of the box methods work for you; you can say exactly what you need:
- http://docs.geotools.org/latest/userguide/guide/library/jts/dim9.html

-- 
Jody Garnett

On Thursday, 31 March 2011 at 11:16 PM, mounir younes wrote:

I want to check if a linestring is inside a polygon ! how can I do t that? I tried .contains and .within but both failed !! can someone help me
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users