Select to view content in your preferred language

How to load points new points into GDB

2240
3
Jump to solution
01-13-2013 02:34 PM
Labels (1)
BenTurrell2
New Contributor
Hi All,

Having some trouble working out how to load point data from CSV into a GDB through a Runtime app. Basically, we want the user to be able to select a CSV whilst in the app, then have the app read in the X,Y data (as well as any other fields) and display the data as points on the map. Essentially taking each row of the CSV and adding it as a row in the feature class.

We've been experimenting by using a blank GDB as a .MPK, but can't work how how to add the data to it.

Any help would be appreciated.

Cheers
0 Kudos
1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor
Hi,

You have two options:

##1 ##
Create an MPK which either includes, or references, a File GDB and start a LocalFeatureService from that MPK. This will allow you to create an ArcGISLocalFeatureLayer which will supporting editing an existing feature classe in that File GDB. Normally adding a layer to the map triggers the initialization but you can call the "Initialize" method explicitly. Then add new graphic features to the graphics collection on that local feature layer and call the Save method.

The main difference when not adding the layer to the map is that you should use Snapshot mode which gets a snapshot of all features or all available features up to the service imposed limit (determined by the service published when using ArcGIS for Server or you can set this for local feature services). For more info see http://resources.arcgis.com/en/help/...QueryMode.html.

It???s also worth noting the different behaviour of the following methods:
.Update() = Selections and unsaved edits will be lost on Update. Performs a new refreshed query against the service and refreshes the graphics layer.
.SaveEdits() = Save edits to the layer. Only required if AutoSave is false.
.Refresh() = Forces a full redraw of all graphic features but does not affect selections or unsaved edits.

Here are some other forum links you might want to look at:
#. Adding features to local feature layers: http://forums.arcgis.com/threads/48324-How-to-create-new-feature.
#. Updating a featurelayer on a background thread: http://forums.arcgis.com/threads/60409-Is-it-possible-to-edit-file-gdb-feature-classes-from-Windows-.... This Windows Service isn't necessarily advisable because that could require an additional runtime license, but the background thread details might be useful for you.


## 2 ##
Use ArcMap to create a geoprocessing model/script which takes a FeatureSet and turns that into a File GDB feature class. The difference with this approach is that it would let you create a new File GDB and Feature Class... plus perform other geoprocessing operations if required, e.g. queries, intersections, validation, etc.


Cheers

Mike

View solution in original post

0 Kudos
3 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

You have two options:

##1 ##
Create an MPK which either includes, or references, a File GDB and start a LocalFeatureService from that MPK. This will allow you to create an ArcGISLocalFeatureLayer which will supporting editing an existing feature classe in that File GDB. Normally adding a layer to the map triggers the initialization but you can call the "Initialize" method explicitly. Then add new graphic features to the graphics collection on that local feature layer and call the Save method.

The main difference when not adding the layer to the map is that you should use Snapshot mode which gets a snapshot of all features or all available features up to the service imposed limit (determined by the service published when using ArcGIS for Server or you can set this for local feature services). For more info see http://resources.arcgis.com/en/help/...QueryMode.html.

It???s also worth noting the different behaviour of the following methods:
.Update() = Selections and unsaved edits will be lost on Update. Performs a new refreshed query against the service and refreshes the graphics layer.
.SaveEdits() = Save edits to the layer. Only required if AutoSave is false.
.Refresh() = Forces a full redraw of all graphic features but does not affect selections or unsaved edits.

Here are some other forum links you might want to look at:
#. Adding features to local feature layers: http://forums.arcgis.com/threads/48324-How-to-create-new-feature.
#. Updating a featurelayer on a background thread: http://forums.arcgis.com/threads/60409-Is-it-possible-to-edit-file-gdb-feature-classes-from-Windows-.... This Windows Service isn't necessarily advisable because that could require an additional runtime license, but the background thread details might be useful for you.


## 2 ##
Use ArcMap to create a geoprocessing model/script which takes a FeatureSet and turns that into a File GDB feature class. The difference with this approach is that it would let you create a new File GDB and Feature Class... plus perform other geoprocessing operations if required, e.g. queries, intersections, validation, etc.


Cheers

Mike
0 Kudos
BenTurrell2
New Contributor
Thanks for that Mike, very helpful.

Following on from that, I've now got another question:

Some of the datasets we would like to load can be in excess of 4 million features, will any of the Runtime layer types support this size of data, and allow for on the fly manipulation and querying using sliders? I'm assuming that going down the path of using graphics for this many features will not work.

Thanks again for your help so far.

Cheers,
Ben
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

For on the fly manipulation you're right that you should be considering the graphics approach, and with that many features you definitely need to be using the accelerated display mode (set via the Map.UseAcceleratedDisplay or the AcceleratedDisplayLayers grouplayer). Pouring that many features into a File GDB will take a little time so definitely needs to be done as a background task and for display some filtering certainly be required for display to ensure it provides a good user experience. We're also looking at ways we can improve performance in the product when working with millions of features.

Cheers

Mike
0 Kudos