Cannot import DTM - Value of '257' is not valid for 'red'

24 views
Skip to first unread message

James Gilbert

unread,
Aug 24, 2017, 7:12:14 AM8/24/17
to Shetran
Hiya,

I'm struggling to import a dtm ascii (or text file). The following message appears: An Error has occurred: Value of '257' is not valid for 'red'. 'red' should be greater than or equal to 0 and less than or equal to 255

The file has the correct number of columns and squares, and I can load other cathcments - just not this one.

Any ideas?

Many thanks,
James
dtm17.asc
soil_sub17.asc
whit_sub17.asc
Capture.PNG

Steve Birkinshaw

unread,
Aug 24, 2017, 10:21:23 AM8/24/17
to Shetran
Hi James,

There seems to be a bit of a bug in the code here. To display the DTM data the values are put onto a scale range between 0 and 255. For some reason it is not doing this correctly (my guess is that there is a conversion to integers at some point). The work around is to add a higher elevation value - outside of the catchment. The attached DTM file and mask file now seem to work OK. Thanks for spotting this, when I get time I will check and change the code.

Regards,
Steve
dtm17.asc
whit_sub17.asc

James Gilbert

unread,
Aug 24, 2017, 10:33:12 AM8/24/17
to Shetran
Amazing, thanks for getting back to me so quick - and with a fix too!

I'm usually generating the dtm from a re-sample (bilinear) of 1m LIDAR. I was wondering if this might be introducing weird values and tried with a 'nearest' re-sample but that didn't help either. If I have similar issues again, shall I try converting the dtm to integer rather than floating point?

I'll compare my original text file with the one you sent through and try to see which value was causing the issue.

Many thanks again,
James
Reply all
Reply to author
Forward
0 new messages