This article describes ways to publish various kinds of geospatial data using the Safe FME Socrata Writer. Currently standard tabular Socrata datasets only support point data but the Geospatial dataset type (also known as Mondara) can support all geometry types (points, lines, polygons) if data is published as a Shapefile or KML file. Socrata can also be used to geocode U.S. addresses to generate lat/lng coordinates (point data).
NOTE: Before reading this guide you should be sure to read the guide on using the FME Socrata Writer.
Publishing point data
Latitude/longitude point data
This section describes how to publish data from a database or spreadsheet where you have fields storing the latitude and longitude values of the points you wish publish. You need to publish the data into a single Location datatype column on Socrata with values formatted as: “(latitude,longitude)”. The easiest way to achieve this is to use a StringConcatenator transformer to concatenate the existing Latitude and Longitude fields into a single Location field formatted correctly. An example of a correctly formatted value is “(41.70737, -87.61694)”.
If you are using the FME Socrata Writer to create a new dataset you must manually set the datatype of the Location column field (containing the pairs of latitude/longitude data) in the User Parameters of the Socrata Writer as shown below.
If you are publishing to an existing dataset ensure you are publishing the values to a Location datatype column. If necessary, you can change the datatype of a column using the Socrata web interface (but FME cannot be used to change datatypes of existing Socrata datasets).
Point data not stored as latitude/longitude (e.g. state plane)
If your point data is not already represented as Latitude and Longitude (a.k.a. WGS 84 or EPSG:4326) then the data must be reprojected. If the data source you are reading is not a tabular data file (e.g. CSV or Excel spreadsheet) you should use an AttributeReprojector transformer to reproject the data to LL84.
If the point data you wish to publish is contained in a geospatial format (Shapefile, geospatial database, etc) refer to the section below called ‘Using FME geometry’.
Publishing address data to be geocoded
Socrata can be used to geocode address data to generate latitude/longitude values for valid U.S. addresses. You need to publish the address as a single Location datatype column on Socrata. If the address is not already within a single field (for example if you have separate columns for street, city, state, etc) you can use a StringConcatenator transformer to concatenate the address columns into a single Location field formatted correctly. An example of a correctly formatted value is “1201 E 12th St, Seattle, WA 98102”. Find more information on acceptable address formats and avoiding errors geocoding.
IMPORTANT: when publishing address data to be geocoded be sure to set the ‘Use Socrata Geocoding’ field to ‘Yes’ in the Socrata Writer. This value should be set to ‘No’ in cases where you are publishing Latitude and Longitude data directly to the Location column (see image below).
Using FME geometry
If the source of the point data you are reading into FME is a geospatial format (Shapefile, geospatial database, etc.) rather than a tabular data file (e.g. CSV or Excel spreadsheet) then FME will store the geospatial data as ‘FME geometry’. When point data is stored as FME geometry it will automatically be published to a Location datatype column defined in the Socrata Writer Format Parameters as the 'Geometry Column Name’ (default name is ‘geom’ but you can change it to any name you desire).
If you are publishing to an existing dataset (rather than creating a new dataset) ensure the 'Geometry Column Name’ matches the name of the existing Location datatype column in the existing dataset. If necessary, you can change the datatype of a column using the Socrata web interface (but FME cannot be used to change datatypes of existing Socrata datasets).
If you get an error about the coordinate system not being set you may need to manually set the coordinate system to the appropriate projection within the Reader you are using and/or the Socrata Writer. For example, if your data is already in latitude/longitude you would set the coordinate system to LL84 (see screenshot below).
If the point data you are publishing uses something other than Latitude/Longitude (i.e. WGS 84) as long as the source coordinate system is set correctly the Socrata writer will automatically be reprojected to Latitude/Longitude. However, you can also use a Reprojector transformer to reproject to LL84 explicitly.
You can read non-point data (lines, polygons, etc) into FME as FME geometry and publish to Socrata using the Socrata Writer. All non-point geometry will be coerced to points. The resulting point will be the starting point if the geometry is a line or the center point of the bounding box for all other geometry types.