Class DaoNotes
- java.lang.Object
-
- org.hortonmachine.gears.io.geopaparazzi.geopap4.DaoNotes
-
public class DaoNotes extends Object
- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description DaoNotes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddNote(Connection connection, long id, double lon, double lat, double altim, long timestamp, String text, String form)Add a new note to the database.static voidcreateTables(Connection connection)Create the notes tables.static org.geotools.geometry.jts.ReferencedEnvelopegetEnvelope(IHMConnection connection, String noteTypeName)Get the current data envelope.static List<Note>getNotesList(IHMConnection connection, float[] nswe)Get the collected notes from the database inside a given bound.
-
-
-
Method Detail
-
createTables
public static void createTables(Connection connection) throws IOException, SQLException
Create the notes tables.- Throws:
IOException- if something goes wrong.SQLException
-
addNote
public static void addNote(Connection connection, long id, double lon, double lat, double altim, long timestamp, String text, String form) throws Exception
Add a new note to the database.- Parameters:
id- the idlon- lonlat- lataltim- elevationtimestamp- the UTC timestamp in millis.text- a textform- the optional json form.- Throws:
IOException- if something goes wrong.Exception
-
getNotesList
public static List<Note> getNotesList(IHMConnection connection, float[] nswe) throws Exception
Get the collected notes from the database inside a given bound.- Parameters:
connection- the db to take from .nswe- optional bounds as [n, s, w, e].- Returns:
- the list of notes inside the bounds.
- Throws:
Exception
-
getEnvelope
public static org.geotools.geometry.jts.ReferencedEnvelope getEnvelope(IHMConnection connection, String noteTypeName) throws Exception
Get the current data envelope.- Parameters:
connection- the db connection.noteTypeName- ifnull, simple notes are handled. Else this is taken as name for the note type.- Returns:
- the envelope.
- Throws:
Exception
-
-