Questions tagged [nettopologysuite]

NetTopologySuite is a direct-port of all the functionalities offered by the [JTS] Topology Suite

NetTopologySuite is a direct-port of all the functionalities offered by the JTS Topology Suite. NTS exposes JTS in a '.NET way', as example using Properties, Indexers etc...

An excerpt from the JTS website explains the capabilities of NetTopologySuite:
"The JTS Topology Suite is an API for modelling and manipulating 2-dimensional linear geometry. It provides numerous geometric predicates and functions. JTS conforms to the Simple Features Specification for SQL published by the Open GIS Consortium."

138 questions
2
votes
1 answer

Area of intersection of rectancle and polgyon NTS TopologySuite

I am interested in the area of a dynamic NetTopologySuite.Geometries.Polygon that is within a fixed bounding box rectangle(105x68). It can sometimes break out the of rectangle (which is fine), but I am only interested in the area that is covered by…
ManuKaracho
  • 1,180
  • 1
  • 14
  • 32
2
votes
1 answer

How to read geographical raster in c#

I am looking for a "clean" way to load rasters to my c# code. By raster I mean any (or at least some) XYZ file that QGis or ArcGis are able to load: .tif, .rrd ... I am using NetTopologySuite. This library works perfectly for shapefiles, which makes…
Xavier Peña
  • 7,399
  • 9
  • 57
  • 99
2
votes
1 answer

Why is sharpmap returning inconsistent results while mapping from point to polygon?

I am using a shapefile(shp) that has an addition field called "ID". The shapefile is clean and does not have any overlapping polygons. When I pass this shapeFile to the following function, I keep getting inconsistent results. (The Id returned is not…
KnightFox
  • 3,132
  • 4
  • 20
  • 35
1
vote
0 answers

EF Core error: The spatial reference identifier (SRID) is not valid when updating database with migration of point data

I am getting the following error when updating a database with default point data: System.ArgumentException: 24204: The spatial reference identifier (SRID) is not valid. The specified SRID must match one of the supported SRIDs displayed in the…
AnotherNewbie
  • 198
  • 1
  • 1
  • 6
1
vote
1 answer

NetTopologySuite WKTReader ignores SRID

I implemented NetTopologySuite into EF Core (SQLServer). I'm getting coordinates from the Google APIs, transforming them into Point and Polygon and saving them into the database without trouble. I stringify Geometry.AsText() these types when sending…
Auguste VN
  • 15
  • 3
1
vote
1 answer

Nettopologysuite Geometry.Intersection does not output the expected polygon

I am creating a web application which shows what area is reachable in x amount of minutes inside of the Netherlands. To do this I want to intersect the polygon of the reachable area(s) with the one of the Netherlands. I am displaying the polygons in…
bengs
  • 26
  • 5
1
vote
1 answer

NetTopologySuite Coordinate vs Point for Entity Framework

So after reading this article Working effectively with coordinates in Entity Framework the author advices to use NetTopologySuites Point class for storing coordinates in the lat/lng SRID 4326 format. In that way you can request the database for…
NLAnaconda
  • 1,534
  • 3
  • 14
  • 38
1
vote
1 answer

How to measure distance between two Points in metres with NetTopologySuite / ProjNet (2022)

This question has been posted multiple times before but the answers no longer appear to match the method signatures available in the latest NuGet packages. After spending days trying to piece together an answer from other places (1, 2, 3, 4, 5, 6,…
1
vote
0 answers

How do I use NetTopologySuite in SQL Server without EF?

I am not (and will not be) using Entity Framework but I'd like to use NetTopologySuite support for SQL Server. I managed to get it working with PostgreSQL but can't seem to crack it with SQL Server. In Npsql I can read/write the Geometry type…
mxcolin
  • 71
  • 7
1
vote
1 answer

How can I map an SQL Server geometry column to an EF6 property

I have a nullable geography column in a table in a SQL Server database. In an Azure Function project (v4, .NET 6.08, NetTopologySuite included), when using Scaffold-DbContext to create an EF6 data context, the geometry column was mapped to Geometry?…
GilShalit
  • 6,175
  • 9
  • 47
  • 68
1
vote
1 answer

Create Shapefile From WKT failed Using NetTopologySuite.IO.Esri

I want to create a shapefile from wkt by using NetTopologySuite.IO.Esri, but get this error like this: Unhandled exception. System.InvalidCastException: Unable to cast object of type 'NetTopologySuite.Geometries.Polygon' to type…
1
vote
1 answer

When writing a SQL Server geography value, the shell of a polygon must be oriented counter-clockwise

Using Net Topology suite I am creating geometries and attempting to insert them into the database. I'm getting this error on some of the Polygons/Multipolygons when attempting to write them to the database: "When writing a SQL Server geography…
1
vote
0 answers

How to make a circle type buffer around NetTopologySuite Point with radius in N meters?

I have to draw a circle with N meters diameter around some geolocation. I could able to generate coordinates for vertically oriented ellipse only. C# using NetTopologySuite; // const int SRID = 4326; var fact = new GeometryFactory(new…
NoWar
  • 36,338
  • 80
  • 323
  • 498
1
vote
1 answer

Serializing FeatureCollection GEOJSON in .NET Core

I am trying to serialize a FeatureCollection so I can pass it as a request body. To do this I am using a NetTopologySuite.IO.GeoJSON package and using the instruction they provide on their github page. The problem is, when hitting the…
Filip Skukan
  • 531
  • 1
  • 7
  • 18
1
vote
0 answers

A bug about PrecisionModel in NTS(C#)?

I use PrecisionModel in NTS(C#) to specify a fixed decimal place (i.e. 0.1, 0.01, 0.001 ... ) for Coordinates in a Geometry. I tried three fixed decimal place : 0.1, 0.01, 0.001 for the same LineString. But the precision of 0.1 always got error when…
Ken
  • 47
  • 3