English 中文(简体)
Postgis Raster: 正在装入 Tif-Sub数据集
原标题:Postgis Raster: Loading Tif-Subdataset

我想把TIF文件的子数据集 装入我的PostGIS数据库

gdalinfo 给了我关于TIF文件的以下信息:

Driver: GTiff/GeoTIFF
Files: pathto/imagename.tif
Size is 611, 1
Coordinate System is ` 
Metadata:
  TIFFTAG_IMAGEDESCRIPTION=CXmlTiff type 
  TIFFTAG_RESOLUSTIONUNIT=2 (pixels/inch)
  TIFFTAG_XRESOLUTION=100
  TIFFTAG_YRESOLUTION=100
ImageStructure Metadata:
  INTERLEAVE=BAND
Subdatasets:
  SUBDATASET_1_NAME=GTIFF_DIR:1:pathto/imagename.tif
  SUBDATASET_1_DESC=Page 1 (611P x 1L x 1B)
  SUBDATASET_2_NAME=GTIFF_DIR:2:pathto/imagename.tif
  SUBDATASET_2_DESC=Page 1 (392P x 514352L x 1B)
Corner Coordinates:
Upper Left  (   0.0, 0.0)
Lower Left  (   0.0, 1.0)
Upper Right ( 611.0, 0.0)
Lower Right ( 611.0, 1.0)
Center      ( 305.5, 0.5)
Band 1 Block=611x1 Type=Byte, ColorInterp=Gray

我想加载第二个子数据集(392x514352)

现在,使用 raster2pgsql 和文件名作为输入,只有第一个子数据集被装入,第二个被忽略。只有一个带,所以使用 -b 开关无效。有建议吗?

多谢多谢

托马斯·托马斯

最佳回答

子数据集在 RASTER 中并不常见, 我从未在 TIFFs 中见过它们( 通常是看到波段, 不是子数据集 ) 。 它看起来像 < a href=" http:// trac. osgeo. org/ postgis/ ticket/1761" rel = "nofollow" 。 HDF5 文件 < / a > 中也固定了类似的错误, 但这可能帮不了您的 GTIff 。 我鼓励您为此特性创建错误票 。

同时,”“http://www.gdal.org/gdal_translate.html”“rel=“nofollow”>gdal_translate 可用 -sds 选项将文件的所有子数据集复制到单个输出文件,然后用raster2pgsql使用。

问题回答

在邮报里,子数据集是由邮报系统创建的,因为邮报里的那些数据集通常都用繁琐的钢筋,每个瓷砖在桌子上用不同的线条表示,通常用不同的马路表示。 我不确定这里发生了什么,但我猜想你用出局的选项储存你的栅栏,对吗?

对于使用 gdal_ translate 来从 Postgis 导出 rasters 的人, 您可以在您的 postgresql 连接选项中使用“ mode= 2” 选项: 结果是一个简单的文件, 将您 rast 列的所有行合并 。

例如:

gdal_translate PG:"host= localhost  port= 5432  dbname= mydb  user= me  schema= public  password= secret  table= rastertable  where= rid BETWEEN 1 and 10  mode= 2 " /path/filename.tif




相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签