I have this code where an IGeometry shape (4-5 circles not filled) should be intersected with another layer's features

                // Convert from IGeometry to ADF Geometry Polygon
                ESRI.ArcGIS.Geometry.IPointCollection com_pointcollection =
                ESRI.ArcGIS.ADF.Web.Geometry.Point[] new_adf_points =
                ESRI.ArcGIS.ADF.Web.Geometry.PointCollection new_adf_pointcollection = new
                for (int i = 0; i < new_adf_points.Length - 1; i++)

                ESRI.ArcGIS.ADF.Web.Geometry.Ring new_adf_path = new
                new_adf_path.Points = new_adf_pointcollection;
                ESRI.ArcGIS.ADF.Web.Geometry.RingCollection new_adf_pathcollection = new
                ESRI.ArcGIS.ADF.Web.Geometry.Polygon new_adf_polygon = new
                new_adf_polygon.Rings = new_adf_pathcollection;

                // Now get the intersect query

                ESRI.ArcGIS.ADF.Web.SpatialFilter spatialFilter =
                    new ESRI.ArcGIS.ADF.Web.SpatialFilter();
                spatialFilter.Geometry = new_adf_polygon;
                spatialFilter.ReturnADFGeometries = false;
                spatialFilter.MaxRecords = 10000;

                System.Data.DataSet queryResultsDataSet = new System.Data.DataSet();
                for (int index = 0; index < layerIDs.Length; index++)
                    System.Data.DataTable queryResultsDataTable =
                  queryFunctionality.Query(queryFunctionalityq.Name, ConvertFromLayerNameToLayerId(m_Map, m_ResourceMapItem, m_firstLayerName), spatialFilter);
                    queryResultsDataTable.TableName = gisResource.Name + "_" + layerNames[index];

I'm converting the IGeometry (which I've drawn on the screen and I know it's correct) to a web ADF Polygon and then using this polygon for an intersection query

However some features which are clearly not intersecting the circles' borders are being included in the result

To better explain the situation I did this screenshot:

enter image description here

Why is that? The red squared features are all different so it's not a problem of "same feature"

Update: with less features it's the same, if they intersect the circle line they get colored, but the others get colored too.. simply adding them seems like telling the system "I'm intersected too"

  • How does this question differ from your preceeding one at gis.stackexchange.com/questions/13456/…? – whuber Aug 12 '11 at 19:01
  • Totally, the problem is different and I've solved the one before. – Marco A. Aug 13 '11 at 10:54
  • 1
    I asked the question because it is not clear how the two questions are different. Both appear to be the same problem with intersecting two layers. The figure is confusing because it's not clear what layer is what. What role, for instance, do the green quadrilaterals play? What is the difference between red and cyan squares--does red denote selection or something else? – whuber Aug 13 '11 at 14:24
  • 1
    Thanks, Paul. The example is sufficiently irregular that it doesn't reveal much about the nature of the error, only that there is an error. Why don't you simplify things? A good start would be to intersect a regular grid of squares with a single circle. If that works, add more circles until you get a failure. Often, the process of simplifying an error instance leads to either a better characterization of the problem or even to a solution. – whuber Aug 14 '11 at 21:50
  • 1
    It's ok to edit your original question, Paul, to reflect the additional information you're gathering. When you can strip a problem down to its essence with a simple example and an account of what's happened, it's more likely someone will identify a solution. – whuber Aug 15 '11 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.