mapbox / make-surface

Vector surfaces creation routines
MIT License
89 stars 18 forks source link

No raster loading #75

Closed dnomadb closed 9 years ago

dnomadb commented 9 years ago

@ian29 is getting this error w/ fillfacets (while I am not w/ the same inputs) - the most probable reason is an empty array is loading from the raster.

Traceback (most recent call last):
  File "/usr/local/bin/makesurface", line 9, in <module>
    load_entry_point('makesurface==0.2.2dev', 'console_scripts', 'makesurface')()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/makesurface/scripts/cli.py", line 83, in fillfacets
    makesurface.fillfacets(input, sampleraster, noproject, output, bidxs, zooming, batchprint, outputgeojson, color)
  File "/usr/local/lib/python2.7/site-packages/makesurface/__init__.py", line 10, in fillfacets
    fill_facets.fillFacets(infile, sampleRaster, noproject, output, band, zooming, batchprint, outputGeom, color)
  File "/usr/local/lib/python2.7/site-packages/makesurface/scripts/fill_facets.py", line 167, in fillFacets
    rasArr = upsampleRaster(rasArr, featDims, zooming)
  File "/usr/local/lib/python2.7/site-packages/makesurface/scripts/fill_facets.py", line 105, in upsampleRaster
    zoomFactor = int(featDims / min(rasArr.shape[0:2])) * 3
ZeroDivisionError: integer division or modulo by zero
  1. Figure out the cause of this error
  2. Better handle these kind of errors
dnomadb commented 9 years ago

Cause was invalid raster windows. Fixed in https://github.com/mapbox/make-surface/pull/81

ian29 commented 9 years ago

\o/