Commit ff75bd64 authored by Nicolas Garcia Ospina's avatar Nicolas Garcia Ospina
Browse files

Included some usage documentation

parent 6aa76f4d
Pipeline #25772 failed with stage
in 2 minutes and 20 seconds
# quadtreegrid
This repository contains code related to the creation and management of quadtree grids.
\ No newline at end of file
This repository contains code related to the creation and management of quadtree grids.
# Usage
the `quadtreegrid.py` script allows the creation of a grid will all tiles contained
within a bounding box. To launch this script, an input extent is required.
For instance, a specific bounding box is introduced with the -in_bounds argument followed by
the West,South,East,North limits separated with single spaces:
```
python quadtreegrid.py -in_bounds 1 1 5 5
```
This would create a file called `output_quadkeys.txt` with all the `zoom level 18` tiles within
that bounding box.
The bounding box can be also extracted from a `shapefile` for example, this can be done with the
argument `-in_file` followed by the relative or absolute path of the target file. For example:
```
python quadtreegrid.py -in_file /path/to/my_shapefile.shp
```
This would create a file called `output_quadkeys.txt` with all the `zoom level 18` tiles within
the bounding box of the entire shapefile.
Two optional arguments to include are: 1) `-output` which allows to set a filename or filepath to
resulting text file. if the resulting filename has the `csv` extension, a header with the name
`quadkey` will be included. The default for this is `output_quadkeys.txt`. 2) the `-zoom` argument
sets the desired zoom level of the output tiles. The default is `18`
```
python quadtreegrid.py -in_bounds 1 1 5 5 -output ./custom_filepath.csv -zoom 9
```
This would create a file called `custom_filepath.csv` with all the `zoom level 9` tiles within
that bounding box and the header `quadkey`.
......@@ -39,7 +39,7 @@ parser.add_argument(
nargs="+",
help="Bounds in order West,South,East,North",
)
parser.add_argument("-in_file", type=str, help="Shapefile with a given geometry")
parser.add_argument("-in_file", type=str, help="Shapefile with a given geometry to extract a bounding box")
parser.add_argument(
"-zoom",
nargs="?",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment