Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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"

share|improve this question
    
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 Aug 13 '11 at 10:54
    
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
    
Let's see: I'm trying to intersect two layers, the green regular squares constitute the first layer and the unfilled circles are the second layer. I'm trying to color red ONLY the squares which intersect with the circles but I'm failing because as you can see other squares are being colored (also if they do not intersect the circles). So red is selected. Do not consider the cyan non-square figures because they play no role in here. –  Marco Aug 14 '11 at 11:01
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
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.