Select to view content in your preferred language

RPC error on Enhanced-Search-Widget

3770
15
Jump to solution
01-23-2014 08:51 AM
by Anonymous User
Not applicable
Original User: leonardo.brandao@gmail.com
Original Date: 2014-01-23T10:51:34-0600

Hi all,

I,m getting a unknown error "[RPC Fault faultString="Unable to complete operation." faultCode="400" faultDetail=""]" in my eSearch widget when I try to run a spatial query using the relationship "entirely contained in" to bring points within polygons.

This error happens when the polygons have a relationship of "contain" between them. That is, when a polygon contain other polygon.

When I have polygons that have intersection between them, identical polygon or polygons with no spatial relationship I do not get this error.

I am using flex api version 3.6 and the widget is also the latest version and I put two screenshots attached for better understanding.

Would anyone say how can I solve this problem?

Thanks,

Leonardo.
0 Kudos
1 Solution

Accepted Solutions
LeonardoAraújo
Deactivated User
We're here to help.

Regards and thanks again,

Leonardo.

View solution in original post

0 Kudos
15 Replies
RobertScheitlin__GISP
MVP Emeritus
Leonardo,

   Are you saying that the two selected polygons overlap (the smaller polygon overlap the larger and is contained within the larger)?
0 Kudos
by Anonymous User
Not applicable
Original User: leonardo.araujo

It is exactly that. I realized now that in some polygons in the error does not happen. It seems to be something with the return value of "unionGeoms" function.

For now I commented a few lines of code "intersectResults" function (as the code below) and the error did not happen, but this way the query result does not consider the smaller polygon.

//if (GeometryUtil.polygonSelfIntersecting(intersectGeom as Polygon)){
                        geometryService.simplify([intersectGeom], new AsyncResponder(simpResult, null, spatialRelat));
                        function simpResult(item:Object ,spatialRelat:String):void{
                            var simpGeoms:Array = item as Array;
                            queryFeaturesGraphical(simpGeoms[0] as Polygon, spatialRelat, configSpatialSearchLayers[(cboSearchLayerSpatial.selectedIndex < 0)?0:cboSearchLayerSpatial.selectedIndex], "spatial");
                        }
                    /*}else{
                        queryFeaturesGraphical(intersectGeom, spatialRelat,configSpatialSearchLayers[(cboSearchLayerSpatial.selectedIndex < 0)?0:cboSearchLayerSpatial.selectedIndex], "spatial");
                    }*/


Thanks,

Leonardo.
0 Kudos
LeonardoAraújo
Deactivated User
Sorry Robert, the polygons do not overlap. They complement each other so that if we remove the smallest polygon the biggest will have a hole.
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Leonardo,

   The fact that you can get past those errors by forcing the geometry to go through the simplification process point to you having some geometry issues in your data (slivers or gaps). I will try to find some time to duplicate this and see if I can error trap for this in my widget. but you would be better off to check your geometry and make sure all your vertices are snapped.
0 Kudos
LeonardoAraújo
Deactivated User
Hi Robert,

We not found topological errors in these polygons. For help in your tests, I attached a shapefile with the group of polygons present in the screenshots uploaded. They were exported from the data source of the service published on ArcGIS Server.

Running the query with the smallest polygon located in the North (as shown in the screenshots) the error happens. But using the smallest polygon located in the South the errors DO NOT happen..

Leonardo.
0 Kudos
LeonardoAraújo
Deactivated User
Hi Robert,

I created a service with the polygons screenshot of it and have made available in http://arcgisserver.sysdesign.com.br:6080/arcgis/rest/services/Tests/eSearch_Test/MapServer

I think this may help you in your tests.

Interestingly, with this new service, the query does not succeed with any of the two combinations of polygons that have the "contains" relationship.

Leonardo.
0 Kudos
by Anonymous User
Not applicable
Original User: leonardo.araujo

Hi Robert,

I implemented a code in the widget to export geometry that resulted from "unionGeoms" function immediately before the execution of spatial query. Take a look at it please.

Leonardo.
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Leonardo,

   I am not find a better way to deal with your geometry issue then the way you have already posted about handling it. Here is my updated code:

            private function intersectResults(spatialRelat:String):void
            {
                geomArr = [];
                var graLayBufferAC:ArrayCollection = graphicsLayerBuffer.graphicProvider as ArrayCollection;
                var graLayAC:ArrayCollection = qFeatLayer.graphicProvider as ArrayCollection;
                var intersectGeom:Geometry;
                if (graLayBufferAC.length >0){
                    var gra:Graphic = graLayBufferAC[0] as Graphic;
                    intersectGeom =  gra.geometry;
                    queryFeaturesGraphical(intersectGeom, spatialRelat, configSpatialSearchLayers[(cboSearchLayerSpatial.selectedIndex < 0)?0:cboSearchLayerSpatial.selectedIndex], "spatial");
                } else if (graLayAC.length >0) {
                    intersectGeom = unionGeoms(resultsFeatureSet);
                    if (GeometryUtil.polygonSelfIntersecting(intersectGeom as Polygon) || (intersectGeom as Polygon).rings.length > 1){
                        geometryService.simplify([intersectGeom], new AsyncResponder(simpResult, null, spatialRelat));
                        function simpResult(item:Object ,spatialRelat:String):void{
                            var simpGeoms:Array = item as Array;
                            queryFeaturesGraphical(simpGeoms[0] as Polygon, spatialRelat, configSpatialSearchLayers[(cboSearchLayerSpatial.selectedIndex < 0)?0:cboSearchLayerSpatial.selectedIndex], "spatial");
                        }
                    }else{
                        queryFeaturesGraphical(intersectGeom, spatialRelat,configSpatialSearchLayers[(cboSearchLayerSpatial.selectedIndex < 0)?0:cboSearchLayerSpatial.selectedIndex], "spatial");
                    }
                }else{
                    showStateResults();
                    showMessage("There is no result to intersect, please make a graphical or text search first.",false);
                }
            }
0 Kudos
LeonardoAraújo
Deactivated User
Thanks so lot Robert, but this change does not solve my problem. The geometryService.simplify removes some internal polygons wrongly as I had commented on this post.
I had to make some modifications in unionGeoms function to include on the resulting polygon only the rings that are not contained by any other polygon because we do not need these rings for the query.

Now, my application is running without errors.

Leonardo.
0 Kudos