|
| 1 | +#!/usr/bin/env pwsh |
| 2 | +# This script is designed to be run in a PowerShell environment. |
| 3 | + |
1 | 4 | # Name: Workspaces Export Script |
2 | | -# Version: 1.2 |
3 | | -# Description: This script directly exports a database using the Workspaces API and saves it to a file. |
4 | | -# Author: Amy Bordenave, Taskar Center for Accessible Technology, University of Washington |
5 | | -# Date: 2025-07-31 |
| 5 | +# Version: 2.0.0 |
| 6 | +# Date: 2025-09-23 |
6 | 7 | # License: CC-BY-ND 4.0 International |
| 8 | +# Author: Amy Bordenave, Taskar Center for Accessible Technology, University of Washington |
7 | 9 |
|
8 | | -# This script is designed to be run in a PowerShell environment. |
| 10 | +<# |
| 11 | +.SYNOPSIS |
| 12 | + Exports data directly from a Workspaces database to an OSM file |
| 13 | +
|
| 14 | +.DESCRIPTION |
| 15 | + This script uses the Workspaces API to export a complete dataset from a |
| 16 | + specified Workspace environment. It retrieves the bounding box for the |
| 17 | + workspace and downloads all data, in .osm format. |
| 18 | +
|
| 19 | +.PARAMETER WorkspaceEnv |
| 20 | + The environment of the Workspace ('dev', 'stage', or 'prod') |
| 21 | +
|
| 22 | +.PARAMETER ApiKey |
| 23 | + Your API key from the corresponding TDEI Portal |
| 24 | +
|
| 25 | +.PARAMETER WorkspaceId |
| 26 | + The numeric ID of the Workspace to export |
| 27 | +
|
| 28 | +.PARAMETER OutputFileName |
| 29 | + The name of the output OSM file (must end with '.osm') |
| 30 | +
|
| 31 | +.EXAMPLE |
| 32 | + # Interactive usage with prompts: |
| 33 | + .\workspaces-export.ps1 |
| 34 | + # Environment: stage |
| 35 | + # API Key: [api-key] |
| 36 | + # Workspace ID: 351 |
| 37 | + # Output file: export-stage-351-20250917-01.osm |
| 38 | + |
| 39 | + Exports all data from Workspace 351 in the stage environment to the specified file. |
| 40 | +
|
| 41 | +.NOTES |
| 42 | + Prerequisites: |
| 43 | + - Valid TDEI Portal API key for the target environment |
| 44 | + - Access permissions to the specified Workspace |
| 45 | + - Sufficient disk space for the export file |
| 46 | + |
| 47 | + API Key locations: |
| 48 | + - Dev: https://portal-dev.tdei.us/ |
| 49 | + - Stage: https://portal-stage.tdei.us/ |
| 50 | + - Prod: https://portal.tdei.us/ |
| 51 | + |
| 52 | + The script will: |
| 53 | + - Validate all input parameters |
| 54 | + - Retrieve the Workspace's bounding box |
| 55 | + - Download the complete dataset as OSM XML |
| 56 | + |
| 57 | + Recommended file naming convention: export-{env}-{workspace_id}-{date}-{counter}.osm |
| 58 | +
|
| 59 | +.LINK |
| 60 | + https://github.com/TaskarCenterAtUW/tdei-tools |
| 61 | +#> |
9 | 62 |
|
10 | 63 | # Ask for and validate inputs |
11 | | -Write-Host "Workspaces Export Script v1.2" |
| 64 | +Write-Host "Workspaces Export Script v2.0.0" |
12 | 65 | Write-Host "Step 1 - Enter the Environment of the dataset you wish to export, in the format 'dev', 'stage', or 'prod'" |
13 | 66 | Write-Host "Example - If your Workspace URL is 'https://workspaces-stage.sidewalks.washington.edu/workspace/351/settings' enter 'stage'" |
14 | 67 | $workspaceEnv = Read-Host |
|
0 commit comments