Search in sources :

Example 21 with Area

use of uk.me.parabola.imgfmt.app.Area in project mkgmap by openstreetmap.

the class RestrictionRelationTest method motor_vehicleExceptCarTest2.

@Test
public void motor_vehicleExceptCarTest2() {
    GeneralRelation gr = createRelation();
    gr.addTag("except", "motorcar");
    gr.addTag("restriction", "no_left_turn");
    gr.addTag("type", "restriction:motor_vehicle");
    RestrictionRelation rr = new RestrictionRelation(gr);
    rr.eval(new Area(-100, -100, 1000, 1000));
    assertTrue(rr.isValid());
    assertEquals(AccessTagsAndBits.BIKE | AccessTagsAndBits.CAR | DEFAULT_EXCEPTION, rr.getExceptMask());
}
Also used : Area(uk.me.parabola.imgfmt.app.Area) Test(org.junit.Test)

Example 22 with Area

use of uk.me.parabola.imgfmt.app.Area in project mkgmap by openstreetmap.

the class RestrictionRelationTest method excplicitTestWithUnknown.

@Test
public void excplicitTestWithUnknown() {
    GeneralRelation gr = createRelation();
    gr.addTag("restriction:xyz", "no_left_turn");
    RestrictionRelation rr = new RestrictionRelation(gr);
    rr.eval(new Area(-100, -100, 1000, 1000));
    assertFalse(rr.isValid());
}
Also used : Area(uk.me.parabola.imgfmt.app.Area) Test(org.junit.Test)

Example 23 with Area

use of uk.me.parabola.imgfmt.app.Area in project mkgmap by openstreetmap.

the class RestrictionRelationTest method motor_vehicleTest2.

@Test
public void motor_vehicleTest2() {
    GeneralRelation gr = createRelation();
    gr.addTag("restriction", "no_left_turn");
    gr.addTag("type", "restriction:motor_vehicle");
    RestrictionRelation rr = new RestrictionRelation(gr);
    rr.eval(new Area(-100, -100, 1000, 1000));
    assertTrue(rr.isValid());
    assertEquals(AccessTagsAndBits.BIKE | DEFAULT_EXCEPTION, rr.getExceptMask());
}
Also used : Area(uk.me.parabola.imgfmt.app.Area) Test(org.junit.Test)

Example 24 with Area

use of uk.me.parabola.imgfmt.app.Area in project mkgmap by openstreetmap.

the class RestrictionRelationTest method noEmergencyTest2.

@Test
public void noEmergencyTest2() {
    GeneralRelation gr = createRelation();
    gr.addTag("restriction:motor_vehicle", "no_left_turn");
    gr.addTag("restriction:emergency", "no_left_turn");
    RestrictionRelation rr = new RestrictionRelation(gr);
    rr.eval(new Area(-100, -100, 1000, 1000));
    assertTrue(rr.isValid());
    assertEquals(AccessTagsAndBits.BIKE | AccessTagsAndBits.FOOT, rr.getExceptMask());
}
Also used : Area(uk.me.parabola.imgfmt.app.Area) Test(org.junit.Test)

Example 25 with Area

use of uk.me.parabola.imgfmt.app.Area in project mkgmap by openstreetmap.

the class RestrictionRelationTest method multipleExcplicitTestWithUnknown.

@Test
public void multipleExcplicitTestWithUnknown() {
    GeneralRelation gr = createRelation();
    gr.addTag("restriction:motorcar", "no_left_turn");
    gr.addTag("restriction:hgv", "no_left_turn");
    gr.addTag("restriction:xyz", "no_left_turn");
    RestrictionRelation rr = new RestrictionRelation(gr);
    rr.eval(new Area(-100, -100, 1000, 1000));
    assertTrue(rr.isValid());
    assertEquals(~(AccessTagsAndBits.CAR | AccessTagsAndBits.TRUCK), rr.getExceptMask());
}
Also used : Area(uk.me.parabola.imgfmt.app.Area) Test(org.junit.Test)

Aggregations

Area (uk.me.parabola.imgfmt.app.Area)49 Test (org.junit.Test)26 Coord (uk.me.parabola.imgfmt.app.Coord)14 ArrayList (java.util.ArrayList)9 List (java.util.List)7 MapShape (uk.me.parabola.mkgmap.general.MapShape)4 MapPoint (uk.me.parabola.mkgmap.general.MapPoint)3 Way (uk.me.parabola.mkgmap.reader.osm.Way)3 Rectangle (java.awt.Rectangle)2 File (java.io.File)2 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ExitException (uk.me.parabola.imgfmt.ExitException)2 MapFailedException (uk.me.parabola.imgfmt.MapFailedException)2 Point (uk.me.parabola.imgfmt.app.trergn.Point)2 Zoom (uk.me.parabola.imgfmt.app.trergn.Zoom)2 Element (uk.me.parabola.mkgmap.reader.osm.Element)2 Node (uk.me.parabola.mkgmap.reader.osm.Node)2 Long2ObjectOpenHashMap (it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap)1