Data Transformations: Look Up Data from Geospatial Datasets with Region Code Functions

Suppose you have a dataset of building permits and their POINT locations but want to know what school district each permit is in. Region Code transforms allow you to look up and import this data from another dataset that contains school district boundaries.

The region code transforms that can do this deserve wider knowledge, as they are one of the few ways one can effectively join datasets on an open data platform. They provide the ability to return data from a dataset that contains boundaries. For example, using region_code_label, you could use a dataset containing boundaries to find which boundary a point lies in, and then return any characteristic of that boundary to the parent dataset, usually as a new column.


Input variables:
geocoded POINT column in the source dataset, {sourcecolumn}
lookup dataset containing the desired data {4X4}
column name in the lookup dataset that contains the data needed {data_column}

region_code - Turns a point into the ID of a region, based on which region the point falls within. region_code | Socrata
Format: forgive(region_code('sourcecolumn',{4X4 of the lookup dataset},'data_column'))

region_code_label - Turns a point into the ID of a region, based on which region the point falls within - returns a text value. region_code_label | Socrata

Format: forgive(region_code_label('sourcecolumn',{4X4 of the lookup dataset},'data_column'))





Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request



Article is closed for comments.