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
16
votes
2 answers

What sort of unit does NetTopologySuite return distances in, and how can I convert it to miles/km?

Whenever I use FreeMapTools to calculate the distance between myself and my friends postcode, it gives me the following: 300.788 Miles 484.072 KM When I use NetTopologySuite, I get the value of 5.2174236612815 returned. 5.2174236612815 times by…
JMK
  • 27,273
  • 52
  • 163
  • 280
14
votes
2 answers

Entity Framework Core 3.1 with NetTopologySuite.Geometries.Point: SqlException: The supplied value is not a valid instance of data type geography

I have a model that looks like this: public class Facility { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } public NetTopologySuite.Geometries.Point Location { get; set; } } Test code for…
Ogglas
  • 62,132
  • 37
  • 328
  • 418
12
votes
3 answers

Having trouble serializing NetTopologySuite FeaturesCollection to GeoJSON

Trying to return some pretty simple GeoJSON data. I found NetTopologySuite, and set up a simple FeaturesCollection and tried to serialize it out to a GeoJson string only to get the following error: "Self referencing loop detected for property…
CodeRedick
  • 7,346
  • 7
  • 46
  • 72
11
votes
3 answers

dotnet core database first using NetTopologySuite

I recently upgraded to the newest version of EntityFrameworkCore.PostgreSQL but the spacial data didn't seem to work, because they now use NetTopologySuite see here To set up the NetTopologySuite plugin, add the …
Pepernoot
  • 3,409
  • 3
  • 21
  • 46
10
votes
2 answers

Converting GeoJSON response to FeatureCollection

Hi I am trying to parse the response from a OSM webservice into feature collection using GeoJson.Net I am new to GeoJSON and not able to identify how to do so: The Json response can be find here. The code I have written is: System.IO.StreamReader…
Mohit Vashistha
  • 1,824
  • 3
  • 22
  • 49
9
votes
1 answer

Is there a way to declare a Spatial Index with EntityFrameworkCore 2.2?

I am using Entity Framework Core 2.2 with NetTopologySuite 1.15.1 and SQL Server 2016. Having a column of type IPoint works great to the point I want to create an index on it. I have this table public class Location { public int Id { get; set;…
8
votes
4 answers

How to seed NetTopologySuite.Geometries.Point data from a Json file in ASP.Net core

I want to seed "Location" data for my user object from my seed file The c# object, where Point is a NetTopologySuite.Geometries.Point is part of my user object public class User: IdentityUser { // member data here public Point…
chuckd
  • 13,460
  • 29
  • 152
  • 331
7
votes
0 answers

Cant filter by distance (meters) using spatial data in EF Core after update

I have a table with Geometry column using EF Core spatial data and Npgsql.EntityFrameworkCore.PostgreSQL provider class City { public int ID { get; set; } public string CityName { get; set; } public Point Location { get; set; } } I…
Mateech
  • 1,010
  • 1
  • 11
  • 26
7
votes
1 answer

Get total bounding box of several polygons (using C# NetCore NetTopologySuite)

I'm a bit new to working with polygon data (in C# using NetTopologySuite) and want to get the bounding box of several polygons, depending on the fact whether the bounding box of each polygon is overlapping with another polygon (polygon…
R. Hoek
  • 916
  • 8
  • 27
7
votes
2 answers

Why am I getting this error when trying to implement UseNetTopologySuite in my ASP.Net Core 2.2 api?

I am attempting to use the geometry functionality in Sql Server and EF Core. I've installed the following packages
Scottie
  • 11,050
  • 19
  • 68
  • 109
6
votes
1 answer

NettopologySuite and Dotspatial WKTReader

So I have a bunch of WKT representing a multi-polygon. I exclusively use DotSpatial to manipulate geometries. Specifically I'm trying to get a DotSpatial.Topology.IGeometry out of my WKT. Unfortunately the DotSpatial guys recently moved a lot of…
Ed Kramer
  • 131
  • 1
  • 12
6
votes
3 answers

create Polygon from point collection with NetTopologySuite

What is the best way to create a polygon from list of point? I have an array of points, if points are at least 3 I would like to join to create a polygon Dim ClickedPoint As New…
5
votes
3 answers

How to handle polyline offset with variable width ("buffer")?

My problem statement: I have a polyline, and I want to do variable width offset along the points, in just one direction. How can I do it? For the polyline, I just need to support straight lines, no need to support curves or arcs. The polyline can be…
Graviton
  • 81,782
  • 146
  • 424
  • 602
5
votes
1 answer

NetTopologySuite Distance is returning odd results in .net Core 3

In my .Net Core 3 API, I set a user location like this: userDetails.Location = new Point(userDetails.latitude, userDetails.longitude) { SRID = 4326 }; and when I try getting users in a given radius double radiusMeters = userSettings.Radius; var…
Zion Hai
  • 330
  • 6
  • 18
5
votes
1 answer

Calculate the geographic distance between two points using NetTopologySuite with EF Core and postgis

I am using the kartoza docker image to run a postgres server with postgis. I have a database which I am consuming using an ASP.NET Core application and Enity Framework Core. The database contains a table named Park which is represented by the…
1
2 3
9 10