Search in sources :

Example 26 with ElementGeometry

use of de.westnordost.streetcomplete.data.osm.ElementGeometry in project StreetComplete by westnordost.

the class ElementGeometryDaoTest method testPolygonGeometryPutGet.

public void testPolygonGeometryPutGet() {
    List<List<LatLon>> polygons = new ArrayList<>();
    polygons.add(createSomeLatLons(0));
    polygons.add(createSomeLatLons(10));
    ElementGeometry geometry = new ElementGeometry(polygons, null);
    dao.put(Element.Type.RELATION, 0, geometry);
    ElementGeometry dbGeometry = dao.get(Element.Type.RELATION, 0);
    assertEquals(geometry, dbGeometry);
}
Also used : ArrayList(java.util.ArrayList) ElementGeometry(de.westnordost.streetcomplete.data.osm.ElementGeometry) List(java.util.List) ArrayList(java.util.ArrayList)

Example 27 with ElementGeometry

use of de.westnordost.streetcomplete.data.osm.ElementGeometry in project StreetComplete by westnordost.

the class ElementGeometryDaoTest method testPolylineGeometryPutGet.

public void testPolylineGeometryPutGet() {
    List<List<LatLon>> polylines = new ArrayList<>();
    polylines.add(createSomeLatLons(0));
    ElementGeometry geometry = new ElementGeometry(polylines, null);
    dao.put(Element.Type.WAY, 0, geometry);
    ElementGeometry dbGeometry = dao.get(Element.Type.WAY, 0);
    assertEquals(geometry, dbGeometry);
}
Also used : ArrayList(java.util.ArrayList) ElementGeometry(de.westnordost.streetcomplete.data.osm.ElementGeometry) List(java.util.List) ArrayList(java.util.ArrayList)

Example 28 with ElementGeometry

use of de.westnordost.streetcomplete.data.osm.ElementGeometry in project StreetComplete by westnordost.

the class OsmQuestDaoTest method testGetNoNextNewAt.

public void testGetNoNextNewAt() {
    ElementGeometry geom = new ElementGeometry(new OsmLatLon(5, 5));
    OsmQuest quest = createNewQuest(new TestQuestType(), 1, Element.Type.NODE, geom);
    quest.setStatus(QuestStatus.ANSWERED);
    addToDaos(quest);
    assertNull(dao.getNextNewAt(1, null));
}
Also used : ElementGeometry(de.westnordost.streetcomplete.data.osm.ElementGeometry) OsmLatLon(de.westnordost.osmapi.map.data.OsmLatLon) OsmQuest(de.westnordost.streetcomplete.data.osm.OsmQuest) TestQuestType(de.westnordost.streetcomplete.data.osm.persist.test.TestQuestType)

Aggregations

ElementGeometry (de.westnordost.streetcomplete.data.osm.ElementGeometry)28 OsmLatLon (de.westnordost.osmapi.map.data.OsmLatLon)11 OsmQuest (de.westnordost.streetcomplete.data.osm.OsmQuest)9 ArrayList (java.util.ArrayList)9 LatLon (de.westnordost.osmapi.map.data.LatLon)7 List (java.util.List)6 TestQuestType (de.westnordost.streetcomplete.data.osm.persist.test.TestQuestType)5 TestQuestType2 (de.westnordost.streetcomplete.data.osm.persist.test.TestQuestType2)4 BoundingBox (de.westnordost.osmapi.map.data.BoundingBox)3 Element (de.westnordost.osmapi.map.data.Element)3 OsmElementQuestType (de.westnordost.streetcomplete.data.osm.OsmElementQuestType)3 OsmNode (de.westnordost.osmapi.map.data.OsmNode)2 QuestGroup (de.westnordost.streetcomplete.data.QuestGroup)2 QuestStatus (de.westnordost.streetcomplete.data.QuestStatus)2 VisibleQuestListener (de.westnordost.streetcomplete.data.VisibleQuestListener)2 Collection (java.util.Collection)2 Date (java.util.Date)2 Node (de.westnordost.osmapi.map.data.Node)1 Relation (de.westnordost.osmapi.map.data.Relation)1 Way (de.westnordost.osmapi.map.data.Way)1