Usage

Generate id

  • It adds a key <id_label> in the PROPERTIES in a GeoJSON file, the value of id can start in 1 or in a given value. This script can work with aws - s3 uri.
COMMAND REQUIRED DESCRIPTION
--in_file yes Path to GeoJSON to process.
--id_label no Key name for id. Default value: id.
--id_start no Value of first id, the next value is its sequence (number). Default value: 1.
--zeros no Add zeros at the beginning of the id value until it reaches the specified length. Example: --zeros 3 --> 003. Default value: 0.
--variation no Type of id (number or uuid). Default value: number.
--output_file yes Path to GeoJSON output.

Return:

GeoJSON file - It contains features that have an id property.

Command line:

docker run --rm -v ${PWD}:/mnt/data developmentseed/geokit:python.latest geo \
    generate_id \
    --in_file=<GEOJSON_PATH> \
    --id_label=<NEW_ID> \
    --id_start=100 \
    --zeros=5  \
    --output_file=S3://an-awesome-bucket-name/file.geojson

Use case:

  • Add ID attribute to each feature in the GeoJSON file.

image