Write DataFrame to layer
Write data and metadata from a DataFrame or GeoDataFrame to supported layer types by enabling the GeoPandasAdapter and using the standard HERE Data SDK write functions.
To write data and metadata to versioned, volatile, index, stream and interactive map layers, please familiarize yourself first with the write functions described in the corresponding section of this user guide.
For content types supported by the GeoPandas Adapter (see Table), contents of a DataFrame or GeoDataFrame can be encoded and written to layer with a single function. For content types not supported, you will need to pass encode=False and take care of the encoding yourself.
All the standard parameters of set_partitions_metadata, write_partitions, append_stream_metadata, write_stream, write_features, update_features, delete_features are supported, in addition to adapter-specific parameters that are forwarded to this adapter and its data encoder.
When writing and encoding data, the GeoPandasAdapter splits the (Geo)DataFrame to write in partitions according to the partition_id column. Each selection of rows is then encoded and stored as standalone partition. Rows with no partition identifier set are discarded. Parameters that are adapter-specific are passed to the DataFrame.to_csv, DataFrame.to_parquet and similar functions that perform the actual encoding of each single partition. You can use them to fine-tune the details of the encoding of single partitions, including how to handle the (Geo)DataFrame index. For more information on supported content types and exact parameters, please see the documentation of GeoPandasEncoder.
In case encode=False is passed to write_partitions or write_stream, a plain Python collection containing bytes and not a (Geo)DataFrame must be passed as well, as the adapter is not used and no encoding takes place.
Write examples are symmetric to the read examples shown above.
Updated 3 days ago