Select to view content in your preferred language

ArcGIS Runtime API looks almost the same as ArcGIS Server API

3631
9
07-27-2011 02:48 PM
Labels (1)
FayuLai
Emerging Contributor
I thought the runtime API is much more than that.

So a basical question: does ArcGIS runtime allow you to add a featureclass dynamically to the map?  Or you need to do it through a mxd file.
0 Kudos
9 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

The ArcGIS Runtime API for WPF builds on the existing ArcGIS API for WPF to provide local data support via local services (i.e. map, feature, geoprocessing, etc). In order to be able to create a local service referencing a feature class, that feature class must first have been added to a Map Document (MXD) then shared as a Map Package (.MPK). The reason for this is two fold: 1) because the Runtime uses the optimised map rendering engine and 2) to keep the Runtime footprint as small as possible (through minimising the components required).

Over time, the existing ArcGIS API for WPF product will become the basic product level within the ArcGIS Runtime API for WPF, with a standard level offering local services support (inc approx ArcView level geoprocessing) and an advanced level providing extended geoprocessing capabilities.

In the application you are writing / are going to write, is one of your key requirements to support the end user being able to add feature classes in an adhoc manner?

Cheers

Mike
0 Kudos
FayuLai
Emerging Contributor
Hi Mike,

We are trying to use ArcGIS Runtime to rewrite one of our important product lines which was developed based on MapObjects 10 years ago.  Currently most of the end users are from other countries and sometimes don't even have ESRI software installed.  They access the data from local driver or ArcSDE directly.  So yes, it is crucial to allow our programs to access the Data directly instead of going through ArcGIS Server's services.

Best regards,

Fayu Lai
Principal Software Engineer

Innovyze
618 Michillinda Ave,                            Tel:         +1 626 568 6605
Suite 200                                                Fax:        +1 626 568 6870
Arcadia, CA 91007
USA

fayu.lai@innovyze.com
www.innovyze.com


Hi,

The ArcGIS Runtime API for WPF builds on the existing ArcGIS API for WPF to provide local data support via local services (i.e. map, feature, geoprocessing, etc). In order to be able to create a local service referencing a feature class, that feature class must first have been added to a Map Document (MXD) then shared as a Map Package (.MPK). The reason for this is two fold: 1) because the Runtime uses the optimised map rendering engine and 2) to keep the Runtime footprint as small as possible (through minimising the components required).

Over time, the existing ArcGIS API for WPF product will become the basic product level within the ArcGIS Runtime API for WPF, with a standard level offering local services support (inc approx ArcView level geoprocessing) and an advanced level providing extended geoprocessing capabilities.

In the application you are writing / are going to write, is one of your key requirements to support the end user being able to add feature classes in an adhoc manner?

Cheers

Mike
0 Kudos
RalfGottschalk
Esri Contributor
Hi Fayu,

The ArcGIS Runtime does not require a connection through ArcGIS Server's services, it can run entirely disconnected from ArcGIS Server.  As Mike said you would create a Map Package in ArcMap that either contains the data you want to use, or a reference to data that you want to use.  You could then load this Map Package in the ArcGIS Runtime and use the data.

The ArcGIS Runtime does not allow you to author data within it and there is no way to add an ArcGIS feature class directly.  The current workflow is to use ArcMap and author a package and then consume this package in the Runtime.  Programmatically the way you consume these packages is very similar to the way you would consume ArcGIS Server Services through the existing Web APIs. 

It sounds like this workflow would work for what you are trying to do, you could create a map package that references your SDE data and then consume that Map Package in the Runtime to do your work.  I don't know enough about the local driver that you are using or how it relates to MapObjects, so I can't comment on how you would consume that in the Runtime. 

If it doesn't it would be great to hear how it falls short, any feedback you could provide for this would be very helpful.  It is a different API and to some degree a different overall design, so a direct one-to-one migration might not be possible.  But, that doesn't mean that you would not be able to accomplish the same functionality in a slightly different way.      
   

Hi Mike,

We are trying to use ArcGIS Runtime to rewrite one of our important product lines which was developed based on MapObjects 10 years ago.  Currently most of the end users are from other countries and sometimes don't even have ESRI software installed.  They access the data from local driver or ArcSDE directly.  So yes, it is crucial to allow our programs to access the Data directly instead of going through ArcGIS Server's services.

Best regards,

Fayu Lai
Principal Software Engineer

Innovyze
618 Michillinda Ave,                            Tel:         +1 626 568 6605
Suite 200                                                Fax:        +1 626 568 6870
Arcadia, CA 91007
USA

