Last active
August 29, 2015 14:19
-
-
Save albert-decatur/6b4582c19979bf25fd3f to your computer and use it in GitHub Desktop.
see landsat-api scene extents on geojson.io
This file contains hidden or 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
{ | |
"type": "Polygon", | |
"coordinates": [ | |
[ | |
[ | |
47.325, | |
33.93596 | |
], | |
[ | |
49.33006, | |
33.54431 | |
], | |
[ | |
49.83915, | |
35.27084 | |
], | |
[ | |
47.79194, | |
35.66304 | |
], | |
[ | |
47.325, | |
33.93596 | |
] | |
] | |
] | |
} |
This file contains hidden or 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
#!/bin/bash | |
# see Development Seed landsat-api scene extent on geojson.io | |
# example use: $0 LC81660362014196LGN00 | |
scene=$1 | |
# get scene metadata from devseed landsat-api | |
curl -s "https://api.developmentseed.org/landsat?search=${scene}" |\ | |
# get corner coords | |
jq '.results[]|[.lowerLeftCornerLongitude,.lowerLeftCornerLatitude,"",.lowerRightCornerLongitude,.lowerRightCornerLatitude,"",.upperRightCornerLongitude,.upperRightCornerLatitude,"",.upperLeftCornerLongitude,.upperLeftCornerLatitude,"",.lowerLeftCornerLongitude,.lowerLeftCornerLatitude]|@csv' |\ | |
# write as WKT | |
sed 's:\\::g;s:"::g;s:\(,\{2\}\):|:g;s:,: :g;s:|:,:g;s:^:POLYGON((:g;s:$:)):g' |\ | |
# get geojson from WKT | |
wellknown |\ | |
# send geojson to geojson.io | |
geojsonio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see landsat-api scene extents on geojson.io
sources
NB
The centroid from landsat-api does not quite agree with the polygon extent generated from API metadata.
Centroid calculated using PostGIS 2.1 w/ GEOS:
This table shows distances in meters between these pairs of points.
This was made using a wkt_point_distances.sh, which given a list of WKT points, will output the distances between all non-duplicate pairs.
(Not needed in this case, but handy in general.)
This shows that there is a slight difference between the metadata centroid and the polygon centroid.
However, a quick check in QGIS makes it seem that the see-scene.sh polygon extent and the landsat-util download TIFs almost line up:
notes
Example going from 166036 in USGS shp to UTM39N coords:
UTM zone can be determined by MTL.
Where can we get these before downloading the scene?