ArcGIS Server: allowing tile resampling.

5751
19
Jump to solution
03-17-2017 08:54 AM
AlessandroValra
Occasional Contributor III

I've been trying to achieve what I was able to do in ArcGIS Online with ArcGIS Server as well.

I red this illuminating discussion on how to allow visualizing tile layers in ArcGIS Online for those scales where no cache was created through resampling.

It was as simple as entering the administrator REST directory by inserting "/admin/" in the right place (.../rest/admin/services/...), entering the edit page and adding {"resampling":true} to the service definition properties.

However, in the ArcGIS Server administrator directory, the edit page looks very different than it is in AGOL, and I am unsure on where should I place the "resampling":true string...

Is it even possible or am I wasting my time? Basically, I'd like to be able to zoom beyond the scales where I built the cache and being able to still visualize the tile service, although blurried because resampled. At least it would be better than nothing as it is now. Generating the cache is not a workaround as I'm very interested in the possibility of resampling on-the-fly possibly.

Finally, I have already set the tiling scheme to present the LODs from 0 to 17, and the cache is only generated until 14 (included). Below is the edit page of my service:

{
 "serviceName": "Italia_web_POP",
 "type": "MapServer",
 "description": "",
 "capabilities": "Map,Query,Data",
 "provider": "ArcObjects",
 "clusterName": "default",
 "minInstancesPerNode": 1,
 "maxInstancesPerNode": 1,
 "instancesPerContainer": 1,
 "maxWaitTime": 60,
 "maxStartupTime": 300,
 "maxIdleTime": 1800,
 "maxUsageTime": 600,
 "loadBalancing": "ROUND_ROBIN",
 "isolationLevel": "HIGH",
 "configuredState": "STARTED",
 "recycleInterval": 24,
 "recycleStartTime": "00:00",
 "keepAliveInterval": 1800,
 "private": false,
 "isDefault": false,
 "maxUploadFileSize": 0,
 "allowedUploadFileTypes": "",
 "properties": {
  "maxImageHeight": "4096",
  "virtualCacheDir": "/rest/directories/arcgiscache",
  "maxSampleSize": "100000",
  "exportTilesAllowed": "false",
  "textAntialiasingMode": "Force",
  "maxImageWidth": "4096",
  "enableDynamicLayers": "false",
  "dynamicDataWorkspaces": "[]",
  "supportedImageReturnTypes": "URL",
  "disableIdentifyRelates": "false",
  "isCached": "true",
  "maxScale": "36111.909642999999",
  "maxBufferCount": "100",
  "schemaLockingEnabled": "true",
  "maxRecordCount": "1000",
  "filePath": "C:\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\STUDIOSIT\\Italia_web_POP.MapServer\\extracted\\v101\\Italia_web_POP.msd",
  "cacheOnDemand": "false",
  "useLocalCacheDir": "true",
  "cacheExtent": "full",
  "outputDir": "C:\\arcgisserver\\directories\\arcgisoutput",
  "virtualOutputDir": "/rest/directories/arcgisoutput",
  "minScale": "18489297.737236001",
  "maxDomainCodeCount": "25000",
  "maxExportTilesCount": "100000",
  "tilingScheme": "1",
  "ignoreCache": "false",
  "antialiasingMode": "None",
  "clientCachingAllowed": "true",
  "cacheDir": "C:\\arcgisserver\\directories\\arcgiscache"
 },
 "extensions": [
  {
   "typeName": "NAServer",
   "capabilities": "null",
   "enabled": "false",
   "maxUploadFileSize": 0,
   "allowedUploadFileTypes": "",
   "properties": {
    "oDCostMatrix_MaxDestinationsToFind": "",
    "serviceArea_MaxBreakValue_TimeUnits": "esriTimeUnitsMinutes",
    "vRP_MaxFeaturesInPolygonBarriers": "",
    "vRP_MaxRoutes": "",
    "serviceArea_MaxBarriers": "",
    "route_MaxFeaturesInLineBarriers": "",
    "vRP_ForceHierarchyBeyondDistanceUnits": "esriMeters",
    "route_ForceHierarchyBeyondDistanceUnits": "esriMeters",
    "locationAllocation_MaxDemandPoints": "",
    "closestFacility_MaxFeaturesInPolygonBarriers": "",
    "closestFacility_MaxFacilities": "",
    "oDCostMatrix_MaxDestinations": "",
    "serviceArea_MaxBreakValue_Length": "",
    "serviceArea_ForceHierarchyBeyondTimeUnits": "esriTimeUnitsMinutes",
    "serviceArea_ForceHierarchyBeyondDistanceUnits": "esriMeters",
    "vRP_MaxFeaturesInLineBarriers": "",
    "closestFacility_ForceHierarchyBeyondDistanceUnits": "esriMeters",
    "route_AllowTimeWindows": "true",
    "serviceArea_MaxFacilities": "",
    "locationAllocation_MaxFeaturesInPolygonBarriers": "",
    "oDCostMatrix_MaxFeaturesInLineBarriers": "",
    "route_MaxFeaturesInPolygonBarriers": "",
    "locationAllocation_ForceHierarchyBeyondDistance": "",
    "saveLayerOnServerWhenError": "false",
    "route_ForceHierarchyBeyondDistance": "",
    "locationAllocation_ForceHierarchyBeyondDistanceUnits": "esriMeters",
    "serviceArea_ForceHierarchyBeyondTime": "",
    "route_MaxStops": "",
    "serviceArea_MaxFeaturesInLineBarriers": "",
    "closestFacility_MaxIncidents": "",
    "oDCostMatrix_ForceHierarchyBeyondDistanceUnits": "esriMeters",
    "allowSaveLayerOnServer": "true",
    "route_MaxBarriers": "",
    "vRP_MaxBarriers": "",
    "oDCostMatrix_ForceHierarchyBeyondDistance": "",
    "serviceArea_MaxBreakValue_LengthUnits": "esriMeters",
    "serviceArea_ForceHierarchyBeyondDistance": "",
    "saveLayerOnServerWhenDebugging": "false",
    "closestFacility_MaxFeaturesInLineBarriers": "",
    "oDCostMatrix_MaxFeaturesInPolygonBarriers": "",
    "oDCostMatrix_MaxBarriers": "",
    "closestFacility_MaxFacilitiesToFind": "",
    "closestFacility_MaxBarriers": "",
    "serviceArea_MaxBreakValue_Other": "",
    "defaultOutputGeometryPrecisionUnits": "esriMeters",
    "vRP_ForceHierarchyBeyondDistance": "",
    "oDCostMatrix_MaxOrigins": "",
    "locationAllocation_MaxBarriers": "",
    "locationAllocation_MaxFeaturesInLineBarriers": "",
    "closestFacility_ForceHierarchyBeyondDistance": "",
    "nALayerDir": "C:\\arcgisserver\\directories\\arcgisoutput",
    "vRP_MaxOrders": "",
    "serviceArea_ForceHierarchyBeyondOther": "",
    "defaultOutputGeometryPrecision": "",
    "serviceArea_MaxFeaturesInPolygonBarriers": "",
    "serviceArea_MaxBreakValue_Time": "",
    "locationAllocation_MaxFacilities": ""
   }
  },
  {
   "typeName": "MobileServer",
   "capabilities": "",
   "enabled": "false",
   "maxUploadFileSize": 0,
   "allowedUploadFileTypes": "",
   "properties": {}
  },
  {
   "typeName": "KmlServer",
   "capabilities": "SingleImage,SeparateImages,Vectors",
   "enabled": "false",
   "maxUploadFileSize": 0,
   "allowedUploadFileTypes": "",
   "properties": {
    "minRefreshPeriod": "30",
    "compatibilityMode": "GoogleEarth",
    "imageSize": "1024",
    "dpi": "96",
    "endPointURL": "",
    "featureLimit": "1000000",
    "useDefaultSnippets": "false"
   }
  },
  {
   "typeName": "WFSServer",
   "capabilities": "null",
   "enabled": "false",
   "maxUploadFileSize": 0,
   "allowedUploadFileTypes": "",
   "properties": {
    "phone": "",
    "appSchemaURI": "http://www.geomaster.it:6080/arcgis/services/STUDIOSIT/Italia_web_POP/MapServer/WFSServer",
    "providerSite": "",
    "administrativeArea": "",
    "electronicMailAddress": "",
    "pathToStoredQueryFile": "",
    "enableTransactions": "false",
    "city": "",
    "hourOfService": "",
    "title": "",
    "postalCode": "",
    "customGetCapabilities": "false",
    "name": "Italia_web_POP",
    "deliveryPoint": "",
    "role": "",
    "axisOrderWFS10": "longlat",
    "axisOrderWFS11": "latlong",
    "serviceTypeVersion": "",
    "accessConstraints": "",
    "positionName": "",
    "abstract": "",
    "onlineResource": "http://www.geomaster.it:6080/arcgis/services/STUDIOSIT/Italia_web_POP/MapServer/WFSServer",
    "facsimile": "",
    "keyword": "",
    "defMaxFeaturesValue": "",
    "individualName": "",
    "fees": "",
    "serviceType": "",
    "enableDefMaxFeatures": "false",
    "country": "",
    "providerName": "",
    "transactionsWithoutLocks": "false",
    "pathToCustomGetCapabilitiesFiles": "",
    "appSchemaPrefix": "STUDIOSIT_Italia_web_POP",
    "contactInstructions": ""
   }
  },
  {
   "typeName": "SchematicsServer",
   "capabilities": "Query",
   "enabled": "false",
   "maxUploadFileSize": 0,
   "allowedUploadFileTypes": "",
   "properties": {}
  },
  {
   "typeName": "FeatureServer",
   "capabilities": "Create,Query,Update,Delete,Uploads,Editing",
   "enabled": "false",
   "maxUploadFileSize": 0,
   "allowedUploadFileTypes": "",
   "properties": {
    "creatorPresent": "false",
    "dataInGdb": "false",
    "xssPreventionEnabled": "true",
    "allowGeometryUpdates": "true",
    "syncVersionCreationRule": "versionPerDownloadedMap",
    "allowOthersToQuery": "true",
    "syncEnabled": "false",
    "editorTrackingTimeZoneID": "UTC",
    "enableZDefaults": "false",
    "realm": "",
    "allowOthersToDelete": "false",
    "allowTrueCurvesUpdates": "false",
    "datasetInspected": "true",
    "editorTrackingRespectsDayLightSavingTime": "false",
    "zDefaultValue": "0",
    "enableOwnershipBasedAccessControl": "false",
    "editorTrackingTimeInUTC": "true",
    "allowOthersToUpdate": "false"
   }
  },
  {
   "typeName": "WCSServer",
   "capabilities": "null",
   "enabled": "false",
   "maxUploadFileSize": 0,
   "allowedUploadFileTypes": "",
   "properties": {
    "phone": "",
    "maxImageHeight": "",
    "maxImageWidth": "",
    "city": "",
    "providerWebsite": "",
    "title": "STUDIOSIT_Italia_web_POP",
    "customGetCapabilities": "false",
    "name": "Italia_web_POP",
    "province": "",
    "role": "",
    "accessConstraints": "Nessuno",
    "abstract": "",
    "onlineResource": "http://www.geomaster.it:6080/arcgis/services/STUDIOSIT/Italia_web_POP/MapServer/WCSServer",
    "keywords": "",
    "fax": "",
    "zipcode": "",
    "fees": "",
    "country": "",
    "responsiblePerson": "",
    "providerName": "",
    "responsiblePosition": "",
    "email": "",
    "address": "",
    "pathToCustomGetCapabilitiesFiles": "",
    "serviceHour": "",
    "contactInstructions": ""
   }
  },
  {
   "typeName": "WMSServer",
   "capabilities": "GetCapabilities,GetMap,GetFeatureInfo,GetStyles,GetLegendGraphic,GetSchemaExtension",
   "enabled": "false",
   "maxUploadFileSize": 0,
   "allowedUploadFileTypes": "",
   "properties": {
    "reaspect": "false",
    "inheritLayerNames": "false",
    "contactPosition": "",
    "contactVoiceTelephone": "",
    "city": "",
    "contactFacsimileTelephone": "",
    "title": "STUDIOSIT_Italia_web_POP",
    "contactOrganization": "",
    "customGetCapabilities": "false",
    "name": "WMS",
    "stateOrProvince": "",
    "accessConstraints": "",
    "abstract": "",
    "onlineResource": "http://www.geomaster.it:6080/arcgis/services/STUDIOSIT/Italia_web_POP/MapServer/WMSServer",
    "keyword": "",
    "postCode": "",
    "fees": "",
    "addressType": "",
    "pathToCustomSLDFile": "",
    "country": "",
    "address": "",
    "contactElectronicMailAddress": "",
    "pathToCustomGetCapabilitiesFiles": "",
    "contactPerson": "",
    "listSupportedCRS": ""
   }
  }
 ],
 "datasets": []
}

