• SimpleFeatureTypeBuilder


     setCRS失败。。

    org.postgresql.util.PSQLException: 致命错误: 用户 "Geotools" Password 认证失败 (pgjdbc: autodetected server-encoding to be GB2312, if the message is not readable, please check database logs and/or host, port, dbname, user, password, pg_hba.conf)
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:438)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:222)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194)
    at org.postgresql.Driver.makeConnection(Driver.java:450)
    at org.postgresql.Driver.connect(Driver.java:252)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:247)
    at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:94)
    at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:79)
    at org.geotools.referencing.factory.epsg.DirectEpsgFactory.getConnection(DirectEpsgFactory.java:3302)
    at org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:436)
    at org.geotools.referencing.factory.DeferredAuthorityFactory.getBackingStore(DeferredAuthorityFactory.java:133)
    at org.geotools.referencing.factory.BufferedAuthorityFactory.isAvailable(BufferedAuthorityFactory.java:235)
    at org.geotools.referencing.factory.DeferredAuthorityFactory.isAvailable(DeferredAuthorityFactory.java:119)
    at org.geotools.factory.FactoryRegistry.isAvailable(FactoryRegistry.java:667)
    at org.geotools.factory.FactoryRegistry.isAcceptable(FactoryRegistry.java:501)
    at org.geotools.factory.FactoryRegistry$1.filter(FactoryRegistry.java:192)
    at javax.imageio.spi.FilterIterator.advance(ServiceRegistry.java:821)
    at javax.imageio.spi.FilterIterator.<init>(ServiceRegistry.java:815)
    at javax.imageio.spi.ServiceRegistry.getServiceProviders(ServiceRegistry.java:516)
    at org.geotools.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.java:197)
    at org.geotools.referencing.ReferencingFactoryFinder.getFactories(ReferencingFactoryFinder.java:180)
    at org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactories(ReferencingFactoryFinder.java:455)
    at org.geotools.referencing.DefaultAuthorityFactory.getBackingFactory(DefaultAuthorityFactory.java:89)
    at org.geotools.referencing.DefaultAuthorityFactory.<init>(DefaultAuthorityFactory.java:69)
    at org.geotools.referencing.CRS.getAuthorityFactory(CRS.java:263)
    at org.geotools.referencing.CRS.decode(CRS.java:525)
    at com.lzugis.geotools.utils.FeaureUtil.creatSimpleFeatureType(FeaureUtil.java:52)
    at com.lzugis.geotools.utils.FeaureUtil.creatSimpleFeatureByFeilds(FeaureUtil.java:156)
    at org.geotools.tutorial.quickstart.EquiSurface.clipFeatureCollection(EquiSurface.java:143)
    at org.geotools.tutorial.quickstart.EquiSurface.calEquiSurface(EquiSurface.java:97)
    at org.geotools.tutorial.quickstart.EquiSurface.main(EquiSurface.java:296)

    参考:https://docs.geotools.org/stable/javadocs/org/geotools/feature/simple/SimpleFeatureTypeBuilder.html

    参考2:https://www.cnblogs.com/tuboshu/p/10752281.html(Geotools创建Feature的两种方式)

    >>geotools - how to `CRS.decode` without loading hsql?:https://stackoverflow.com/questions/55788089/geotools-how-to-crs-decode-without-loading-hsql

    >>GeoTools入门(五)-- CRS操作:https://blog.csdn.net/oYinHeZhiGuang/article/details/118315724

    官方关于CRS的说明:https://docs.geotools.org/latest/userguide/library/referencing/crs.html

    CRS->DirectEpsgFactory

    To hook this up make sure you have one of the gt-epsg plugins on your CLASSPATH. The gt-epsg-hsql plugin is recommended.

     DirectEpsgFactory在package org.geotools.referencing.factory.epsg;包下,

    然后getConnection就发动了。。

    然后就找到了DriverManager了。。

    然后就报错了。。

    奇怪,如果不安装postgresql,难道就不能用setCRS了吗?

  • 相关阅读:
    Eclipse+Java+OpenCV246人脸识别
    Eclipse+Java+OpenCV246环境搭建和代码测试
    Request对象和Response对象详解
    request与response对象详述
    request对象和response对象
    减少HTTP请求之将图片转成二进制并生成Base64编码,可以在网页中通过url查看图片(大型网站优化技术)
    base64码通过http传输 +号变 空格 问题解决
    RSA Android加密的数据服务器上无法解密?
    RSA解密时javax.crypto.BadPaddingException: Data must start with zero
    SRA解密报错:Data must start with zero
  • 原文地址:https://www.cnblogs.com/2008nmj/p/15842630.html
Copyright © 2020-2023  润新知