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

CSharp Generate polygons from a set of intersecting lines

https://gis.stackexchange.com/questions/58245/generate-polygons-from-a-set-of-intersecting-lines https://i.stack.imgur.com/UUyHF.png https://i.stack.imgur.com/3ClRI.png I want to find the bounding polygon like this link. I'm using C#…
Hyeseong
  • 3
  • 2
0
votes
0 answers

Has anyone got a working .Net Core SQL Server Client Implementation for Geospatial Types?

I've tried and tried with this but support still seems laughably broken. The 2 options for a .NET Core supported implementation I can see are: NetTopologySuite.IO.SqlServerBytes 3rd Party Microsoft.SqlServer.Types library NetTopologySuite works…
mxcolin
  • 71
  • 7
0
votes
1 answer

Convert Arc to segments for Polygonize

I'm trying to convert an arc to line segments in AutoCAD as per the image below. I would like to run the polygonize function in net topology suite to count all enclosed areas and I haven't found a way of doing this without only using line…
0
votes
2 answers

Count number of polygons within a polyline

I have a collection of vertices that have been drawn sequentially by a user and I need to count how many enclosed areas there are within this shape. I have managed to find the intersecting points of crossing segments so I was thinking of walking…
Jackster
  • 1
  • 1
0
votes
1 answer

Can't serialize GeoJson coordinates in .Net Core controller

I have a .net 6 API project that exports FeatureCollections. I'm using 'NetTopologySuite.IO.GeoJSON' version 2.0.4, and have a public API call like: public async Task ExportGeoJSON() { GeoJSON.Net.Feature.FeatureCollection ret =…
Phil
  • 1,852
  • 2
  • 28
  • 55
0
votes
1 answer

how to calculate two geometry distance via meters in NetTopologySuite?

I use PGSQL to get geometry data. var hca = new WKTReader().Read( $"SRID=4326;{hcaShape}"); var point = new GeometryFactory().CreatePoint(new Coordinate(x, y)); var res = hca.Distance(point) The result Shows like:'0.00009xxx' But I want…
Fush1
  • 93
  • 1
  • 7
0
votes
2 answers

expected type was 'NetTopologySuite.Geometries.Point' but the actual type was 'GeoJSON.Net.Geometry.Point'

When I uncomment this: /*.Include(r => r.Establishment)*/ from this: public bool ReIndexVeganItemEstablishments( VepoContext context ) { …
BeniaminoBaggins
  • 11,202
  • 41
  • 152
  • 287
0
votes
0 answers

IsWithinDistance method doesn't work with geojson file for library TopologySuite

I'm trying to get all the points within a distance of 10 meter for example. the Withindistance() doesn't work and it doesn't give me any error so i don't know what is the issue. Here is my controller : public IActionResult GetWeather() { …
Fadi
  • 585
  • 4
  • 22
0
votes
1 answer

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

All, I'm using NetTopologySuite/ Entity Asp Core for my project. I want to create a radius of 1000 meter for the 'searchArea ' When I'm running the the app it gives me an error : System.ArgumentException: When writing a SQL Server geography value,…
Fadi
  • 585
  • 4
  • 22
0
votes
0 answers

ASP.NET Core 3.1 - OData Loop

Could anyone help me with something I have been stuck on for a few days now. I am using Odata with asp.net core and NetTopologySuite. I have a postgres database with column type Geometry. The request with npgsql works fine but the serialization by…
Mike
  • 241
  • 1
  • 13
0
votes
0 answers

Is there any way to save coordinates in cartesian system using NetTopologySuite and MS SQL Server?

I'm trying to find out how to do the following: We are using C# .NET with NetTopologySuite to manage spatial data on the backend. We do some distance calculations and this requires to use a cartesian system representation. So we use EPSG 3857 since…
evrc
  • 1
  • 1
0
votes
1 answer

Which NetTopologySuite Index is optimal for include and exclude rectangle search

I have a following problem: huge number of points and huge number of queries which need to provide as fast as possible any point that is inside include rectangle (red) and outside exclude rectangle (green). As number of points is huge and rectangles…
watbywbarif
  • 6,487
  • 8
  • 50
  • 64
0
votes
0 answers

C# Union and intersection of two geometries/polygons in one function call

We're using the library NetTopologySuite to work with geometries/(multi)polygons (in C#). At some point, we need both the 'union' AND 'intersection' of two geometries (functionally we want the union of the two geometries and determine the duplicate…
R. Hoek
  • 916
  • 8
  • 27
0
votes
1 answer

NetTopologySuite.Geometries.MultiPoint needs to have a constructor with 0 args

I'm trying to map a NetTopologySuite.Geometries.MultiPoint with Automapper but I keep getting the error System.ArgumentException: NetTopologySuite.Geometries.MultiPoint needs to have a constructor with 0 args or only optional args. var config = new…
Greg
  • 792
  • 2
  • 9
  • 24
0
votes
1 answer

How to store/query co-ordiantes for calculating the distance between in meters?

I am storing co-ordinates in my database like this var geometryFactory = NtsGeometryServices.Instance.CreateGeometryFactory(srid: 4326); var point = geometryFactory.CreatePoint(new NetTopologySuite.Geometries.Coordinate( …
Bassie
  • 9,529
  • 8
  • 68
  • 159