You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i use hadoopMultibandGeoTiffRDD to read a tif. then i got the error
scala.MatchError: (34665,13) (of class scala.Tuple2$mcII$sp)
at geotrellis.raster.io.geotiff.reader.TiffTagsReader$.readTag(TiffTagsReader.scala:125)
at geotrellis.raster.io.geotiff.reader.TiffTagsReader$.read(TiffTagsReader.scala:101)
at geotrellis.raster.io.geotiff.reader.GeoTiffReader$.readGeoTiffInfo(GeoTiffReader.scala:359)
at geotrellis.spark.io.hadoop.HadoopGeoTiffInfoReader.getGeoTiffInfo(HadoopGeoTiffInfoReader.scala:53)
at geotrellis.spark.io.GeoTiffInfoReader$$anonfun$1.apply(GeoTiffInfoReader.scala:75)
at geotrellis.spark.io.GeoTiffInfoReader$$anonfun$1.apply(GeoTiffInfoReader.scala:73)
and tif was uploaded here: https://github.com/lovelj/TestData
(it's a part rar file, you need download all parts of rar file.then upzip the rar file ,you will get a tif)
and gdalinfo output is
Driver: GTiff/GeoTIFF
Files: "tifpath"
Size is 20973, 14016
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (110.992711196399995,24.007216846799999)
Pixel Size = (0.000143730400000,-0.000143730400000)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_DATETIME=2015:01:25 16:58:51
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_SOFTWARE=Adobe Photoshop CS6 (Windows)
TIFFTAG_XRESOLUTION=72
TIFFTAG_YRESOLUTION=72
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 110.9927112, 24.0072168) (110d59'33.76"E, 24d 0'25.98"N)
Lower Left ( 110.9927112, 21.9926916) (110d59'33.76"E, 21d59'33.69"N)
Upper Right ( 114.0071689, 24.0072168) (114d 0'25.81"E, 24d 0'25.98"N)
Lower Right ( 114.0071689, 21.9926916) (114d 0'25.81"E, 21d59'33.69"N)
Center ( 112.4999400, 22.9999542) (112d29'59.78"E, 22d59'59.84"N)
Band 1 Block=20973x1 Type=Byte, ColorInterp=Red
Band 2 Block=20973x1 Type=Byte, ColorInterp=Green
Band 3 Block=20973x1 Type=Byte, ColorInterp=Blue
i test the geotrellis code "geotrellis-2.3.1\raster\src\main\scala\geotrellis\raster\io\geotiff\reader\TiffTagsReader.scala"
val ByteBuffer = toMappedByteBuffer(tifpath)
(ByteBuffer.get.toChar, ByteBuffer.get.toChar) match {
case ('I', 'I') => ByteBuffer.order(ByteOrder.LITTLE_ENDIAN)
case ('M', 'M') => ByteBuffer.order(ByteOrder.BIG_ENDIAN)
case _ => throw new Exception("incorrect byte order")
}
val byteReader=ByteBuffer
val typechar = byteReader.getChar
val tagsStartPosition=byteReader.getInt.toLong
val pos1 = byteReader.position(tagsStartPosition.toInt)
val tagcount=byteReader.getShort
val GeoKeyDirectoryTag = 34735
for(tag<- 0 until tagcount){
val tag = byteReader.getChar.toInt // Tag
val type1 =byteReader.getChar.toInt // Type
val count1 = byteReader.getInt // Count
val offset1 = byteReader.getInt // Offset
if(tag==GeoKeyDirectoryTag){
println("geokey")
} else{
println("this")
}
println(tag+"###"+type1)
(tag,type1) match {
case (ModelPixelScaleTag, _) =>
{
println("right")
}
case (ModelTiePointsTag, _) =>
{println("right")}
case (GeoKeyDirectoryTag, _) =>
{println("right")}
case (_, BytesFieldType) =>
{println("right")}
case (_, AsciisFieldType) =>
{println("right")}
case (_, ShortsFieldType) =>
{println("right")}
case (_, IntsFieldType) =>
{println("right")}
case (_, FractionalsFieldType) =>
{}
case (_, SignedBytesFieldType) =>
{}
case (_, UndefinedFieldType) =>
{}
case (_, SignedShortsFieldType) =>
{}
case (_, SignedIntsFieldType) =>
{}
case (_, SignedFractionalsFieldType) =>
{}
case (_, FloatsFieldType) =>
{}
case (_, DoublesFieldType) =>
{}
case (_, LongsFieldType) =>
{}
case (_, SignedLongsFieldType) =>
{}
case (_, IFDOffset) =>{}
// println("here")
case (_,_)=>{
println("not implemented")
}
}
}
i found that when (tag,type1) equals (34665,13), code in TiffTagsReader.readTag function will throw matcherror. is it a bug?
i could not use gdal_translate to convert this file to standard tiff file for some reason.
Is there any other solution to this problem?
The text was updated successfully, but these errors were encountered:
i use hadoopMultibandGeoTiffRDD to read a tif. then i got the error
and tif was uploaded here: https://github.com/lovelj/TestData
(it's a part rar file, you need download all parts of rar file.then upzip the rar file ,you will get a tif)
and gdalinfo output is
i test the geotrellis code "geotrellis-2.3.1\raster\src\main\scala\geotrellis\raster\io\geotiff\reader\TiffTagsReader.scala"
i found that when (tag,type1) equals (34665,13), code in TiffTagsReader.readTag function will throw matcherror. is it a bug?
i could not use gdal_translate to convert this file to standard tiff file for some reason.
Is there any other solution to this problem?
The text was updated successfully, but these errors were encountered: