postgresql && .net core 使用空间数据

it2022-06-27  89

这里主要讲遇到的一些报错 增删改查 && 计算部分基本和sql server的空间数据操作一毛一样,感谢微软大大的倾情支持,直接看demo即可(~ ̄▽ ̄)~ 前往sql server & .net core 使用空间数据

引用库

Npgsql.EntityFrameworkCore.PostgreSQL Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite

迁库的时候报错

could not open extension control file ".../PostgreSQL/version/share/extension/postgis.control": No such file or directory

下载postgis,并安装,解决这个问题 报错

could not load library ".../postgis-2.5.dll": %1 is not a valid Win32 application.

在 \PostgreSQL\version\bin目录下,将libxml2-2.dll替换成libxml2.dll,即libxml2.dll和libxml2-2.dll都是原来的libxml2.dll文件 参考资料https://stackoverflow.com/questions/16828383/postgis-database-installation-of-functions-failedhttps://blog.csdn.net/xinshijimanon/article/details/80521947

示例代码

https://github.com/zLulus/NotePractice/blob/dev3/Console/CodeLibraryForDotNetCore/UsePostgresql/PostgresqlUseGeometryDemo.cs

参考资料

https://www.npgsql.org/efcore/mapping/nts.html

转载于:https://www.cnblogs.com/Lulus/p/10417518.html


最新回复(0)