User Tools

Site Tools


map_suite_services_edition_layers_featuresources_samples

Map Suite Services Edition Layers & FeatureSources Samples

ENC Viewer for displaying S-57 (*.000) File

map_suite_wpf_desktop_edition_s57viewer.jpg

Today’s project is a tool of ENC Viewer for displaying unencrypted Electronic Navigational Charts (ENCs) available in the S-57 exchange format (*.000).
This tool takes use of Map Suite HydrographyExtension to display ENC data in compliance with the latest version of ECDIS Presentation Library Edition 4.0, which is defined by the International Hydrographic Organization (IHO) in the special publication S-52.

NOTE: the styling file “NauticalCharts.xml” for drawing S-57 (*.000) file is included in the source code package.


GPS EXchange Format FeatureLayer

This sample demonstrates how to read GPS EXchange Format file(*.gpx) with Map Suite. GPX (GPS Exchange Format) is a light-weight XML data format for the interchange of GPS data (waypoints, routes, and tracks) between applications and Web services on the Internet, which you can find more information:here. Now Map Suite supports the GPX 1.0 and 1.1 schema. This sample works with Map Suite development branch daily build 7.0.275.0 or later.


Maritime S57 FeatureLayer

This sample demonstrates how to display unencrypted Electronic Navigational Charts (ENCs) available in the S-57 exchange format (*.000). It follows the style schema defined in the latest version of ECDIS Presentation Library Edition 4.0 (S-52), which is published by International Hydrographic Organization (IHO).

NOTE: This sample works with Map Suite development branch daily build 9.0.31.0 or later, Map Suite Unmanaged Dependencies 9.0.31.0.msi or later needs to be installed.


Build Custom Shapefile Indexes

map_suite_services_edition_sample_build_custom_shapefile_indexs.jpg

This sample shows how you can display a subset of a shapefile without splitting the physical shapefile. For example, you may have a single shapefile that contains both highways and local roads. To improve display speed, you may be temped to split it into two separate shapefiles so you can quickly display local roads with one style and highways with another style (and avoid using a value style, which can be slow). But at this project demonstrates, rather than split your shapefile you can simply build two custom indexes, one for each road type. Then, when you create your ShapeFileFeatureLayer, you'll simply use your original shapefile and specify a custom index. Each custom index will limit the records that can be seen by the Layer, making it very fast and efficient.


CAD FeatureLayer

map_suite_services_edition_sample_display_cad_file.jpg

This sample demonstrates how you can read data from an CAD file(*.dwg, *.dxf) in your Map Suite GIS applications, and how to render it with CAD embedded style as well as a customized style. It works with Map Suite daily development build version 7.0.46.0 or later, and Setup Unmanaged Dependencies 7.0.46.0 or later needs to be installed to make the sample work. This Cad File support would work in all of the Map Suite controls such as WPF Desktop Edition, Silverlight Edition, Web Edition, MVC Edition. The CAD dependencies assemblies can be downloaded from http://wiki.thinkgeo.com/wiki/File:MapSuiteCADDependencies8.0.109.0.zip


TAB FeatureLayer With Embed Style

map_suite_services_edition_sample_display_tab_file.jpg

This sample demonstrates how you can read data from an Tab file(*.tab) in your Map Suite GIS applications, and how to render it with Tab embedded style as well as a customized style. It works with Map Suite daily development build version 8.0.208.0 or later. This Tab File support would work in all of the Map Suite controls such as WPF Desktop Edition, Silverlight Edition, Web Edition, MVC Edition.



Compass

map_suite_services_edition_sample_compas.jpg

In the project “North Arrow”, you saw how to extend AdornmentLayer to create a North Arrow AdormentLayer. In this project, we expand on that idea and create a more sophisticated class. You will see how you can combine two images to create a compass. Compare to “North Arrow” project, we also added some other handy properties such as a Position property. Also, the compass can be of varied sizes thanks to the SizePercentage property. Finally, if you pass just one image, the compass can behave just like a regular north arrow.
We also added new designs of compass in smaller version. See the attached file: Rotating Compass New Smaller Designs.zip


File Geodatabase

map_suite_services_edition_sample_filegeodatabase.jpg

This sample demonstrates how you can read data from an ESRI FileGeodatabase in your Map Suite GIS applications. The sample will read data from 3 tables of one FileGeodatabase, and you will find the code as straightforward as consuming any other data source in Map Suite. It works with Map Suite daily development build version 6.0.115.0 or later, and you will need to run the “Setup Unmanaged Dependencies” installer from your daily build package in order for the sample to work The FileGeodatabase sample works in all of the Map Suite controls such as WPF Desktop Edition, Silverlight Edition, Web Edition, MVC Edition and so on.

