This is a migrated thread and some comments may be shown as answers.

Support for ESRI Shape Files

1 Answer 89 Views
Map
This is a migrated thread and some comments may be shown as answers.
Sanjay
Top achievements
Rank 1
Sanjay asked on 17 Nov 2014, 09:36 AM
I'm trying to load ESRI Shapefile inside RadMap using InformationLayer manually, but getting this issue "The DBF file is invalid or has unsupported format."
The shapefiles which I'm referring to is running fine in other window application.

Telerik example link which I'm referring is here http://www.telerik.com/help/wpf/radmap-features-shapefiles-support.html

Here is a WPF project that can reproduce the issue: https://www.dropbox.com/s/tr2vorqfbllbn6r/TelerikRadMap.rar?dl=0

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 18 Nov 2014, 12:21 PM
Hi Sanjay,

The exception is expected. You have misplaced the shp stream with the dbf stream. Just replace the two arguments or replace the names of your streams:

StreamResourceInfo shapeResourceInfo = Application.GetResourceStream(new Uri("/TelerikRadMaps;component/ShapeFiles/coast.dbf", UriKind.RelativeOrAbsolute));

               StreamResourceInfo dbfResourceInfo = Application.GetResourceStream(new Uri(" /TelerikRadMaps;component/ShapeFiles/coast.shp", UriKind.RelativeOrAbsolute));

               List<FrameworkElement> shapes = ShapeFileReader.Read(shapeResourceInfo.Stream, dbfResourceInfo.Stream);


When you fix these lines the shape over the Mauritius island could be seen successfully witht he following Map settings:

Center="-19.981681155272,57.3084997231693" ZoomLevel="8"



Regards,
Petar Mladenov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Map
Asked by
Sanjay
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or