half-pixel shift while using demzip convert tif to RasterLAZ

30 views
Skip to first unread message

suzuki kuo

unread,
Jan 5, 2026, 2:43:08 AM (5 days ago) Jan 5
to LAStools - efficient tools for LiDAR processing
hi, and happy new year!

I have 2 Elevation Grid data saved in Geotiff(*.tif). as attached sample file.
2 files are same range, same pixel size and same projection.

I use demzip64, convert to RasterLAZ
demzip64 -i XXX.tif -olaz -o XXX.laz -epsg xxxx

seems have half-pixel shift between two RasterLAZ, as follow image.
i think, definition location "in the center" is as my expect.
shifthalfpixelinRasterLAZ.png

I checked the metadata(*.tif) in Globalmapper,
two tif have different definition in "RASTER_TYPE" : Pixel is Area / Pixel is Point

when "RASTER_TYPE=Pixel is Area" will locate in the center
when "RASTER_TYPE=Pixel is Point" will locate in the coner

I hope no matter what RASTER_TYPE is, RasterLAZ should locate in the center.
coz, using demzip64 convert jj_pixelisPoint.laz back to geotiff
the output geotiff contains half-pixel shift, that will be different from the original one(jj_pixelisPoint.tif).

Thanks in advance.
Greetings.
file.zip

Jochen Rapidlasso

unread,
Jan 5, 2026, 4:40:11 PM (4 days ago) Jan 5
to LAStools - efficient tools for LiDAR processing
Hi Suzuki Kuo,
if the resulting LAZ file would not contain any information how the pixels are organized you would be right: Then we would need a definition what each pixel means.
But within the resulting LAZ file we have the same pixel information as we have in the GeoTIFF input file.

Using geotiffinfo we get the source pixel information
  geotiffinfo64 -i jj_pixelisPoint.tif

...
KeyID   Loc Cnt Value: KeyDesc = Value
 1024     0   1     1: GTModelTypeGeoKey = ModelTypeProjected
 1025     0   1     2: GTRasterTypeGeoKey = RasterPixelIsPoint
...

  geotiffinfo64 -i jj_pixelisArea.tif

...
KeyID   Loc Cnt Value: KeyDesc = Value
 1024     0   1     1: GTModelTypeGeoKey = ModelTypeProjected
 1025     0   1     1: GTRasterTypeGeoKey = RasterPixelIsArea
...

Then we do the RasterLAZ conversion

demzip64 -i jj_pixelisPoint.tif -o tmp_p.laz
demzip64 -i jj_pixelisArea.tif -o tmp_a.laz

and check the output files:

lasinfo64 -i tmp_p.laz
lasinfo64 -i tmp_a.laz

We get the same key values as we have in the input files:

LAStools lasinfo (by in...@rapidlasso.de) version 251223
reading 'tmp_p.laz' with 644 points
...
    GeoKeyDirectoryTag version 1.1.0 number of keys 5
      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected
      key 1025 tiff_tag_location 0 count 1 value_offset 2 - GTRasterTypeGeoKey: RasterPixelIsPoint
...

and for the file 'tmp_a.laz'
...
      key 1025 tiff_tag_location 0 count 1 value_offset 2 - GTRasterTypeGeoKey: RasterPixelIsArea
...

So we think this is the way it should work.


If you have a TIF with GTRasterTypeGeoKey = RasterPixelIsPoint but you want to have your output as Raster LAZ with PixelIsArea you easy can change your input file to the required pixel type using gdal:

gdal_edit.exe -mo AREA_OR_POINT=Area file_to_change.tif


Cheers,

Jochen @rapidlasso

suzuki kuo

unread,
Jan 7, 2026, 1:40:05 AM (3 days ago) Jan 7
to LAStools - efficient tools for LiDAR processing

Hi  Jochen ,

Thank you very much for your help. I will try and take your advice.

Cheers,

suzuki


Jochen Rapidlasso 在 2026年1月6日 星期二清晨5:40:11 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages