Skip to content

Instantly share code, notes, and snippets.

@bradlipovsky
Last active August 25, 2020 14:04
Show Gist options
  • Save bradlipovsky/0a9097548e438efe48af6ff1132c864e to your computer and use it in GitHub Desktop.
Save bradlipovsky/0a9097548e438efe48af6ff1132c864e to your computer and use it in GitHub Desktop.
Plot a dataset overlain on imagery
#
# First, Convert the ground track to imagery coordinate system
#
from pyproj import Transformer
transformer = Transformer.from_crs("EPSG:4326", "EPSG:32617")
#
# Make a plot for the imagery
#
import rasterio
from rasterio.plot import show
fig,ax = plt.subplots(figsize=(10,10))
sat_data = rasterio.open('SomeTifFile.tif')
show(sat_data,cmap="gray")
#
# Convert our dataset from lat-lon to projected coordinates, then plot
#
[x,y] = transformer.transform( lat , lon )
ax.scatter(x,y)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment