Search in sources :

Example 31 with OsmLatLon

use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.

the class CreateNoteDaoTest method testGetAll.

public void testGetAll() {
    CreateNote note1 = new CreateNote();
    note1.text = "this is in";
    note1.position = new OsmLatLon(0.5, 0.5);
    dao.add(note1);
    CreateNote note2 = new CreateNote();
    note2.text = "this is out";
    note2.position = new OsmLatLon(-0.5, 0.5);
    dao.add(note2);
    assertEquals(1, dao.getAll(new BoundingBox(0, 0, 1, 1)).size());
    assertEquals(2, dao.getAll(null).size());
}
Also used : BoundingBox(de.westnordost.osmapi.map.data.BoundingBox) OsmLatLon(de.westnordost.osmapi.map.data.OsmLatLon)

Example 32 with OsmLatLon

use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.

the class CreateNoteDaoTest method testCountSeveral.

public void testCountSeveral() {
    CreateNote note1 = new CreateNote();
    note1.position = new OsmLatLon(0.5, 0.5);
    note1.text = "joho";
    dao.add(note1);
    CreateNote note2 = new CreateNote();
    note2.position = new OsmLatLon(0.1, 0.5);
    note2.text = "hey";
    dao.add(note2);
    assertEquals(2, dao.getCount());
}
Also used : OsmLatLon(de.westnordost.osmapi.map.data.OsmLatLon)

Example 33 with OsmLatLon

use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.

the class NoteDaoTest method createNote.

static Note createNote() {
    Note note = new Note();
    note.position = new OsmLatLon(1, 1);
    note.status = Note.Status.OPEN;
    note.id = 5;
    note.dateCreated = new Date(5000);
    NoteComment comment = new NoteComment();
    comment.text = "hi";
    comment.date = new Date(5000);
    comment.action = NoteComment.Action.OPENED;
    comment.user = new User(5, "PingPong");
    note.comments.add(comment);
    return note;
}
Also used : NoteComment(de.westnordost.osmapi.notes.NoteComment) User(de.westnordost.osmapi.user.User) Note(de.westnordost.osmapi.notes.Note) OsmLatLon(de.westnordost.osmapi.map.data.OsmLatLon) Date(java.util.Date)

Example 34 with OsmLatLon

use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.

the class OsmNoteQuestDaoTest method testGetPositions.

public void testGetPositions() {
    Note note = NoteDaoTest.createNote();
    note.position = new OsmLatLon(34, 35);
    noteDao.put(note);
    OsmNoteQuest quest = new OsmNoteQuest(note, questType);
    dao.add(quest);
    List<LatLon> positions = dao.getAllPositions(new BoundingBox(0, 0, 50, 50));
    assertEquals(1, positions.size());
    assertEquals(new OsmLatLon(34, 35), positions.get(0));
}
Also used : LatLon(de.westnordost.osmapi.map.data.LatLon) OsmLatLon(de.westnordost.osmapi.map.data.OsmLatLon) Note(de.westnordost.osmapi.notes.Note) BoundingBox(de.westnordost.osmapi.map.data.BoundingBox) OsmLatLon(de.westnordost.osmapi.map.data.OsmLatLon)

Example 35 with OsmLatLon

use of de.westnordost.osmapi.map.data.OsmLatLon in project StreetComplete by westnordost.

the class RoadNameSuggestionsDaoTest method createRoadPositions.

private static ArrayList<LatLon> createRoadPositions() {
    ArrayList<LatLon> roadPositions = new ArrayList<>();
    roadPositions.add(new OsmLatLon(0, 0));
    roadPositions.add(new OsmLatLon(0, 0.0001));
    return roadPositions;
}
Also used : LatLon(de.westnordost.osmapi.map.data.LatLon) OsmLatLon(de.westnordost.osmapi.map.data.OsmLatLon) ArrayList(java.util.ArrayList) OsmLatLon(de.westnordost.osmapi.map.data.OsmLatLon)

Aggregations

OsmLatLon (de.westnordost.osmapi.map.data.OsmLatLon)61 LatLon (de.westnordost.osmapi.map.data.LatLon)33 ArrayList (java.util.ArrayList)24 BoundingBox (de.westnordost.osmapi.map.data.BoundingBox)9 ElementGeometry (de.westnordost.streetcomplete.data.osm.ElementGeometry)9 Date (java.util.Date)8 List (java.util.List)8 OsmQuest (de.westnordost.streetcomplete.data.osm.OsmQuest)7 Note (de.westnordost.osmapi.notes.Note)6 OsmNode (de.westnordost.osmapi.map.data.OsmNode)5 TestQuestType (de.westnordost.streetcomplete.data.osm.persist.test.TestQuestType)5 Element (de.westnordost.osmapi.map.data.Element)4 TestQuestType2 (de.westnordost.streetcomplete.data.osm.persist.test.TestQuestType2)4 Node (de.westnordost.osmapi.map.data.Node)3 NoteComment (de.westnordost.osmapi.notes.NoteComment)3 HashMap (java.util.HashMap)3 Point (android.graphics.Point)2 Rect (android.graphics.Rect)2 LongSparseArray (android.util.LongSparseArray)2 QuestGroup (de.westnordost.streetcomplete.data.QuestGroup)2