You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+53-48
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,20 @@
4
4
5
5
There are 2 kinds of files in this project:
6
6
7
-
* Under `features/` there are `.geojson` files to describe the areas where the communities are active
8
7
* Under `resources/` there are `.json` files to describe the community resources
8
+
* Under `features/` there are `.geojson` files to describe the areas where the communities are active
9
9
10
10
##### tl;dr
11
11
12
12
To add your community resource:
13
13
14
-
* Add a **feature**`.geojson` file under `features/` folder
15
-
* This is a boundary around where the resource is active
16
-
* You can use [geojson.io](http://geojson.io) or other tools to create these.
17
-
* Add a **resource**`.json` file under `resources/` folder
14
+
* (required) Add a **resource**`.json` file under `resources/` folder
18
15
* This contains info about what the resource is (slack, forum, mailinglist, facebook, etc.)
19
16
* You can just copy and change an existing one
20
-
* Several resources can share the same `.geojson` feature
17
+
* Each resource needs an `includeLocations` property to say where it is active.
18
+
* (optional) Add a **feature**`.geojson` file under `features/` folder
19
+
* This is a boundary around where the resource is active
20
+
* You can use [geojson.io](http://geojson.io) or other tools to create these.
21
21
*`npm run test`
22
22
* This will build and check for errors and make the files pretty
23
23
@@ -30,56 +30,18 @@ To add your community resource:
30
30
* Run `npm install` to install libraries
31
31
32
32
33
-
### Features
34
-
35
-
These are `*.geojson` files found under the `features/` folder. Each feature file contains a single GeoJSON `Feature` for a region where a community resource is active.
36
-
37
-
Feature files look like this:
38
-
39
-
```js
40
-
{
41
-
"type":"Feature",
42
-
"id":"usa_full",
43
-
"properties": { "area":11645277.77 },
44
-
"geometry": {
45
-
"type":"MultiPolygon",
46
-
"coordinates": [
47
-
...
48
-
]
49
-
}
50
-
}
51
-
```
52
-
53
-
Note: A `FeatureCollection` containing a single `Feature` is ok too - the build script can handle this.
54
-
55
-
There are many online tools to create or modify these `.geojson` files. A workflow could be:
56
-
57
-
1. Create the shape with [geojson.io](http://geojson.io) from scratch.
58
-
59
-
or
60
-
61
-
1. Generate a precise file with the [Polygon creation](http://polygons.openstreetmap.fr/) from an OSM Relation.
62
-
1. Simplify the file with [Mapshaper](http://mapshaper.org/). Beware that the simplification probably cuts some border areas.
63
-
1. So load the file in [geojson.io](http://geojson.io) and include the border areas again and perhaps reduce the point count further. It is probably better to have the feature a bit larger than missing an area.
64
-
65
-
Each feature must have a unique `id` property, for example `usa_full`.
66
-
67
-
You do not need to supply an `area` property. The `npm run build` script will calculate the `area` property automatically.
68
-
69
-
70
33
### Resources
71
34
72
35
These are `*.json` files found under the `resources/` folder.
73
-
Each resource file contains a single JSON object with information about
74
-
the community resource.
36
+
Each resource file contains a single JSON object with information about the community resource.
75
37
76
38
Resource files look like this:
77
39
78
40
```js
79
41
{
80
42
"id":"OSM-US-slack",
81
-
"featureId":"usa_full",
82
43
"type":"slack",
44
+
"includeLocations": ["us"],
83
45
"countryCodes": ["us"],
84
46
"languageCodes": ["en"],
85
47
"name":"OpenStreetMap US Slack",
@@ -111,14 +73,24 @@ Resource files look like this:
111
73
Here are the properties that a resource file can contain:
112
74
113
75
*__`id`__ - (required) A unique identifier for the resource.
114
-
*__`featureId`__ - (optional) A unique identifier for the feature. This `featureId` matches the resource to a .geojson feature. If null, this is a global resource.
115
76
*__`type`__ - (required) Type of community resource (see below for list).
77
+
*__`includeLocations`__ - (required) Array of locations where the resource is active. May contain any of these:
78
+
* Any string recognized by the [country-coder library](https://github.com/ideditor/country-coder#readme). These should be [ISO 3166-1 2 or 3 letter country codes or UN M.49 numeric codes](https://en.wikipedia.org/wiki/List_of_countries_by_United_Nations_geoscheme).
79
+
Example: `"de"`
80
+
* Any filename for a `.geojson` file saved under the `/features` folder
81
+
Example: `"de-hamburg.geojson"`
82
+
* A `[longitude, latitude]` coordinate pair. A 15km radius circle will be computed around this point.
83
+
Example: `[8.67039, 49.41882]`
84
+
*__`excludeLocations`__ - (optional) Array of locations to exclude from `includeLocations` (specified in the same format):
116
85
*__`name`__ - (required) Display name for this community resource
86
+
(in English, will be sent to Transifex for translation to other languages)
117
87
*__`description`__ - (required) One line description of the community resource
88
+
(in English, will be sent to Transifex for translation to other languages)
118
89
*__`extendedDescription`__ - (optional) Longer description of the community resource
90
+
(in English, will be sent to Transifex for translation to other languages)
119
91
*__`url`__ - (required) A url link to visit the community resource
120
92
*__`signupUrl`__ - (optional) A url link to sign up for the community resource
121
-
*__`countryCodes`__ - (optional) Array of [two letter country codes](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) where the community is active
93
+
*__`countryCodes`__ - (optional) Array of [two letter country codes](https://en.wikipedia.org/wiki/List_of_countries_by_United_Nations_geoscheme) where the community is active
122
94
*__`languageCodes`__ - (optional) Array of [two letter](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) or [three letter](https://en.wikipedia.org/wiki/List_of_ISO_639-3_codes) spoken by this community
123
95
*__`order`__ - (optional) When several resources with same geography are present, this adjusts the display order (default = 0, higher numbers display more prominently)
124
96
@@ -165,6 +137,39 @@ Resources may have events. These are optional.
165
137
*__`url`__ - (optional) A url link for the event
166
138
167
139
140
+
### Features
141
+
142
+
These are `*.geojson` files found under the `features/` folder. Each feature file contains a single GeoJSON `Feature` for a region where a community resource is active.
143
+
144
+
Feature files look like this:
145
+
146
+
```js
147
+
{
148
+
"type":"Feature",
149
+
"id":"boston_metro",
150
+
"properties": {"area":6992.97},
151
+
"geometry": {
152
+
"type":"Polygon",
153
+
"coordinates": [...]
154
+
}
155
+
}
156
+
```
157
+
158
+
Note: A `FeatureCollection` containing a single `Feature` is ok too - the build script can handle this.
159
+
160
+
There are many online tools to create or modify these `.geojson` files. A workflow could be:
161
+
162
+
1. Create the shape with [geojson.io](http://geojson.io) from scratch.
163
+
164
+
or
165
+
166
+
1. Generate a precise file with the [Polygon creation](http://polygons.openstreetmap.fr/) from an OSM Relation.
167
+
1. Simplify the file with [Mapshaper](http://mapshaper.org/). Beware that the simplification probably cuts some border areas.
168
+
1. So load the file in [geojson.io](http://geojson.io) and include the border areas again and perhaps reduce the point count further. It is probably better to have the feature a bit larger than missing an area.
169
+
170
+
You do not need to supply an `area` property or `id` property. The `npm run build` script will calculate these automatically.
0 commit comments