How i do Geometry.IsInside(Geometry) ?

Topics: SharpMap v2.0
Sep 14, 2007 at 1:19 PM
I have used one other tool to work with ShapeFiles before but now when i get over to SharpMap i not founding IsInside command that say if the Geometry is inside the Geometry.

Not in the boundingbox only in, i use SharpMap v2.0 and NTS to use Intersects but whant also check if the Geometry is inside the Geometry and not only intersects.

Someone that can help?
Developer
Sep 14, 2007 at 3:09 PM
NTS Geometry.Contains could be useful? geom1.Contains(geom2)
Developer
Sep 14, 2007 at 3:14 PM
Edited Sep 14, 2007 at 8:31 PM
Within is the method you're looking for.

NTS basic method names are OGC/ISO standard, so you can get a good background reading the Simple Features specifications. Also, try the interactive demo of JTS for almost all possible combinations of predicate and analysis functions.

Best regards,
Ricardo Stuven.
Developer
Sep 14, 2007 at 5:04 PM
an implementation detail...
NTS Geometry.Within calls internally Geometry.Contails, so:
geom1.Within(Geom2) means geom2.Contains(Geom1)
Jan 16, 2008 at 8:16 AM


D_Guidi wrote:
an implementation detail...
NTS Geometry.Within calls internally Geometry.Contails, so:
geom1.Within(Geom2) means geom2.Contains(Geom1)

Hi
I use geom1.Within(Geom2) in Sharpmap v0,9 and I sure that Geom1 is inside Geom2,
but it return False.
Please Help Me
Thanks in advance
Developer
Jan 16, 2008 at 8:36 AM

Jula wrote:
I use geom1.Within(Geom2) in Sharpmap v0,9 and I sure that Geom1 is inside Geom2,
but it return False.


SharpMap v.0.9 implements a simplified topology comparison, based on bounding box, so you need to check your geoms using NTS.
You need to use NTSProvider, then convert your geometries in NTS geometries, and then use Contains or IsInside
Jan 23, 2008 at 7:39 AM
What are NTS and NTSProvider? I didn't find them
Coordinator
Jan 23, 2008 at 9:31 AM
Hi Jula, NTS stands for Net Topology Suite and can be found here: http://sourceforge.net/projects/nts . NTSProvider is a sharpmap provider allowing you to use NTS Geometries within sharpmap. Note this is changing in v2 of sharpmap.