Local Database

3980
1
02-27-2015 07:30 PM
NathanMellor
Occasional Contributor

I haven't used the SDK extensively yet, but I am evaluating it for a project.

The documentation gives me two ways of creating data. 

  • Generate a geodatabase from a sync-enabled feature service using the API (services pattern).

This means I have some data on a server and may want to sync back with it later.

  • Generate a geodatabase using ArcGIS for Desktop (desktop pattern).

This means I hire someone who can use ArcGIS for Desktop to create some read only data

Let's suppose I wanted to create an empty database right on the iOS device.

It would hold points of interest, polygons, and polylines as someone is marking them in the field.

It doesn't necessarily need to ever sync with a server. It is end user data.

From what I have seen so far, it seems like I can't do this. Meaning I can't create a geodatabase from scratch on the iOS device.

If I want to store user data, its up to me to create an SQLite Database or something else, update it, and retrieve data into a Graphics Layer as I go.

If the answer to this question is "Why would you ever want to do that?" then perhaps I am looking at the wrong SDK. Perhaps so, if this is only meant for enterprises, where all users of the application are employees of one organization with a common goal. But if end users use an app and just want to mark the path they took or the boundaries of their own property, it does make sense.

Nathan

0 Kudos
1 Reply
MichaelDavis3
Occasional Contributor III

As it exists now - what you are describing is not very practical with the ESRI SDK.  The 2 supported options for offline data are this:

  • Generate a feature service in ArcGIS Server with sync enabled.  Download geodatabase (with existing data or empty) to device, collect data, and sync it back up
  • Generate a geodatabase from ArcGIS Desktop with read-only data.

That said, there are a couple of other things you could do within the ESRI framework that aren't exactly supported:

  • Generate a feature service with sync, download a geodatabase... and then embed it in your app.  You wouldn't ever be able to sync really, but you could collect data into it and then export other ways... the trick is you still have to authenticate your app against ArcGIS Portal or AGOL to be able to write offline data, which leads me to...
  • JSON.  JSON is your friend.  We used JSON files to maintain offline data before ESRI added it to the SDK and it is still extremely useful.  You can export feature data to JSON, and once there use any number of tools to make CSV, SHP, GPX, whatever.  We set up a basic set of add/edit JSON files for maintaining offline features and it worked pretty well.  Got a bit sticky when the data got large, so if that is going to be an issue you might use SQLite or http://realm.io/  to store the data, then just use JSON as the intermediary.  
0 Kudos