Ejemplo n.º 1
0
 def __band_list(self,std_fix=True):
     if std_fix:
         self._std_fix()
     output_band = np.zeros((self.rows,self.cols),dtype=np.uint16)
     for i,coordinate_x in enumerate(self.__range_x):
         sys.stdout.write("\r{}/{}".format(i+1,self.cols))
         sys.stdout.flush()
         for coordinate_y in self.__range_y:
             for raster_array in self.__rasters:
                 pixel = raster_array.pixel_from_coordinate((coordinate_x,coordinate_y))
                 if pixel:
                     pixel_x, pixel_y = world2pixel(self.geo_transform, coordinate_x, coordinate_y)
                     output_band[pixel_y][pixel_x] = pixel
                     break
     return [output_band]
Ejemplo n.º 2
0
 def pixel_from_coordinate(self,coordinates,band=0):
     try:
         pixel_x, pixel_y = world2pixel(self.geo_transform, coordinates[0], coordinates[1])
         return self.band_list[band][pixel_y][pixel_x]
     except:
         return 0