[OpenLayers-Users] ArcGIS Online Cached tiles datum shift
Vadim Bokin
vbokin at gmail.com
Thu Jul 22 14:33:22 EDT 2010
Is there any way to make this work with the /rest/... URL?
I took the code you (Robert) provided from ArcGISCache and changed how
it was generating the URL. not calculating, that is left in place,
but generating - and I just removed all the "L" and "R" prefixing, and
padding with 0's and so on. And made that work with the /tile/z/x/y
scheme, but tiles are still mis-aligned.
Do you know of any efforts to make ArcGIS tile/cached services work on
top of XYZ.js with the /rest/... URL.
Thank you,
-Vadim
On Tue, Jul 20, 2010 at 1:45 PM, Robert Sanson
<Robert.Sanson at asurequality.com> wrote:
> ArcGIS Server can create tile caches, similar to what Google maps creates
> and uses. These are 256x256 pixel tiles laid out in a grid fashion which are
> pre-rendered at various scales. They can be accessed either via the ArcGIS
> Server REST API - requests take the form:
>
>
>
> http://<map service URL>/tile/<level>/<row>/<column>
>
>
>
> eg.:
>
>
>
> http://ws-esrimt/ArcGIS/rest/services/mapservice_topography_vector_prod/MapServer/tile/0/17/7
>
>
>
> or via a direct URL call against the virtual cache on the Web server eg.:
>
>
>
> http://ws-esrimt/MapCache/mapservice_topography_vector_prod/Layers/_alllayers/L00/R00000011/C00000007.png
>
>
>
> The former requires ArcGIS Server, as requests are handled through the REST
> API and may result in some interpolation. The latter is faster as it
> requests the tile directly from the Web server.
>
>
>
> The tileOrigin for ArcGIS Server caches is the upper left corner, with
> increasing row and column numbers moving down and to the right. This differs
> from some other commercial and free tile caches, which usually have their
> origin to the lower left. The virtual cache directory structure uses zero
> padded hexadecimal numbers for the row and column numbers.
>
>
>
> OpenLayers can request tiles using either mechanism, but the virtual cache
> format is the fastest (and produces the sharpest images). According to
> ESRI's own Web site:
>
>
>
> http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_java_help/index.html#/Map_cache_usage_by_clients/009200000t1n000000/
>
> "After an initial connection to the GIS server, the Web ADF retrieves tiles
> directly from the virtual cache directory. This is the fastest way for the
> application to get the tiles. Tiles can only be retrieved this way for
> caches stored in the exploded format."
>
>
>
> To access these virtual caches, OpenLayers requires ArcGISCache.js and a
> patched XYZ.js file to tell OpenLayers to calculate the grid layout from the
> upper left rather than the bottom left.
>
>
>
> The scale ranges are specified when the map object is created:
>
>
>
> var mapoptions = {
>
> maxExtent: new OpenLayers.Bounds(-4020900, 4554869.11353823,
> 2568710.79993, 19998100),
>
> restrictedExtent: new
> OpenLayers.Bounds(980902.6296,4672753.201,2606505.881,6298356.452),
>
> //scales: [12000000, 3000000, 1000000, 750000, 500000,
> 250000, 100000, 75000, 50000, 35000, 25000, 20000, 15000, 10000, 7500,
> 5000],
>
> resolutions: new Array(3175.0063500127003, //0
>
> 793.75158750317507, //1
>
> 264.58386250105838, //2
>
> 198.43789687579377, //3
>
> 132.29193125052919, //4
>
> 66.145965625264594, //5
>
> 26.458386250105836, //6
>
> 19.843789687579378, //7
>
> 13.229193125052918, //8
>
> 9.260435187537043, //9
>
> 6.6145965625264589, //10
>
> 5.2916772500211673, //11
>
> 3.9687579375158752, //12
>
> 2.6458386250105836, //13
>
> 1.9843789687579376, //14
>
> 1.3229193125052918),//15
>
> tileSize: new OpenLayers.Size(256,256),
>
> units: 'm',
>
> projection: new OpenLayers.Projection('EPSG:2193'),
>
> fractionalZoom: false
>
> };
>
> var map = new OpenLayers.Map( 'map',mapoptions );
>
>
>
> A cached map layer is then specified as follows:
>
>
>
> var topoagc = new OpenLayers.Layer.ArcGISCache({
>
> name: "agscache",
>
> url:
> "http://ws-esrimt/MapCache/mapservice_topography_vector_prod/Layers/_alllayers/",
>
> tileOrigin: new
> OpenLayers.LonLat(-4020900,19998100)
>
> });
>
> map.addLayer(topoagc);
>
>
> regards,
>
> Robert Sanson
>
>>>> Vadim Bokin <vbokin at gmail.com> 20/07/2010 6:20 p.m. >>>
> Ok, now I'm confused. How do I initialize the ArcGISCache layer with
> this service
>
> http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer
>
> ??
>
> Previously I was going after
>
> http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer
> + "/tile/" + "${z}/${y}/${x}" tiles.
>
> This goes after completely different scheme of tiles.
>
>
>
> This message has been scanned for malware by SurfControl plc.
> www.surfcontrol.com
More information about the Users
mailing list