Select to view content in your preferred language

How to import ESRI Shape file in WPF?

4833
5
02-16-2012 01:07 PM
AhmedCogenli
New Contributor
Is it possible to import ESRI Shape file via WPF API? If so, could you share any sample code?

Thanks
0 Kudos
5 Replies
JenniferNery
Esri Regular Contributor
You can probably refer to this sample: http://esrislcontrib.codeplex.com/. I know this is Silverlight-specific but you can probably tweak it for WPF.
0 Kudos
SimonGuard
Occasional Contributor
You just need the ShapeFile classes and the ExtentionMethods from the codeplex libarary. They compile under WPF no problem. Be warned though. Loading large shapefiles directly into a graphics layer will have a huge impact on performance. The graphics layer makes no attempt at simplifing shapes as you zoom out. At full extent everything gets drawn and this can take seconds. I loaded a political map of turkey and it takes seconds just to pan. The map will cull shapes as you zoom in and it becomes more responsive but a full extent it sucks CPU.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

You might also be interested in the ArcGIS Runtime SDK for WPF. It's an evolution of the existing WPF API you're familiar with, which will allow you to use local data, maps, locators and geoprocessing tools. Inidividual Shapefiles can be added via a capability called "dynamic layers" which is also available in ArcGIS for Server at 10.1. The ArcGIS Runtime SDK for WPF has been in beta for some time now and a pre-release will be available shortly. It is due to be released with ArcGIS 10.1 in Q2 this year but it's worth signing up for the beta programme if you're interested in participating: http://beta.esri.com/community/

For more information please see:

Home/community: http://resourcesbeta.arcgis.com/en/communities/runtime-wpf/index.html
Concept doc: http://resourcesbeta.arcgis.com/en/beta/wpf-sdk/concepts/ (you'll need to be a registered beta user for these pages)
API Ref : http://resourcesbeta.arcgis.com/en/beta/wpf-sdk/apiref/index.html (you'll need to be a registered beta user for these pages)


Cheers

Mike
0 Kudos
SimonGuard
Occasional Contributor
I would love to test ArcGIS Runtime SDK for WPF but it does not show up in my list of Beta Opportunaties. Only ArcGIS Runtime SDK for Windows Phone shows up.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Unfortunately I think the Beta 2 signup/download for all products has now closed, you'll need to wait a little longer until the pre-release for the ArcGIS Runtime SDK for WPF.

Cheers

Mike
0 Kudos