Video Overview


Hook Up External Data to Shapefile

map_suite_services_edition_sample_hook_up_external_data_to_shapefile.jpg

This sample shows how to hook up external data to shapefile. The US states shapes are from a shapefile while the population values for Washington and New York come from an external database. From this sample, we can see how to use the event FeatureSource.CustomColumnFetch to introduce an external data source and utilize Dictionary objects to cache the external data.



Isolines

map_suite_services_edition_sample_isolines.jpg

In this sample we show how you can use Map Suite to add isolines (commonly known as contour lines) to your .NET application. Isolines are a way to visualize breaks between different groups of data such as elevation levels, soil properties, or just about anything else you can imagine. This sample also shows the various steps in creating isolines, including the gathering of point data, creating a grid using interpolation, and finally, picking your isoline break levels. We also quickly dive into some more advanced options such as generating isolines on the fly.

To bring this all together, check out our instructional video that will walk you through the process of setting up and working with isolines in Map Suite.

Please note that you will need version 5.0.87.0 or newer of Map Suite in order to use isolines. For more information on how to upgrade, see the Map Suite Daily Builds Guide.

From 6.0.187.0, the sample has been updated that polygons can also be returned as IsoLines results. You need version 6.0.187.0 or newer of Map Suite in order to use this sample.


Isolines with Kriging

map_suite_services_edition_sample_isolines_with_kriging.jpg

In this sample we show how you can generate isolines (commonly known as contour lines) using Kriging Interpolation Models. We integrated 5 Kriging interpolation models (Circular, Exponential, Gaussian, Linear, Spherical) in Map Suite which you can see from the sample are powerful and very straightforward to use. It works with Map Suite 6.0.126.0 or later.



MapShapes

map_suite_services_edition_sample_map_shapes.jpg

One of the most requested features left out of Map Suite 3.0 is MapShapes. For those who are not familiar with MapShapes, in Map Suite 2.0 they were a group of self-contained features that had their own styles, projection and column data. This meant that each one could be unique; however, this also meant you had to specify all of the attributes about each single MapShape.

In working with customers using MapShapes for a number of years, we found a common pattern. First, users tried MapShapes by adding one to the screen. This was very simple and got them up and running fast. They next added a few more as they started to build more of their application. After a short amount of time they realized that it was cumbersome to set the projection, styles, zoom levels, etc. on so many MapShapes, especially since the MapShapes often represented the same kind of underlying feature, like a fire hydrant or road block. The problem was that there was no good solution with Map Suite 2.0 to handle lots of very similar dynamic features.

In designing Map Suite 3.0, we took this into account and created the InMemoryFeatureLayer and InMemoryFeatureSource. These allowed you to treat all of the same kinds of similar features as if they were one group, which solved many problems. What we later found was that it made it more difficult for the cases where you truly had dozens or hundreds of features that were each unique and you needed to represent them as such. Having not implemented MapShapes, we were caught with a hole in our offering.

To fill this gap, we are presenting a project for a simple MapShapeLayer. This is a simple version of a more powerful one that we will include as part of the core framework in the near future. What really struck us when we were creating this new Layer was just how easy it was to do! It is a testament to our 3.0 framework and we decided to include the section below on how we implemented it.
Notes from the developer:

Success! This was about as easy as I thought it would be. All of the heavy lifting was done by existing classes and all I needed was a little glue code. In retrospect, I would had liked to do this by inheriting from the FeatureLayer and FeatureSource, because then it would have made the layer accessible by spatial queries. In the interests of time, and so I could post this on our forums as fast as possible, I inherited from Layer, which is really simple. You can see that the comments and my notes here take up more room than the code itself!

I think you will find this works nearly exactly as the 2.0 MapShapes did. It doesn't support projection; however, I think this could be easily added. We will be creating a production version of this class to include with the framework in the near future, and if projection is indeed easy to add, it will support projection and spatial querying.

In a nutshell, what I did was to create a MapShape class that housed a ZoomLevelSet and a single Feature. The ZoomLevelSet has all of the zoom levels, styles, etc. on it, so that part was nice to reuse. I matched this up with a new kind of Layer. I created the MapShapeLayer by inheriting from Layer. The only required overload was Draw, which was nice. I added to the class a MapShape's GeoCollection to store all of your MapShapes. In the Draw I simply looped through the MapShapes, and for each of them I found the zoom level that would be drawing and called its Draw method. In just a few lines of code, it all came together.


