You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Find and organize satellite images for area/time of interest (tailored for Planet Labs Imagery)
3
3
4
-
**planet_overlap** is a scalable satellite imagery query engine for retrieving and filtering PlanetScope imagery over large areas and long time periods.
4
+
**planet_overlap** is a scalable satellite imagery query engine for retrieving and filtering Planet Labs imagery (PSScene and SkySatScene) over large areas and long time periods.
5
5
6
6
It supports:
7
7
8
+
- 🛰 **Imagery Types**: PSScene (PlanetScope) and SkySatScene
8
9
- 📍 Multiple Areas of Interest (AOIs)
9
10
- 📌 Automatic buffering of point inputs
10
11
- 🗺 Automatic spatial tiling (in degrees)
@@ -29,12 +30,13 @@ You provide:
29
30
30
31
The system:
31
32
32
-
1. Connects to the Planet API
33
-
2. Filters imagery by date and quality
34
-
3. Automatically tiles large areas (if needed)
35
-
4. Tracks progress during execution
36
-
5. Logs runtime (seconds) and peak memory usage (MB)
37
-
6. Saves structured output
33
+
1. Connects to the Planet API with your API key
34
+
2. Searches for **PSScene** and **SkySatScene** imagery
35
+
3. Filters imagery by date and quality
36
+
4. Automatically tiles large areas (if needed)
37
+
5. Tracks progress during execution
38
+
6. Logs runtime (seconds) and peak memory usage (MB)
39
+
7. Saves structured results (GeoJSON and JSON files)
38
40
39
41
40
42
---
@@ -54,18 +56,40 @@ pip install .
54
56
```
55
57
---
56
58
## 🔑 Planet API Key
59
+
60
+
This tool requires a valid Planet API key to search and retrieve imagery. You can obtain an API key from the [Planet Developer Portal](https://www.planet.com/developer/).
61
+
57
62
Set your API key as an environment variable:
58
-
#### macOS/Linux
59
63
64
+
#### macOS/Linux
60
65
61
66
```bash
62
67
export PLANET_API_KEY=your_api_key_here
63
68
```
64
69
65
-
#### Windows (PowerShell)
70
+
To make this permanent, add it to your `~/.bashrc` or `~/.zshrc`:
Restart your terminal or PowerShell session to apply the changes.
84
+
85
+
#### Verify API Key
86
+
87
+
To verify your API key is set correctly:
88
+
89
+
```bash
90
+
echo$PLANET_API_KEY# macOS/Linux
91
+
echo$env:PLANET_API_KEY # PowerShell
92
+
```
69
93
---
70
94
## 🛰 Basic Usage
71
95
@@ -78,6 +102,31 @@ planet_overlap \
78
102
--output-dir ./output
79
103
```
80
104
105
+
### CLI Options
106
+
107
+
| Option | Description | Default |
108
+
|--------|-------------|---------|
109
+
|`--aoi-file`| Path to GeoJSON file containing Area of Interest |**required**|
110
+
|`--start-date`| Start date in YYYY-MM-DD format |**required**|
111
+
|`--end-date`| End date in YYYY-MM-DD format |**required**|
112
+
|`--output-dir`| Output directory for results |**required**|
113
+
|`--max-cloud`| Maximum cloud cover fraction (0.0-1.0) |`0.5`|
114
+
|`--min-sun-angle`| Minimum sun angle in degrees (0.0-90.0) |`0.0`|
115
+
|`--tile-size`| Spatial tile size in decimal degrees |`1.0`|
116
+
|`--point-buffer`| Buffer size for point inputs in degrees |`0.001`|
117
+
118
+
### Example with Filters
119
+
120
+
```bash
121
+
planet_overlap \
122
+
--aoi-file colorado.geojson \
123
+
--start-date 2023-01-01 \
124
+
--end-date 2023-01-31 \
125
+
--max-cloud 0.3 \
126
+
--min-sun-angle 30 \
127
+
--output-dir ./output
128
+
```
129
+
81
130
## 📅 Date Filtering
82
131
83
132
Dates must be provided in ISO format:
@@ -117,6 +166,20 @@ Sun angle is measured in degrees (°) above the horizon. Lower values may produc
117
166
```bash
118
167
--min-sun-angle 10
119
168
```
169
+
170
+
---
171
+
## 🛰 Imagery Types
172
+
173
+
The tool searches for the following Planet imagery types:
174
+
175
+
| Type | Description | Resolution |
176
+
|------|-------------|------------|
177
+
|**PSScene**| PlanetScope imagery (3-band and 4-band) |~3.7m per pixel |
178
+
|**SkySatScene**| High-resolution satellite imagery |~0.5m per pixel |
179
+
180
+
Both imagery types are searched simultaneously and results are combined in the output.
181
+
182
+
---
120
183
## 🗺 Spatial Tiling
121
184
Large AOIs are automatically divided into grid tiles. This can also occur for long date ranges and memory-sensitive runs. Tile size is specified in decimal degrees (°):
122
185
@@ -150,6 +213,29 @@ Buffer size is specified in decimal degrees (°):
150
213
```
151
214
0.001° ≈ 111 meters (latitude direction)
152
215
216
+
---
217
+
## 📂 Output Files
218
+
219
+
The CLI generates the following files in your output directory:
220
+
221
+
| File | Description |
222
+
|------|-------------|
223
+
|`results.geojson`| GeoJSON file with filtered satellite imagery (contains geometry, timestamps, cloud cover, sun angle, etc.) |
224
+
|`properties.json`| JSON file with all scene properties for further analysis |
225
+
226
+
Each scene in `results.geojson` includes:
227
+
-`name`: Scene ID
228
+
-`geometry`: Scene footprint as a polygon
229
+
-`view_angle`: View angle of the scene
230
+
-`acquired`: Acquisition timestamp
231
+
-`cloud_cover`: Cloud cover fraction (0.0-1.0)
232
+
-`sun_elevation`: Sun elevation angle
233
+
-`sun_angle`: Sun angle above horizon (90° - sun_elevation)
234
+
-`satellite_id`: Satellite identifier
235
+
-`central_lon`/`central_lat`: Scene center coordinates
236
+
-`local_times`: Local acquisition time
237
+
-`max_sun_diff`: Maximum sun angle difference with overlapping scenes
238
+
153
239
---
154
240
## 📊 Performance Tracking
155
241
Each run reports:
@@ -176,12 +262,19 @@ Tests verify:
176
262
* Tiling behavior
177
263
* Point buffering
178
264
* Filter construction
265
+
* CLI argument parsing
266
+
* Planet API integration
267
+
268
+
Run all tests with pytest:
179
269
180
-
Run all unit tests:
270
+
```bash
271
+
pytest tests/
272
+
```
181
273
274
+
Run tests with verbose output:
182
275
183
276
```bash
184
-
python -m unittest discover planet_overlap/tests
277
+
pytest tests/ -v
185
278
```
186
279
187
280
---
@@ -204,36 +297,50 @@ Workflow file:
204
297
README.md # Project documentation
205
298
pyproject.toml # Project configuration
206
299
.gitignore # Files Git should ignore
207
-
planet_overlap/
208
-
├── cli.py
209
-
├── geometry.py
210
-
├── filters.py
211
-
├── pagination.py
212
-
├── quality.py
213
-
├── analysis.py
214
-
├── performance.py
215
-
├── logger.py
216
-
├── client.py
217
-
├── io.py
218
-
└── tests/
300
+
src/
301
+
└── planet_overlap/
302
+
├── __init__.py
303
+
├── cli.py # CLI interface and argument parsing
304
+
├── geometry.py # AOI loading, point detection, buffering
305
+
├── filters.py # Planet API filter construction
306
+
├── pagination.py # Spatial and temporal tiling
307
+
├── quality.py # Quality filtering functions
308
+
├── analysis.py # Analysis and processing pipeline
309
+
├── performance.py # Runtime and memory profiling
310
+
├── logger.py # Logging configuration
311
+
├── client.py # Planet API client and session management
312
+
├── io.py # File I/O operations
313
+
└── utils.py # Utility functions
314
+
tests/
219
315
├── __init__.py
220
316
├── test_geometry.py # Test loading AOIs, point detection, buffering, polygons
221
317
├── test_filters.py # Test single/multiple .geojson AOIs, date ranges, cloud/sun filters
222
-
├── test_client.py # Test Planet API session creation, authentication, pagination
223
-
├── test_io.py # Test reading/writing lists and CSV/GeoDataFrames
224
-
├── test_quality.py # Test filtering by view_angle, sun_angle, cloud cover
225
-
├── test_overlap.py # Test polygon intersection, area and sun angle calculations
226
318
├── test_analysis.py # Test overall analysis pipeline logic, derived columns
227
319
├── test_cli.py # Test CLI argument parsing, dynamic config, and default overrides
228
-
├── test_utils.py # Test scene estimation, temporal tiling, and helper functions
229
-
└── test_tiling.py # Test automatic spatial and temporal tiling logic
320
+
├── test_geometry.py # Test geometry operations
321
+
├── test_points.py # Test point handling and date tiling
322
+
└── test_tiling.py # Test automatic spatial and temporal tiling logic
230
323
```
231
324
232
325
---
233
326
## ⚙ Requirements
234
-
* Python ≥ 3.9
327
+
* Python ≥ 3.10
235
328
* requests
236
329
* geopandas
237
330
* shapely
238
331
* tqdm
239
332
333
+
### Installing Dependencies
334
+
335
+
After cloning the repository, install the package with its dependencies:
0 commit comments