Geographic information system (GIS) is a system designed for capturing, storing, manipulating, analyzing, managing, and visualizing all types of spatial or geographic data. GIS connects data to a map, integrating location data with all types of descriptive information. Data formats used in GIS supports both spatial and informative data sets.
GIS technology allows for the integration of multiple forms of information, including maps, numerical data, and text, in order to better understand relationships, patterns, and trends in the data. This technology is used in a wide range of fields, including geography, urban planning, environmental science, and many others
We mentioned earlier that a geographic information system (GIS) is a system that storing, manipulating, and analyzing spatial data.
Spatial data represents the physical location and the shape of objects. Many databases provide support for this type of data so it can be indexed and queried alongside other data. Beside the nature of spatial data can be reflected into a program with ease. Entities represents a spatial shape or location can be imitate with objects in a program. Common scenarios include querying for objects within a given distance from a location, or selecting the object whose border contains a given location. EF Core supports mapping to spatial data types using the NetTopologySuite spatial library. Spatial analysis can be made by using the objects provided by NetTopologySuite
NetTopologySuite supports following databases; SQL Server, PostgreSQL, MySQL, Oracle. Implementation can be done in basic steps. Below example demonstrates how we can use NetTopologySuite with SQL Server
When we are working on a project provides GIS solutions, we are obligated to store, process, analyze spatial data. We mentioned earlier nature of spatial entities can be reflected to a program using objects. Thanks to NetTopologySuite, we will have all these objects that represents spatial entity.
There are several objects provided by NetTopologySuite listed below
Geometry – Point – LineString – Polygon | GeometryCollection – MultiPoint – MultiLineString – MultiPolygon |
Let assume we are using EntityFramework and following code first approach to designing our database, we need start with designing our domain and create our entities. Lets create an example entity contains spatial data using spatial objects provided by NetTopologySuite
In the above example we create a LastLocation entity. Which we may encounter in a GPS based tracking systems.
GPS tools sends X and Y coordinates of a spatial location which we can reflect with Point object provided by NetTopologySuite.
When Entity Framework start to read our entities and map into our database system, it will understand the Point data type and how he can map and operate since we told when we add UseNetTopologySuite options in the startup.
Required information will be provided by NetTopologySuite to EntityFramework
NetTopologySuite supports data formats what modern Web API’s use. Such as XML and JSON. In GIS there are known data formats accepted by the community as a standard. NetTopologySuite supports following spatial data formats listed below.
In the above stage we discuss about what data formats NetTopologySuite can support and produce.
There are most common two format in the industry; KML and GeoJSON. Since using JSON data become into a standard. I will demonstrate how you can easily convert your geometry object into the standardized GeoJSON type.
In the above example we can convert our geometry objects in the entity to GeoJSON using NetTopologySuite. It can be easily integrated our REST services and we can return JSON response contains our spatial data in GeoJSON format. Like the JsonSerializer, NetTopologySuite provides another helper class called GeoJsonSerializer which can help us to seralize or deserialize our GeoJSON and geometry objects to each other.
Above example demonstrates how we can deserialize GeoJSON into geometry objects using GeoJsonSerializer
In the article I tried to explain basic steps to work with the NetTopologySuite. Of course it is not everything there are so many things we can discuss about NetTopologySuite but I believe the post got long and I don’t want to make you bored 😀
If you want to get to know more about the GIS and NetTopologySuite. Stay tuned! We just started! I’m planning to share more about it in my following posts 🙂 Until then, take care 🙂 May the GeoJSON be with you!
Herkese Merhabalar. Bildiğiniz üzere bu ay Angular 17 yepyeni bir imaj çalışması ile birlikte yayına…
Herkese merhaba arkadaşlar. Önceki yazımızda openlayers nedir ve neden kullanmalıyız sorunu yanıtlamıştık. Popüler harita kütüphanelerinden…
Merhaba arkadaşlar. Eğer CBS (Coğrafi Bilgi Sistemleri) dünyasına yeni yeni adımlar atıyorsanız adını sık sık…
Herkese merhabalar. Bugün angular ekosisteminde NGXS kullanarak nasıl state management yapacağımızı inceleyeceğiz. Angular state management…
Herkese Merhaba. Bu yazımızda frontend camiasında faaliyet gösteren herkesin aklındaki o soruya bir açıklık getireceğiz.…
Uzun bir aradan sonra herkese merhaba :) Angular Template Driven Form Nedir, Ne işe yarar…