hivemapper-python


Namehivemapper-python JSON
Version 0.4.14 PyPI version JSON
download
home_pageNone
SummarySDK for Hivemapper APIs
upload_time2025-07-16 09:29:16
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements area geographiclib geopy numpy opencv-python pyexiftool pyproj pyshp requests scipy shapely tqdm timezonefinder python-dateutil
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # hive-py

![Python Version](https://img.shields.io/badge/python-%3E%3D3.10-blue)

## Install

Method: PyPi

```
pip install hivemapper-python
```

Method: Clone locally and run

```
pip install -r requirements.txt
```

## Notes & Limitations

- Generate a base64 encoded string of 'my-user-name:api-key' to use as input for `authorization`
- The Imagery API demo restricts queries to Polygons with a maximum area of 1 km^2
  - This wrapper supports automatically breaking up large geometries into smaller geometries behind the scenes

# Usage

### Imagery CLI

```
> python -m imagery.query
usage: query.py [-h] -i INPUT_FILE [-s START_DAY] [-e END_DAY] [-L] [-x] [-d MAX_DIST] [-l MAX_LAG] [-z MAX_ANGLE] -o OUTPUT_DIR [-g] [-w WIDTH] [-M]
                [-I CUSTOM_ID_FIELD] [-S CUSTOM_MIN_DATE_FIELD] [-k] [-E] [-K SKIP_GEO_FILE] [-P IMAGE_POST_PROCESSING] -a AUTHORIZATION [-c NUM_THREADS] [-v]
                [-C] [-b] [-N]

options:
  -h, --help            show this help message and exit
  -i INPUT_FILE, --input_file INPUT_FILE
  -sg SEGMENT_IDS, --segment_ids SEGMENT_IDS
  -s START_DAY, --start_day START_DAY
  -e END_DAY, --end_day END_DAY
  -L, --latest
  -x, --stitch
  -d MAX_DIST, --max_dist MAX_DIST
  -l MAX_LAG, --max_lag MAX_LAG
  -z MAX_ANGLE, --max_angle MAX_ANGLE
  -o OUTPUT_DIR, --output_dir OUTPUT_DIR
  -Z, --zip_dirs
  -Zio, --zip_images_only
  -g, --export_geojson
  -w WIDTH, --width WIDTH
  -m MOUNT, --mount MOUNT
  -M, --merge_metadata
  -I CUSTOM_ID_FIELD, --custom_id_field CUSTOM_ID_FIELD
  -S CUSTOM_MIN_DATE_FIELD, --custom_min_date_field CUSTOM_MIN_DATE_FIELD
  -SF CUSTOM_MIN_DATE_FORMATTING --custom_min_date_formatting CUSTOM_MIN_DATE_FORMATTING
  -Io CUSTOM_OUTPUT_DIR_FIELD, --custom_output_dir_field CUSTOM_OUTPUT_DIR_FIELD
  -Ib CUSTOM_OUTPUT_SUCCESS_FIELD, --custom_output_success_field CUSTOM_OUTPUT_SUCCESS_FIELD
  -Is CUSTOM_OUTPUT_DATE_FIELD, --custom_output_date_field CUSTOM_OUTPUT_DATE_FIELD
  -tI, --track_by_custom_id
  -p, --passthrough_csv_output
  -k, --camera_intrinsics
  -E, --update_exif
  -K SKIP_GEO_FILE, --skip_geo_file SKIP_GEO_FILE
  -P IMAGE_POST_PROCESSING, --image_post_processing IMAGE_POST_PROCESSING
  -a AUTHORIZATION, --authorization AUTHORIZATION
  -c NUM_THREADS, --num_threads NUM_THREADS
  -v, --verbose
  -C, --cache
  -b, --use_batches
  -N, --skip_cached_frames
```

### Bursts CLI

```
> python -m burts.query
usage: query.py [-h] -i INPUT_FILE -a AUTHORIZAITON

options:
  -h, --help            show this help message and exit
  -i INPUT_FILE, --input_file INPUT_FILE
  -a AUTHORIZATION, --authorization AUTHORIZATION
  -v, --verbose
```

### Map Features CLI

```
> python -m mapfeatures.query
usage: query.py [-h] -i INPUT_FILE -o OUTPUT_DIR [-w WIDTH] -a AUTHORIZATION [-c NUM_THREADS] [-v]

options:
  -h, --help            show this help message and exit
  -i INPUT_FILE, --input_file INPUT_FILE
                        Input file
  -o OUTPUT_DIR, --output_dir OUTPUT_DIR
  -w WIDTH, --width WIDTH
  -a AUTHORIZATION, --authorization AUTHORIZATION
  -c NUM_THREADS, --num_threads NUM_THREADS
  -v, --verbose
  -z, --zip_images
```

### Python API

**Query and download**

```
from imagery import query, download_files

# make the API call to query available data
# note: start_day and end_day are Datetime objects
frames = query(geojson_file, start_day, end_day, output_dir, authorization, use_cache=False)

# download the content into folders grouped by its session id
download_files(frames, output_dir)
```

**Create Honey Burst**

```
from bursts import create_bursts

# make the API call to create new bursts by given geojson polygons
# requires polygon type for each of the location
burst_results = create_burts(geojson_file, authorization)
```

## Example

### Query imagery for a GeoJSON Polygon Feature

```
python -m imagery.query -v -M --input_file "test_feature.json" --start_day "2023-07-28" --end_day "2023-07-28" --output_dir "temp" --authorization <your encoded key string>
```

### Query imagery for a Overture Road Segment Id

```
python -m imagery.query -v -M -sg 089283082abbffff0423fcc946ad8fec --start_day "2024-07-28" --end_day "2024-07-28" --output_dir "temp" --authorization <your encoded key string>
```

### Query imagery for a Overture Road Segment Id for a given direction

```
python -m imagery.query -v -M -sg 089283082abbffff0423fcc946ad8fec --start_day "2024-07-28" --end_day "2024-07-28" -A 180 -T 45 --output_dir "temp" --authorization <your encoded key string>
```

### Query imagery for a single week

```
python -m imagery.query -v -M -sg 089283082abbffff0423fcc946ad8fec --week "2024-07-22" --output_dir "temp" --authorization <your encoded key string>
```

### Query latest contiguous imagery for max coverage of GeoJSON Polygon FeatureCollection; stitch together; save a GeoJSON of LineStrings; use a single min date

```
python -m imagery.query -v -M -x -g --input_file "test_feature_col.json" -L -G "2025-01-01" -j --output_dir "temp" --authorization <your encoded key string>
```

### Query imagery for multiple Overture Road Segment Id

```
python -m imagery.query -v -M -sg 089283082abbffff0423fcc946ad8fec 088283082abfffff0467f4b6b725f9af --start_day "2024-07-28" --end_day "2024-07-28" --output_dir "temp" --authorization <your encoded key string>
```

### Query imagery for a GeoJSON Polygon Feature, use cache for resumable, use batches

```
python -m imagery.query -v -M -C -b --input_file "test_feature.json" --start_day "2023-07-28" --end_day "2023-07-28" --output_dir "temp" --authorization <your encoded key string>
```

### Query imagery for a GeoJSON Polygon FeatureCollection; stitch together; save a GeoJSON of LineStrings

```
python -m imagery.query -v -M -x -g --input_file "test_feature_col.json" --start_day "2023-07-28" --end_day "2023-07-28" --output_dir "temp" --authorization <your encoded key string>
```

### Query imagery for a GeoJSON Polygon FeatureCollection; save a GeoJSON of points

```
python -m imagery.query -v -M -g --input_file "test_feature_col.json" --start_day "2023-07-28" --end_day "2023-07-28" --output_dir "temp" --authorization <your encoded key string>
```

### Query imagery for a GeoJSON Polygon Feature, add camera intrinsics and encode to exif

```
python -m imagery.query -v -M -k -E --input_file "test_feature.json" --start_day "2023-07-28" --end_day "2023-07-28" --output_dir "temp" --authorization <your encoded key string>
```

`Focal Length` is encoded in pixel units (i.e., not mm)
`Lens` is encoded as `<k1> <k2>`

Note: `exiftool` is required to be installed (see https://exiftool.org/)

### Converting .shp to Hivemapper-optimized GeoJSON

```
> python -m util.geo -h
usage: geo.py [-h] [-s SHAPEFILE] [-c CSVFILE] -o OUTPUT_JSON [-w WIDTH] [-I CUSTOM_ID_FIELD] [-S CUSTOM_MIN_DATE_FIELD] [-q]

options:
  -h, --help            show this help message and exit
  -s SHAPEFILE, --shapefile SHAPEFILE
  -c CSVFILE, --csvfile CSVFILE
  -o OUTPUT_JSON, --output_json OUTPUT_JSON
  -w WIDTH, --width WIDTH
  -I CUSTOM_ID_FIELD, --custom_id_field CUSTOM_ID_FIELD
  -S CUSTOM_MIN_DATE_FIELD, --custom_min_date_field CUSTOM_MIN_DATE_FIELD
  -q, --quiet
```

### Skipping last output frames areas

```
> python -m util.geo -h
python -m imagery.query -v -M -g --input_file "test_feature_col.json" --start_day "2023-07-28" --end_day "2023-07-28" --output_dir "temp" --authorization <your encoded key string> -K last_out/frames.geojson
```

### Skipping multiple output frames areas

```
> python -m util.geo -h
python -m imagery.query -v -M -g --input_file "test_feature_col.json" --start_day "2023-07-28" --end_day "2023-07-28" --output_dir "temp" --authorization <your encoded key string> -K last_out/frames.geojson,another_out/frames.geojson
```

### Querying API Usage

```
usage: info.py [-h] -a AUTHORIZATION [-b] [-l LIMIT] [-t] [-v]

options:
  -h, --help            show this help message and exit
  -a AUTHORIZATION, --authorization AUTHORIZATION
  -b, --balance
  -l LIMIT, --limit LIMIT
  -t, --history
  -v, --verbose
```

### Querying Remaining API Credit Balance

```
python -m account.info -ba <your encoded key string>
```

### Querying API Transaction history (default limit of 25)

```
python -m account.info -ta <your encoded key string>
```

### Querying Map Features

```
python -m mapfeatures.query --input_file "test_feature_col.json" --output_dir "out" --authorization <encoded key>
```

## Restitching

```
usage: stitching.py [-h] [-R RESTITCH] [-o OUT] [-d MAX_DIST] [-l MAX_LAG] [-z MAX_ANGLE] [-m MIN_SEQ_SIZE] [-v]

options:
  -h, --help            show this help message and exit
  -R RESTITCH, --restitch RESTITCH
  -o OUT, --out OUT
  -d MAX_DIST, --max_dist MAX_DIST
  -l MAX_LAG, --max_lag MAX_LAG
  -z MAX_ANGLE, --max_angle MAX_ANGLE
  -m MIN_SEQ_SIZE, --min_seq_size MIN_SEQ_SIZE
  -v, --verbose
```

### Restitch a directory `out` (creates hard links to images)

```
python -m util.stitching -R out -o out2 -v
```

### Restitch a directory `out`, but only keep sequences >= 100m (creates hard links to images)

```
python -m util.stitching -R out -o out2 -v -m 100
```

## Post Processing

- Install ImageMagick >=7.0.0
- Use Python >=3.7

```
python -m imagery.query -v -M -x -g --input_file "test_feature_col.json" --start_day "2023-07-28" --end_day "2023-07-28" --output_dir "temp" --authorization <your encoded key string> -P clahe-smart-clip
```

## Optical Flow (Image Orientation)

Default Usage:

```
python optical_flow.py input_dir
```

All Options:

```
python optical_flow.py input_dir --unzip --max_corners MAX_CORNERS --num_random_checks NUM_RANDOM_CHECKS --threshold_dxdy_ratio THRESHOLD_DXDY_RATIO --turn_threshold TURN_THRESHOLD
```

### `clahe-smart-clip` (Contrast Limited Adaptive Histogram Equalization with Smart Clipping)

- https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE
- https://imagemagick.org/script/clahe.php
- https://www.mdpi.com/1424-8220/22/22/8967

It's highly recommended to use the module directly in order to preserve the original imagery, as well as to tune values for your own purposes.

By default, settings are naively configured to sacrifice aesthetics to improve unsupervised feature detection. Some general deep learning inference use cases and human in the loop use cases may also see benefits from these default settings.

#### Mitigating Direct Sunlight

![directsun](https://github.com/Hivemapper/hive-py/assets/3093002/46b84ee7-eb5f-4527-92d1-6d48c36b3436)
![clahe1](https://github.com/Hivemapper/hive-py/assets/3093002/f6554add-dd1f-44a2-a0b8-2d5b8fc0d82e)

#### Mitigating Heavy Shadows

![dark1](https://github.com/Hivemapper/hive-py/assets/3093002/8a2cd6cf-910a-4f2b-b680-3c1f003d33f7)
![clahe2](https://github.com/Hivemapper/hive-py/assets/3093002/8e46c7f4-8ff1-4f62-a2bb-d16fdd1a06c0)

# Examples

- [Road Segment Analysis Google Colab Notebook](https://colab.research.google.com/drive/1Fd8ZhD4JUa8uM3y-AppT4IMX7qpzivfL?usp=sharing)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "hivemapper-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Hivemapper <hi@hivemapper.com>",
    "download_url": "https://files.pythonhosted.org/packages/8c/f4/a42a2940750924e3a95547532b2068c6d4bfa0a12f04d0e16b631001cee3/hivemapper_python-0.4.14.tar.gz",
    "platform": null,
    "description": "# hive-py\n\n![Python Version](https://img.shields.io/badge/python-%3E%3D3.10-blue)\n\n## Install\n\nMethod: PyPi\n\n```\npip install hivemapper-python\n```\n\nMethod: Clone locally and run\n\n```\npip install -r requirements.txt\n```\n\n## Notes & Limitations\n\n- Generate a base64 encoded string of 'my-user-name:api-key' to use as input for `authorization`\n- The Imagery API demo restricts queries to Polygons with a maximum area of 1 km^2\n  - This wrapper supports automatically breaking up large geometries into smaller geometries behind the scenes\n\n# Usage\n\n### Imagery CLI\n\n```\n> python -m imagery.query\nusage: query.py [-h] -i INPUT_FILE [-s START_DAY] [-e END_DAY] [-L] [-x] [-d MAX_DIST] [-l MAX_LAG] [-z MAX_ANGLE] -o OUTPUT_DIR [-g] [-w WIDTH] [-M]\n                [-I CUSTOM_ID_FIELD] [-S CUSTOM_MIN_DATE_FIELD] [-k] [-E] [-K SKIP_GEO_FILE] [-P IMAGE_POST_PROCESSING] -a AUTHORIZATION [-c NUM_THREADS] [-v]\n                [-C] [-b] [-N]\n\noptions:\n  -h, --help            show this help message and exit\n  -i INPUT_FILE, --input_file INPUT_FILE\n  -sg SEGMENT_IDS, --segment_ids SEGMENT_IDS\n  -s START_DAY, --start_day START_DAY\n  -e END_DAY, --end_day END_DAY\n  -L, --latest\n  -x, --stitch\n  -d MAX_DIST, --max_dist MAX_DIST\n  -l MAX_LAG, --max_lag MAX_LAG\n  -z MAX_ANGLE, --max_angle MAX_ANGLE\n  -o OUTPUT_DIR, --output_dir OUTPUT_DIR\n  -Z, --zip_dirs\n  -Zio, --zip_images_only\n  -g, --export_geojson\n  -w WIDTH, --width WIDTH\n  -m MOUNT, --mount MOUNT\n  -M, --merge_metadata\n  -I CUSTOM_ID_FIELD, --custom_id_field CUSTOM_ID_FIELD\n  -S CUSTOM_MIN_DATE_FIELD, --custom_min_date_field CUSTOM_MIN_DATE_FIELD\n  -SF CUSTOM_MIN_DATE_FORMATTING --custom_min_date_formatting CUSTOM_MIN_DATE_FORMATTING\n  -Io CUSTOM_OUTPUT_DIR_FIELD, --custom_output_dir_field CUSTOM_OUTPUT_DIR_FIELD\n  -Ib CUSTOM_OUTPUT_SUCCESS_FIELD, --custom_output_success_field CUSTOM_OUTPUT_SUCCESS_FIELD\n  -Is CUSTOM_OUTPUT_DATE_FIELD, --custom_output_date_field CUSTOM_OUTPUT_DATE_FIELD\n  -tI, --track_by_custom_id\n  -p, --passthrough_csv_output\n  -k, --camera_intrinsics\n  -E, --update_exif\n  -K SKIP_GEO_FILE, --skip_geo_file SKIP_GEO_FILE\n  -P IMAGE_POST_PROCESSING, --image_post_processing IMAGE_POST_PROCESSING\n  -a AUTHORIZATION, --authorization AUTHORIZATION\n  -c NUM_THREADS, --num_threads NUM_THREADS\n  -v, --verbose\n  -C, --cache\n  -b, --use_batches\n  -N, --skip_cached_frames\n```\n\n### Bursts CLI\n\n```\n> python -m burts.query\nusage: query.py [-h] -i INPUT_FILE -a AUTHORIZAITON\n\noptions:\n  -h, --help            show this help message and exit\n  -i INPUT_FILE, --input_file INPUT_FILE\n  -a AUTHORIZATION, --authorization AUTHORIZATION\n  -v, --verbose\n```\n\n### Map Features CLI\n\n```\n> python -m mapfeatures.query\nusage: query.py [-h] -i INPUT_FILE -o OUTPUT_DIR [-w WIDTH] -a AUTHORIZATION [-c NUM_THREADS] [-v]\n\noptions:\n  -h, --help            show this help message and exit\n  -i INPUT_FILE, --input_file INPUT_FILE\n                        Input file\n  -o OUTPUT_DIR, --output_dir OUTPUT_DIR\n  -w WIDTH, --width WIDTH\n  -a AUTHORIZATION, --authorization AUTHORIZATION\n  -c NUM_THREADS, --num_threads NUM_THREADS\n  -v, --verbose\n  -z, --zip_images\n```\n\n### Python API\n\n**Query and download**\n\n```\nfrom imagery import query, download_files\n\n# make the API call to query available data\n# note: start_day and end_day are Datetime objects\nframes = query(geojson_file, start_day, end_day, output_dir, authorization, use_cache=False)\n\n# download the content into folders grouped by its session id\ndownload_files(frames, output_dir)\n```\n\n**Create Honey Burst**\n\n```\nfrom bursts import create_bursts\n\n# make the API call to create new bursts by given geojson polygons\n# requires polygon type for each of the location\nburst_results = create_burts(geojson_file, authorization)\n```\n\n## Example\n\n### Query imagery for a GeoJSON Polygon Feature\n\n```\npython -m imagery.query -v -M --input_file \"test_feature.json\" --start_day \"2023-07-28\" --end_day \"2023-07-28\" --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n### Query imagery for a Overture Road Segment Id\n\n```\npython -m imagery.query -v -M -sg 089283082abbffff0423fcc946ad8fec --start_day \"2024-07-28\" --end_day \"2024-07-28\" --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n### Query imagery for a Overture Road Segment Id for a given direction\n\n```\npython -m imagery.query -v -M -sg 089283082abbffff0423fcc946ad8fec --start_day \"2024-07-28\" --end_day \"2024-07-28\" -A 180 -T 45 --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n### Query imagery for a single week\n\n```\npython -m imagery.query -v -M -sg 089283082abbffff0423fcc946ad8fec --week \"2024-07-22\" --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n### Query latest contiguous imagery for max coverage of GeoJSON Polygon FeatureCollection; stitch together; save a GeoJSON of LineStrings; use a single min date\n\n```\npython -m imagery.query -v -M -x -g --input_file \"test_feature_col.json\" -L -G \"2025-01-01\" -j --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n### Query imagery for multiple Overture Road Segment Id\n\n```\npython -m imagery.query -v -M -sg 089283082abbffff0423fcc946ad8fec 088283082abfffff0467f4b6b725f9af --start_day \"2024-07-28\" --end_day \"2024-07-28\" --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n### Query imagery for a GeoJSON Polygon Feature, use cache for resumable, use batches\n\n```\npython -m imagery.query -v -M -C -b --input_file \"test_feature.json\" --start_day \"2023-07-28\" --end_day \"2023-07-28\" --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n### Query imagery for a GeoJSON Polygon FeatureCollection; stitch together; save a GeoJSON of LineStrings\n\n```\npython -m imagery.query -v -M -x -g --input_file \"test_feature_col.json\" --start_day \"2023-07-28\" --end_day \"2023-07-28\" --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n### Query imagery for a GeoJSON Polygon FeatureCollection; save a GeoJSON of points\n\n```\npython -m imagery.query -v -M -g --input_file \"test_feature_col.json\" --start_day \"2023-07-28\" --end_day \"2023-07-28\" --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n### Query imagery for a GeoJSON Polygon Feature, add camera intrinsics and encode to exif\n\n```\npython -m imagery.query -v -M -k -E --input_file \"test_feature.json\" --start_day \"2023-07-28\" --end_day \"2023-07-28\" --output_dir \"temp\" --authorization <your encoded key string>\n```\n\n`Focal Length` is encoded in pixel units (i.e., not mm)\n`Lens` is encoded as `<k1> <k2>`\n\nNote: `exiftool` is required to be installed (see https://exiftool.org/)\n\n### Converting .shp to Hivemapper-optimized GeoJSON\n\n```\n> python -m util.geo -h\nusage: geo.py [-h] [-s SHAPEFILE] [-c CSVFILE] -o OUTPUT_JSON [-w WIDTH] [-I CUSTOM_ID_FIELD] [-S CUSTOM_MIN_DATE_FIELD] [-q]\n\noptions:\n  -h, --help            show this help message and exit\n  -s SHAPEFILE, --shapefile SHAPEFILE\n  -c CSVFILE, --csvfile CSVFILE\n  -o OUTPUT_JSON, --output_json OUTPUT_JSON\n  -w WIDTH, --width WIDTH\n  -I CUSTOM_ID_FIELD, --custom_id_field CUSTOM_ID_FIELD\n  -S CUSTOM_MIN_DATE_FIELD, --custom_min_date_field CUSTOM_MIN_DATE_FIELD\n  -q, --quiet\n```\n\n### Skipping last output frames areas\n\n```\n> python -m util.geo -h\npython -m imagery.query -v -M -g --input_file \"test_feature_col.json\" --start_day \"2023-07-28\" --end_day \"2023-07-28\" --output_dir \"temp\" --authorization <your encoded key string> -K last_out/frames.geojson\n```\n\n### Skipping multiple output frames areas\n\n```\n> python -m util.geo -h\npython -m imagery.query -v -M -g --input_file \"test_feature_col.json\" --start_day \"2023-07-28\" --end_day \"2023-07-28\" --output_dir \"temp\" --authorization <your encoded key string> -K last_out/frames.geojson,another_out/frames.geojson\n```\n\n### Querying API Usage\n\n```\nusage: info.py [-h] -a AUTHORIZATION [-b] [-l LIMIT] [-t] [-v]\n\noptions:\n  -h, --help            show this help message and exit\n  -a AUTHORIZATION, --authorization AUTHORIZATION\n  -b, --balance\n  -l LIMIT, --limit LIMIT\n  -t, --history\n  -v, --verbose\n```\n\n### Querying Remaining API Credit Balance\n\n```\npython -m account.info -ba <your encoded key string>\n```\n\n### Querying API Transaction history (default limit of 25)\n\n```\npython -m account.info -ta <your encoded key string>\n```\n\n### Querying Map Features\n\n```\npython -m mapfeatures.query --input_file \"test_feature_col.json\" --output_dir \"out\" --authorization <encoded key>\n```\n\n## Restitching\n\n```\nusage: stitching.py [-h] [-R RESTITCH] [-o OUT] [-d MAX_DIST] [-l MAX_LAG] [-z MAX_ANGLE] [-m MIN_SEQ_SIZE] [-v]\n\noptions:\n  -h, --help            show this help message and exit\n  -R RESTITCH, --restitch RESTITCH\n  -o OUT, --out OUT\n  -d MAX_DIST, --max_dist MAX_DIST\n  -l MAX_LAG, --max_lag MAX_LAG\n  -z MAX_ANGLE, --max_angle MAX_ANGLE\n  -m MIN_SEQ_SIZE, --min_seq_size MIN_SEQ_SIZE\n  -v, --verbose\n```\n\n### Restitch a directory `out` (creates hard links to images)\n\n```\npython -m util.stitching -R out -o out2 -v\n```\n\n### Restitch a directory `out`, but only keep sequences >= 100m (creates hard links to images)\n\n```\npython -m util.stitching -R out -o out2 -v -m 100\n```\n\n## Post Processing\n\n- Install ImageMagick >=7.0.0\n- Use Python >=3.7\n\n```\npython -m imagery.query -v -M -x -g --input_file \"test_feature_col.json\" --start_day \"2023-07-28\" --end_day \"2023-07-28\" --output_dir \"temp\" --authorization <your encoded key string> -P clahe-smart-clip\n```\n\n## Optical Flow (Image Orientation)\n\nDefault Usage:\n\n```\npython optical_flow.py input_dir\n```\n\nAll Options:\n\n```\npython optical_flow.py input_dir --unzip --max_corners MAX_CORNERS --num_random_checks NUM_RANDOM_CHECKS --threshold_dxdy_ratio THRESHOLD_DXDY_RATIO --turn_threshold TURN_THRESHOLD\n```\n\n### `clahe-smart-clip` (Contrast Limited Adaptive Histogram Equalization with Smart Clipping)\n\n- https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE\n- https://imagemagick.org/script/clahe.php\n- https://www.mdpi.com/1424-8220/22/22/8967\n\nIt's highly recommended to use the module directly in order to preserve the original imagery, as well as to tune values for your own purposes.\n\nBy default, settings are naively configured to sacrifice aesthetics to improve unsupervised feature detection. Some general deep learning inference use cases and human in the loop use cases may also see benefits from these default settings.\n\n#### Mitigating Direct Sunlight\n\n![directsun](https://github.com/Hivemapper/hive-py/assets/3093002/46b84ee7-eb5f-4527-92d1-6d48c36b3436)\n![clahe1](https://github.com/Hivemapper/hive-py/assets/3093002/f6554add-dd1f-44a2-a0b8-2d5b8fc0d82e)\n\n#### Mitigating Heavy Shadows\n\n![dark1](https://github.com/Hivemapper/hive-py/assets/3093002/8a2cd6cf-910a-4f2b-b680-3c1f003d33f7)\n![clahe2](https://github.com/Hivemapper/hive-py/assets/3093002/8e46c7f4-8ff1-4f62-a2bb-d16fdd1a06c0)\n\n# Examples\n\n- [Road Segment Analysis Google Colab Notebook](https://colab.research.google.com/drive/1Fd8ZhD4JUa8uM3y-AppT4IMX7qpzivfL?usp=sharing)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "SDK for Hivemapper APIs",
    "version": "0.4.14",
    "project_urls": {
        "Homepage": "https://github.com/Hivemapper/hive-py",
        "Issues": "https://github.com/Hivemapper/hive-py/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ec7a40c20c8670a262e9607746e8242d43b9066891a08daa3325654dbeaf863",
                "md5": "e02e21ec2c375b8f8559704d0c4bea4c",
                "sha256": "b275033b2041e28f96835e64f3dae82c8e7a235639a810cf1d9bbc43371eb064"
            },
            "downloads": -1,
            "filename": "hivemapper_python-0.4.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e02e21ec2c375b8f8559704d0c4bea4c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 38598,
            "upload_time": "2025-07-16T09:29:14",
            "upload_time_iso_8601": "2025-07-16T09:29:14.901517Z",
            "url": "https://files.pythonhosted.org/packages/3e/c7/a40c20c8670a262e9607746e8242d43b9066891a08daa3325654dbeaf863/hivemapper_python-0.4.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8cf4a42a2940750924e3a95547532b2068c6d4bfa0a12f04d0e16b631001cee3",
                "md5": "287114712a420101b14dc948f9bc3896",
                "sha256": "fb2cb113eaf536f131c0cc15741f9a3659ee1bd90f484a5bca384e8eb8e567a7"
            },
            "downloads": -1,
            "filename": "hivemapper_python-0.4.14.tar.gz",
            "has_sig": false,
            "md5_digest": "287114712a420101b14dc948f9bc3896",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 38841,
            "upload_time": "2025-07-16T09:29:16",
            "upload_time_iso_8601": "2025-07-16T09:29:16.173073Z",
            "url": "https://files.pythonhosted.org/packages/8c/f4/a42a2940750924e3a95547532b2068c6d4bfa0a12f04d0e16b631001cee3/hivemapper_python-0.4.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-16 09:29:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Hivemapper",
    "github_project": "hive-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "area",
            "specs": [
                [
                    "==",
                    "1.1.1"
                ]
            ]
        },
        {
            "name": "geographiclib",
            "specs": [
                [
                    ">=",
                    "2.0"
                ]
            ]
        },
        {
            "name": "geopy",
            "specs": [
                [
                    ">=",
                    "2.3.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "opencv-python",
            "specs": [
                [
                    ">=",
                    "4.10"
                ]
            ]
        },
        {
            "name": "pyexiftool",
            "specs": [
                [
                    "==",
                    "0.5.6"
                ]
            ]
        },
        {
            "name": "pyproj",
            "specs": [
                [
                    ">=",
                    "3.7.0"
                ]
            ]
        },
        {
            "name": "pyshp",
            "specs": [
                [
                    ">=",
                    "2.3.1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    ">=",
                    "1.14.1"
                ]
            ]
        },
        {
            "name": "shapely",
            "specs": [
                [
                    ">=",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "tqdm",
            "specs": [
                [
                    ">=",
                    "4.66.1"
                ]
            ]
        },
        {
            "name": "timezonefinder",
            "specs": [
                [
                    ">=",
                    "6.2.0"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": []
        }
    ],
    "lcname": "hivemapper-python"
}
        
Elapsed time: 1.02282s