fayu.lai@innovyze.com
www.innovyze.com
0 Kudos
FayuLai
Emerging Contributor
Thank you, Ralf.  Now I understand better how ArcGIS runtime works.  So is it possible that I do the following things?

1) We create all GIS data in file geodatabase format in ArcGIS and share them as Map Packages in ArcMap.  We will include Bing map in case the users need to view the background map.  We may also create different templates in different map packages to allow our users to choose different map styles.

2) We deliver those map packages together with our software to our end users.

3) When the users open our program and select a map package.  Our program will make a copy of the map package and the user can directly edit on the copy of the map package.

Not sure if we can do these steps above.  One more questions:

Can I change spatial reference of GIS data and/or map frame in ArcGIS runtime?  We don't know what kind of spatial reference the users will use in our development side.

Best regards,

Fayu Lai
Principal Software Engineer

Innovyze
618 Michillinda Ave,                            Tel:         +1 626 568 6605
Suite 200                                                Fax:        +1 626 568 6870
Arcadia, CA 91007
USA

fayu.lai@innovyze.com
www.innovyze.com

Hi Fayu,

The ArcGIS Runtime does not require a connection through ArcGIS Server's services, it can run entirely disconnected from ArcGIS Server.  As Mike said you would create a Map Package in ArcMap that either contains the data you want to use, or a reference to data that you want to use.  You could then load this Map Package in the ArcGIS Runtime and use the data.

The ArcGIS Runtime does not allow you to author data within it and there is no way to add an ArcGIS feature class directly.  The current workflow is to use ArcMap and author a package and then consume this package in the Runtime.  Programmatically the way you consume these packages is very similar to the way you would consume ArcGIS Server Services through the existing Web APIs. 

It sounds like this workflow would work for what you are trying to do, you could create a map package that references your SDE data and then consume that Map Package in the Runtime to do your work.  I don't know enough about the local driver that you are using or how it relates to MapObjects, so I can't comment on how you would consume that in the Runtime. 

If it doesn't it would be great to hear how it falls short, any feedback you could provide for this would be very helpful.  It is a different API and to some degree a different overall design, so a direct one-to-one migration might not be possible.  But, that doesn't mean that you would not be able to accomplish the same functionality in a slightly different way.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

1) Map Packages can either contain the data within a File GDB within the Package, or reference File GDBs which are external to the Map Package. There is an option in the Sharing dialog in ArcMap to specify this behaviour. You could create multiple Map Documents (.MXDs) in ArcMap which reference the same data (e.g. within a File GDB) but with each map displaying the data differently, with different symbols/styles. Then you could package each map Document choosing to reference the data source rather than include it in the package. That way, you would have multiple Maps Packages, each with a different style, but pointing at the same data source to avoid data duplication.

2) Yes, the premise of Map Packages is that they make maps and data very easy to share/deploy with applications. The ArcGIS Runtime will resolve relative paths to Packages so you can ship the package alongside your application. 

3) Exactly what data the user edits is up to you. Map Packages are a compressed bundle of files, a "package", so are therefore unpacked into the users profile to be used within the ArcGIS Runtime. In Beta 1 this is always  the user profile (\My Documents\ArcGIS\Packages) but after Beta 1 we hope to allow the developer to specify this location via the API. If you choose to include the data within the Map Package the data will be edited in the unpacked location within the user profile. The Package will not be unpacked a second time if it already exists in the user profile so the user will continue to see any edits they have made. However, if you choose to reference the data externally to the package then edits will be made against the external File GDB.

4) The spatial reference of the map control in the ArcGIS Runtime API can be changed - but it does not support reprojection on the fly. If you do not explicitly set the map control spatial reference, it is determined by the first layer added to the map. All subsequent layers must match that spatial reference. When creating Map Packages, the spatial reference of the Map Document can be different to the spatial reference of the data - the LocalMapService will perform reprojection. You can reproject GIS data using Geoprocessing within the ArcGIS Runtime - but the data would need to be referenced by a Map Package in order for it to be added to the Map Control.

Cheers

Mike
0 Kudos
FayuLai
Emerging Contributor
Thanks a lot, Mike. 

I thought ArcGIS Runtime will work on the .mpk file directly.  So did you mean that the ArcGIS Runtime will automatically unpackage the data to user profile folder and the end user don't have to worry about anything of this process?  How about the end user want to transfer his/her works to someone else?  Does it require to "package" the data again and share it with someone else?

Fayu Lai
Principal Software Engineer

