Priority Rule Model

class maproulette.models.priority_rule.PriorityRule(priority_type, priority_operator, priority_value)

Definition for a single priority rule

Parameters
  • priority_type (Types or str) – the data type for the priority rule. The valid options are defined by the Types enum.

  • priority_operator (NumericOperators or StringOperators or str) – the operator to use for the priority rule. The valid options for string-type priority rules are defined by the StringOperators enum and the valid options for numeric-type priority rules are defined by the NumericOperators enum.

  • priority_value (str) – the value to use for the priority rule. This should be formatted like ‘highway.footway’ to indicate that any task with a ‘highway’ property equal to ‘footway’ should be considered for this rule. Multiple values can be specified using commas. Example: ‘highway.footway,pedestrian’.

property priority_operator

The operator to use for the priority rule

property priority_type

The type for the priority rule

property priority_value

The value for the priority rule

to_dict()

Converts all properties of a priority rule object into a dictionary

to_json()

Converts all properties of a priority rule object into a JSON object

class maproulette.models.priority_rule.PriorityRuleModel(condition, rules)

A model for a priority rule definition in MapRoulette.

Parameters
  • condition (Conditions or str) – the logical condition to use to string together multiple rules. The valid options for conditions are defined by the Conditions enum.

  • rules (PriorityRule or list) – one or more rules to use for the priority rule definition. Rules should be instances of the PriorityRule class.

property condition

The condition to use to chain together multiple priority rules

property rules

The list of priority rules to be used in the priority rule model

to_dict()

Converts all properties of a priority rule model object into a dictionary

to_json()

Converts all properties of a priority rule model object into a JSON object