【问题标题】:Not able to load raster to postgis无法将栅格加载到 postgis
【发布时间】:2020-12-10 22:24:24
【问题描述】:

我想在 postgis 中加载一个光栅文件 在命令提示符下我正在运行

C:\Program Files\PostgreSQL\9.4\bin>raster2pgsql -I -C -s 4326 D:\Aparna\Data\PNV\pnv_new.tiff public.testraster|psql -d geodjango

我收到以下错误

ERROR: Unable to read raster file: D:\Aparna\Data\PNV\pnv_new.tiff
psql: could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?
received invalid response to SSL negotiation: -

我的端口是 5433。在浏览了几篇文章后,我更改了 pg_hba.conf 中的行 来自

# IPv4 local connections:
host    all             all             127.0.0.1/32          md5

# IPv4 local connections:
host    all             all             0.0.0.0/0            trust

但它不起作用。我该如何解决这个问题?

【问题讨论】:

    标签: postgresql postgis raster


    【解决方案1】:

    如果您没有在端口 5432 上运行 postgres,则需要在命令中添加 -p <port>,即 -p 5433,但根据错误消息,您似乎在“两端”都有问题 - 两者都有连接到服务器并读取文件。

    【讨论】:

    • 成功了!命令是 raster2pgsql -I -C -s ​​4326 "D:\Aparna\Da clipped_data\pnv_new.tif" public.testraster|psql -h localhost -p 5433 -d geodjango -U postgres
    • 太棒了!你能接受这个答案是正确的吗?
    • 当我尝试这个时,我得到错误:insert_records:无法为 INSERT 语句分配内存错误:process_rasters:无法将光栅图块转换为 INSERT 或 COPY 语句
    猜你喜欢
    • 1970-01-01
    • 2012-05-29
    • 2020-09-29
    • 2017-01-16
    • 1970-01-01
    • 2022-06-28
    • 1970-01-01
    • 2016-03-27
    • 2017-03-25
    相关资源
    最近更新 更多