Exemplo n.º 1
0
 def __buildvrt(archives, vrtfile, pattern, vsi, extent, nodata):
     locals = [
         vsi + x for x in dissolve([finder(x, [pattern]) for x in archives])
     ]
     gdalbuildvrt(src=locals,
                  dst=vrtfile,
                  options={
                      'outputBounds': (extent['xmin'], extent['ymin'],
                                       extent['xmax'], extent['ymax']),
                      'srcNodata':
                      nodata
                  })
Exemplo n.º 2
0
 def __buildvrt(archives, vrtfile, pattern, vsi, extent, nodata=None, srs=None):
     locals = [vsi + x for x in dissolve([finder(x, [pattern]) for x in archives])]
     if nodata is None:
         with Raster(locals[0]) as ras:
             nodata = ras.nodata
     opts = {'outputBounds': (extent['xmin'], extent['ymin'],
                              extent['xmax'], extent['ymax']),
             'srcNodata': nodata}
     if srs is not None:
         opts['outputSRS'] = crsConvert(srs, 'wkt')
     gdalbuildvrt(src=locals, dst=vrtfile,
                  options=opts)