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
3
votes
1 answer

Error when using NetTopologySuite TransformGeometry

I am trying to read in a shapefile that has UK Northing/Eastings coordinate system (BritishNationalGridOSGB36) into latitude/longitude (WGS1984). I found an excellent post here on how to use NetTopologySuite to do this. The reading of the shapefile…
Jon P Smith
  • 2,391
  • 1
  • 30
  • 55
2
votes
1 answer

Geography SQL type support in .NET Core 6 / Entity Framework Core

I have a .NET Core 6 application and SQL Server database which has a table with a column defined as type Geography. My goal is to use a Linq query to retrieve a list of rows where the Geography Distance < 4000 meters from a point. The following…
2
votes
1 answer

NetTopologySuite: calculate length/area of geography

I've been using DbGeography in C# to calculate length and area of WKT geometries (geographies), like this: var polygon = DbGeography.FromText(wkt, 4326); var area = polygon.Area; var line = DbGeography.FromText(wkt2, 4326); var length =…
Alcibiades
  • 335
  • 5
  • 16
2
votes
3 answers

Bulk Insert with NTS geometries in .NET Core

As you probably know, inserting data into a table the "Entity Framework"-way is incredibly slow when you try to insert a lot of rows. One other way is to use SqlBulkCopy which does a great job of increasing performance. The problem is that…
Johan
  • 1,260
  • 16
  • 34
2
votes
1 answer

NetTopology 'found non-noded intersection' Exception when determining the difference between two specific geometries

Using the NetTopology in C# I'm getting a 'found non-noded intersection' Exception when determining the difference between two specific geometries. These geometries are the result of using several routines like CascadedPolygonUnion.Union,…
R. Hoek
  • 916
  • 8
  • 27
2
votes
1 answer

Where is NetTopologySuite.Algorithm.SimplePointInRing()?

We're moving a project from .NET 4.5.2 to .NET 5.0. In the process, this means moving a dependency on the NetTopologySuite NuGet package from v1.14.0 to v2.2.0. In v1.14.0, there are a number of places where we're using the…
Jeff Dege
  • 11,190
  • 22
  • 96
  • 165
2
votes
1 answer

NetTopologySuite reverse a polygon to have it CCW

I have added a check to identify if the polygon coords are in the wrong order and if the condition is verified I want to fix it, but I get that the Reverse() function is deprecated: List polygonCoords = new…
Giox
  • 4,785
  • 8
  • 38
  • 81
2
votes
2 answers

Searching by area using radius with EF Core and NetTopologySuite

I'm building an application that I need to be able to search for businesses, based on their 'delivery area' For example, London Business provides services up to 10000 meters from a lat/lon Southampton Business provides services 1000 meters from a…
Alex
  • 37,502
  • 51
  • 204
  • 332
2
votes
1 answer

Is it possible to use a NetTopologySuite Point in a uniqueness key constraint using entity framework?

I'm building an API using .net core and entity framework core with NetTopologySuite.Core and Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite. I have a use case where I want to store a set of geo locations that together builds up a net. I…
David Berg
  • 1,958
  • 1
  • 21
  • 37
2
votes
1 answer

How to find the smallest sector of a circle that covers a polygon?

Given the circle C: (O, r) and the polygon P, how can I find the smallest sector of C that covers P? Assume that the radius of the circle is large enough, so the main problem is to find the initial and final angles of the sector. I tried to draw…
saastn
  • 5,717
  • 8
  • 47
  • 78
2
votes
1 answer

How to create circle using IGeometry (NetTopolgy) in C# and Store as IGeometry type

now, I am using NetTopologySuite For Create polygon in C#, I need to save circle As well, but I can't find how to implement If anyone help me with it?
Kumaran
  • 116
  • 1
  • 4
2
votes
3 answers

Xamarin forms get places in the map area

I develop a xamarin forms app where I store some places in my database. I store Location NetTopology suite with efcore with latitude and longitude. Then I can find the closest places from a point on the map. But if i move the map or zoom out how can…
dalton5
  • 915
  • 2
  • 14
  • 28
2
votes
1 answer

How to Buffer a Point (Geography) by 1 Meter in Entity Framework Core with Net Topology Suite

I'm using Entity Framework Core (3.1.0) with the Net Topology Suite packages as is recommended here, and I'm having a very hard time buffering a point to create a circle polygon around it. If I pass a value of 1 to Buffer(), where I'm under the…
Gup3rSuR4c
  • 9,145
  • 10
  • 68
  • 126
2
votes
1 answer

Entity Framework Core IndexOutOfRangeException when saving geometry using NetTopologySuite

I'm getting a DbUpdateException when I call SaveChanges with some geometries loaded from a shapefile. The error I get is: IndexOutOfRangeException: Index was outside the bounds of the array. Here is some sample code that saves two WKT polygons:…
Sean
  • 14,359
  • 13
  • 74
  • 124
2
votes
2 answers

Mapping GeoJson feature to a property

I'm trying to map a Multipolygon from a GeoJSON FeatureCollection I have to a property which is a NetTopologySuite type of Multipolygon. This is what I…
Frets
  • 141
  • 2
  • 11
1 2
3
9 10