hibernate 支持postgis函数

参考:

http://www.hibernatespatial.org/documentation/02-Tutorial/01-tutorial4/

https://stackoverflow.com/questions/34136676/hibernate-spatial-4-3-not-found-in-maven

 

maven 项目

使用hisbernate版本 但是在https://mvnrepository.com/artifact/org.hibernate/hibernate-spatial  中没有4.3版本

 

可以这样做:

 

在pom中添加

 <project....

<repositories>
<repository>
<id>Hibernate Spatial repo</id>
<url>http://www.hibernatespatial.org/repository</url>
</repository>
</repositories>



再添加
<!-- https://mvnrepository.com/artifact/org.postgis/postgis-jdbc -->
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>com.spatial4j</groupId>
<artifactId>spatial4j</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-spatial -->
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>4.3</version>

<exclusions>
<exclusion>
<artifactId>dom4j</artifactId>
<groupId>dom4j</groupId>
</exclusion>
<exclusion>
<artifactId>hibernate-core</artifactId>
<groupId>org.hibernate</groupId>
</exclusion>
<exclusion>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</exclusion>
</exclusions>
</dependency>
 
...project>









///////////////////安装步骤:
windos

下载 postgit  


在Windows上安装PostGIS时,您不必担心任何这些先决条件。您只需要为您的平台安装Postgresql安装程序即可。然后,您可以启动Application Stack Builder来安装PostGIS。


在此处输入图片说明


在此处输入图片说明


您可以在Boston GIS网站上找到更详细的安装说明。

 

如果遇到了

23:00:20: XML解析错误: 'no element found' 位于 行 1
23:00:20: 无法分析应用程序列表:http://www.postgresql.org/applications-v2.xml
这样的问题得话  可以直接在:https://winnie.postgis.net/download/windows/ 下载对应的版本





 
posted @   ldp.im  阅读(173)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
历史上的今天:
2020-11-09 centos 查询磁盘空间占用情况 以及Can't create/write to file '/tmp/#sql_1f98_0.MYI' (Errcode: 28)
2016-11-09 跑github上的Symfony项目遇到的问题2
点击右上角即可分享
微信分享提示