1

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.Geometry.IPointCollection)multipointPoints2;
                ESRI.ArcGIS.ADF.Web.Geometry.Point[] new_adf_points =
                                        ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Local.Converter.FromIPointCollection
                    (com_pointcollection);
                ESRI.ArcGIS.ADF.Web.Geometry.PointCollection new_adf_pointcollection = new
                    ESRI.ArcGIS.ADF.Web.Geometry.PointCollection();
                for (int i = 0; i < new_adf_points.Length - 1; i++)
                {
                    new_adf_pointcollection.Add(new_adf_points[i]);
                }

                ESRI.ArcGIS.ADF.Web.Geometry.Ring new_adf_path = new
                    ESRI.ArcGIS.ADF.Web.Geometry.Ring();
                new_adf_path.Points = new_adf_pointcollection;
                ESRI.ArcGIS.ADF.Web.Geometry.RingCollection new_adf_pathcollection = new
                    ESRI.ArcGIS.ADF.Web.Geometry.RingCollection();
                new_adf_pathcollection.Add(new_adf_path);
                ESRI.ArcGIS.ADF.Web.Geometry.Polygon new_adf_polygon = new
                    ESRI.ArcGIS.ADF.Web.Geometry.Polygon();
                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];
                    queryResultsDataSet.Tables.Add(queryResultsDataTable);
                }

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"

7
  • How does this question differ from your preceeding one at gis.stackexchange.com/questions/13456/…?
    – whuber
    Commented Aug 12, 2011 at 19:01
  • Totally, the problem is different and I've solved the one before.
    – Marco A.
    Commented Aug 13, 2011 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
    Commented Aug 13, 2011 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
    Commented Aug 14, 2011 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
    Commented Aug 15, 2011 at 13:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.