mapbox / rio-rgbify

Encoded arbitrary bit depth rasters in pseudo base-256
MIT License
99 stars 36 forks source link

CRSError: CRS is empty or invalid: u'' #21

Closed andrewharvey closed 5 years ago

andrewharvey commented 5 years ago

rio rgbify --min-z 0 --max-z 14 --format png LHI.tiff LHI.mbtiles

Traceback (most recent call last):
  File "/rio-rgbify/rio_rgbify/scripts/cli.py", line 84, in rgbify
    tiler.run(workers)
  File "/rio-rgbify/rio_rgbify/mbtiler.py", line 355, in run
    tiles):
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 673, in next
    raise value
CRSError: CRS is empty or invalid: u''

Traceback (most recent call last):
  File "/usr/local/bin/rio", line 11, in <module>
    sys.exit(main_group())
  File "/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/rio-rgbify/rio_rgbify/scripts/cli.py", line 84, in rgbify
    tiler.run(workers)
  File "/rio-rgbify/rio_rgbify/mbtiler.py", line 355, in run
    tiles):
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 673, in next
    raise value
rasterio.errors.CRSError: CRS is empty or invalid: u''

LHI.tiff.zip

andrewharvey commented 5 years ago

Not sure I'f I'm making progress or just digging a deeper hole for myself, but if I change

https://github.com/mapbox/rio-rgbify/blob/31bd65b175938a4362e0e8bf1d3b86d5e8d31e5b/rio_rgbify/mbtiler.py#L132

to

dst_crs="epsg:3857",

I no longer get the above error, but instead get

/home/user/.local/lib/python2.7/site-packages/rasterio/__init__.py:225: NotGeoreferencedWarning: Dataset has no geotransform set. The identity matrix may be returned.
  **kwargs)
/home/user/.local/lib/python2.7/site-packages/rasterio/__init__.py:225: NotGeoreferencedWarning: Dataset has no geotransform set. The identity matrix may be returned.
  **kwargs)
ERROR 4: No such file or directory
ERROR 4: No such file or directory
/home/user/.local/lib/python2.7/site-packages/rasterio/__init__.py:225: NotGeoreferencedWarning: Dataset has no geotransform set. The identity matrix may be returned.
  **kwargs)
/home/user/.local/lib/python2.7/site-packages/rasterio/__init__.py:225: NotGeoreferencedWarning: Dataset has no geotransform set. The identity matrix may be returned.
  **kwargs)
ERROR 4: No such file or directory
ERROR 4: No such file or directory
andrewharvey commented 5 years ago

Made sure to wipe all my local python libs and re install rio-rgbify, now getting:

CRSError: The WKT could not be parsed. OGR Error code 5

andrewharvey commented 5 years ago

To sum up, both #18 and #15 fix this issue, so I'll close this as duplicate of #14.

It still gives the errors in https://github.com/mapbox/rio-rgbify/issues/21#issuecomment-460617171 but it seems to generate the write outputs, so I'll just ignore the errors.

kylebarron commented 4 years ago

Installing from master seemed to fix my "CRSError: The WKT could not be parsed. OGR Error code 5" errors

frodrigo commented 4 years ago

Install all master and using python3 go over the issue for me.

farfromrefug commented 4 years ago

@frodrigo what do you mean by install "all master" ? I am facing that issue right now

frodrigo commented 4 years ago

Not sure it change something, but I install git master of rasterio and rio-rgbify.

ghigio2000 commented 4 years ago

I am getting the same error right now. I tried both on Windows and Ubuntu, no difference. I suspect it is my input GeoTiff file? Is there a spec how the GeoTiff format must be? I am trying to convert SRTM HGT files into GeoTiff and then to mbtiles using rio-rgbify. But I am getting the "CRSError: The WKT could not be parsed. OGR Error code 5" error. Thanks for your help.