Query operation being performed in backend when Loading layers

3472
6
Jump to solution
11-22-2015 10:43 AM
BenjaminBhumireddy1
New Contributor

Hi,

We recently create a iOS application with ArcGIS integration. The application uses a MapServer URL and
1. Loads the base map

2. Loads different layers defined by the user

But when the map is loaded or even when the map is zoomed there is large amount of data usage, 4-8MB per zoom action. When checked log on the mapserver there are a lot of query hits, please find the log snippet below

=======

FINE    Nov 20, 2015, 11:24:24 AM    REST request successfully processed. Response size is 983215 characters.    Secure.MapServer    appuser

FINE    Nov 20, 2015, 11:24:24 AM    End Query    Secure.MapServer    appuser

FINE    Nov 20, 2015, 11:24:23 AM    Begin Query    Secure.MapServer    appuser

FINE    Nov 20, 2015, 11:24:23 AM    REST request received. Request size is 377 characters.    MapServer    appuser

=======

Can you please tell me, if the loading the layers or zooming the map is so costly. Is there any alternative

0 Kudos
1 Solution

Accepted Solutions
GagandeepSingh
Occasional Contributor II

For each zoom or pan action, the map view requests data from all the layers (including the basemap) in it, for the new extent. The size of the response varies based on the content of these layer. The sample response you posted has a size of 0.9 mb.

One way to save on data usage could be, if you have a small extent, you can package the basemap (.tpk file) along with the app. That way each zoom or pan action would load or refresh the basemap locally. Here is the how to : ArcGIS Local Tiled layer—ArcGIS Runtime SDK for iOS | ArcGIS for Developers

I hope this helps, let me know.

View solution in original post

0 Kudos
6 Replies
GagandeepSingh
Occasional Contributor II

For each zoom or pan action, the map view requests data from all the layers (including the basemap) in it, for the new extent. The size of the response varies based on the content of these layer. The sample response you posted has a size of 0.9 mb.

One way to save on data usage could be, if you have a small extent, you can package the basemap (.tpk file) along with the app. That way each zoom or pan action would load or refresh the basemap locally. Here is the how to : ArcGIS Local Tiled layer—ArcGIS Runtime SDK for iOS | ArcGIS for Developers

I hope this helps, let me know.

0 Kudos
BenjaminBhumireddy1
New Contributor

Thanks Gagandeep, We will try packing the tpk file in the app.

But one query, we have a GIS desktop application, where when map is zoomed on browser the log looks different

It looks like the browser version does not use query but it uses a ExportMapImage. Any idea if iOS works differently

==============

FINE    Nov 20, 2015, 10:45:48 AM    End ExportMapImage    Secure.MapServer   appuser

FINE    Nov 20, 2015, 10:45:48 AM    Extent:-13781904.815457,4336953.333804,-13054667.472143,4804622.886889; Size:975,627; Scale:2819085.21    Secure.MapServer   appuser

FINE    Nov 20, 2015, 10:45:48 AM    Begin ExportMapImage    Secure.MapServer    appuser

============

Thanks for the response again

0 Kudos
GagandeepSingh
Occasional Contributor II

I am not aware of the desktop application but the iOS SDK does use the export APIs internally.

0 Kudos
BenjaminBhumireddy1
New Contributor

Thanks Gagandeep for your help.

0 Kudos
DiveshGoyal
Esri Regular Contributor

If you are using feature layer (AGSFeatureLayer class), that will query the service for the raw feature data (geometry, attributes, etc) and then draw them on the client. Depending upon how much data is returned by the service, this could be expensive. Some tricks to optimize this is to limit the attributes requested by the layer (by setting the outFields parameter on the layer), and if you don't intend to edit the geometry, also generalizing feature geometry (by setting the maxAllowableOffset) which will remove unnecessary vertices and help reduce size.

Another alternative to using feature layer is to use dynamic map service layer  (AGSDynamicMapServiceLayer class) that will export images from the service instead of querying the data. In some cases, the image would be much smaller than the raw data, but you won't be able to edit on the client.

Or if the service has been pre cached into tiles you can use a tiled map service layer (AGSTiledMapServiceLayer class). This is less expensive than exporting images on the fly and instead uses pre-generated tiles which are then assembled on the client.

Some related reading - Layer types—ArcGIS Runtime SDK for iOS | ArcGIS for Developers 

BenjaminBhumireddy1
New Contributor

Thanks Divesh for your response.

For reducing the out parameters, We are not constructing any query operations. We are loading feature layers and looks like iOS SDK is hitting a query operation the background.

We can look as AGSDynamicMapServiceLayer or AGSTiledMapServiceLayer options, as we do not have edit operation. But even if the data usage is reduced to 50% its still a lot of data, as we have multiple users.

If we use TPK file with required layers, do you think we can run identify operation on it. We have a requirement to tap on a point/region and see its details

0 Kudos