Skip to content

Commit 1ed0671

Browse files
committed
fix geoextent usage
1 parent 2abea68 commit 1ed0671

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ All geoextent endpoints return valid GeoJSON FeatureCollections by default, matc
458458
- `/api/v1/geoextent/extract-batch/` - Batch processing of multiple files
459459
- Method: POST with multipart/form-data (multiple files)
460460
- Parameters: files[], bbox, tbox, convex_hull, response_format, placename, gazetteer, size_limit_mb
461-
- Uses geoextent's `fromDirectory` for native extent combination
461+
- Uses geoextent's `from_directory` for native extent combination
462462
- Returns: GeoJSON FeatureCollection with combined extent and individual features
463463

464464
**Response Formats** (`response_format` parameter):
@@ -502,7 +502,7 @@ GeoJSON, GeoTIFF, Shapefile, GeoPackage, KML, GML, GPX, FlatGeobuf, CSV (with la
502502

503503
**Known Issues:**
504504

505-
- **Coordinate order bug in geoextent.fromRemote()**: The geoextent library's `fromRemote()` function returns bounding boxes in `[minLat, minLon, maxLat, maxLon]` format instead of the GeoJSON standard `[minLon, minLat, maxLon, maxLat]`. This affects remote extractions only (not file uploads). This needs to be fixed upstream in the geoextent library. Until fixed, remote extraction coordinates will be in the wrong order.
505+
- **Coordinate order bug in geoextent.from_remote()**: The geoextent library's `from_remote()` function returns bounding boxes in `[minLat, minLon, maxLat, maxLon]` format instead of the GeoJSON standard `[minLon, minLat, maxLon, maxLat]`. This affects remote extractions only (not file uploads). This needs to be fixed upstream in the geoextent library. Until fixed, remote extraction coordinates will be in the wrong order.
506506

507507
### Geoextent Web UI
508508

docs/manage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ When to clear which:
517517
### Operate the geoextent service
518518

519519
- Configuration knobs from CLAUDE.md §[Geoextent API Endpoints](../CLAUDE.md): `GEOEXTENT_MAX_FILE_SIZE_MB`, `GEOEXTENT_MAX_BATCH_SIZE_MB`, `GEOEXTENT_MAX_DOWNLOAD_SIZE_MB`, `GEOEXTENT_DOWNLOAD_WORKERS`.
520-
- Known upstream bug (coordinate-order in `geoextent.fromRemote()`); how to detect it in the wild.
520+
- Known upstream bug (coordinate-order in `geoextent.from_remote()`); how to detect it in the wild.
521521
- Where logs surface for failed remote extractions.
522522

523523
### Backup and restore

tests/test_geoextent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ class GeoextentRemoteTest(TestCase):
456456
"""
457457

458458
# Reference value from Zenodo dataset 10.5281/zenodo.4593540
459-
# NOTE: geoextent.fromRemote() has a bug where it returns coordinates in
459+
# NOTE: geoextent.from_remote() has a bug where it returns coordinates in
460460
# [minLat, minLon, maxLat, maxLon] format instead of the GeoJSON standard
461461
# [minLon, minLat, maxLon, maxLat]. This needs to be fixed upstream in geoextent.
462462
# Pennsylvania coordinates: ~40°N latitude, ~75-80°W longitude
@@ -591,7 +591,7 @@ class GeoextentRemoteGetTest(TestCase):
591591
"""
592592

593593
# Reference value from Zenodo dataset 10.5281/zenodo.4593540
594-
# NOTE: geoextent.fromRemote() has a bug where it returns coordinates in
594+
# NOTE: geoextent.from_remote() has a bug where it returns coordinates in
595595
# [minLat, minLon, maxLat, maxLon] format instead of the GeoJSON standard
596596
# [minLon, minLat, maxLon, maxLat]. This needs to be fixed upstream in geoextent.
597597
# Pennsylvania coordinates: ~40°N latitude, ~75-80°W longitude

works/viewsets.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -507,15 +507,15 @@ def extract(self, request):
507507
temp_dir = None
508508

509509
if is_zip:
510-
# Extract ZIP to temporary directory and process with fromDirectory
510+
# Extract ZIP to temporary directory and process with from_directory
511511
temp_dir = tempfile.mkdtemp(prefix='geoextent_zip_')
512512
logger.info(f"Extracting ZIP file to: {temp_dir}")
513513

514514
with zipfile.ZipFile(temp_path, 'r') as zip_ref:
515515
zip_ref.extractall(temp_dir)
516516

517-
# Call geoextent.fromDirectory on extracted contents
518-
geoextent_result = geoextent.fromDirectory(
517+
# Call geoextent.from_directory on extracted contents
518+
geoextent_result = geoextent.from_directory(
519519
temp_dir,
520520
bbox=bbox,
521521
tbox=tbox,
@@ -527,7 +527,7 @@ def extract(self, request):
527527
else:
528528
# Call geoextent once with all parameters
529529
# placename parameter: None, 'nominatim', 'geonames', or 'photon'
530-
geoextent_result = geoextent.fromFile(
530+
geoextent_result = geoextent.from_file(
531531
temp_path,
532532
bbox=bbox,
533533
tbox=tbox,
@@ -628,12 +628,12 @@ def extract_remote(self, request):
628628
try:
629629
workers = settings.GEOEXTENT_DOWNLOAD_WORKERS
630630

631-
# Pass identifiers as list or string to geoextent.fromRemote
631+
# Pass identifiers as list or string to geoextent.from_remote
632632
# It will handle combining extents natively
633633
geoextent_input = identifiers[0] if len(identifiers) == 1 else identifiers
634634

635635
# Call geoextent once with all identifiers
636-
geoextent_result = geoextent.fromRemote(
636+
geoextent_result = geoextent.from_remote(
637637
geoextent_input,
638638
bbox=bbox,
639639
tbox=tbox,
@@ -810,9 +810,9 @@ def extract_batch(self, request):
810810
destination.write(chunk)
811811
logger.debug(f"Saved {uploaded_file.name} to {temp_path}")
812812

813-
# Use geoextent.fromDirectory to process all files at once
813+
# Use geoextent.from_directory to process all files at once
814814
# details=True provides individual file results
815-
geoextent_result = geoextent.fromDirectory(
815+
geoextent_result = geoextent.from_directory(
816816
temp_dir,
817817
bbox=bbox,
818818
tbox=tbox,

0 commit comments

Comments
 (0)