This is another case where reading the javadocs should I hope help?

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:

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.
Geotools-gt2-users mailing list