This mini project is a POC that shows how to perform different tasks to manipulate or act on spatial geometry using the NetTopologySuite in-memory operations, PostgreSQL + PostGIS EF database operations.
- NetTopologySuite : This library is used in this project to perform GIS functions that are absent from SQL Server in-memory.
- ProjNet : This library is used to perform Coordinate System Transformations (Reprojections).
- NPGSQL : Consistes of 2 libraries that are used to perform EF database operations on a PostgreSQL DB with PostGIS. Full documenation on the library, it's usage and supported PostGIS functions can be found here
Assumes you have Visual Studio & Docker installed.
- Fork & Clone the Repo
- Execute the docker-compose in ./docker/postgis
- Execute the scripts in ./ddl to create the required schema/table(s).
- Open the solution and ensure the required libraries are installed.
- You can rebuild the EF Context/Models with the following command
Scaffold-DbContext -Connection "host=localhost;port=5432;database=gis;user id=docker;password=docker" -Provider Npgsql.EntityFrameworkCore.PostgreSQL -o Models -ContextDir Context -Context ScaffoldDbContext -Schemas gis_test -Force