Socrata Writer
The Socrata Writer enables FME to write both attribute and point data into the Socrata Social Data Cloud Platform.
Overview
Socrata enables users to easily upload and manage data in the cloud (for example, spreadsheets and comma-separated value [CSV] files).
Socrata makes it easy to share data with collaborators or make data publicly accessible.
The Socrata Writer uses Socrata’s Import API to provide dataset creation capabilities. The Socrata DataSync tool is used to perform upsert, replace, and delete operations on existing datasets.
The Socrata Writer produces a Socrata dataset with a row for each feature. New tables can be created for each specified feature type or, alternatively, rows can be written to existing datasets that match the feature type names. The feature type may also be treated as a dataset ID, if it matches Socrata’s alphanumeric 4-4 ID pattern. The Socrata Writer enforces uniqueness for dataset names owned by the user. For more information, refer to Feature Representation.
Note: Note that when a dataset has been newly created, it may not be immediately reflected in the Socrata web interface, and the Socrata Writer may not detect the new dataset if the same translation is run too soon. To prevent the creation of duplicate datasets, allow a few minutes for the original dataset to appear in the Socrata web interface before re-running a translation.
Dataset IDs are always assigned by Socrata upon the creation of a dataset: datasets cannot be created with a specific ID. The ID of an existing dataset may be found by opening the dataset in the Socrata web interface and selecting the 4-4 alphanumeric ID from the URL.
Only 2D point geometry is supported by the Socrata Writer. The point coordinates are stored in a column of type “Location” on the Socrata dataset. The Socrata Writer will coerce geometries to a point whenever possible. Each location column supports a 1 point. Multiple geometry columns may be specified, in which case the Socrata Writer will expect the input to be named geometry or named multiple geometry with names that map to the geometry column names.
Features are written to a temporary CSV file, which is then uploaded and converted to a Socrata dataset using Socrata’s Import API. If the target Socrata dataset already exists, the Socrata DataSync tool is used instead. The Socrata Writer will generate the appropriate configuration file and control file for use with the DataSync tool. If the FME_DEBUG
environment variable is set, the CSV file generated by the Socrata Writer will not be deleted from the system’s temporary folder.
When writing to existing Socrata datasets, the user is responsible for defining user attributes that match the destination dataset. When performing UPSERT and DELETE operations, the user is responsible for supplying the appropriate values for the user attribute that corresponds to the Row Identifier column for the dataset.
A user login, password, and app token are required in order to access the SODA API. An app token can be generated by logging into your Socrata account and creating a new application under the App Tokens page.
The Socrata Writer will only access Socrata using HTTPS and basic authentication. If you are connecting via a proxy server, ensure that it supports HTTPS.