This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

JOSM preset, forward backward with one checkbox. How?

1

We have a traffic_sign C12.

alt text

Because this sign works from one side. Their could be no sign on the other side. Other side, it is possible to enter and turn on road or visit a house/field. And go back. The way must set to forward or backward on a small section. Where you do not turn anymore. For the traffic_sign, mofa, moped and motor_vehicle Can this be done with one checkbox? for forward or backward. And not with multiple checkboxes.

<item name="C12 " icon="traffic_signs/NL/NL_C12.png" type="node,way">
        <key key="traffic_sign"value="NL:C12" />
        <key key="motor_vehicle" value="no" />
        <key key="mofa" value="yes" />
        <key key="moped" value="yes" />

        <space />
        <check key="traffic_sign:forward" text="Forward motor_vehicle" default="off" value_off="" value_on="NL:C12" />
        <check key="traffic_sign:backward" text="Backward motor_vehicle" default="off" value_off="" value_on="NL:C12" />
        <check key="motor_vehicle:forward" text="Forward motor_vehicle" default="off" value_off="" value_on="no" />
        <check key="motor_vehicle:backward" text="Backward motor_vehicle" default="off" value_off="" value_on="no" />
        <check key="mofa:forward" text="Forward motor_vehicle" default="off" value_off="" value_on="yes" />
        <check key="mofa:backward" text="Backward motor_vehicle" default="off" value_off="" value_on="yes" />
        <check key="moped:forward" text="Forward motor_vehicle" default="off" value_off="" value_on="yes" />
        <check key="moped:backward" text="Backward motor_vehicle" default="off" value_off="" value_on="yes" />
</item>

Off course in above example the original k/v must be replaced by :forward= or :backward=

I can not find any solution in other presets.

Is this possible?

asked 26 Jul '17, 14:48

Allroads's gravatar image

Allroads
222161725
accept rate: 10%

edited 26 Jul '17, 14:51


One Answer:

1

I don't believe this is possible directly, JOSM allows JAVA code in presets so probably there is a way to do it, but likely not easy.

answered 30 Jul '17, 20:49

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

Source code available on GitHub .