Skip to content

Buffer dtype mismatch #5

@itcarroll

Description

@itcarroll

I have installed malstroem from your fork on a linux platform, but cannot run the given example successfully. I don't know how C extensions for Python work, so I'm at a loss to debug this. Is there additional information I could provide to help?

$ malstroem complete -r 10 -r 30 -filter "maxdepth > 0.05" -dem dem.tif -outdir out
Processing
   dem: dem.tif
   outdir: out
   rain: 10.0mm, 30.0mm
   accum: False
   filter: maxdepth > 0.05
Calculating filled DEM
Calculating bluespot depths
Calculating flow directions
Done
Calculating unfiltered bluespots
Number of bluespots found before filtering: 1788
Calculating filtered bluespots
Number of bluespots left after filtering: 1788
Calculating watersheds
Calculating pour points at min filled
Traceback (most recent call last):
  File "/research-home/icarroll/.local/bin/malstroem", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/research-home/icarroll/.local/lib/python3.5/site-packages/malstroem/scripts/complete.py", line 100, in process_all
    bluespot_tool.process()
  File "/research-home/icarroll/.local/lib/python3.5/site-packages/malstroem/bluespots.py", line 204, in process
    filled_no_flats = fill.fill_terrain_no_flats(dem, short, diag)
  File "/research-home/icarroll/.local/lib/python3.5/site-packages/malstroem/algorithms/fill.py", line 209, in fill_terrain_no_flats
    if keep_going and _fill_terrain_no_flats(dtm, filled, 1, maxrow, 1, maxcol, short, diag):
  File "malstroem/algorithms/speedups/_fill.pyx", line 74, in malstroem.algorithms.speedups._fill._fill_terrain_no_flats
ValueError: Buffer dtype mismatch, expected 'DTYPE_t_DTM' but got 'unsigned short'

Versions
Ubuntu==16.04
Python==3.5.2
numpy==1.16.2
Cython==0.29.6
click-log=0.1.8
GDAL==2.1.3
scipy==1.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions