nakijun / tilers-tools

Automatically exported from code.google.com/p/tilers-tools
1 stars 0 forks source link

Better error handling with broken KAP files #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Purpose of the feature:

Provide a better error output instead an exception with badly formatted/broken 
KAP files.

Detailed description:

I was batch-processing some KAP files and saw this:

python /arquivos/maps/tilers_tools/gdal_tiler.py -z :+1 --tps -q -r -s -p xyz 
/arquivos/maps/BSB/BR/23101.KAP -t /arquivos/maps/RNC
Traceback (most recent call last):
  File "/arquivos/maps/tilers_tools/gdal_tiler.py", line 184, in <module>
    main(sys.argv)
  File "/arquivos/maps/tilers_tools/gdal_tiler.py", line 176, in main
    res = parallel_map(preprocess_src, sources)
  File "/arquivos/maps/tilers_tools/tiler_functions.py", line 97, in parallel_map
    return map(func, iterable)
  File "/arquivos/maps/tilers_tools/gdal_tiler.py", line 45, in preprocess_src
    res = map2gdal.process_src(src, no_error=True, opt=opt)
  File "/arquivos/maps/tilers_tools/map2gdal.py", line 63, in process_src
    res = [(layer.convert(), True) for layer in cls(src,options=opt).get_layers()]
  File "/arquivos/maps/tilers_tools/reader_bsb.py", line 61, in get_layers
    return [BsbLayer(self,self.header)]
  File "/arquivos/maps/tilers_tools/reader_backend.py", line 200, in __init__
    self.raster_ds = gdal.Open(self.img_file.encode(locale.getpreferredencoding()),GA_ReadOnly)
RuntimeError: `/arquivos/maps/BSB/BR/23101.KAP' not recognised as a supported 
file format.

Couldn't tilers-tools catch the exception (and just print an error) instead 
throwing an exception?

Original issue reported on code.google.com by nao...@gmail.com on 17 Jul 2014 at 5:21

Attachments:

GoogleCodeExporter commented 9 years ago
Implemented by option "--skip-invalid" in revision e6afc5b1415d

Original comment by vadp.d...@gmail.com on 24 Jul 2014 at 9:12