Shapefile Problem

2 posts, 0 answers
  1. baq
    baq avatar
    1 posts
    Member since:
    Sep 2014

    Posted 10 Sep 2014 Link to this post

    i am using silverlight radmap control ,I have different shape files, some of the files show data like countries borders without any problems, another files does not show any thing , i don't know if those files have problems.
    can any one help me to check if i have problem on the shape files or have other problem in my code.

    the files in the link below.

    thanks.





    <telerik:RadMap x:Name="radMap"
                    ZoomLevel="5"
                    Center="36, 40">
                <telerik:RadMap.Provider>
                    <telerik:OpenStreetMapProvider />
                </telerik:RadMap.Provider>
                <telerik:VisualizationLayer x:Name="visualizationLayer" >
                    <telerik:VisualizationLayer.ShapeFill>
                        <telerik:MapShapeFill Fill="#6FDFEFFF"
                                      Stroke="Blue"
                                      StrokeThickness="2" />
                    </telerik:VisualizationLayer.ShapeFill>
                    <telerik:VisualizationLayer.Reader>
                        <telerik:AsyncShapeFileReader x:Name="mapShapeDataReader"
                                              Source="/TelerikSilverlightApp1;component/Westbank_Destrict.shp"
                                                      DataSource="/TelerikSilverlightApp1;component/Westbank_Destrict.dbf" ToolTipFormat="AREA" PreviewReadShapeDataCompleted="mapShapeDataReader_PreviewReadShapeDataCompleted" />
                    </telerik:VisualizationLayer.Reader>
                </telerik:VisualizationLayer>
            </telerik:RadMap>


    [URL=http://wikisend.com/download/525280/Shapefiles.rar]Shapefiles.rar[/URL]
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 12 Sep 2014 Link to this post

    Hello baq,

    I used your shape files and checked the PreviewReadShapeDataCompleted event handler. In it the e.Items returns collection of 11 objects of type PolygoneData. All of them have location with big Longitudes and Latitudes, for example:
    e.Items[0]
    {Telerik.Windows.Controls.Map.PolygonData}
        [Telerik.Windows.Controls.Map.PolygonData]: {Telerik.Windows.Controls.Map.PolygonData}
        ExtendedData: {Telerik.Windows.Controls.Map.ExtendedData}
        Layer: null
        Location: {217546.310175,157026.798323}
        location: {217546.310175,157026.798323}
        PropertyChanged: null
        ToolTipFormat: "AREA"
        ToolTipStyle: null
        ToolTipTemplate: null
        verticalOrder: 0
        visualizationLayer: null
        ZIndex: 0

    This means that your shape file is not in the default projection RadMap Uses - EPSG:4326 (in it the latitude is between -85 and 85 and longitude is between -180 and 180). Actually if you have also "prj" file you can see the projection in your shape file. Then you can convert the files into EPSG:4326 with some tools, for example GDAL (www.gdal.org).

    Regards,
    Petar Mladenov
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. DevCraft banner
Back to Top