标签: nettopologysuite

使用 Dapper 调用带有地理参数的 PostgreSQL 函数时出现 NotSupportedException

我使用 Dapper (使用npgsql带有插件的数据提供程序NetTopologySuite)来调用带有参数的 PostgreSQL 函数geography,然后收到一个NotSupportedException

System.NotSupportedException: The member _location of type NetTopologySuite.Geometries.Point cannot be used as a parameter value
at Dapper.SqlMapper.LookupDbType(Type type, String name, Boolean demand, ITypeHandler& handler) in C:\projects\dapper\Dapper\SqlMapper.cs:line 417
at Dapper.SqlMapper.CreateParamInfoGenerator(Identity identity, Boolean checkForDuplicates, Boolean removeUnused, IList`1 literals) in C:\projects\dapper\Dapper\SqlMapper.cs:line 2516
at Dapper.SqlMapper.GetCacheInfo(Identity identity, Object exampleParameters, Boolean addToCache) in C:\projects\dapper\Dapper\SqlMapper.cs:line 1707
at Dapper.SqlMapper.ExecuteScalarImplAsync[T](IDbConnection cnn, CommandDefinition command) in C:\projects\dapper\Dapper\SqlMapper.Async.cs:line 1207
...
Run Code Online (Sandbox Code Playgroud)

但当我使用NpgsqlCommand通过方法指定的类型时,它工作得很好AddWithValue

我怎样才能将 Dapper 映射NetTopologySuite.Geometries.Point到 …

c# postgresql npgsql dapper nettopologysuite

3
推荐指数
1
解决办法
2609
查看次数

使用 NetTopologySuite 编写 2d 形状文件

我创建了一个可以正确写入形状文件的例程,但我有一个问题:形状是 3d,但我需要写入 2d 形状文件。
我怎样才能做到这一点?

谢谢

c# shapefile nettopologysuite

3
推荐指数
1
解决办法
2013
查看次数

如何使用 Net Topology Suite 在 Entity Framework Core 中缓冲一个点(地理)1 米

我按照此处推荐的方式将 Entity Framework Core (3.1.0) 与 Net Topology Suite 包一起使用,并且我很难缓冲一个点以在其周围创建圆形多边形。如果我传递一个值1to Buffer(),我认为它意味着 1 米,那么我最终会得到一个半径接近 120 英里的圆。

1米应该用什么值来表示?我使用GeometryFactorySRID 为 4326 的 来创建点和多边形。我正在使用的代码大致如下:

GeometryFactory Geography = NtsGeometryServices.Instance.CreateGeometryFactory(4326);

var point = Geography.CreatePoint(coordinate.Latitude, coordinate.Longitude);
var polygonCoordinates = point.Buffer(1).Normalized().Reverse().Coordinates;
var polygon = Geography.CreatePolygon(polygonCoordinates);
Run Code Online (Sandbox Code Playgroud)

c# geospatial nettopologysuite entity-framework-core

2
推荐指数
1
解决办法
2890
查看次数

Xamarin 表单获取地图区域中的位置

我开发了一个 xamarin 表单应用程序,我将一些地方存储在我的数据库中。我使用具有纬度和经度的 efcore 存储 Location NetTopology 套件。然后我可以从地图上的一个点找到最近的地方。

但是,如果我移动地图或缩小地图,我如何才能找到存储在我的数据库中的新区域中的地点以将它们固定在地图上?

有例子吗?

我真的很难找到一种方法来说明我数据库中的这个地点列表是地图显示内容的一部分。

我使用 xamarin 地图。

谢谢

maps nettopologysuite xamarin.forms entity-framework-core

1
推荐指数
1
解决办法
792
查看次数