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

    Here is a WPF project that can reproduce the issue:
  2. Petar Mladenov
    Petar Mladenov avatar
    2991 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"

    Petar Mladenov

    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.

Back to Top