Last active
August 25, 2020 14:04
-
-
Save bradlipovsky/0a9097548e438efe48af6ff1132c864e to your computer and use it in GitHub Desktop.
Plot a dataset overlain on imagery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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