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
1
vote
0 answers

Filter Geometry (Lat, Lng) Distance by kilometers with Entity Framework Core and MS SQL

I used the artice from https://learn.microsoft.com/de-de/ef/core/modeling/spatial to start and use Entity Framework Core MS SQL NetTopologySuite.Core 1.15.3 I have a class City with IGeometry type. It was automatically created because i created…
1
vote
0 answers

SQL Server with EF Core Net Topology Suite Within Query Not Returning Correct Results

I have a Google Map that I'm getting the bounds from, and sending those to the server to get a list of markers. Here's an example set of parameters passed up: neLat 60.11131083608817 neLng -74.22879847513246 swLat 47.2231665957533 swLng …
Zout
  • 821
  • 10
  • 18
1
vote
2 answers

C# NetTopologySuite M-values

I'm using NetTopologySuite as a .net core replacement for SqlGeometries. It seems like it doesn't support M values in the points or coordinates although it has M properties. For example this simple code: using NetTopologySuite.Geometries; using…
Johan
  • 1,260
  • 16
  • 34
1
vote
1 answer

NetTopologySuite squash multipolygon to polygon

I am working in aspnetcore using the most up to date GeoAPI and NetTopologySuite version for core. What I'm trying to do should be fairly simple but I can't seem to find the proper way to do it either through experimentation of googling. Or even…
Ed Kramer
  • 131
  • 1
  • 12
1
vote
0 answers

Reading shapefile encoding

I have to read shapefile and get all attribut value. I use (NetTopologySuite ) : void readShape() { AtlGeometryFactory geom = new AtlGeometryFactory(); var reader = new ShapefileDataReader(shpFileName, geom.GeometryFactory); DbaseFileHeader…
Jack
  • 11
  • 2
1
vote
1 answer

Serializing/Deserializing a roundtrip with NetTopologySuite's IO Library for GeoJson reveals a potential bug

I'm having trouble using NetTopologySuite's GeoJsonReader to deserialize Feature objects. In particular, I'm receiving the following exception (which at first glance seems straightforward, so please read on): An unhandled exception of type…
D. Reagan
  • 841
  • 1
  • 8
  • 24
1
vote
1 answer

How to determine the coordinatesystem of a shapefile set with ShapefileDataReader

I have the following code to read a shapefile set (.dbf, .prj, .shp, .shx) with the NetTopologySuite.IO.ShapefileDataReader: public FeatureCollection ReadShapeFile(string localShapeFile) { var collection = new FeatureCollection(); var…
Jan Willem B
  • 3,787
  • 1
  • 25
  • 39
1
vote
1 answer

SharpMap: Creating and editing geometry

I´m working in a project using sharpmap on this we're displaying information, but is necessary create and edit too. I have experience with presenting information but i need some advices with creating and editing. I am working with 1.1.0 version of…
1
vote
0 answers

Point.Empty.Equals(Point.Empty) == false // why?

Using NetTopologySuite, these expressions are false: Point.Empty.Equals(Point.Empty); // false Polygon.Empty.Equals(Polygon.Empty); // false Debugging shows that this behavior is implemented by // Geometry public IntersectionMatrix…
citykid
  • 9,916
  • 10
  • 55
  • 91
0
votes
1 answer

Problem with Triangulation using NetTopologySuite

I don't have much experience with NetTopologySuite, so any help will be appreciated! I have a polygon: POLYGON((10 12,10 8,9 8,9 13,10 13,10 15,11 15,11 13,12 13,12 15,14 15,14 13,15 13,15 8,13 8,13 12,12 12,12 9,11 9,11 12,10 12)) and I need to…
user17952421
  • 103
  • 3
0
votes
0 answers

Use NetTopologySuite to offset a polyline with variable distance

NetTopologySuite seems able to create a buffer polygon with a varying buffer distance at each vertex along a line. But what about just offsetting a polyline with variable distance? Is there anyway to use built-in functions, or manipulate the…
Graviton
  • 81,782
  • 146
  • 424
  • 602
0
votes
1 answer

Using NetTopologySuite, how can I convert meters to degrees?

I have no language preference for an answer; either VB.NET or C# will be fine. I've seen this problem discussed elsewhere here on SO, for example here and here, but I've not found solutions that employ the NetToplogySuite and ProjNet libraries.…
0
votes
1 answer

How to serialize NetTopologySuite classes like Polygon using protocol buffer in C#?

I'm new to protocol buffers. I thought to use protobuf-net nuget to serialize / deserialize my City class. Polygon is a type from NetTopologySuite nuget. [ProtoContract] public class City { [ProtoMember(1)] public Guid Id { get; set; } …
0
votes
0 answers

How do you calculate the area of a polygon using the NetTopologySuite in meters squared?

I am trying to calculate the area of a polygon using the NetTopologySuite version 2.5.0 in meters squared. var gf_4326 = NetTopologySuite.NtsGeometryServices.Instance.CreateGeometryFactory(4326); var ply1 = gf_4326.CreatePolygon(new[] { new…
Petras
  • 4,686
  • 14
  • 57
  • 89
0
votes
1 answer

Create point shapefile with NetTopologySuite in c#

I'm trying to create a shapefile, but every time I get some kind of error. I'm tried use DotSpatial and NetTopologySuite libraries too, but it still not working. I'm tried do with ShapefileDataWriter but i get exception (System.ApplicationException:…
Krink
  • 13
  • 3