Feature Files - osmlab/name-suggestion-index GitHub Wiki
Feature files are optional .geojson
files found under the features/
folder.
Each feature file defines a custom region (aka geofence). These can then be referenced by the locationSet
property of index items to specify where a brand or organization is considered valid.
The features/
folder is organized by country:
features/*
us/US-NJ.geojson
ca/CA-QC.geojson
- and so on…
See Regional Features for information on which countries and regions already have custom features.
Naming conventions
When naming a .geojson
file, consider if the area you've drawn matches an existing ISO 3166-2 area. For example, if you're adding a .geojson
for Alberta in Canada, then the ISO 3166-2:CA value for the province (CA-AB
) would be the ideal filename. As such, the existing feature for Alberta is located at CA-AB.geojson.
File contents
Each file should contain a single GeoJSON Feature
. (Note: A FeatureCollection
containing a single Feature
is ok too - the build script can handle this.)
Only Polygon
and MultiPolygon
geometries are supported.
The build script will automatically generate an id
property to match the filename. The id
will be an all-lowercase version of the filename, and is used by the locationSet
property of index items to reference features.
Feature files look like this:
{
"type": "Feature",
"id": "us-nj.geojson",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": […]
}
}
GeoJSON Protips
- There are many online tools to create or modify
.geojson
files. - You can draw and edit GeoJSON polygons with geojson.io - (Editing MultiPolygons does not work in drawing mode, but you can edit the code directly).
- You can get the geometry of a given OSM relation with polygons.openstreetmap.fr
- You can simplify GeoJSON files with mapshaper.org
- A step-by-step tutorial on how to create and edit GeoJSON files using QGIS
- More than you ever wanted to know about GeoJSON