I'm trying to return polygon features that intersect a larger polygon which defines my area of interest. It is working in some cases, but when the area of interest gets large (7000 intersecting records) it is not working. The MaxRecordCount property in the configuration file at ArcGIS install location\Server\user\cfg\configuration file name.cfg was increased to 10,000 but still no records were returned. I have read about an upper limit of 2000 records and the queries that are working correctly return less than this number of records. One idea is to split the area of interest into parts. An FAQ I read suggest to iterate through consecutive blocks of results on the client by using the field that contains a unique key (e.g. primary key) to track progress. And it seems the number of attributes in the records returned may have an impact. What works for others?

I am not the programmer, but I'll include the code being used.

     Private Sub QueryTask_ExecuteCompleted_Zoom_Filter_Events_Layer(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.Tasks.QueryEventArgs)

        'special code just for Event Filter option
        'save the selected polygon to use to retrieve all parcels within it


            Dim featureSet As FeatureSet = args.FeatureSet

            Dim myGraphicsLayerSelectedFeature As ESRI.ArcGIS.Client.GraphicsLayer = TryCast(MyMap.Layers("GraphicsLayerSelectedFeature"), 

            If featureSet IsNot Nothing AndAlso featureSet.Features.Count > 0 Then

                Dim selectedFeature As Graphic = featureSet.Features(0)

                ' *****************************************************
                ' Hightlight selected feature
                selectedFeature.Symbol = TryCast(gridGISMapInteractive.Resources("BlueLineFillSymbol"), ESRI.ArcGIS.Client.Symbols.Symbol)

                ' *****************************************************
                ' Zoom to selected feature (define expand percentage)
                Dim selectedFeatureExtent As ESRI.ArcGIS.Client.Geometry.Envelope = selectedFeature.Geometry.Extent

                Dim expandPercentage As Double = 90

                Dim widthExpand As Double = selectedFeatureExtent.Width * (expandPercentage / 100)
                Dim heightExpand As Double = selectedFeatureExtent.Height * (expandPercentage / 100)

                'save the selected polygon envelope
polygonExtent = New ESRI.ArcGIS.Client.Geometry.Envelope(selectedFeatureExtent.XMin, selectedFeatureExtent.YMin, selectedFeatureExtent.XMax, 

                ' *****************************************************
                'query the parcels in the selected filter polygon
                Dim strQueryLayerID As String = CType(Convert_Web_Service_Layer_Name_To_Index("Parcel MBL"), String)

                'query a specified layer to find data that intersect with the polygon buffer around the selected point
                Dim queryTask As New QueryTask(CityOfWorcester.Url & "/" & strQueryLayerID)
                AddHandler queryTask.ExecuteCompleted, AddressOf QueryTask_ExecuteCompleted_Polygon_Parcels_Filter_Events
                AddHandler queryTask.Failed, AddressOf QueryTask_Failed_Polygon_Parcels

                Dim query As New ESRI.ArcGIS.Client.Tasks.Query()
                query.ReturnGeometry = True
                'query.Geometry = polygonExtent
                'query.Geometry = selectedFeature.Geometry
                query.Geometry = selectedFeatureExtent
                'query.SpatialRelationship = SpatialRelationship.esriSpatialRelContains
                query.SpatialRelationship = SpatialRelationship.esriSpatialRelIntersects

                'specify which fields to return (must be case specific)
                'Output Fields are specific to the layer being queried

                query.OutFields.AddRange(New String() {"X_COORD"})
                query.OutFields.AddRange(New String() {"Y_COORD"})
                query.OutFields.AddRange(New String() {"HOUSE_NO"})
                query.OutFields.AddRange(New String() {"STREET"})
                query.OutFields.AddRange(New String() {"GISGPV_MBL"})
                query.OutFields.AddRange(New String() {"MBL"})


            End If

        Catch ex As Exception
            HandleError(ex, False)
        End Try

    End Sub
  • Please clarify your use case, because there is likely a better way to go about it. – MLowry Apr 26 '13 at 19:46
  • Where have you read about the "upper limit of 2000 records"? I have hit this limit inserting to a RecordSet and can't find it documented. – nef001 Apr 27 '13 at 2:14
  • Here is one discussion about the limit: link – cwb Apr 29 '13 at 12:25

I don't have a 9.3 server to screenshot.
but here as a 10.1

  • 1
    In 9.3.1 the MaxRecordCount setting is changed in the config file. – cwb Apr 29 '13 at 12:18

We increased the MaxRecordCount but the key seems to be altering the query to work on a polygon layer with fewer attributes. It takes some time but it works as expected without having to split the area of interest into smaller pieces.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.