1 Solution

Accepted Solutions
JonathanQuinn
Esri Notable Contributor

I don't believe this is possible with a traditional ArcGIS Server service.  If your server is federated to Portal, what you can try is to publish a hosted cached service and then try to add that property to that service.  The same type of service would be published to AGOL, so you're testing against more similar things.

View solution in original post

19 Replies
JonathanQuinn
Esri Notable Contributor

Are you trying this in your own application?  I thought I read in a post somewhere that you can configure the application to render tiles until an LOD, and at that point, render it dynamically.  I can't find it now, though, but if you're using your own custom application, it may be a start.

0 Kudos
AlessandroValra
Occasional Contributor III

Hi Jonathan, thanks for the response.

Indipendently of wheter I am using it with my own application or not, I think I should clarify the situation.

I am actually asking if it is possible to allow resampling for those LODs that are present in the MapService detail page (in REST), but are not rendered because cache wasn't generated. I did this with AGOL, and I thought it was also possible with ArcGIS Server as well.

So, let's say I have LODs from 0 to 17. Cahce was generated only down to level 14 (included). Resampling would allow me to draw them dynamically from the last LOD where the tile were cached (generated), although they will show up blurried (as it's a resample).

In AGOL I could go to the administrator REST directory, enter the EDIT page of my Tiled service, and in the Properties window (which shows up completely blank), write "{"resampling":true}" (without double quotes). Ten open a map in AGOL with the same tile service loaded, zoom to a LOD where cache was not generated and keep seeing the layer resampled.

