bugpktools - Bugs: bug #43500, Unsigned 16-bit tifs with pkfilter

 
 

bug #43500: Unsigned 16-bit tifs with pkfilter

Submitted by:  None
Submitted on:  Wed 29 Oct 2014 06:41:33 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Pieter kempeneers <kempenep>
Open/Closed: ClosedOperating System: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 08 Nov 2014 09:46:13 AM UTC, comment #1:

Thanks for your comments. The nodata option was declared as a short type (min value=-32768, max value=32767). It is now set to double and the problem should be fixed in the next release (tested with the datasets you attached). Happy coding.

Pieter kempeneers <kempenep>
Project AdministratorIn charge of this item.
Wed 29 Oct 2014 06:41:33 PM UTC, original submission:

It seems there is a bug when processing unsigned 16-bit tifs with pkfilter. When I try to set the -nodata flag to 65535, it returns a ‘BadConversion’ error and crashes. But if I first recast the data to a signed 16-bit integer, with a new nodata value (-32768), it works… See below for example with attached files… Seems like it doesn’t like a missing value of 65535…

$ gdalinfo test_signed16.tif
Driver: GTiff/GeoTIFF
Files: test_signed16.tif
Size is 240, 600
Band 1 Block=240x17 Type=Int16, ColorInterp=Gray
Min=169.429 Max=19693.833
Minimum=169.429, Maximum=19693.833, Mean=nan, StdDev=nan
NoData Value=-32768

$ gdalinfo test_unsigned16.tif
Driver: GTiff/GeoTIFF
Files: test_unsigned16.tif
Size is 240, 600
Band 1 Block=240x17 Type=UInt16, ColorInterp=Gray
Min=169.429 Max=19693.833
Minimum=169.429, Maximum=19693.833, Mean=nan, StdDev=nan
NoData Value=65535

$ pkfilter -nodata -32768 -dx 21 -dy 21 -f stdev -circ TRUE -i test_signed16.tif -o testout.tif
0...10...20...30...40...50...60...70...80...90...100 - done.
$ pkfilter -nodata -32768 -dx 21 -dy 21 -f stdev -circ TRUE -i test_unsigned16.tif -o testout.tif
0...10...20...30...40...50...60...70...80...90...100 - done.
$ pkfilter -nodata 65535 -dx 21 -dy 21 -f stdev -circ TRUE -i test_unsigned16.tif -o testout.tif
terminate called after throwing an instance of 'BadConversion'
what(): 65535
Aborted (core dumped)

I expect that the third example above would run using the correct 65535 nodata value, but instead it crashes…

Thanks for this wonderful software!

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #32340:  test_unsigned16.tif added by None (283KiB - image/tiff)
file #32341:  test_signed16.tif added by None (283KiB - image/tiff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by kempenep (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 08 Nov 2014 09:46:13 AM UTCkempenepStatusNone=>Fixed
      Assigned toNone=>kempenep
      Open/ClosedOpen=>Closed
    Wed 29 Oct 2014 06:41:33 PM UTCNoneAttached File-=>Added test_unsigned16.tif, #32340
      Attached File-=>Added test_signed16.tif, #32341

    Back to the top


    Powered by Savane 3.1-cleanup1