$npx -y skills add opengeos/geoai-skills --skill overture-dataDownload Overture Maps data (buildings, places, roads, land use, water, etc.) for a bounding box. Returns a GeoDataFrame saved as GeoJSON or GeoPackage.
| 1 | You are helping the user download Overture Maps data using geoai. |
| 2 | |
| 3 | Input: `$@` |
| 4 | |
| 5 | Follow these steps in order. |
| 6 | |
| 7 | ## Step 1 -- Parse arguments |
| 8 | |
| 9 | Extract: |
| 10 | - `$0` or the first positional argument as the Overture data type |
| 11 | - `--bbox minx,miny,maxx,maxy` as the bounding box (required) |
| 12 | - `--output FILE` as the output file path (optional, default: `./<data_type>_overture.gpkg`) |
| 13 | |
| 14 | Valid Overture data types: |
| 15 | `address`, `building`, `building_part`, `division`, `division_area`, |
| 16 | `division_boundary`, `place`, `segment`, `connector`, `infrastructure`, |
| 17 | `land`, `land_cover`, `land_use`, `water` |
| 18 | |
| 19 | If the data type is not recognized, print the list of valid types and ask the user to pick one. |
| 20 | |
| 21 | If the user provided natural language (e.g. "get buildings in downtown Nashville"), extract the data type and either infer or ask for the bounding box. |
| 22 | |
| 23 | ## Step 2 -- Validate the bounding box |
| 24 | |
| 25 | Confirm the bounding box has 4 numeric values: |
| 26 | - `minx < maxx` and `miny < maxy` |
| 27 | - Values within WGS84 range |
| 28 | |
| 29 | If validation fails, report the issue and ask for corrected coordinates. |
| 30 | |
| 31 | ## Step 3 -- Download the data |
| 32 | |
| 33 | ### For building data specifically |
| 34 | |
| 35 | ```bash |
| 36 | python3 -c " |
| 37 | import geoai |
| 38 | |
| 39 | gdf = geoai.download_overture_buildings( |
| 40 | bbox=(MINX, MINY, MAXX, MAXY), |
| 41 | output='OUTPUT_PATH', |
| 42 | ) |
| 43 | print(f'Features: {len(gdf)}') |
| 44 | print(f'Columns: {list(gdf.columns)}') |
| 45 | print(f'CRS: {gdf.crs}') |
| 46 | print(f'Bounds: {gdf.total_bounds.tolist()}') |
| 47 | print('---') |
| 48 | print('Sample (first 5 rows):') |
| 49 | print(gdf.head().to_string()) |
| 50 | " |
| 51 | ``` |
| 52 | |
| 53 | ### For all other data types |
| 54 | |
| 55 | ```bash |
| 56 | python3 -c " |
| 57 | import geoai |
| 58 | |
| 59 | gdf = geoai.get_overture_data( |
| 60 | overture_type='DATA_TYPE', |
| 61 | bbox=(MINX, MINY, MAXX, MAXY), |
| 62 | output='OUTPUT_PATH', |
| 63 | ) |
| 64 | print(f'Features: {len(gdf)}') |
| 65 | print(f'Columns: {list(gdf.columns)}') |
| 66 | print(f'CRS: {gdf.crs}') |
| 67 | print(f'Bounds: {gdf.total_bounds.tolist()}') |
| 68 | print('---') |
| 69 | print('Sample (first 5 rows):') |
| 70 | print(gdf.head().to_string()) |
| 71 | " |
| 72 | ``` |
| 73 | |
| 74 | Replace `DATA_TYPE`, `MINX`, `MINY`, `MAXX`, `MAXY`, and `OUTPUT_PATH` with actual values. |
| 75 | |
| 76 | ## Step 4 -- Update state |
| 77 | |
| 78 | If a state directory exists, update it: |
| 79 | |
| 80 | ```bash |
| 81 | STATE_DIR="" |
| 82 | test -f .geoai-skills/state.json && STATE_DIR=".geoai-skills" |
| 83 | PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")" |
| 84 | PROJECT_ID="$(echo "$PROJECT_ROOT" | tr '/' '-')" |
| 85 | test -f "$HOME/.geoai-skills/$PROJECT_ID/state.json" && STATE_DIR="$HOME/.geoai-skills/$PROJECT_ID" |
| 86 | ``` |
| 87 | |
| 88 | If `STATE_DIR` is set: |
| 89 | |
| 90 | ```bash |
| 91 | python3 -c " |
| 92 | import json, os |
| 93 | state_file = 'STATE_DIR/state.json' |
| 94 | state = {} |
| 95 | if os.path.exists(state_file): |
| 96 | with open(state_file) as f: |
| 97 | state = json.load(f) |
| 98 | state.setdefault('downloaded_files', []) |
| 99 | state['downloaded_files'].append('OUTPUT_PATH') |
| 100 | with open(state_file, 'w') as f: |
| 101 | json.dump(state, f, indent=2) |
| 102 | " |
| 103 | ``` |
| 104 | |
| 105 | ## Step 5 -- Report results |
| 106 | |
| 107 | Summarize: |
| 108 | - Data type downloaded |
| 109 | - Number of features |
| 110 | - Output file path and size |
| 111 | - Column summary |
| 112 | - CRS and spatial extent |
| 113 | |
| 114 | Then suggest: *"Use `/geoai-skills:inspect-geo` to examine the downloaded data in detail."* |
| 115 | |
| 116 | ## Error handling |
| 117 | |
| 118 | - **`import geoai` fails** -> delegate to `/geoai-skills:install-geoai`. |
| 119 | - **`overturemaps` not installed** -> suggest `pip install "geoai-py[extra]"` which includes the overturemaps dependency. |
| 120 | - **No features found** -> suggest expanding the bounding box or trying a different data type. |
| 121 | - **Network error** -> report and suggest retrying. |