Support for ESRI Shape Files

2 posts, 0 answers
  1. Sanjay
    Sanjay avatar
    21 posts
    Member since:
    Jun 2014

    Posted 17 Nov 2014 Link to this post

    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
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 18 Nov 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top