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

SqlGeospatialDataReader multigeometry grouping

4 Answers 58 Views
Map
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 27 Mar 2014, 04:49 PM
Hi

I've been looking at your "Map of World Continents" example whereby you can highlight Europe and all geographies within Europe are highlighted together. I can see that you are loading this information via a shapefile. I am trying to do exactly the same but using the SqlGeospatialDataReader - a single row for each continent containing a geometry field returned as STAsBinary. I have managed to get the shapes to be displayed however when I go to highlight Europe, RadMap only highlights the part of Europe which the cursor is over.

Is the functionality I require only available for Shapefiles or am I missing something obvious?

Code snippet showing how the Reader is assigned:
var sqlReader = new telerikMap.SqlGeospatialDataReader()
                {
                    Source = e.Result,
                    GeospatialPropertyName = "ShapeDataByteArray",
                    ToolTipFormat = "GeographyName",
                };
 
informationLayer.Reader = sqlReader;


Thanks
Keith

4 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 31 Mar 2014, 08:49 AM
Hi Keith,

There are 2 visualization engines in the RadMap package.
The old implementation of the map objects' (points and shapes) visualization consists of 3 layers: InformationLayer, DynamicLayer and VirtualizationLayer. This visualization engine, however, lacks certain features and has a few performance issues.
In the Q2 2013 release we've introduced a new visualization engine in the RadMap. It has been designed from scratch to have better performance. The new visualization engine replaces all 3 layers with the new VisualizationLayer. The major goals of the new engine are:
1. Improve the performance of the data visualization.
2. Allow reading map shapes from different sources (KML, ESRI, and SQL Geospatial) in the background thread.
3. Integrating clustering and items virtualization into the core. This simplifies the usage of both features.
4. Ability to attach/detach almost any input event available for the FrameworkElement to the map shape visualization.
5. Support of items selection in the engine core.

So, first I would recommend using the new engine (and its VisualizationLayer) instead of old one (or the InformationLayer).

The ESRI shape-file contains a single geometry type only. Also a single record can contain multiple shapes. So, Europe in the shape-file in example contains a few of polygons in a single record which are grouped, because it is a single shape type.
In fact the Polygon feature of WKT/WKB geometry also can contain multiple polygons. In this case they will be grouped like the polygons from the shape-file. But when your rows contain the GeometryCollection then the polygons will not grouped automatically.
I think you can use the Items Selection feature to highlight the shapes you need.
I have attached a sample solution. It uses the Name property of the data row to select all shapes from the one record.
I hope it helps.

Regards,
Andrey Murzov
Telerik

 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Keith
Top achievements
Rank 1
answered on 04 Apr 2014, 11:44 AM
Really disappointed that there's been no update yet. I'm surprised as previously, responses have usually been provided very quickly.
0
Petar Mladenov
Telerik team
answered on 04 Apr 2014, 01:12 PM
Hello Keith,

Please excuse us for the inconvenience caused. We have posted an answer but it seems there was a problem with our internal systems and this answer has not been published. We will investigate this case precisely.

Here is our answer from Andrey Murzov:

There are 2 visualization engines in the RadMap package. 
The old implementation of the map objects' (points and shapes) visualization consists of 3 layers:InformationLayer, DynamicLayer and VirtualizationLayer. This visualization engine, however, lacks certain features and has a few performance issues.
In the Q2 2013 release we've introduced a new visualization engine in the RadMap. It has been designed from scratch to have better performance. The new visualization engine replaces all 3 layers with the newVisualizationLayer. The major goals of the new engine are:
1. Improve the performance of the data visualization.
2. Allow reading map shapes from different sources (KML, ESRI, and SQL Geospatial) in the background thread.
3. Integrating clustering and items virtualization into the core. This simplifies the usage of both features.
4. Ability to attach/detach almost any input event available for the FrameworkElement to the map shape visualization.
5. Support of items selection in the engine core.

So, first I would recommend using the new engine (and its VisualizationLayer) instead of old one (or theInformationLayer).

The ESRI shape-file contains a single geometry type only. Also a single record can contain multiple shapes. So, Europe in the shape-file in example contains a few of polygons in a single record which are grouped, because it is a single shape type.
In fact the Polygon feature of WKT/WKB geometry also can contain multiple polygons. In this case they will be grouped like the polygons from the shape-file. But when your rows contain the GeometryCollection then the polygons will not grouped automatically.
I think you can use the Items Selection feature to highlight the shapes you need.
I have attached a sample solution. It uses the Name property of the data row to select all shapes from the one record.


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.

 
0
Keith
Top achievements
Rank 1
answered on 08 Apr 2014, 02:23 PM
Hi Peter

Thanks for the reply and explanation. I have already switched the code over to use the VisualizationLayer to get the performance gains. I implemented my own drawing mechanism which merges the shapes on the fly which seems to work. I'll take a further look at your example project as it may be useful when we come to use the various selection features we require.

Thanks
Keith
Tags
Map
Asked by
Keith
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Keith
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or