Sync Offline Map Package issue

1220
12
11-08-2017 11:46 AM
JerrySimmons_GISP
New Contributor III

I have an application that references a AGOL web map - I'm able to load the web map in the map view, I'm able to download a map package and reference the downloaded map in the map view, I'm able to add new feature to the downloaded map.  Issue is when I sync using OfflineMapSyncTask the job comes back as successful but I get error on the server side stating "the spatial references do not match".  It appears that the map package that was downloaded and is in a different spatial reference than the feature service in web map service.  

When testing the downloading using GeodatabaseSyncTask I ran into the same issue, however, there was an option to specify the OutSpatialReference in the GenerateGeodatabaseParameters constructor. 

Does this functionality exist, should it be possible to sync a map package to the web map it was downloaded from after adding features?  

FYI - I contacted ESRI support and at this point I was asked to re-project my data to resolve the issue. This is not an option.

OfflineMapSyncTask task = await OfflineMapSyncTask.CreateAsync(_mapView.Map);
OfflineMapSyncParameters para = new OfflineMapSyncParameters()
{
SyncDirection = SyncDirection.Bidirectional,
RollbackOnFailure = true
};

OfflineMapSyncJob job = task.SyncOfflineMap(para);
job.JobChanged += (s, e) =>
{
if (job.Status == Esri.ArcGISRuntime.Tasks.JobStatus.Succeeded)
{
InvokeOnMainThread(() =>
{
genericAlert("Off Line Map Package", "Synchronization is complete!");
});
}
else if (job.Status == Esri.ArcGISRuntime.Tasks.JobStatus.Failed)
{
InvokeOnMainThread(() =>
{
genericAlert("Off Line Map Package", "Synchronization failed: ");
});
}
else
{
InvokeOnMainThread(() =>
{
string statusMessage = "Sync in progress ...";
});
}
};

0 Kudos
12 Replies
AnttiKajanus1
Regular Contributor II

Interesting. Could you provide a bit more details about your setup?

- What is the spatial reference in your basemap in the WebMap?

- What is the spatial reference in the services that you are using?

- Which version of the ArcGIS Enterprise you're using?

- How did you take the map offline? Using OfflineMapTask or using GeodatabaseSyncTask/ExportTileCacheTask?

- What is the spatial reference of the Map when you open the WebMap in the client?

- What is the spatial reference of the Map when you open the offline map in the client?

- When you get the results from the OfflineMapSyncTask, is there any errors reported in the results?

- What messages are written to the job.Messages when you run the sync?

0 Kudos
JerrySimmons_GISP
New Contributor III

- What is the spatial reference in your basemap in the WebMap?

 WkText: "PROJCS[\"WGS_1984_Web_Mercator_Auxiliary_Sphere\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"W…"

    Wkid: 3857

 

- What is the spatial reference in the services that you are using?

The spatial refernece for the FeatureServer service the web map uses is - Spatial Reference: 102719  (2264) .  

When the web map is added to the mapView.Map the feature layer spatial reference is:

 WkText: "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Green…"

    Wkid: 4326 

- Which version of the ArcGIS Enterprise you're using?

10.4

 

- How did you take the map offline?

OfflineMapTask

 

- What is the spatial reference of the Map when you open the WebMap in the client? 

 WkText: "PROJCS[\"WGS_1984_Web_Mercator_Auxiliary_Sphere\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"W…"

    Wkid: 3857

- What is the spatial reference of the Map when you open the offline map in the client?

WkText: "PROJCS[\"WGS_1984_Web_Mercator_Auxiliary_Sphere\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"W…"

    Wkid: 3857

 

- When you get the results from the OfflineMapSyncTask, is there any errors reported in the results?

Sync is done after a new feature is added and returns job.Status = Succeeded but here is the sync result details for the feature layer:

 

- What messages are written to the job.Messages when you run the sync?

job.Messages[0].Message

"Job started."

job.Messages[1].Message

"Sub-job (http://<server>/arcgis/rest/services/FCEMC/RecloserInspection/FeatureServer) Job started."

 

job.Messages[2].Message

"Sub-job (http://<server>/arcgis/rest/services/FCEMC/RecloserInspection/FeatureServer) Creating server job."

 

job.Messages[3].Message

"Sub-job (http://<server>/arcgis/rest/services/FCEMC/RecloserInspection/FeatureServer) failed: \"Job error 22 User defined failure. Error while handling get server sync job status. Job error 400 .\""

 

job.Messages[4].Message

"Job succeeded."

 

Hope this sheds more light on the issue.

0 Kudos
AnttiKajanus1
Regular Contributor II

Sorry for delayed anser here. I have verified that we have an issue in some cases when using `OfflineMapSyncTask` with a `OfflineMapTask` where the map contains layers with multiple SRs. Interestingly some of them work and some doesn't so we keep investigating this issue. 

0 Kudos
JerrySimmons_GISP
New Contributor III

This was filed last week:

[BUG-000109728 : OfflineMapSyncTask doesn't update the feature service in the webmap if the spatial reference of the feature service isn't Web Mercator.]

0 Kudos
AnttiKajanus1
Regular Contributor II

EDITED

Hi Jerry, thanks for the link. Could you verify that all the services that you use have all required capabilities enabled?

Editable data—If clients will edit the data when offline and synchronize changes with the feature service when they have connectivity, set the CREATE, DELETE, QUERY, SYNC, and UPDATE capabilities on the feature service. Note that you must grant all of the editing capabilities.

0 Kudos
JerrySimmons_GISP
New Contributor III

There's only one feature service being used in the web map, the feature service only has one layer as well.  These capabilities for the feature service are enabled - Create,Query,Update,Sync & Delete.

0 Kudos
AnttiKajanus1
Regular Contributor II

I cannot see Delete operation enabled for the service that fails. This might have something to do with the issue. 

 "capabilities" : "Create,Query,Update,Editing,Sync"
0 Kudos
AnttiKajanus1
Regular Contributor II

I think I should be a bit more specific here. I'm having a look at the services that were reported as part of the support issue.

0 Kudos
JerrySimmons_GISP
New Contributor III

What service are you hitting? You might be hitting an invalid test service (I just took it down) the current service that I'm using has the capabilities I mentioned previously. Can you email me the link your using?

0 Kudos