Skip to content

Commit

Permalink
Lower zone tag priority relative to fee tag (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlant committed Mar 25, 2023
1 parent 95aad38 commit 7fa21bc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/parking/access-condition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export function getConditions(tags: OsmTags, side?: string) {
if (maxstayValue)
conditions.default = 'disc'

const zoneValue = getValue(tags, 'zone', side)
if (zoneValue)
conditions.default = 'residents'

if (feeValue === 'yes')
conditions.default = 'ticket'

Expand All @@ -85,10 +89,6 @@ export function getConditions(tags: OsmTags, side?: string) {
if (accessValue)
conditions.default = mapAccessValue(tags, accessValue, side)

const zoneValue = getValue(tags, 'zone', side)
if (zoneValue)
conditions.default = 'residents'

const openingHoursValue = getValue(tags, 'opening_hours', side)
if (openingHoursValue) {
conditions.conditionalValues!.push({
Expand All @@ -109,6 +109,8 @@ function mapAccessValue(tags: OsmTags, accessValue: string | undefined, side?: s
return getValue(tags, 'fee', side) === 'yes' ? 'ticket' : 'free'

case 'private':
return getValue(tags, 'zone', side) ? 'residents' : 'no_stopping'

case 'no':
case 'permissive':
case 'permit':
Expand Down

0 comments on commit 7fa21bc

Please sign in to comment.