Skip to content

Commit 77b8401

Browse files
Adds test instructions to readme; adds maidenhead vis demo
1 parent 4bdeede commit 77b8401

File tree

1 file changed

+50
-2
lines changed

1 file changed

+50
-2
lines changed

README.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,43 @@ gpd.GeoDataFrame(o, geometry="geometry", crs="EPSG:4326").to_file('tests/data/ou
254254
```
255255
</details>
256256

257+
<details>
258+
<summary>For Maidenhead output...</summary>
259+
260+
For <summary>For Maidenhead output...</summary>
261+
output, you can use [`maidenhead`](https://https://github.com/space-physics/maidenhead) or other similar Maidenhead library. Example:
262+
263+
```python
264+
import pandas as pd
265+
import maidenhead
266+
from shapely.geometry import shape
267+
import geopandas as gpd
268+
o = pd.read_parquet('./tests/data/output/5/sample_maidenhead.pq')
269+
270+
o['geometry'] = o.index.map(lambda mh: shape(maidenhead.to_geoJSONObject(mh, center=True)['features'][1]['geometry']))
271+
272+
'''
273+
band 1 2 3 geometry
274+
maidenhead_5
275+
JO22de80UB 0 0 0 POLYGON ((4.323611111111111 52.16684027777778,...
276+
JO22de80UC 0 0 0 POLYGON ((4.323611111111111 52.16701388888889,...
277+
JO22de80UD 0 0 0 POLYGON ((4.323611111111111 52.1671875, 4.3239...
278+
JO22de80UE 0 0 0 POLYGON ((4.323611111111111 52.16736111111111,...
279+
JO22de80UF 0 0 0 POLYGON ((4.323611111111111 52.16753472222222,...
280+
... .. .. .. ...
281+
JO22fg62PB 0 0 0 POLYGON ((4.471875 52.25850694444444, 4.472222...
282+
JO22fg62QA 0 0 0 POLYGON ((4.472222222222222 52.25833333333333,...
283+
JO22fg62QB 0 0 0 POLYGON ((4.472222222222222 52.25850694444444,...
284+
JO22fg62RA 0 0 0 POLYGON ((4.472569444444445 52.25833333333333,...
285+
JO22fg62RB 0 0 0 POLYGON ((4.472569444444445 52.25850694444444,...
286+
287+
[227470 rows x 4 columns]
288+
'''
289+
290+
gpd.GeoDataFrame(o, geometry="geometry", crs="EPSG:4326").to_file('tests/data/output/5/sample_maidenhead.gpkg')
291+
```
292+
</details>
293+
257294
## Installation
258295

259296
PyPi:
@@ -299,14 +336,25 @@ If you run `poetry install`, the CLI tool will be aliased so you can simply use
299336

300337
Please run `black .` before committing.
301338

302-
#### Testing
339+
#### Tests
340+
341+
Tests are included. To run them, set up a poetry environment, then follow these instructons:
342+
343+
```bash
344+
cd tests
345+
python ./test_rater2dggs.py
346+
```
347+
348+
Test data are included at `tests/data/`.
349+
350+
#### Experimenting
303351

304352
Two sample files have been uploaded to an S3 bucket with `s3:GetObject` public permission.
305353

306354
- `s3://raster2dggs-test-data/Sen2_Test.tif` (sample Sentinel 2 imagery, 10 bands, rectangular, Int16, LZW compression, ~10x10m pixels, 68.6 MB)
307355
- `s3://raster2dggs-test-data/TestDEM.tif` (sample LiDAR-derived DEM, 1 band, irregular shape with null data, Float32, uncompressed, 10x10m pixels, 183.5 MB)
308356

309-
You may use these for testing. However you can also test with local files too, which will be faster. A good, small (5 MB) sample image is available [here](https://github.com/mommermi/geotiff_sample).
357+
You may use these for experimentation. However you can also use local files too, which will be faster. A good, small (5 MB) sample image is available [here](https://github.com/mommermi/geotiff_sample).
310358

311359
## Example commands
312360

0 commit comments

Comments
 (0)