Skip to content

Commit

Permalink
Fix our CRS Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Oct 3, 2017
1 parent 306d0b0 commit 8bf5051
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Binary file added raster/data/geotiff-test-files/epsg31467.tif
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ class GeoTiffCSParser(geoKeyDirectory: GeoKeyDirectory) {
case None => (Some(semiMajor), None)
} else (Some(semiMajor), Some(semiMinor))
}
case None => (Some(semiMajor), None)
case _ => (Some(semiMajor), None)
}
}
} else (None, None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@

package geotrellis.raster.io.geotiff.writer

import geotrellis.proj4.{CRS, LatLng}
import geotrellis.proj4.{CRS, LatLng, WebMercator}
import geotrellis.raster._
import geotrellis.raster.io.geotiff._
import geotrellis.raster.io.geotiff.tags.TiffTags
import geotrellis.raster.io.geotiff.tags.codes.ColorSpace
import geotrellis.raster.render.{ColorRamps, IndexedColorMap}
import geotrellis.raster.testkit._
import geotrellis.vector.Extent

import org.scalatest._

import java.io._

class GeoTiffWriterSpec extends FunSpec
Expand Down Expand Up @@ -118,6 +116,16 @@ class GeoTiffWriterSpec extends FunSpec
actualCRS.toProj4String should be (geoTiff.crs.toProj4String)
}

it ("should write DHDN_3_Degree_Gauss_Zone_3 correctly") {
val geoTiff = MultibandGeoTiff(geoTiffPath("epsg31467.tif"))

addToPurge(path)
geoTiff.write(path)
val actualCRS = SinglebandGeoTiff(path).crs

actualCRS.toProj4String should be (geoTiff.crs.toProj4String)
}

it("should write floating point rasters correctly") {
val t = DoubleArrayTile(Array(11.0, 22.0, 33.0, 44.0), 2, 2)

Expand Down

0 comments on commit 8bf5051

Please sign in to comment.