Mini Map Adornment Layer

map_suite_services_edition_sample_mini_map_with_adornment_layer.jpg

This project shows how to create a simple mini map to give a reference of where you are when you zoomed in. As for WaterMarkAdornmentLayer, the MiniMapAdormentLayer inherits from AdornmentLayer.




Multi Geo Raster Layer

no_screenshot.jpg

MapSuite API has RasterLayer from which inherits MrSIDRasterLayer and ECWRasterLayer etc. If we have many raster files, we would need to add all the raster files as separate layer. However this has a performance issue. In this project, we show how to create a class MultiGeoRasterLayer that treats all the raster file as one layer.

This class show how to do that using JPEG images with its associating JGW world file. It speeds up the loading of a large number of Raster layers by loading and drawing on demand only the files in the current extent. It loads a reference file that contains the bounding box, path and file information for all of the Raster files. We load this information into an in-memory spatial index. When the map requests to draw the layer, we find the Rasters that are in the current extent, create a layer on-the-fly, call their Draw method and then close them. In this way, we load on demand only the files that are in the current extent.


Multi Index

map_suite_services_edition_sample_multi_index.jpg

Today our purpose is to gather into one concise project all the different knowledge we learned about multi index in various Discussion Forum posts such as:
http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5921/afv/topic/Default.aspx
http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5958/afv/topic/Default.aspx
Consolidating various physical shapefiles into one layer is a flexible and clean way to handle your data. Thanks to multi index, you can treat your layers as one. Depending on your needs you can choose to use all the shapefiles in one folder or only a few. In this project you will see the different ways to use the powerful static function MultipleShapeFileFeatureLayer.BuildIndex()


North Arrow

map_suite_services_edition_sample_north_arrow.jpg

This project demonstrates basically two techniques; How to rotate a map and how to have a North Arrow keeping the right north orientation.

Rotating the map:

To rotate the map, you have to be aware that you have to use RotationProjection class provided by MapSuite API. All the layers need to have their projection property set to RotationProjection. Beware that if a Layer does not have that property set, it will not rotate along with the rest of the map.

Displaying the North Arrow:

As the map rotate, it is important to keep track of the orientation of the map and to know what the direction to the North is. Inheriting from Adornment Layer, RotatingAdornmentLayer class takes an Image representing a North Arrow and with its RotateAngle property set according to the angle property of RotationProjection, it always shows the North correctly.


Oledb Point FeatureSource

map_suite_services_edition_sample_oledb_point_featuresource.jpg

This project shows the power of MapSuite by giving to the developer the possibility to create its own layer based on an existing format containing spatial information. If the developer is familiar with a certain format like oledb, he can create its own FeatureSource reading the database and its own FeatureLayer wrapping the FeatureSource and providing the drawing logic.

In this project, we create the class OledbPointFeatureSource inheriting from FeatureSource and OledbPointFeatureLayer inheriting from FeatureLayer.


Oledb FeatureSource

map_suite_services_edition_sample_oledb_featuresource.jpg

This project shows how you can store your geometry data in any OLEDB compatible database. The sample provides a custom FeatureSource and FeatureLayer that allows you to query, insert and edit a full range of spatial. The spatial data is stored in binary using Well Known Binary and its index is a series of four columns describing the bounding box. This solution does not require your database to support any sort of special spatial indexing as it is all build into table structure and uses plain SQL statements to query back the data. This sample is also a great way to see how it is easy and efficient to extend Map Suite to meet your specific requirements.

NOTE: For portability and allowing the sample to be self-contained with minimal setup we have used a Microsoft Access database. Due to this there is a limitation there the “Microsoft.Jet.OLEDB” engine can only run in X86 mode. This is reflected in the target for this project. If you use another OLDB source then is limitation is no longer applicable.


Scale Bar

map_suite_services_edition_sample_scale_bar.jpg

Map Suite already offers classes such as ScaleBarAdornmentLayer for displaying scale bars on the map but they are limited to certain common units like meters, kilometers, feet and miles. In this project, you are going to learn the basics for creating a scale bar using the unit of your choice. The class CustomUnitScaleBar displays a very simple scale bar but you will find the logic for basics of creating a scale bar. Looking at the code, you will be able to create more sophisticated stylish scale bars for your own needs.


