Skip to content

Commit

Permalink
'skip_creating_polygon' is updated in README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
dabhicusp committed Jul 7, 2023
1 parent 218694e commit b514385
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions weather_mv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ usage: weather-mv bigquery [-h] -i URIS [--topic TOPIC] [--window_size WINDOW_SI
[--import_time IMPORT_TIME] [--infer_schema]
[--xarray_open_dataset_kwargs XARRAY_OPEN_DATASET_KWARGS]
[--tif_metadata_for_datetime TIF_METADATA_FOR_DATETIME] [-s]
[--coordinate_chunk_size COORDINATE_CHUNK_SIZE] ['--create_polygon']
[--coordinate_chunk_size COORDINATE_CHUNK_SIZE] ['--skip_creating_polygon']
```

The `bigquery` subcommand loads weather data into BigQuery. In addition to the common options above, users may specify
Expand All @@ -81,7 +81,9 @@ _Command options_:
* `--tif_metadata_for_datetime` : Metadata that contains tif file's timestamp. Applicable only for tif files.
* `-s, --skip-region-validation` : Skip validation of regions for data migration. Default: off.
* `--disable_grib_schema_normalization` : To disable grib's schema normalization. Default: off.
* `--create_polygon` : Ingest grid points as polygons in BigQuery. Default: Ingest grid points as normal point in BigQuery. Note: This feature relies on the assumption that the provided grid is regular.
* `--skip_creating_polygon` : Not ingest grid points as polygons in BigQuery. Default: Ingest grid points as Polygon in
BigQuery. Note: This feature relies on the assumption that the provided grid has an equal distance between consecutive
points of latitude and longitude.

Invoke with `bq -h` or `bigquery --help` to see the full range of options.

Expand Down Expand Up @@ -118,14 +120,14 @@ weather-mv bq --uris "gs://your-bucket/*.nc" \
--dry-run
```

Ingest grid points as polygons in BigQuery:
Ingest grid points with skip creating polygon in BigQuery:

```bash
weather-mv bq --uris "gs://your-bucket/*.nc" \
--output_table $PROJECT.$DATASET_ID.$TABLE_ID \
--temp_location "gs://$BUCKET/tmp" \ # Needed for batch writes to BigQuery
--direct_num_workers 2 \
--create_polygon
--skip_creating_polygon
```

Load COG's (.tif) files:
Expand Down
7 changes: 4 additions & 3 deletions weather_mv/loader_pipeline/bq.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ def add_parser_arguments(cls, subparser: argparse.ArgumentParser):
subparser.add_argument('-a', '--area', metavar='area', type=float, nargs='+', default=list(),
help='Target area in [N, W, S, E]. Default: Will include all available area.')
subparser.add_argument('--skip_creating_polygon', action='store_true',
help='Ingest grid points as polygons in BigQuery. Default: Ingest grid points as normal '
'point in BigQuery. Note: This feature relies on the assumption that the provided '
'grid is regular.')
help='Not ingest grid points as polygons in BigQuery. Default: Ingest grid points as '
'Polygon in BigQuery. Note: This feature relies on the assumption that the '
'provided grid has an equal distance between consecutive points of latitude and '
'longitude.')
subparser.add_argument('--import_time', type=str, default=datetime.datetime.utcnow().isoformat(),
help=("When writing data to BigQuery, record that data import occurred at this "
"time (format: YYYY-MM-DD HH:MM:SS.usec+offset). Default: now in UTC."))
Expand Down

0 comments on commit b514385

Please sign in to comment.