Writer Overview

The Google Maps Engine Tables writer uses the Google Maps Engine API to write table features. When writing, features are sent to Google Maps Engine in batches of up to 50 features each.

The Google Maps Engine writer supports table creation.

In most circumstances, table creation is accomplished by writing all features to a KML file, and then uploading the KML to Google Maps Engine as a vector table. If the gx_location attribute is present, or if boolean or datetime attributes are on the schema, then the Google Maps Engine Writer will create and populate the table using REST API calls in order to accommodate geocoding or to preserve attribute types, respectively.

Note that in the KML upload table creation case, the Google Maps Engine Writer will poll Google Maps Engine for the KML processing status until it obtains either a success or failure state. A success state does not necessarily mean that all features were processed successfully: refer to the “Bad features” section at http://support.google.com/mapsengine/answer/1272933 for details.

All features must provide a value for the primary key attribute, except when the writer mode is set to INSERT, in which case one may be generated automatically using a unique identifier. For table creation, a single attribute may be defined as the primary key. If no primary key is defined, Google Maps Engine will create a primary key attribute called gx_id to serve as the primary key.

If Google Maps Engine adds a gx_id primary key column, it will not automatically be reflected on the writer feature type. After running a workspace that creates a new vector table, it is necessary to either re-import feature types for the table using the Google Maps Engine Tables reader, or manually add the gx_id column as a user attribute on the writer feature type. Otherwise, subsequent UPDATE and DELETE operations using the same workspace will fail due the lack of a primary key in the schema.

The primary key defined on the feature type, if any, is ignored when writing to existing tables. Instead, the primary key attribute specified in the schema returned by Google Maps Engine is used. The Google Maps Engine writer will output the name of the primary key column to the log.

Layer Creation and Styling

When the Google Maps Engine writer creates a new table, it can also create a styled layer that contains the new table. If any of the layer creation and styling format attributes are present, the writer will create a layer for the table after the table is successfully created and populated with features. The GoogleMapsEngineStyler transformer provides a convenient interface for supplying these format attributes, as well as for defining layer styling and filtering rules.

Layer creation and styling options are only obtained from the first feature of each feature type that contains any of the layer-related format attributes. Layer creation and styling format attributes on subsequent features are ignored.

The Google Maps Engine writer does not create layers for existing tables. The writer will log a warning if layer-related format attributes are present when writing to an existing table.

See Feature Representation for a list of format attributes related to layer creation and styling.