Select to view content in your preferred language

REST API Map Image Export and Scale Dependency

3664
3
06-23-2010 08:18 AM
TJBara
by
Emerging Contributor
I have been able to documented unexpected (for me) behavior regarding scale dependency and the map export method of the REST API.

I have 3 map services on an ArcGIS Server (I am not the administrator so I cannot access it).
Tiled Imagery
Tiled Thematic
Dynamic Thematic

Scale dependency of all 3 layers is respected in a map control.
When I produce a map image of the service using the REST export method, scale dependency is respected for the Tiled and Dynamic Thematic Services.  But scale dependency is not fully respected for the Tiled Imagery service.

The REST call to the service (omitting http:):

<server>/ArcGIS/rest/services/Imagery3/MapServer/

produces:

Imagery3 (MapServer)
View In:   ArcMap   ArcGIS Explorer   ArcGIS JavaScript   Google Earth

View Footprint In:   Google Earth

Service Description:

Map Name: Layers2

Layers:
.
.
.
Description:

Copyright Text:

Spatial Reference: 2264

Single Fused Map Cache: true

Tile Info:


Height: 512

Width: 512

DPI: 96

Levels of Detail: (# Levels: 4)

Level ID: 0 [Start Tile, End Tile]
Resolution: 28.25
Scale: 32544
Level ID: 1 [Start Tile, End Tile]
Resolution: 13.0208333333333
Scale: 15000
Level ID: 2 [Start Tile, End Tile]
Resolution: 6.51041666666667
Scale: 7500
Level ID: 3 [Start Tile, End Tile]
Resolution: 1.73611111111111
Scale: 2000
Format: JPEG
Compression Quality: 75
Origin:
X: -121841900
Y: 154024800

Spatial Reference: 2264
Intial Extent:

XMin: 1837306.32463124
YMin: 370328.619961146
XMax: 1861403.57463124
YMax: 393465.369961146
Spatial Reference: 2264

Full Extent:

XMin: 267000.005956989
YMin: -20998.7395168134
XMax: 3192999.8740899
YMax: 1100997.84466795
Spatial Reference: 2264

Units: esriFeet

Supported Image Format Types: PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI


I don't expect to see image data with a scale value greater than 32544.  Again in a map control, I do not.

===
When I call the REST map export method:
<server>/ArcGIS/rest/services/Imagery3/MapServer/export?f=pjson&bbox=1648619.791666668,490746.52777777775,1811380.208333335,599253.4722222222&size=700,400&transparent=true&format=jpg&layers=show:0,1,2,3,4,5,6,7&layerDefs=

I get the following PJSON
{
  "href" : "http://<server>/arcgisoutput/_ags_map4a786ff41f0a487eb3713316aa17e2ea.jpg",
  "width" : 700,
  "height" : 400,
  "extent" : {
    "xmin" : 1635056.42361111,
    "ymin" : 490746.527777778,
    "xmax" : 1824943.57638889,
    "ymax" : 599253.472222222,
    "spatialReference" : {
      "wkid" : 2264
    }
  },
  "scale" : 312500
}

Note the scale.

When I change f=pjson to f=image, I get an image of the tiled data.

As I zoom in, I continue to get an image result. 

But if I zoom out, say to where scale is "1250000", I no longer get the image.  So it is partially respecting scale dependency.

I cannot tell if this is a bug in the REST API, or a server setting I can't see on the returned PJSON.

Any suggestions would be greatly appreciated.

TJ
0 Kudos
3 Replies
VasylMelnychuk
Emerging Contributor
As far as i know "export" operation is not using tiled data. It generates new image according to bbox, size e.t.c.

Tiled data may be accessed via url:
<server>/ArcGIS/rest/services/Imagery3/MapServer/tile/<scalelevelnumber>/<row>/<column>
In this case scale level is predefined and cannot be different than during tiles configuration

Maybe this will be helpfull:
http://resources.esri.com/help/9.3/arcgisserver/apis/rest/index.html?export.html
http://resources.esri.com/help/9.3/arcgisserver/apis/rest/index.html?tile.html

Regards,
Vasyl
0 Kudos
TJBara
by
Emerging Contributor
As far as i know "export" operation is not using tiled data. It generates new image according to bbox, size e.t.c.

Tiled data may be accessed via url:
<server>/ArcGIS/rest/services/Imagery3/MapServer/tile/<scalelevelnumber>/<row>/<column>
In this case scale level is predefined and cannot be different than during tiles configuration

Maybe this will be helpfull:
http://resources.esri.com/help/9.3/arcgisserver/apis/rest/index.html?export.html
http://resources.esri.com/help/9.3/arcgisserver/apis/rest/index.html?tile.html

Regards,
Vasyl


Thank you for your input, Vasyl.  I am not sure it gets to the issue - I am getting expected behavior for other tiled services, and I am getting expected behavior from the imagery tiled service at different scales.

Because I am trying to produce a printable image of the map service as represented in a map control, trying to pull a specific tile doesn't seem like the right approach.

I appreciate you taking the time to respond.

TJ
0 Kudos
AxelSchaefer
Emerging Contributor
If you're using the JS API as a client, you can test and verify the requests by adding the cached service as an esri.layers.ArcGISDynamicMapServiceLayer. The request will be an exportImage request.

If you add it to the client as a ArcGISTiledMapServiceLayer, it will request the tiles. If you have one tiled layer in your js api client, you will have the zoom steps according to the cache scales and you can only zoom in theses steps.

So it would be appropriate to access the tiled service as a dynamic one with an interpolated image.

HTH.
0 Kudos