我正在尝试使用GeoTools库加载和解析一个shapefile。但是,当我试图加载文件时,下面的调用将导致org.geotools.factory.FactoryRegistry的依赖关系失败
DataStore newStore = DataStoreFinder.getDataStore(connect);错误:
org/geotools/factory/FactoryRegistry
java.lang.NoClassDefFoundError: org/geotools/factory/FactoryRegistry我在gradle中包含了以下依赖项:
compile files ('libs/geotools/gt-opengis-14.2.jar')
compile files ('libs/geotools/gt-api-14.2.jar')
compile files ('libs/geotools/gt-shapefile-14.2.jar')
compile files ('libs/geotools/gt-cql-14.2.jar')
compile files ('libs/geotools/gt-main-14.2.jar')
compile files ('libs/geotools/gt-referencing-14.2.jar')
compile files ('libs/geotools/gt-epsg-hsql-14.2.jar')我不确定是否所有的课程都是必需的,但是没有一门课是缺少的。我还有什么其他的依赖吗?这个类被记录为这里。
发布于 2016-03-18 10:25:22
解决这个问题的简单方法是使用Maven来管理您的依赖项,然后这将自动为您引入gt-metadata并解决您的问题。
如果您必须手动管理您的依赖项,那么I编写了一个博客帖子,它描述了如何使用哦哦搜索GeoTools jars中的类。
https://stackoverflow.com/questions/36058118
复制相似问题