If resample is not true (the default), I cannot see anything of my layer when I zoom in a LOD which is specified for the service, but no cache (tile), was generated. This is my situation with my actual MapServer and ArcGIS Server.

0 Kudos
JonathanQuinn
Esri Notable Contributor

I don't believe this is possible with a traditional ArcGIS Server service.  If your server is federated to Portal, what you can try is to publish a hosted cached service and then try to add that property to that service.  The same type of service would be published to AGOL, so you're testing against more similar things.

AlessandroValra
Occasional Contributor III

Thanks Jonathan,

Actually my AGS is not federated with a Portal yet. So I think either I federate it or I should build the cache fot the LODs where tiles are missing. Again, thanks for proposing a possible workaround (it probably work as I was successful with AGOL). I will mark your answer as correct (at least until someone would come up saying it is possible and how).

0 Kudos
by Anonymous User
Not applicable

From what I understand you are tryingto do this is possible and we do it. One trick is the doco online is a little wrong in saying you add the line;

  • "resampling":true

in fact it should be 

  • "resampling" : "true"

as per the other configurations. Also the level above must be half the resolution - fine if you are in teh Google/Bing tiling scheme but not always the case and wasn't in ours as we had built to 'nice' scales (1:50,000 and then 1:20,000 for example)

 

What are you consuming this service as - we are yet to get it working via WMS but via Esri rest it all works fine for us.

