Can't get returnExtentOnly option to work?

1458
6
05-24-2018 03:27 PM
FredSpataro
Occasional Contributor III

Hi All:

According to the REST SDK help page, MapService\Layer\Query supports the returnExtentOnly option at 10.3.1+ for on-premise servers when the layer's "supportsReturningQueryExtent" is true.  The WYSIWYG REST Query form has a radio button for the values as well.  However I can't seem to get this option to return anything at all.  Is the documentation off, something else wrong? 

Follow these steps on the sample server: 

1. Open the top level REST info for the server: Folder: / 

 + verified server is 10.6

2. Open the SampleWorldCities\Continent info Layer: Continent (ID: 1) 

 + verified supportsReturningQueryExtent = true (both in html and json output)

3. Open SampleWorldCities\Continent\Query Query: Continent (ID: 1) 

   + set where for a specific feature ie : CONTINENT='South America'

   + click Returns Extents Only to True radio button

   + click Query (Get) button

Result is definitely not a simple extent.  

   + click Return Geometry to False radio button

   + click Query (Get) button

Result is just the display attribute

   + click Return Count Only to True radio button (this is mentioned in the help) 

   + click Query (Get) button

Result is just the count number.  

So is the help wrong or does this service not support the option even though it says it does or am I doing something wrong or have the wrong expectation of what this does?  I tried some other map services and get the same result so it doesn't seem particular to the SampleWorldCities, I used that as a simple example since everyone has it on their server. 

Thanks

Fred

 

Tags (2)
0 Kudos
6 Replies
FredSpataro
Occasional Contributor III

There's a JavaScript API wrapper method on the QueryTask for this option called queryForExtent.  I created a quick SitePen using the 'query without map' sample and ...it works.  So it's not a bug on the server or service.  Those appear to be correct... I've captured the network requests and will see what the difference is.  

FredSpataro
Occasional Contributor III

Alright ... looks like it's a typo on the MapService\Layer\Query form for this value.  The radio buttons have a plural name for this form value instead of a singular --- returnExtentsOnly instead of returnExtentOnly

If you modify these values in the source inspector or the url after a get button click, the expected results is returned.  

MattH
by
New Contributor II

Found my old login just to say thanks for following up and posting your solution.

FredSpataro
Occasional Contributor III

One last comment --- sorry about my OCD on this one, I'm trying to put together a small training for newbies on the REST SDK and really wanted to use this page/function in a demonstration --- it looks like the offending file is here:

[INSTALLDIR]\ArcGIS\Server\framework\runtime\tomcat\webapps\arcgis#rest\www\client\mapserver\query.jsp 

Modify the returnExtentsOnly to returnExtentOnly and the form starts working as expected.  

There's one other file that appears to have the same issue:  

[INSTALLDIR]\ArcGIS\Server\framework\runtime\tomcat\work\Catalina\localhost\arcgis#rest\org\apache\jsp\www\client\mapserver\query_jsp.java

0 Kudos
EricMahaffey1
Occasional Contributor

Looks like this is still an issue at version 10.5.  Not sure if it's been fixed at any version higher.  Thanks to Fred Spataro for catching it, and sharing the resolution.

FredSpataro
Occasional Contributor III

Glad it helped out!  

It does appear to be fixed at 10.7:

0 Kudos