Skip to content

Commit

Permalink
Rename maxspeed field type to roadspeed
Browse files Browse the repository at this point in the history
Add `roadheight` field type for openstreetmap/iD#8075
Add `locationSet` info to the readme
  • Loading branch information
quincylvania committed Nov 25, 2020
1 parent 9518d0a commit ef677f6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,18 @@ For example, a feature with `amenity=cafe` and `building=commercial` will match

The default is `1.0`.

##### `countryCodes`
##### `locationSet`

An array of two-letter, lowercase [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. The preset will only be searchable when the user is editing over the specified, whitelisted countries. The locale and language of iD are not factors, just the position of the map.
An object with the identifiers of regions where this field should or shouldn't be shown. By default, fields are available everywhere.

By default, presets are available everywhere.
See the [location-conflation](https://github.com/ideditor/location-conflation) package for details.

##### `notCountryCodes`

An array of two-letter, lowercase [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. Similar to `countryCodes` except a blocklist.
```js
"locationSet": {
"include": ["US"],
"exclude": ["PR", "VI"]
}
```

##### `replacement`

Expand Down Expand Up @@ -408,7 +411,8 @@ A string specifying the UI and behavior of the field. Must be one of the followi
* `access` - Block of dropdowns for defining the `access=*` tags on a highway
* `address` - Block of text and dropdown fields for entering address information (localized for editing location)
* `cycleway` - Block of dropdowns for adding `cycleway:left` and `cycleway:right` tags on a highway
* `maxspeed` - Numeric text field for speed and dropdown for "mph/kph"
* `roadspeed` - Numeric text field for speed and dropdown for "mph" / "km/h", defaulting to the speed unit used for roads in the feature's region
* `roadheight` - Numeric text field for height and dropdowns for "m" / "ft" and "in", defaulting to the height unit used for roads in the feature's region
* `restrictions` - Graphical field for editing turn restrictions
* `wikidata` - Search field for selecting a Wikidata entity
* `wikipedia` - Block of fields for selecting a wiki language and Wikipedia page
Expand Down Expand Up @@ -544,11 +548,18 @@ For example, this is how we show the Internet Access Fee field only if the featu

If a feature has a value for this field's `key` or `keys`, it will display regardless of the `prerequisiteTag` property.

##### `countryCodes`
##### `locationSet`

An object with the identifiers of regions where this field should or shouldn't be shown. By default, fields are available everywhere.

An array of two-letter, lowercase [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. The field will only be available for features in the specified, whitelisted countries.
See the [location-conflation](https://github.com/ideditor/location-conflation) package for details.

By default, fields are available everywhere.
```js
"locationSet": {
"include": ["US"],
"exclude": ["PR", "VI"]
}
```

##### `notCountryCodes`

Expand Down
3 changes: 2 additions & 1 deletion schemas/field.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@
"identifier",
"localized",
"manyCombo",
"maxspeed",
"multiCombo",
"networkCombo",
"number",
"onewayCheck",
"radio",
"restrictions",
"roadspeed",
"roadheight",
"semiCombo",
"structureRadio",
"tel",
Expand Down

4 comments on commit ef677f6

@bhousel
Copy link
Contributor

@bhousel bhousel commented on ef677f6 Dec 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why roadspeed? maxspeed is used on railway and waterway too..

@quincylvania
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, well this field type gets its units from the road signage used in the given country, which might not correspond to the units expected by other things. I changed the name since this field type is also used for minspeed.

@bhousel
Copy link
Contributor

@bhousel bhousel commented on ef677f6 Dec 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, well this field type gets its units from the road signage used in the given country, which might not correspond to the units expected by other things. I changed the name since this field type is also used for minspeed.

cool, makes sense, I was just curious (no need to change anything)

@quincylvania
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's one of those things where the name isn't incredibly important but since we're changing stuff anyone it seemed like a good opportunity to change it. I forgot about the railroad usage. I'm sure that eventually someone will complain about the default railway speed unit somewhere.

Please sign in to comment.