Beispiel #1
0
def get_ndvi(latlng_pair):
    latlng = []
    latlng.append(list(latlng_pair))
    l = GeoCoordinatesToWorldwideReferenceSystem()
    image_map = l.getPathRowToLatLngListMapFromLatLngList(latlng)
    for path in image_map.keys():
        value = image_map[path]
        for row in value.keys():
            directory_path = construct_directory_path(path, row)
            latlng_pairs = value[row]
            band_file = get_band_filename(directory_path)
            xy_pairs = get_xy_from_latlng(latlng_pairs,
                                          directory_path + band_file)
            xy_pairs_bands = get_bands(xy_pairs, directory_path)
            print band_file
            print xy_pairs_bands
            metadata = ParseMetaData(band_file.split('_')[0], directory_path)
            metadata.get_meta_filename()
            metadata.process_metadata()
            m_b4 = metadata.get_radiance_mult_band_4()
            m_b5 = metadata.get_radiance_mult_band_5()
            a_b4 = metadata.get_radiance_add_band_4()
            a_b5 = metadata.get_radiance_add_band_5()
            ndvi = CalcNDVI(m_b4, m_b5, a_b4, a_b5)
            band4And5Pairs = map(lambda allBands: [allBands[3], allBands[4]],
                                 xy_pairs_bands)
            return ndvi.computeNDVIList(band4And5Pairs)
Beispiel #2
0
def get_ndvi(latlng_pair):
    latlng = []
    latlng.append(list(latlng_pair))
    l = GeoCoordinatesToWorldwideReferenceSystem()
    image_map = l.getPathRowToLatLngListMapFromLatLngList(latlng)
    for path in image_map.keys():
        value = image_map[path]
        for row in value.keys():
            directory_path = construct_directory_path(path, row)
            latlng_pairs = value[row]
            band_file = get_band_filename(directory_path)
            xy_pairs = get_xy_from_latlng(latlng_pairs, directory_path+band_file)
            xy_pairs_bands = get_bands(xy_pairs, directory_path)
            print band_file
            print xy_pairs_bands
            metadata = ParseMetaData(band_file.split('_')[0], directory_path)
            metadata.get_meta_filename()
            metadata.process_metadata()
            m_b4 = metadata.get_radiance_mult_band_4()
            m_b5 = metadata.get_radiance_mult_band_5()
            a_b4 = metadata.get_radiance_add_band_4()
            a_b5 = metadata.get_radiance_add_band_5()
            ndvi = CalcNDVI(m_b4, m_b5, a_b4, a_b5)
            band4And5Pairs = map(lambda allBands : [allBands[3], allBands[4]],
                                 xy_pairs_bands)
            return ndvi.computeNDVIList(band4And5Pairs)
Beispiel #3
0
latLngList = [[27.486772, -81.459955],[27.397890, -81.296839],[27.425886, -81.173685],[27.364792, -81.398872],[27.361307, -81.413538]]
l = GeoCoordinatesToWorldwideReferenceSystem()
image_map = l.getPathRowToLatLngListMapFromLatLngList(latLngList)
print image_map

xy_pairs = []

for path in image_map.keys():
    value = image_map[path]
    for row in value.keys():
        directory_path = construct_directory_path(path, row)
        latlng_pairs = value[row]
        band_file = get_band_filename(directory_path)
        xy_pairs = get_xy_from_latlng(latlng_pairs, directory_path+band_file)
        xy_pairs_bands = get_bands(xy_pairs, directory_path)
        print band_file
        print xy_pairs_bands
        metadata = ParseMetaData(band_file.split('_')[0], directory_path)
        metadata.get_meta_filename()
        metadata.process_metadata()
        m_b4 = metadata.get_radiance_mult_band_4()
        m_b5 = metadata.get_radiance_mult_band_5()
        a_b4 = metadata.get_radiance_add_band_4()
        a_b5 = metadata.get_radiance_add_band_5()
        ndvi = CalcNDVI(m_b4, m_b5, a_b4, a_b5)
        band4And5Pairs = map(lambda allBands : [allBands[3], allBands[4]],
                             xy_pairs_bands)
        print band4And5Pairs
        print ndvi.computeNDVIList(band4And5Pairs)
Beispiel #4
0
    [27.364792, -81.398872],
    [27.361307, -81.413538],
]
l = GeoCoordinatesToWorldwideReferenceSystem()
image_map = l.getPathRowToLatLngListMapFromLatLngList(latLngList)
print image_map

xy_pairs = []

for path in image_map.keys():
    value = image_map[path]
    for row in value.keys():
        directory_path = construct_directory_path(path, row)
        latlng_pairs = value[row]
        band_file = get_band_filename(directory_path)
        xy_pairs = get_xy_from_latlng(latlng_pairs, directory_path + band_file)
        xy_pairs_bands = get_bands(xy_pairs, directory_path)
        print band_file
        print xy_pairs_bands
        metadata = ParseMetaData(band_file.split("_")[0], directory_path)
        metadata.get_meta_filename()
        metadata.process_metadata()
        m_b4 = metadata.get_radiance_mult_band_4()
        m_b5 = metadata.get_radiance_mult_band_5()
        a_b4 = metadata.get_radiance_add_band_4()
        a_b5 = metadata.get_radiance_add_band_5()
        ndvi = CalcNDVI(m_b4, m_b5, a_b4, a_b5)
        band4And5Pairs = map(lambda allBands: [allBands[3], allBands[4]], xy_pairs_bands)
        print band4And5Pairs
        print ndvi.computeNDVIList(band4And5Pairs)