true intersection testing errors in POINTS and LINESTRINGS

Topics: Algorithms, Data Access
Mar 27, 2009 at 6:33 PM
Edited Mar 27, 2009 at 6:35 PM
Hi, i am using the function:   

PostFilterExistingFeatureDataTable(FeatureDataTable featureDataTable, SharpMap.Geometries.Geometry testGeometry)

In a shapefile provider to do a true intersection test, it works fine when the compareGeometry is a POLYGON, but when is a LINESTRING or a POINT the intersects is always false, at any zoom.
Any idea why this is happening?

This is my example:

private void MainMap_MouseClick(object sender, MouseEventArgs e)
            SharpMap.Forms.MapImage.Tools tool;
            tool = MainMap.ActiveTool;

            if (tool == SharpMap.Forms.MapImage.Tools.Query)
                SharpMap.Geometries.Point p = MainMap.Map.ImageToWorld(e.Location);
                SharpMap.Data.FeatureDataSet cacheTable = new SharpMap.Data.FeatureDataSet();
                SharpMap.Data.FeatureDataTable data = new SharpMap.Data.FeatureDataTable();
                VectorLayer layer = MainMap.Map.Layers[CapaIdentificar] as SharpMap.Layers.VectorLayer;
                layer.DataSource.ExecuteIntersectionQuery(p.GetBoundingBox(), cacheTable);
                data = cacheTable.Tables[0];
                if (data.Count >= 1)
                    Identificar_query = true;
                    PostFilterExistingFeatureDataTable(data, p);
Mar 28, 2009 at 3:25 PM
Hi Betoens, are all your datasets in the same coordinate reference system? cheers jd
Mar 30, 2009 at 8:16 PM
Hi Johndiss, yes all my datasets are in the same coordinate system (utm Wgs 84). When i do the .ExecuteIntersectionQuery in a POINT or LINESTRING it returns me a datatable with 3 rows for example, which one row is the geometry selected , then enters the post process to remove rows do not truly intersect de test geometry. But it always elimanate all the  pre-populated datable.