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

Reading ShapeFile from SQL

1 Answer 49 Views
Map
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 17 Jan 2013, 02:28 PM
Hello,

So I've been doing a lot of research, and I cannot find a single thing on this.  Here's my dilemma...I have a utility that allows a user to upload an image to SQL server, to be used as a UriImageProvider...works great.  I now need to be able to support shapefiles, in the same manner.  What I've accomplished thus far is converting shapefile (.shp) into a byte array, and storing in the database as a VarBinary(max).  Data is there, seems ok.  The way I am getting the images (image/shapefile) from the database and into the RadMap, is by using a HttpHandler.  This works great with getting the images, i just set the Uri to the HttpHandler with the ImageId.  This is not working with the shapefile through.  Here is my code snipped below...

Dim shapeResourceInfo As StreamResourceInfo = Application.GetResourceStream(New Uri(map.ImageUri, UriKind.RelativeOrAbsolute))
                        Dim dbfResourceInfo As StreamResourceInfo = Application.GetResourceStream(New Uri(map.DbfUri, UriKind.RelativeOrAbsolute))
                        Dim shapes As List(Of FrameworkElement) = ShapeFileReader.Read(shapeResourceInfo.Stream, dbfResourceInfo.Stream)
                        For Each shape In shapes
                            Dim infoLayer = New InformationLayer
                            infoLayer.Items.Add(shape)
                            TestShapeFileMap.Items.Add(infoLayer)
                        Next

The error I am getting is "Specified argument was out of the range of valid values."  

Any help or tips would be greatly appreciated.  

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 18 Jan 2013, 12:13 PM
Hello Josh,

Your scenario is very complicated and it is hard to reproduce the problem without your solution. Could you, please, provide us with your solution or with a small sample solution which demonstrates the exception?

All the best,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Map
Asked by
Josh
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or