📜 ⬆️ ⬇️

Map and GIS components for GitHub developers

Good afternoon, residents and guests of Habr!

I present to your attention one interesting tool, for those who, by the nature of their activity or by virtue of their hobbies, are interested in spatial data, the creation of diverse GIS systems and cartographic services.

So, MapAround is a full-fledged cartographic engine that contains tools for solving most typical tasks arising in the development of GIS, is fully implemented in .NET (is not a wrapper for native libraries), and has a high degree of modularity. This SDK organizes data in a form that is digestible for the card, i.e. allows you to bind the map to real coordinates, adjust its display, split into layers / merge them.
')



Sources on GitHub are available at the link: github.com/gkrsu
github.com/gkrsu/maparound.core - core

Functionality:
- calculation of lengths, distances, areas and perimeters;
- solution of direct and inverse geodetic tasks;
- calculation of associations, intersections, difference and symmetric difference of objects
- construction of buffer zones;
- calculation of the intersection matrix;
- calculation of the values ​​of binary predicates: "equivalent", "disconnected", "contains", "contains", "crosses", "crosses", "overlaps", "concerns"
- construction of the Voronoi partition and Delaunay triangulation;
- conversion from geographic coordinates to one of the following projections: the Mercator projection; transverse projection of Mercator (UTM); the equal projection of Albers; Lambert Conformal Projection.

If it is simpler to express it, then the tasks from the category “ to select all areas of at least a hectare not closer than two hundred meters from the railway route and not crossed by power lines ” are solved quite easily.
Or, for example, you need to calculate the buffer zone, having geographical coordinates somewhere in the region of Arkhangelsk - in MapAround it is possible.

When making digital maps, the engine has the following features:

- display of vector and raster symbols;
- setting up line objects hatching;
- polygon objects (a large number of fill patterns, simple and shaded areas);
- support for smoothing and translucency;
- raster display;
- system of an output of inscriptions.

You can get any thematic map. You can customize the appearance of the map without encoding. All settings can be saved in xml-format. An image of a digital map can be obtained in the following formats: JPG, BMP, PNG, GIF, TIFF.

I will give a simple example of creating a map (WinForms)

public partial class Form1 : Form { private Map _map; public Form1() { //   MapAround   (MapControl)      InitializeComponent(); _map = new MapAround.Mapping.Map(); mapControl.Map = _map; //    MAP } private void btnOpen_Click(object sender, EventArgs e) //   « » { using (var dialog = new OpenFileDialog()) { dialog.Filter = "*.shp|*.shp"; dialog.CheckFileExists = true; if (dialog.ShowDialog() == DialogResult.OK) { //    var layer = new FeatureLayer() { Alias = dialog.FileName, Visible = true }; var shape = new ShapeFileSpatialDataProvider {FileName = dialog.FileName}; shape.QueryFeatures(layer); //    Shape  _map.AddLayer(layer); //     SetViewBox(); //   ViewBox (  ) } } } private void SetViewBox() //   ViewBox { BoundingRectangle rectangle = _map.CalculateBoundingRectangle(); if (rectangle.IsEmpty()) return; //     // ,  ,       double deltaY = rectangle.Width * mapControl.Height / 2 / mapControl.Width - rectangle.Height / 2; //   ViewBox mapControl.SetViewBox( new BoundingRectangle(rectangle.MinX, rectangle.MinY - deltaY, rectangle.MaxX, rectangle.MaxY + deltaY)); } //   /    private void btnZoomIn_Click(object sender, EventArgs e) { if (_map.Layers.Count == 0) return; mapControl.ZoomIn(); } private void btnZoomOut_Click(object sender, EventArgs e) { if (_map.Layers.Count == 0) return; mapControl.ZoomOut(); } private void btnViewAll_Click(object sender, EventArgs e) { if (_map.Layers.Count == 0) return; SetViewBox(); } } 


The sample code is posted on github, you can download it here.

What else to say.
MapAround supports the following vector graphics formats: ESRI Shape-file, MapInfo TAB, DXF. Spatial data can be stored in relational database tables (supported by: Oracle Spatial; PostGIS; Microsoft SQL Server 2008 (geometry, geography))

Vector data can be serialized to Well-known text and Well-known binary formats.

If it became interesting to you, I remind, source codes can be taken here.

And as usual - we will be very glad to receive your comments and suggestions on MapAround!

Source: https://habr.com/ru/post/168369/


All Articles