landsatxplore
Search and download Landsat scenes from EarthExplorer.
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.0%) to scientific vocabulary
Keywords
Repository
Search and download Landsat scenes from EarthExplorer.
Basic Info
Statistics
- Stars: 232
- Watchers: 13
- Forks: 104
- Open Issues: 65
- Releases: 12
Topics
Metadata Files
README.md
⚠️ This package is no longer maintained, you are welcome to take over ⚠️
Description

The landsatxplore Python package provides an interface to the EarthExplorer portal to search and download Landsat Collections scenes through a command-line interface or a Python API.
The following datasets are supported:
| Dataset Name | Dataset ID |
|-|-|
| Landsat 5 TM Collection 2 Level 1 | landsat_tm_c2_l1 |
| Landsat 5 TM Collection 2 Level 2 | landsat_tm_c2_l2 |
| Landsat 7 ETM+ Collection 2 Level 1 | landsat_etm_c2_l1 |
| Landsat 7 ETM+ Collection 2 Level 2 | landsat_etm_c2_l2 |
| Landsat 8 Collection 2 Level 1 | landsat_ot_c2_l1 |
| Landsat 8 Collection 2 Level 2 | landsat_ot_c2_l2 |
| Landsat 9 Collection 2 Level 1 | landsat_ot_c2_l1 |
| Landsat 9 Collection 2 Level 2 | landsat_ot_c2_l2 |
Quick start
Searching for Landsat 5 TM scenes that contains the location (12.53, -1.53) acquired during the year 1995.
landsatxplore search --dataset landsat_tm_c2_l1 --location 12.53 -1.53 \
--start 1995-01-01 --end 1995-12-31
Search for Landsat 7 ETM scenes in Brussels with less than 5% of clouds. Save the returned results in a .csv file.
landsatxplore search --dataset landsat_tm_c2_l2 \
--location 50.83 4.38 --clouds 5 > results.csv
Downloading three Landsat scenes from different datasets in the current directory.
landsatxplore download LT51960471995178MPS00 LC80390222013076EDC00 LC82150682015350LGN01
To use the package, Earth Explorer credentials are required (registration).
Installation
The package can be installed using pip.
pip install landsatxplore
Usage
landsatxplore can be used both through its command-line interface and as a Python module.
Command-line interface
landsatxplore --help
``` Usage: landsatxplore [OPTIONS] COMMAND [ARGS]...
Options: --help Show this message and exit.
Commands: download Download one or several Landsat scenes. search Search for Landsat scenes. ```
Credentials
Credentials for the Earth Explorer portal can be obtained here.
--username and --password can be provided as command-line options or as environment variables:
shell
export LANDSATXPLORE_USERNAME=<your_username>
export LANDSATXPLORE_PASSWORD=<your_password>
Searching
landsatxplore search --help
``` Usage: landsatxplore search [OPTIONS]
Search for Landsat scenes.
Options: -u, --username TEXT EarthExplorer username. -p, --password TEXT EarthExplorer password. -d, --dataset [landsattmc1|landsatetmc1|landsat8c1|landsattmc2l1|landsattmc2l2|landsatetmc2l1|landsatetmc2l2|landsatotc2l1|landsatotc2l2|sentinel2a] Landsat data set. -l, --location FLOAT... Point of interest (latitude, longitude). -b, --bbox FLOAT... Bounding box (xmin, ymin, xmax, ymax). -c, --clouds INTEGER Max. cloud cover (1-100). -s, --start TEXT Start date (YYYY-MM-DD). -e, --end TEXT End date (YYYY-MM-DD). -o, --output [entityid|display_id|json|csv] Output format. -m, --limit INTEGER Max. results returned. --help Show this message and exit. ```
Downloading
landsatxplore download --help
``` Usage: landsatxplore download [OPTIONS] [SCENES]...
Download one or several Landsat scenes.
Options: -u, --username TEXT EarthExplorer username. -p, --password TEXT EarthExplorer password. -d, --dataset TEXT Dataset. -o, --output PATH Output directory. -t, --timeout INTEGER Download timeout in seconds. --skip --help Show this message and exit. ```
If the --dataset is not provided, the dataset is automatically guessed from the scene identifier. Note that only the newer Landsat Product Identifiers contain information related to collection number and processing level. To download Landsat Collection 2 products, use Product IDs or set the --dataset option correctly.
API
EarthExplorer API
landsatxplore provides an interface to the Earth Explorer JSON API. Please refer to the official (documentation) for possible request codes and parameters.
Basic usage
``` python from landsatxplore.api import API
Initialize a new API instance and get an access key
api = API(username, password)
Perform a request. Results are returned in a dictionnary
response = api.request(
'
Log out
api.logout() ```
Please refer to the official JSON API Reference for a list of all available requests.
Searching for scenes
``` python import json from landsatxplore.api import API
Initialize a new API instance and get an access key
api = API(username, password)
Search for Landsat TM scenes
scenes = api.search( dataset='landsattmc2l1', latitude=50.85, longitude=-4.35, startdate='1995-01-01', enddate='1995-10-01', maxcloud_cover=10 )
print(f"{len(scenes)} scenes found.")
Process the result
for scene in scenes: print(scene['acquisitiondate'].strftime('%Y-%m-%d')) # Write scene footprints to disk fname = f"{scene['landsatproductid']}.geojson" with open(fname, "w") as f: json.dump(scene['spatialcoverage'].geo_interface, f)
api.logout() ```
Output:
4 scenes found.
1995-09-23
1995-08-22
1995-08-15
1995-06-28
Downloading scenes
``` python from landsatxplore.earthexplorer import EarthExplorer
ee = EarthExplorer(username, password)
ee.download('LT51960471995178MPS00', output_dir='./data')
ee.logout() ```
Owner
- Name: Yann Forget
- Login: yannforget
- Kind: user
- Location: Brussels
- Repositories: 6
- Profile: https://github.com/yannforget
PostDoc @ Spatial Epidemiology Lab, Université Libre de Bruxelles.
GitHub Events
Total
- Issues event: 4
- Watch event: 13
- Delete event: 1
- Issue comment event: 9
- Pull request review comment event: 1
- Pull request review event: 4
- Pull request event: 2
- Fork event: 5
- Create event: 1
Last Year
- Issues event: 4
- Watch event: 13
- Delete event: 1
- Issue comment event: 9
- Pull request review comment event: 1
- Pull request review event: 4
- Pull request event: 2
- Fork event: 5
- Create event: 1
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Yann | y****t@m****g | 58 |
| Yann Forget | f****1@g****m | 16 |
| valpamp | 5****p | 9 |
| Guido Riembauer | r****r@m****e | 7 |
| Alexandros Vythoulkas | a****s@p****m | 1 |
| Veronica Andreo | v****o@g****m | 1 |
| Hiyam Debary | 1****y | 1 |
| sjdqbyitr178crs813tgbr8gsdufygeuy53 | 2****3 | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 87
- Total pull requests: 21
- Average time to close issues: 4 months
- Average time to close pull requests: 6 months
- Total issue authors: 73
- Total pull request authors: 19
- Average comments per issue: 2.78
- Average comments per pull request: 1.38
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 6
- Pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: about 3 hours
- Issue authors: 5
- Pull request authors: 3
- Average comments per issue: 1.67
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- henrykironde (4)
- Digdgeo (3)
- veroandreo (2)
- Asim12345 (2)
- trexbatman (2)
- Fenrihr (2)
- ChangpeiHe (2)
- jacquesmoati (2)
- lastproxy (2)
- yannforget (1)
- TristanMTG (1)
- hgf777-br (1)
- ESimonson710 (1)
- envaidya (1)
- zhangte113 (1)
Pull Request Authors
- griembauer (3)
- wendian02 (2)
- williamjr (2)
- veroandreo (2)
- jcintasr (1)
- barneyjackson (1)
- bdnorman (1)
- faendeg (1)
- MrChebur (1)
- hiyamdebary (1)
- anikaweinmann (1)
- ekcomputer (1)
- Laughingbi (1)
- legendjslc (1)
- AnupaKulathunga (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 890 last-month
-
Total dependent packages: 1
(may contain duplicates) -
Total dependent repositories: 6
(may contain duplicates) - Total versions: 20
- Total maintainers: 1
proxy.golang.org: github.com/yannforget/landsatxplore
- Documentation: https://pkg.go.dev/github.com/yannforget/landsatxplore#section-documentation
- License: mit
-
Latest release: v0.13.0
published almost 5 years ago
Rankings
pypi.org: landsatxplore
Search and download Landsat scenes from EarthExplorer
- Homepage: https://github.com/yannforget/landsatxplore
- Documentation: https://github.com/yannforget/landsatxplore
- License: MIT
-
Latest release: 0.15.0
published almost 3 years ago
Rankings
Maintainers (1)
Dependencies
- pytest ^6.2 develop
- pytest-cov ^2.11 develop
- click ^7.1
- python ^3.7
- python-dateutil ^2.8
- requests ^2.20
- shapely ^1.7
- tqdm ^4.58
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v1 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v1 composite