0 Kudos
by Anonymous User
Not applicable

I just stumbled across this. 

This should definitely be a default behavior. After the max LOD in a tile service it should by default resample and render it dynamically. Please consider this a Feature Enhancement. I have created an idea. Please vote for it. https://community.esri.com/ideas/14421 

NicolasGIS
Occasional Contributor III

Hello, 

Just wanted to share that I added the resampling to true on a tiledMapService of ArcGIS Server 10.4 as well and it was not working after.

Debugging showed me that the property had been taken into account as "blankTile=false" was added to my request, but then it went through all the tiling scheme to find the previous level but it did not find any. I had this kind of error in my console:

It should have been able to find tile at level 14 but it seems that it requested the wrong one.

Looking at the javascript API, I found out that in the _resample method of the TiledMapServiceLayer, it is assuming that levels follow a scale/2 LOD pattern (this._multiple = Math.pow(2, f)) and it was not the case of my tiling scheme.

I modified the tiling scheme for the last levels and it worked.

So maybe it should be added to the workflow:

1. Make sure your tiling scheme follow a scale/2 pattern at least for the scales you want to be able to resample.

2. Add the property "resampling" : "true", property to the JSON and don't forget that according to the documentation:

How To: Enable resampling for a map service in the ArcGIS Server Administrator Directory 

You are supposed to add the property before the maxRecordCount one.

Hope that help,

Nicolas

Jack_Zhang
Occasional Contributor

hi Nicolas, Thanks for the post. I tested on our own ArcGIS Server 10.5 the "resamping":"true" did the trick, though it seems even it was placed above maxrecordCount item, it will automatically be moved before maxExportTilesCount. However, I also had the 404 error caused by blankTile=false. My tile scheme did follows the scale/2 pattern (e.g. 2000,1000,500,250), and I even tried put a blank.png under the _allLayer folder according to How To: Configure the cache folder to display a 'Data not available' tile for empty map cache areas ... , but it still returns the error, though it won't effect the final result. I'm wondering did you ever solved the 404 error on your end?> thanks

NicolasGIS
Occasional Contributor III

Hi Jack,

On my side 404 error was due to the tiling scheme not following a scale/2 pattern. Once I updated the tiling scheme, it worked.

Also, I was using 3.25 JS API. Are you using 4.X by any chance ? Maybe the behavior is different. I never tested on 4.X.

Would you have a url to test ?

Nicolas