3

我尝试按照本教程 [http://www.postgis.org/documentation/manual-svn/using_raster.xml.html][1] 将光栅文件导入我的 postgres 数据库

环境: windows7、Postgres 8.4、postgis 2.0。

我的命令行是:

cd C:\Program Files (x86)\PostgreSQL\8.4\bin
raster2pgsql -s 4236 -I -G -M kiwi.jpg -F -t 100x100 public.gis > out.sql
psql -U postgres -d mydb2 -f out.sql

名为“kiwi”的图片位于“C:\Program Files (x86)\PostgreSQL\8.4\bin”文件夹中。可以成功生成out.sql。但是输入 "psql -U postgres -d mydb2 -f out.sql" 后,出现错误。

psql:out.sql:98:错误:“可用”处或附近的语法错误

第 1 行:可用的 GDAL 栅格格式:

谢谢!这是查询的内容:(我对postgis很新,所以我无法弄清楚这里出了什么问题。因为我只是按照教程进行的,它应该可以工作)

    Available GDAL raster formats:
      Virtual Raster
      GeoTIFF
      National Imagery Transmission Format
      Raster Product Format TOC format
      ECRG TOC format
      Erdas Imagine Images (.img)
      CEOS SAR Image
      CEOS Image
      JAXA PALSAR Product Reader (Level 1.1/1.5)
      Ground-based SAR Applications Testbed File Format (.gff)
      ELAS
      Arc/Info Binary Grid
      Arc/Info ASCII Grid
      GRASS ASCII Grid
      SDTS Raster
      DTED Elevation Raster
      Portable Network Graphics
      JPEG JFIF
      In Memory Raster
      Japanese DEM (.mem)
      Graphics Interchange Format (.gif)
      Graphics Interchange Format (.gif)
      Envisat Image Format
      Maptech BSB Nautical Charts
      X11 PixMap Format
      MS Windows Device Independent Bitmap
      SPOT DIMAP
      AirSAR Polarimetric Image
      RadarSat 2 XML Product
      PCIDSK Database File
      PCRaster Raster File
      ILWIS Raster Map
      SGI Image File Format 1.0
      SRTMHGT File Format
      Leveller heightfield
      Terragen heightfield
      USGS Astrogeology ISIS cube (Version 3)
      USGS Astrogeology ISIS cube (Version 2)
      NASA Planetary Data System
      EarthWatch .TIL
      ERMapper .ers Labelled
      NOAA Polar Orbiter Level 1b Data Set
      FIT Image
      GRIdded Binary (.grb)
      Raster Matrix Format
      EUMETSAT Archive native (.nat)
      Idrisi Raster A.1
      Intergraph Raster
      Golden Software ASCII Grid (.grd)
      Golden Software Binary Grid (.grd)
      Golden Software 7 Binary Grid (.grd)
      COSAR Annotated Binary Matrix (TerraSAR-X)
      TerraSAR-X Product
      DRDC COASP SAR Processor Raster
      R Object Data Store
      Portable Pixmap Format (netpbm)
      USGS DOQ (Old Style)
      USGS DOQ (New Style)
      ENVI .hdr Labelled
      ESRI .hdr Labelled
      Generic Binary (.hdr Labelled)
      PCI .aux Labelled
      Vexcel MFF Raster
      Vexcel MFF2 (HKV) Raster
      Fuji BAS Scanner Image
      GSC Geogrid
      EOSAT FAST Format
      VTP .bt (Binary Terrain) 1.3 Format
      Erdas .LAN/.GIS
      Convair PolGASP
      Image Data and Analysis
      NLAPS Data Format
      Erdas Imagine Raw
      DIPEx
      FARSITE v.4 Landscape File (.lcp)
      NOAA Vertical Datum .GTX
      NADCON .los/.las Datum Grid Shift
      NTv2 Datum Grid Shift
      ACE2
      Snow Data Assimilation System
      Swedish Grid RIK (.rik)
      USGS Optional ASCII DEM (and CDED)
      GeoSoft Grid Exchange Format
      Northwood Numeric Grid Format .grd/.tab
      Northwood Classified Grid Format .grc/.tab
      ARC Digitized Raster Graphics
      Standard Raster Product (ASRP/USRP)
      Magellan topo (.blx)
      SAGA GIS Binary Grid (.sdat)
      Kml Super Overlay
      ASCII Gridded XYZ
      HF2/HFZ heightfield raster
      OziExplorer Image File
      USGS LULC Composite Theme Grid
      Arc/Info Export E00 GRID
      ZMap Plus Grid
      NOAA NGS Geoid Height Grids

I have no idea about this error after searching a lot. I really appreciate that if you can give me some suggestions.


  [1]: http://www.postgis.org/documentation/manual-svn/using_raster.xml.html
  [2]: http://i.stack.imgur.com/YxjNJ.png
4

1 回答 1

5

PostgreSQL 中的psql实用程序用于处理 SQL 命令。您显示的文件不包含 SQL 命令,它似乎包含帮助某人选择raster2pgsql程序选项的信息。快速的网络搜索在这里找到了文档:

http://www.postgis.org/documentation/manual-svn/using_raster.xml.html

请注意,该-G选项用于“打印支持的光栅格式”。您用于运行程序的命令行包括该开关。如果您的目标是生成 SQL 语句,那么这不是您应该包括的选项。我不知道是否需要对你的命令进行任何其他调整,但你可以先放弃它,看看你得到了什么。

于 2012-06-23T21:09:06.383 回答