def fill_and_shade(located_elevations):
    """
    Given an array of elevations in a LocatedImage, fill any holes in
    the data and add a relief (shadows) to give a realistic 3d appearance.

    """
    new_elevations = srtm.fill_gaps(located_elevations.image, max_distance=15)
    new_img = srtm.add_shading(new_elevations, azimuth=135, altitude=15)
    return LocatedImage(new_img, located_elevations.extent)
Esempio n. 2
0
def main():
    ax = plt.axes(projection=ccrs.PlateCarree())

    # Get the 1x1 degree SRTM tile for 12E, 47N
    elev, crs, extent = srtm.srtm_composite(12, 47, 1, 1)

    # Fill the gaps present in the elevation data
    elev_filled = srtm.fill_gaps(elev, 15)

    # Add shading simulating the Sun at 10am (South-East)
    # and with a low angle (15 degrees above horizon)
    shaded = srtm.add_shading(elev_filled, 135.0, 15.0)

    # The plot the result :
    plt.imshow(shaded, extent=extent, transform=crs,
               cmap='Greys', origin='lower')

    plt.title("SRTM Shaded Relief Map")

    gl = ax.gridlines(draw_labels=True)
    gl.xlabels_top = False
    gl.ylabels_left = False

    plt.show()
Esempio n. 3
0
def main():
    ax = plt.axes(projection=ccrs.PlateCarree())

    # Get the 1x1 degree SRTM tile for 12E, 47N
    elev, crs, extent = srtm.srtm_composite(12, 47, 1, 1)

    # Fill the gaps present in the elevation data
    elev_filled = srtm.fill_gaps(elev, 15)

    # Add shading simulating the Sun at 10am (South-East)
    # and with a low angle (15 degrees above horizon)
    shaded = srtm.add_shading(elev_filled, 135.0, 15.0)

    # The plot the result :
    plt.imshow(shaded, extent=extent, transform=crs,
               cmap='Greys', origin='lower')

    plt.title("SRTM Shaded Relief Map")

    gl = ax.gridlines(draw_labels=True,)
    gl.xlabels_top = False
    gl.ylabels_left = False

    plt.show()