Example #1
0
def load_img(f, fzip):
	import geo_raster_c as ge

	_prj = ge.proj_from_epsg(3857)
	_reg = ge.open(fzip.unzip(f)).extent().to_polygon().segment_ratio(30).project_to(_prj)

	return _reg.extent()
Example #2
0
	def __init__(self, f, fzip):
		if f.endswith('.shp'):
			import geo_raster_ex_c as gx
			self.bnd = [gx.geo_band_stack_zip.from_shapefile(f, file_unzip=fzip)]
		else:
			import geo_raster_c as ge
			_img = ge.open(fzip.unzip(f))
			self.bnd = [_img.get_band(_b + 1) for _b in xrange(_img.band_num)]

		self.color = self.bnd[0].color_table if len(self.bnd) == 1 else None