Tag every building on a site with its zoning district in one step. The Sections tool in gGIS copies fields from a GeoJSON layer onto your drawn geometries by location. This is a spatial join. Once a zoning code sits on each geometry, you can style, filter, and report on it like any other field.
To start, choose Giraffe sections on the gGIS start screen. The Sections tab in the Enrich tab group opens the same tool.
Before you start
The layer you copy values from must be a static GeoJSON layer in your project. gGIS does not list vector tile, server, or raster layers. To use a tiled layer, like a city's zoning tiles, make a GeoJSON copy first with Build a layer.
Pick the geometries to update
Step 1, Sections to enrich, sets which geometries receive the new fields.
Choose a layer from Section layer.
Click All to update every geometry on that layer, OR click Selected on map to update only the geometries you have selected. Each option shows how many geometries it includes.
Pick the layer to take values from
In step 2, Layer to take values from, choose the GeoJSON layer that holds the data, like a zoning layer. Only static GeoJSON layers appear in this list.
Choose how geometries match
Step 3, How each section finds its values, sets the rule under Match by. Open How the join works to see a diagram of each rule.
Centre point inside: each geometry takes the values of the polygon its centre point falls in. This is the default. A building that straddles two zones takes the zone under its centre.
Largest overlap: each geometry takes the values of the polygon that covers most of it.
Nearest: each geometry takes the values of the closest polygon, measured from its centre point to the polygon's nearest edge. Set Within (m) to limit the distance. Tick Also write the distance to save the distance as a field too.
All overlapping features: every polygon that overlaps a geometry is found, and the values are combined with Group by.
Same id (field match): this rule ignores location. A geometry matches the rows whose value in Equals layer field equals its own value in Section field.
Group by appears for All overlapping features and Same id (field match). Choose Count, Sum, Average, Minimum, or Maximum. Same id also offers First match, which is its default. For All overlapping features, the default is Count, which writes one field: the prefix plus count.
A geometry with no match gets no new values. With Count or Sum, it gets 0. If you re-run a join, a geometry that no longer matches loses the values the earlier run wrote under the same field names.
Set a field prefix
In step 4, Name the new fields, set a Field prefix. Each copied field is saved as the prefix plus the field name. The prefix keeps joined fields apart from fields your geometries already have. gGIS suggests a prefix from the layer name. The prefix can't be empty.
Choose the fields to copy
In step 5, Fields to bring in, tick each field you want. Nothing is ticked at first.
Optional: edit the new field name after the prefix. For example, with the prefix
wz_, write a zoning layer'sZONEDISTfield aswz_zoning.
If a target field already exists on the geometries, gGIS lists it. Writing replaces those values. This is expected when you re-run the same join.
Write the fields
Click Write N fields to M sections. gGIS updates the geometries in Giraffe straight away, and reports how many matched. Click a geometry and check the Property Palette to see the new field.
Write a field to usage and color by zone
Write a joined field to each geometry's usage to style the map by it. Click as usage next to a ticked field in step 5. Only one field can go to usage, and only when each geometry takes a single match. Usage isn't available with Group by set to Count, Sum, Average, Minimum, or Maximum.
🚨 Warning: writing to usage replaces the usage of every matched geometry, and they restyle straight away. This can't be undone. Geometries with no match keep their usage.
A value like R6 has no style until a usage with that name exists. gGIS lists any values that aren't usages in your project yet.
Open the Usage Editor.
Add a usage for each value, like R6, and give it a color.
Save. Every geometry with that usage takes the new color.
Remove fields from geometries
Remove joined fields to undo a join or clean up your geometries. Open Remove fields at the bottom of the Sections tool. It works on the same geometries chosen in step 1.
Tick the fields to delete. Each field shows how many geometries have it.
Click Remove N fields.
Click Yes, remove from N sections to confirm, or Cancel to stop. N counts the geometries that have those fields.
Fields tagged Giraffe, like usage and height, are ones Giraffe uses itself. Removing them changes how geometries look. The id and layer fields can't be removed.
Writing fields to geometries can't be undone. Remove fields deletes fields a join added. It doesn't bring back a usage or a value the join replaced.