Create Featues From Shapefile Offline

2597
3
03-07-2014 05:32 AM
Labels (1)
DannyNieruch
New Contributor II
Hi,

I have to evaluate the ArcGIS Runtime WPF SDK for a new project. Therefore this topic is really new to me.
It is required that the WPF Application will run in an offline environment. I have to load a local .tpk File and draw lines and polygons from two shapefiles. I came accross the "Create Features From Shapefile" example in the runtime samples. The sample project worked for me with a local shapefile and seems exactly what I need but it uses the ArcGIS Portal REST API (http://www.arcgis.com/sharing/rest/content/features/generate) for generating the features.
Is there a way to do this in an offline scenario without the REST API? I discovered the LocalFeatureService. Can I use them to generate the features from the shapefiles?

Many thanks in advance 🙂
0 Kudos
3 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

What's the timescale for your project?

Cheers

Mike
0 Kudos
AhmedEl-Sisi
Occasional Contributor III
Hi,

I have to evaluate the ArcGIS Runtime WPF SDK for a new project. Therefore this topic is really new to me.
It is required that the WPF Application will run in an offline environment. I have to load a local .tpk File and draw lines and polygons from two shapefiles. I came accross the "Create Features From Shapefile" example in the runtime samples. The sample project worked for me with a local shapefile and seems exactly what I need but it uses the ArcGIS Portal REST API (http://www.arcgis.com/sharing/rest/content/features/generate) for generating the features.
Is there a way to do this in an offline scenario without the REST API? I discovered the LocalFeatureService. Can I use them to generate the features from the shapefiles?

Many thanks in advance 🙂


The sample illustrates how to use the ArcGISWebClient class to post multi-part content (e.g. file) to a service\operation as mentioned in its description.
If you want just to load local shapefile to your map at runtime you can check "Add Shapefiles and Raster" sample as It will load your content as ArcGISLocalDynamicMapServiceLayer.
0 Kudos
DannyNieruch
New Contributor II
The sample   illustrates how to use the ArcGISWebClient class to post multi-part content (e.g. file) to a service\operation as mentioned in its description. 
If you want just to load local shapefile to your map at runtime you can check "Add Shapefiles and Raster" sample as It will load your content as ArcGISLocalDynamicMapServiceLayer.


Thanks for responding! 🙂
I checked the "Add Shapefiles and Raster" sample in the WPF SDK Samples but the live sample throws a Nullpointer Exception after adding my local shapefile.
I created a new WPF project from scratch with the code from the live sample to check the exception.
arcGisLocalDynamicMapServiceLayer.GetDetails(dynamicLayerInfo.ID, (featureLayerInfo, exception) =>
{
    switch (featureLayerInfo.GeometryType) <-- featureLayerInfo is null
    {
        //set renderer
        [...]
    }
}


I modified the code and set the renderer with a SimpleFillSymbol manually but I can't see my shapefile on the map.
I also checked the sample/code from: http://www.arcgis.com/home/item.html?id=953a530ada30477d95cc69e788268bc9
This sample is missing the switch-statement and it's running without problems/exceptions but I can't see my shapefile on the map too 😞

What am I doing wrong?

Hi, 

What's the timescale for your project? 

Cheers 

Mike


The project will only start in a few weeks. But I have just two days left vor evaluating the WPF SDK.
0 Kudos