2016-10-27 7 views

答えて

0

あなたはRGB画像について話していますので、潜在的にはint GeoTiffを意味します。

コードは(現在のスナップショット版1.0.0-SNAPSHOT)のようになります。

val matrix: Array[Array[Int]] = ??? 
val cols = ??? // matrix dimensions 
val rows = ??? 
val extent: Extent = ??? // you need extent for geotiff 
val crs: CRS = ??? // you need to know crs 
val tile = IntArrayTile.empty(cols, rows) // create an empty tile 

for { 
    c <- 0 until cols 
    r <- 0 until rows 
} tile.set(c, r, matrix(c)(r)) 

val geotiff = SinglebandGeoTiff(tile, extent, crs) // it's a geotiff 

geotiff.write("dir where you plan to save your geotiff") 

それはあなたが3枚のタイルを作成することもRGB画像を永続化するために、グレイスケールGeoTIFFのだろう、とマルチバンドなどすべてを保存することがGeoTiff。

val red: Tile = ??? 
val green: Tile = ??? 
val blue: Tile = ??? 

val mbtile = MultibandTile(red, green, bule) 

val mbgeotiff = new MultibandGeoTiff(
    mbtile, 
    extent, 
    crs, 
    GeoTiffOptions(
    Striped, 
    NoCompression, 
    ColorSpace.RGB 
) 
) // GeoTiff options setup is quite important, to set up `TIFFTAG_PHOTOMETRIC` tag 
mbgeotiff.write("dir where you plan to save your geotiff") 

しかし、私はBreeze APIに精通していないです、我々はGeoTrellisギッターチャネルまたは/であなたのユースケースを議論することができ、そこに多くの情報を提供します。

関連する問題