Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for quadbin #93

Merged
merged 3 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/source/user_guide/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ project named ``my-gcp-project``, a dataset named ``my-bigquery-dataset``, and a
named ``my-bigquery-table``. If the table already contains data, this data will be
overwritten because the ``--overwrite`` flag is set.

You can also use the ``--output_quadbin`` flag to upload the raster to the BigQuery
table in a quadbin format. To use this option, the input raster must be a
``GoogleMapsCompatible`` raster. You can make your raster compatible by converting it with
the following command with GDAL:

.. code-block:: bash

gdalwarp your_raster.tif -of COG -co TILING_SCHEME=GoogleMapsCompatible -co COMPRESS=DEFLATE your_compatible_raster.tif

.. seealso::
See the :ref:`cli_details` for a full list of options.

Expand Down
11 changes: 11 additions & 0 deletions docs/source/user_guide/use_with_python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ For example:

This function returns `True` if the upload was successful.

.. note::

To upload the raster to BigQuery in a quadbin format, set the ``output_quadbin``
parameter of ``rasterio_to_bigquery()`` to ``True``. This option requires a
``GoogleMapsCompatible`` input raster. You can make your raster compatible by
converting it with GDAL:

.. code-block:: bash

gdalwarp your_raster.tif -of COG -co TILING_SCHEME=GoogleMapsCompatible -co COMPRESS=DEFLATE your_compatible_raster.tif

Inspecting a raster file on BigQuery
------------------------------------

Expand Down
5 changes: 4 additions & 1 deletion raster_loader/cli/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ def bigquery(args=None):
)
@click.option(
"--output_quadbin",
help="Upload the raster to the BigQuery table in a quadbin format.",
help=(
"Upload the raster to the BigQuery table in a quadbin format "
"(input raster must be a GoogleMapsCompatible raster)."
),
default=False,
is_flag=True,
)
Expand Down
3 changes: 2 additions & 1 deletion raster_loader/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ def rasterio_to_bigquery(
overwrite : bool, optional
Overwrite the table if it already contains data, by default False
output_quadbin : bool, optional
Upload the raster to the BigQuery table in a quadbin format.
Upload the raster to the BigQuery table in a quadbin format (input raster must
be a GoogleMapsCompatible raster)

Returns
-------
Expand Down