Select to view content in your preferred language

How to download all feature layers without selecting area through IOS SDK.

3575
28
03-27-2017 07:10 AM
KamalMittal
Deactivated User

Hi,

I want to generate a geodatabase which contain all feature layers data so that I can use that database when there is no internet connection but I do not want to give an option to user to select area of interest.  All feature layer data should be  download automatically in background. 

Thanks,

Kamal

Tags (1)
0 Kudos
28 Replies
KamalMittal
Deactivated User

Thanks for the reply.

Actually I have two different csv files which contain hospital and fire-hydrant data. I have uploaded them to ArcGIS online from the Add data option. Then it create two layers under content section and I have save them as a separate layer and publish it to ArcGIS online as feature layer so I get two different feature layer urls. So my question is can I publish these two layers as a single like Sync/WildfireSync from ArcGIS online?

Another thing is that I have one use case like "42 street is not accessible in newyork city". so how I show that usecase into Arcgis online basemap and publish it as a feature layer.

Last thing is that I am bit confuse about "REST to create Replica". How do I use that and how it can be helpful for me in IOS app.

Thanks,

Kamal

0 Kudos
KamalMittal
Deactivated User

Any update on this?

Thanks,

Kamal

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hey Kamal‌,

Services with Multiple Layers

For creating multiple layers within one service from CSVs, as Yue mentions you currently have to use the Desktop tools. There are plans for an enhancement to enable this without Desktop tools but I don't have a timeline.

If you had Shapefiles instead of CSVs, you could combine the Shapefiles for each layer you want in a single folder, zip up that folder, and upload it. The zip file name will determine the Service name and each Shapefile will become a Layer within that Service (note: a "Shapefile" is made up many constituent parts - you would combine all those parts from all the Shapefiles in one flat folder, zip that up and upload it). I did that here (here is the REST endpoint).

Additionally, if you uploaded a File Geodatabase, that can be published as a Service with many Layers.

REST Actions to Create Replica

When you use the Runtime's AGSGeodatabaseSyncTask, it's using the REST Create Replica endpoint behind the scenes. Since you're using the Runtime you don't have to worry about this as it wraps all that up for you. Yue was just referring to that. I would add to Yue's response below that you don't need to dig into the REST APIs if you're OK with the Runtime SDK samples, but if you really want to get into the weeds, use the REST docs as reference.

Incidentally, you might find these two videos from the recent Developer Summit useful if you want to find out more about your options for working offline with the Runtime:

ArcGIS Runtime: Working with Maps Online and Offline

and

ArcGIS Runtime: Editing Your Data Online and Offline 

Cheers,

Nick.

0 Kudos
KamalMittal
Deactivated User

Thanks Nicholas for the video sharing and nice explanation. So we have to go with ArcMap or ArcGIS Pro for sharing multiple layers into one service url or to customize shapefile at own level?

Thanks,

Kamal

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi Kamal,

If the layers are based off CSVs, that's correct. If they're based off Shapefiles, my above description will get you a single Service with multiple Layers without using ArcMap or ArcGIS Pro.

But I'm not sure I understand "customize shapefile at own level". Perhaps you mean modifying shapefiles (changing data, adding or removing fields)?

If so, there is some limited stuff you can do in the browser. You can of course edit data and then you can export a FeatureLayer as a Shapefile using the Extract Data analysis tool. In fact, you might be able to use this workflow to upload multiple CSVs, extract them as multiple Shapefiles which you would then put into one folder locally before zipping and uploading that to create a single Service with multiple Layers. It's convoluted, but it should work.

You're also able to add and delete fields from a Feature Layer if you own it. This is done from the Table View in the ArcGIS Online Map Viewer.

In general, the Desktop tools significantly simplify many of these workflows. With Desktop you have good ways to script these workflows too with arcpy, although the new ArcGIS API for Python might be worth looking at for scripting some of this ArcGIS Online administration without a need for Desktop.

Hope that helps,

Nick

0 Kudos
KamalMittal
Deactivated User

Thanks Nicholas for reply.

Currently I have one usecase. I want to indicate in map that "42nd street is not accessible in Newyork due to some emergency" so how I indicate that thing in map( should i indicate red line, area or polygon). Is this possible through arcgis online or I have to go with ArcGIS Pro or ArcMap to create shapefile  of that thing and publish it to ArcGIS online? That is my main concern.

Thanks,

Kamal

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Absolutely.

So far we've been talking about taking existing data that you've obtained elsewhere as a CSV or Shapefile, but it sounds like you actually might simply want an empty FeatureService+Layer for redlining (or perhaps one for points, one for lines, and one for polygons). You can do this at the developer portal (log in with your org credentials). This will give you a lot of control over attribute names and types that go with each record. This DevLab explains how to do that: Create a new dataset

Once you create a layer through the developer portal you will see it in the main ArcGIS Online My Content browser.

But there is another option that might work for you. You can create a Feature Layer directly in the My Content browser from a Template. Select Create->Feature Layer, and look at the From Template tab. There's a Road Closures template that could work for you. Here's a blog post about that functionality. [Update: Here's the documentation on that too]

Nick

P.S. I recommend you take a look at all the DevLabs, but in particular the Data section sounds like it could be useful to you.

0 Kudos
KamalMittal
Deactivated User

Hi Nicholas,

Thanks for the good explanation. Now I understand all possible scenarios to create a feature layer from ArcGIS online.
Another thing is that when I try to publish tpk file from ArcGIS Pro to ArcGIS online , it gives me an error "Staging failed". Attached is the screenshot.
Last thing is that I am showing vector tile layer through below code in IOS:

let localVectorTiledLayer = AGSArcGISVectorTiledLayer(name: "StreetMap_Day")

self.map = AGSMap(basemap: AGSBasemap(baseLayer: localVectorTiledLayer))

I want to set initialViewPoint to NewYork City so how i get x,y and scale coordinates?


Thanks,
Kamal
0 Kudos
KamalMittal
Deactivated User

Any update on this?

Thanks,

Kamal

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi Kamal,

A reply of yours (which you now seem to have replaced with this one) said you have licensed Streetmap Premium North America. That leads me to wonder why you are using ArcGIS Online at all. You have the source data to generate MMPKs (including geocoder and network model) of just the area you need, so I don't see that publishing to ArcGIS Online and then taking the data offline buys you anything.

In that reply you also asked about TPKs vs VTPKs. Since you have the source data, and you want to go offline, I would go for VTPKs if at all possible. These are much smaller, take a much shorter time to create, and are rendered at the best resolution your device can manage.

This code will get you roughly to Manhattan. Play with the scale and lat/long to start exactly where you want:

self.map.initialViewpoint = AGSViewpoint(latitude: 40.7128, longitude: -74.0059, scale: 200000)

Also take a look at the Bookmarklets here. Add the "Get Map Info" bookmarklet to your browser's favorites bar, then open the ArcGIS Online map viewer and navigate to the map area you want. Click the bookmarklet favorite and you'll get a display of some map info.

Cheers,

Nick.

P.S. A couple of observations: you seem to be deleting and replacing replies (e.g. the one that mentioned StreetMap Premium and asked about TPKs vs VTPKs), and this topic has strayed to other topics that would be better discussed in another forum, DM, or by opening a support ticket (especially the case of "Staging failed" which we'll need much more log info to diagnose). Keeping discussions in the right place improves the chance that other people can benefit from them.