From ae8670ab64fc34b0a7a418f15fe45a84d260146c Mon Sep 17 00:00:00 2001 From: Wendel Hime Date: Wed, 9 Dec 2020 03:40:27 -0300 Subject: [PATCH] adding float and double as types with name and size tests (#51) add translate to type cases replace float compare by Nextafter and Nextafter32 add parser for floats and doubles add float and double parsers add support for doubles and floats in FormatFrom functions add ReadFloats and ReadDoubles for context add float32 and double encoder merging merge add float and double parsers add ReadFloats and ReadDoubles for context add float32 and double encoder removing log alias from parser removing log alias from parser_test removing log alias from type removing log alias from type_test removing log alias from value_context removing aliases from value_contex_test removing log alias from value_encoder removing log alias from value_encoder_test update parser slices from floats and doubles merge update values for tests raise exception when parsing with different expected size Revert "move tags to bottom part of IFD and add description with source" This reverts commit 9d79f79757c6e976e7ad2f9818b81e8f706cab8b. Revert "adding Geotiff tags ModelTransformationTag, ModelTiepointTag and ModelPixelScaleTag" This reverts commit 60653d5647b02bf5b6dded4884f3138888bd007a. adding tags with required formatation --- v2/tags_data.go | 19 ------------------- v3/common/value_encoder_test.go | 2 +- v3/tags_data.go | 25 ++++++++++++++++++------- 3 files changed, 19 insertions(+), 27 deletions(-) diff --git a/v2/tags_data.go b/v2/tags_data.go index bcc9d92..a770e55 100644 --- a/v2/tags_data.go +++ b/v2/tags_data.go @@ -909,25 +909,6 @@ IFD: - id: 0xc74e name: OpcodeList3 type_name: UNDEFINED -# This tag may be used to specify the size of raster pixel spacing in the model space units, when the raster space can be embedded in the model space coordinate system without rotation, and consists of the following 3 values: -# ModelPixelScaleTag = (ScaleX, ScaleY, ScaleZ) -# where ScaleX and ScaleY give the horizontal and vertical spacing of raster pixels. The ScaleZ is primarily used to map the pixel value of a digital elevation model into the correct Z-scale, and so for most other purposes this value should be zero (since most model spaces are 2-D, with Z=0). -# Source: http://geotiff.maptools.org/spec/geotiff2.6.html#2.6.1 -- id: 0x830e - name: ModelPixelScaleTag - type_name: RATIONAL -# This tag stores raster->model tiepoint pairs in the order -# ModelTiepointTag = (...,I,J,K, X,Y,Z...), -# where (I,J,K) is the point at location (I,J) in raster space with pixel-value K, and (X,Y,Z) is a vector in model space. In most cases the model space is only two-dimensional, in which case both K and Z should be set to zero; this third dimension is provided in anticipation of future support for 3D digital elevation models and vertical coordinate systems. -# Source: http://geotiff.maptools.org/spec/geotiff2.6.html#2.6.1 -- id: 0x8482 - name: ModelTiepointTag - type_name: RATIONAL -# This tag may be used to specify the transformation matrix between the raster space (and its dependent pixel-value space) and the (possibly 3D) model space. -# Source: http://geotiff.maptools.org/spec/geotiff2.6.html#2.6.1 -- id: 0x85d8 - name: ModelTransformationTag - type_name: RATIONAL IFD/Exif/Iop: - id: 0x0001 name: InteroperabilityIndex diff --git a/v3/common/value_encoder_test.go b/v3/common/value_encoder_test.go index 764920f..6a57693 100644 --- a/v3/common/value_encoder_test.go +++ b/v3/common/value_encoder_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/dsoprea/go-logging" + log "github.com/dsoprea/go-logging" ) func TestValueEncoder_encodeBytes__Cycle(t *testing.T) { diff --git a/v3/tags_data.go b/v3/tags_data.go index bcc9d92..4d62922 100644 --- a/v3/tags_data.go +++ b/v3/tags_data.go @@ -909,25 +909,36 @@ IFD: - id: 0xc74e name: OpcodeList3 type_name: UNDEFINED -# This tag may be used to specify the size of raster pixel spacing in the model space units, when the raster space can be embedded in the model space coordinate system without rotation, and consists of the following 3 values: +# This tag may be used to specify the size of raster pixel spacing in the +# model space units, when the raster space can be embedded in the model space +# coordinate system without rotation, and consists of the following 3 values: # ModelPixelScaleTag = (ScaleX, ScaleY, ScaleZ) -# where ScaleX and ScaleY give the horizontal and vertical spacing of raster pixels. The ScaleZ is primarily used to map the pixel value of a digital elevation model into the correct Z-scale, and so for most other purposes this value should be zero (since most model spaces are 2-D, with Z=0). +# where ScaleX and ScaleY give the horizontal and vertical spacing of raster +# pixels. The ScaleZ is primarily used to map the pixel value of a digital +# elevation model into the correct Z-scale, and so for most other purposes +# this value should be zero (since most model spaces are 2-D, with Z=0). # Source: http://geotiff.maptools.org/spec/geotiff2.6.html#2.6.1 - id: 0x830e name: ModelPixelScaleTag - type_name: RATIONAL + type_name: DOUBLE # This tag stores raster->model tiepoint pairs in the order # ModelTiepointTag = (...,I,J,K, X,Y,Z...), -# where (I,J,K) is the point at location (I,J) in raster space with pixel-value K, and (X,Y,Z) is a vector in model space. In most cases the model space is only two-dimensional, in which case both K and Z should be set to zero; this third dimension is provided in anticipation of future support for 3D digital elevation models and vertical coordinate systems. +# where (I,J,K) is the point at location (I,J) in raster space with +# pixel-value K, and (X,Y,Z) is a vector in model space. In most cases the +# model space is only two-dimensional, in which case both K and Z should be +# set to zero; this third dimension is provided in anticipation of future +# support for 3D digital elevation models and vertical coordinate systems. # Source: http://geotiff.maptools.org/spec/geotiff2.6.html#2.6.1 - id: 0x8482 name: ModelTiepointTag - type_name: RATIONAL -# This tag may be used to specify the transformation matrix between the raster space (and its dependent pixel-value space) and the (possibly 3D) model space. + type_name: DOUBLE +# This tag may be used to specify the transformation matrix between the +# raster space (and its dependent pixel-value space) and the (possibly 3D) +# model space. # Source: http://geotiff.maptools.org/spec/geotiff2.6.html#2.6.1 - id: 0x85d8 name: ModelTransformationTag - type_name: RATIONAL + type_name: DOUBLE IFD/Exif/Iop: - id: 0x0001 name: InteroperabilityIndex