Shape SQL Map data

5 posts, 2 answers
  1. Luke
    Luke avatar
    9 posts
    Member since:
    Jan 2015

    Posted 20 Apr 2015 Link to this post

    Recently I encountered this article;

     

    http://www.sqlservercentral.com/articles/Reporting+Services+(SSRS)/124307/

     

    Which was a great little article showing me a much better way of storing the map data (SQL - rather than as a shape file).  Using it in the standard Microsoft Report Builder is a breeze.

     

    Ha! I thought, with my recent (and slowly getting better) understanding of the map control, and SqlGeospatialDataReader, I though I could master that data and use it for all my map needs.  Problem is I cannot get to grips at all with using that Map data in a dataset and implementing it the map control.  The documentation offered at http://docs.telerik.com/devtools/silverlight/controls/radmap/features/information-layer/sql-geospatial-data certainly makes reference to what I assume is what I am after (it makes specific reference to dataset data sources), but I cannot envisage where to begin, as the documentation is not so specific about the dataset element.

     

    Any advice/direction is much appreciated, thanks

  2. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 22 Apr 2015 Link to this post

    Hello Luke,

    Generally both the InformationLayers'  SQLGeoSpatialDataReader and the VisualizationLayer's  AsyncSqlGeospatialDataReader have two main properties - Source and GeoSpatialPropertyName.

    Source should be used to references a collection of objects which store SQL Geospational Data in WKT / WKB format in one of its properties or in one of its Columns (if the object is System.Data.DataRow). The GeoSpatialProeprtyName specifies the Name of the property (usually a string property) which holds the geometry data. In the documentation you read the example shows this approach with binding to database. You can also find simpler example in our online demos - Map WKT Reader Demo. In it the SQLReader Source is bound to collection of business objects which are *hardcoded* in the ViewModel:
    public class WktDataViewModel
    {
        private Collection<WktDataRow> _wktDataCollection;
     
        public WktDataViewModel()
        {
            this.WktDataCollection = new Collection<WktDataRow>();
     
            WktDataRow northAreaDataRow = new WktDataRow();
            northAreaDataRow.Name = "North Area";
            northAreaDataRow.Geometry = "Polygon (("
                    + "-84.3932461670301, 33.7967217961125"
                    + ", -84.418995373573 33.808989109452"
                    + ", -84.4303250244518 33.8377961143588"
                    + ", -84.4303250244518 33.8480616114576"

    I hope this sample will help you in the getting started process. If any questions arise please do not hesitate to ask further.

    Regards,
    Petar Mladenov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Luke
    Luke avatar
    9 posts
    Member since:
    Jan 2015

    Posted 22 Apr 2015 in reply to Petar Mladenov Link to this post

    Hi and many thanks for the response

     

    I am new to WPF, and I should also add that I am using VB.net (2012).  I understand what you mention above, and implemented the attached in VB.net - keeping all namespaces etc, but it keeps coming up with the same error in that 'WktDataViewModel' does not exist in the namespace;

    The name "WktDataViewModel" does not exist in the namespace "clr-namespace:SQLGeospatialData"
     

    I am not sure if I have ventured into a principle VB/WPF issue, or still floundering with the map, but any advice?

     

    thanks

     

    Luke

     

  5. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 24 Apr 2015 Link to this post

    Hi Luke,

    When adding the class "WktDataViewModel" in the application please first build it in order to check that no errors exist in the class. The double check the namespace of the class to match the alias used in XAML.
    For example in our online sample in XAML *example* alias stands for:
    xmlns:example="clr-namespace:Telerik.Windows.Examples.Map.WktReader"
    and the ViewModel is defined in the same namespace:
    namespace Telerik.Windows.Examples.Map.WktReader
    {
        public class WktDataViewModel

    Simply check the solution for any errors in the files and corrrect matches between aliases, namespaces and classes.



    Regards,
    Petar Mladenov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. Luke
    Luke avatar
    9 posts
    Member since:
    Jan 2015

    Posted 26 Apr 2015 in reply to Petar Mladenov Link to this post

    Thanks - sorted it
Back to Top
UI for WPF is Visual Studio 2017 Ready