Creates a task to export a FeatureCollection to a BigQuery table. This feature is in Preview, and the API and behavior may change significantly. Args: collection: The feature collection to be exported. description: Human-readable name of the task. table: T
(
collection: _arg_types.FeatureCollection,
description: str = 'myExportTableTask',
table: str | None = None,
overwrite: bool = False,
append: bool = False,
selectors: Sequence[str] | str | None = None,
maxVertices: int | None = None,
priority: int | None = None,
**kwargs,
)
| 821 | |
| 822 | @staticmethod |
| 823 | def toBigQuery( |
| 824 | collection: _arg_types.FeatureCollection, |
| 825 | description: str = 'myExportTableTask', |
| 826 | table: str | None = None, |
| 827 | overwrite: bool = False, |
| 828 | append: bool = False, |
| 829 | selectors: Sequence[str] | str | None = None, |
| 830 | maxVertices: int | None = None, |
| 831 | priority: int | None = None, |
| 832 | **kwargs, |
| 833 | ) -> Task: |
| 834 | """Creates a task to export a FeatureCollection to a BigQuery table. |
| 835 | |
| 836 | This feature is in Preview, and the API and behavior may change |
| 837 | significantly. |
| 838 | |
| 839 | Args: |
| 840 | collection: The feature collection to be exported. |
| 841 | description: Human-readable name of the task. |
| 842 | table: The fully-qualifed BigQuery destination table with |
| 843 | "project_id.dataset_id.table_id" format. |
| 844 | overwrite: Whether the existing table should be |
| 845 | overwritten by the results of this export. |
| 846 | The `overwrite` and `append` parameters cannot be `true` |
| 847 | simultaneously. The export fails if the table already exists and both |
| 848 | `overwrite` and `append` are `false`. |
| 849 | append: Whether table data should be appended if the table already |
| 850 | exists and has a compatible schema. |
| 851 | selectors: The list of properties to include in the output, as a list of |
| 852 | strings or a comma-separated string. By default, all properties are |
| 853 | included. |
| 854 | maxVertices: Max number of uncut vertices per geometry; geometries with |
| 855 | more vertices will be cut into pieces smaller than this size. |
| 856 | priority: The priority of the task within the project. Higher priority |
| 857 | tasks are scheduled sooner. Must be an integer between 0 and 9999. |
| 858 | Defaults to 100. |
| 859 | **kwargs: Holds other keyword arguments that may have been deprecated. |
| 860 | |
| 861 | Returns: |
| 862 | An unstarted Task that exports the table. |
| 863 | """ |
| 864 | if table: |
| 865 | if ( |
| 866 | not isinstance(table, str) |
| 867 | or re.fullmatch(r'.+\..+\..+', table) is None |
| 868 | ): |
| 869 | raise ee_exception.EEException( |
| 870 | 'The BigQuery table reference must be a string of the form' |
| 871 | ' "project_id.dataset_id.table_id".' |
| 872 | ) |
| 873 | |
| 874 | config = { |
| 875 | 'description': description, |
| 876 | 'table': table, |
| 877 | 'overwrite': overwrite, |
| 878 | 'append': append, |
| 879 | 'selectors': selectors, |
| 880 | 'maxVertices': maxVertices, |