Select to view content in your preferred language

SpatialReference is changed when exporting tilecache with parameters

3435
1
Jump to solution
04-07-2016 04:09 AM
LucianoRodríguez
Deactivated User

Hi to everyone, and thanks in advance for the help.

I have an strange problem using v.10.2.5 of ArcGis-RunTIme-SDK-iOS. After reading the guides i've been able to export tile cache of one agstiledlayer using the following code:

//temp is an NSMutableArray containing NSNumbers... something like {@"1",@"2",@"3"...}

//self.geom is an instance of AGSEnvelope with WKID = 25830 and xmin,ymin,xmax and ymax initialized to the values of the envelope i want to cache.

params = [[AGSExportTileCacheParams alloc] initWithLevelsOfDetail:temp areaOfInterest:self.geom];

[task exportTileCacheWithParameters:params downloadFolderPath:exportedPath useExisting:NO status:^(AGSResumableTaskJobStatus status, NSDictionary *userInfo) {

     //UPDATE STATUS OF DOWNLOADED PERCENTAGE...

} completion:^(AGSLocalTiledLayer *localTiledLayer, NSError *error) {

     //localTiledLayer spatialReference WKID is 102100

}];

The problem i have is that the localTiledLayer downloaded has a different spatialreference (102100) than the parameters i used to specify the download (25830). Why is this happening? Am i doing something wrong or is something not related with the client (iOS) side?

Thanks for your help,

0 Kudos
1 Solution

Accepted Solutions
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Luciano,

You cannot overwrite/change the default spatial reference when you execute an export tile cache. The reason is because all tiling schemes are associated with a certain spatial reference. Your data frame/dataset/layer's spatial reference must match the spatial reference of your tiling scheme in order for tiles to be created. Think tile cached as a image, that you cannot distort those predefined image into another spatial reference. For more information, you can read this online documentation:

What is map caching?—Documentation (10.3 and 10.3.1) | ArcGIS for Server


Normally, when we download the cache tile in Runtime iOS, we will define the AGSEnvelope to current mapView extent:

AGSEnvelope *extent = [self.mapView visibleAreaEnvelope];

If you want to download a tile cache in 25830, you must find a tile cache service that has same spatial reference 25830.


Hope this can help.

View solution in original post

1 Reply
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Luciano,

You cannot overwrite/change the default spatial reference when you execute an export tile cache. The reason is because all tiling schemes are associated with a certain spatial reference. Your data frame/dataset/layer's spatial reference must match the spatial reference of your tiling scheme in order for tiles to be created. Think tile cached as a image, that you cannot distort those predefined image into another spatial reference. For more information, you can read this online documentation:

What is map caching?—Documentation (10.3 and 10.3.1) | ArcGIS for Server


Normally, when we download the cache tile in Runtime iOS, we will define the AGSEnvelope to current mapView extent:

AGSEnvelope *extent = [self.mapView visibleAreaEnvelope];

If you want to download a tile cache in 25830, you must find a tile cache service that has same spatial reference 25830.


Hope this can help.