SQLInMemoryLayer

The purpose of this sample is to show you a quick and easy way to read data from a SQL data source and display it on the map using an InMemoryFeatureLayer. Since geometric feature data can be stored in a number of different formats such as X and Y coordinates, WKT (Well Known Text), and Geometry data types, this sample shows you how to load, edit and save data to a SQL data source for each different type of format. The sample includes a SQL script you need to run first, in order to create and populate a SQL Server table with sample data. You will also need to change the connection information in the code on lines 71 and 204 so that it points to your SQL Server.

Note: The approach in this sample works best for small amounts of data (less than 10,000 features) since it loads all of the data into memory. For larger datasets, we recommend using the SQL2008FeatureLayer or the ''OledbFeatureSource'', which only reads the data for the given extent you are working in (much more efficient for larger datasets).


Styles with InMemoryFeatureLayer

In this WPF project, we show how to build an InMemoryFeatureLayer from a text file. You'll notice how the columns are set up so that styles can be used as if the InMemoryFeatureLayer were a static layer such as a Shapefile. Here, we apply a Class Breask Style and a Text Style to our InMemoryFeatureLayer. What we learn in this sample can be applied to all the different editions of Map Suite.


Swine Flu

map_suite_services_edition_sample_swine_flu.jpg

In today’s project is going to apply some of the techniques we learned in the previous projects to some swine flu data available on the web.
On the web site
http://www.mapcruzin.com/free-download-h1n1-swine-flu-arcgis-shapefile.htm, it is possible to download point based shapefiles of swine flu occurrences in the world. While this information is valuable, it is a little difficult to display it at world level. At high zoom levels, all the points are on top of each other making the map very difficult to read and get overall information of the swine flu situation at the world level as you can see in the image with the map of the upper left.

Using some the techniques we used before such as Spatial Join with some modification, we can create a new polygon based layer from the country layer adding info from the swine flu layer. That resulting layer can be displayed with the info being a lot more readable as you can see in the map of the lower right corner of the image.

We basically use the techniques we saw in the “Spatial Join” project with getting the info from the swine flu layer into the country layer based on spatial relationship. We also use the techniques from “Dissolve with statistics” for doing some statistics on the swine flu records according to what country they belong to. See the comments in the project for more details.

Keep in mind that the project is for shapefile data format, if there are people expressing interest for doing the same thing with other data format, we will create a new more generic project.


Watermark Adornment Layer

map_suite_services_edition_sample_watermark_adornment_layer.jpg

This project shows how to create a WaterMarkAdornmentLayer class inheriting from AdormentLayer. Notice that in the overridden method DrawCore, the drawing is done using screen coordinates. This is a characteristic of Adornment Layer and any layer inheriting from it. In this example, the code in the DrawCore method places the water mark text at regular interval but you could easily modify the code to have the water mark text placed randomly on the map. Notice that WaterMarkAdornmentLayer is added to the StaticLayers collection of the MapEngine meaning that you can place this adornment layer on top of all the other layers or between any other layers. This class is useful for providing demos to clients.


WMTS Layer

This project shows how to consume data from a WMTS Server using WmtsLayer. You would find the code pretty straightforward, just like displaying a shapefile, while behind the scenes we request tiles from the server asynchronously and efficiently, and stitch them into a proper map.
This class is introduced from version 6.0.187.0, besides this WmtsLayer, we also have WmtsOverlays in different products. For example, this is the WPF WmtsOverlay Sample.


Zedgraph

LEAD Technologies Inc. V1.01

In our “How Do I” apps, there is sample app that shows how to add graphs to the map using the ZedGraph library. In this project, using the same data, the US cities, we elaborate a little bit on the pie chart. You will see how to add some gradient colors to the chart, how to label the different pie slices, how to add a title etc. Zedgraph is a truly massive library for graphics and Pie chart is only one type of chart among many others. As you can add pie charts to your map, you can also add bar charts, trend charts etc. I suggest you check out this site for more info on ZedGraph http://zedgraph.org/wiki/index.php?title=Main_Page With Map Suite, you have the whole ZedGraph API available with an easy interface to add the graphs to the map. For this project, in addition to the MapSuiteCore.dll, you will also need the ZedGraph.dll and ZedGraphStyleExtension.dll references. We will have several projects showing how to integrate other types of charts to your map.

map_suite_services_edition_layers_featuresources_samples.txt · Last modified: 2017/03/17 03:08 by tgwikiupdate