Innovyze
618 Michillinda Ave,                            Tel:         +1 626 568 6605
Suite 200                                                Fax:        +1 626 568 6870
Arcadia, CA 91007
USA

fayu.lai@innovyze.com
www.innovyze.com


Hi,

1) Map Packages can either contain the data within a File GDB within the Package, or reference File GDBs which are external to the Map Package. There is an option in the Sharing dialog in ArcMap to specify this behaviour. You could create multiple Map Documents (.MXDs) in ArcMap which reference the same data (e.g. within a File GDB) but with each map displaying the data differently, with different symbols/styles. Then you could package each map Document choosing to reference the data source rather than include it in the package. That way, you would have multiple Maps Packages, each with a different style, but pointing at the same data source to avoid data duplication.

2) Yes, the premise of Map Packages is that they make maps and data very easy to share/deploy with applications. The ArcGIS Runtime will resolve relative paths to Packages so you can ship the package alongside your application. 

3) Exactly what data the user edits is up to you. Map Packages are a compressed bundle of files, a "package", so are therefore unpacked into the users profile to be used within the ArcGIS Runtime. In Beta 1 this is always  the user profile (\My Documents\ArcGIS\Packages) but after Beta 1 we hope to allow the developer to specify this location via the API. If you choose to include the data within the Map Package the data will be edited in the unpacked location within the user profile. The Package will not be unpacked a second time if it already exists in the user profile so the user will continue to see any edits they have made. However, if you choose to reference the data externally to the package then edits will be made against the external File GDB.

4) The spatial reference of the map control in the ArcGIS Runtime API can be changed - but it does not support reprojection on the fly. If you do not explicitly set the map control spatial reference, it is determined by the first layer added to the map. All subsequent layers must match that spatial reference. When creating Map Packages, the spatial reference of the Map Document can be different to the spatial reference of the data - the LocalMapService will perform reprojection. You can reproject GIS data using Geoprocessing within the ArcGIS Runtime - but the data would need to be referenced by a Map Package in order for it to be added to the Map Control.

Cheers

Mike
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

There are several possible workflows for sharing maps and data depending on your requirements: ArcGIS.com; direct package exchange; or ArcSDE...

But addressing the question about sharing a package directly, the ArcGIS Runtime can re-package maps and data into MPKs using Geoprocessing tools built in ArcGIS for Desktop. It is quite straightforward to create a model which:

1. Takes the path to a Map Document (.MXD) - this will be within the user profile in the unpacked package location (e.g. C:\Users\mbranscomb\Documents\ArcGIS\Packages\WaterDistributionSystem\v101\WaterDistributionSystem.mxd)
2. Optionally also exposes options such as package name, version support (10.0, 10.1, etc) or map extent.
3. Calls the Package Map tool to create an MPK which the user can share with others. (ArcToolbox > Data Management Tools > Package > Package Map).

This model can then be shared/exported as a Geoprocessing Package (.GPK) for use within the ArcGIS Runtime. As the developer you would programmatically call the Geoprocessing package via the ArcGIS Runtime (LocalGeoprocessingService) taking the user defined MXD path and perhaps a package name and providing them with a suitable way to share the output Map Package. For example this might be via a function in your application to email the new MPK.

See the attached picture for an example model. Note the "Map Package Name" variable is not connected to any process, but instead is used with in-line variable substitution to allow the user to specify the output map package name so the "Output Map Package" variable value becomes "%ScratchWorkspace%\%Map Package Name%.mpk".

I hope this helps.

Cheers

Mike
0 Kudos
TomNicoski
Emerging Contributor
Am I understanding correctly, that the new ArcGIS Runtime does not have the capability of adding a shape file or a cad file unless it is pre-defined in the mxd project?  If this is the case it sounds like it will have a limited use just as the ArcReader pmf files.  Based on what I have heard to date the ArcGIS Runtime was going to be the replacement for MapObjects and MapObjectsLT. If that was so, I would have assumed that it would have as a minumum the functionality of MapObjectsLT.  Not being able to add shp or cad files on the fly is one of my problems with the ArcReaderControl as a replacement for MapObjectsLT. 

Is there any chance that this functionality will be added down the road?
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

The Beta 1 API itself does not contain functionality for adding Shapefiles directly to the map. However, we really appreciate the feedback and will be investigating API support for adding adhoc  datasets to the map at runtime.

UPDATE 04/19/2012: The Package Map Geoprocessing Tool is not supported within the ArcGIS Runtime. Map Packages must be produced within ArcGIS for Desktop where the the full authoring process is supported.

Cheers

Mike
0 Kudos