Query task with polygon not working after upgrade to 10

782
5
Jump to solution
02-29-2012 12:47 PM
CarmenDurham
Occasional Contributor II
All,

Production Web Server just upgraded to Server 10. 

We have some web applications (happens with both a 2.0 and 2.5 api app) that will:


  • find an address point through query task (works fine at 10)

  • then buffers the address point by 500 ft (geometry server - works fine in 10 and we can display the buffer as a graphic to know it worked)

  • Then selects all the fire hydrants within that buffer polygon using a query task.- I think this works because the featureset.count that is returned is correct.

  • Cycle through the returned hydrants, create graphics of those features and display. - this no longer works after the upgrade to 10.  It is like the QueryEvent returns something different that will not work anymore.

Any ideas??  Below is the code where I think the problem occurs - it is in the query task executeComplete function.  The hydrants are in a secure service, but that shouldn't matter.  I tried it with unsecured services, too.

Below is a link to one site - type in an address.  Let it process through a bunch of queries. Then press the "Show Hydrants.." button in section 3. It zooms out to where it should, but you don't see any cute yellow fire hydrants.  I can tell it is finding the hydrants because of the count it returned in a test.
https://gis.greenvillesc.gov/wheresmyhouse/

   private function onfireHydrantQueryComplete4Locate(event:QueryEvent):void    {     var hydrantFeatureSet: FeatureSet = event.featureSet;           for each (var hydrantGraphicFeature: Graphic in hydrantFeatureSet.features)      {       firehydrantCount = firehydrantCount + 1;       hydrantGraphicFeature.symbol = firehydrantSymbol;       fireHydrantLayer.add(hydrantGraphicFeature);      }       if (firehydrantCount == 0)      {      Alert.show("Zero fire hydrants found within 500 feet of this address");      }  // end if     else        {       fireHydrantLayer.visible = true; //      Alert.show(firehydrantCount.toString());       map.extent = lastBufferGraphic.geometry.extent.expand(1.5);      } // end else        cursorManager.removeBusyCursor();    }   // end function onfireHydrantQueryComplete4Locate


Thanks for any help.  I hope this is something someone has already seen.

Carmen
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
CarmenDurham
Occasional Contributor II
Well, I finally figured it out.  The fire hydrant query needed the "returnGeometry=true" parameter -- see below.

 <esri:Query id="fireHydrantQuery" returnGeometry="true" outSpatialReference="{map.spatialReference}">


I am not sure WHY it worked fine with ArcGIS Server 9.3 unless the default used to be "true" and now the default is now "false" for 10.  I will do some more digging to see if that is the case. 

I finally noticed all the graphics being returned had no geometry attached.  Attributes were being returned which led me to believe all was working as before.  In both affected web applications, the query for the address was working fine - but I DID have returnGeometry=true set for it.

Hope this helps someone else.

Thanks,
Carmen

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus
Carmen,

   Can you try commenting this line where you specify the symbol and see what happens? I watched the app using fidler and nothing is going wrong with the responses.

hydrantGraphicFeature.symbol = firehydrantSymbol;
0 Kudos
CarmenDurham
Occasional Contributor II
Thank you for replying.

I commented out the line of code and the behavior is exactly the same.   Any other ideas are appreciated and I will continue to try to figure out what is happening.

Carmen
0 Kudos
CarmenDurham
Occasional Contributor II
Well, I finally figured it out.  The fire hydrant query needed the "returnGeometry=true" parameter -- see below.

 <esri:Query id="fireHydrantQuery" returnGeometry="true" outSpatialReference="{map.spatialReference}">


I am not sure WHY it worked fine with ArcGIS Server 9.3 unless the default used to be "true" and now the default is now "false" for 10.  I will do some more digging to see if that is the case. 

I finally noticed all the graphics being returned had no geometry attached.  Attributes were being returned which led me to believe all was working as before.  In both affected web applications, the query for the address was working fine - but I DID have returnGeometry=true set for it.

Hope this helps someone else.

Thanks,
Carmen
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Carmen,

   Also in your apps you can start using useAMF = true for better speed in the query now that you are using ArcGIS Server 10.
0 Kudos
CarmenDurham
Occasional Contributor II
Thank you for reminding me.  I had in my mind that SDE had to also be at 10 (about a month away)...  But, hooray, I was wrong.  I switched all to true and now the queries (especially the flood queries) do seem faster.

Carmen
0 Kudos