def test(conceptList):
    import configure
    configure.configurePath()
    from org.mbari.jdo.castor import JdoDatabaseFactory as jdf; 
    db = jdf.getDatabase("vars");
    db.begin();
    c = db.getJdbcConnection()
    s = c.createStatement()
    rs = s.executeQuery("SELECT ObservationID_FK,  Associations,  ConceptName,  Depth,  Image,  Latitude,  Longitude,  RecordedDate,  TapeTimeCode,  VideoArchiveName FROM Annotations WHERE ( ( ConceptName IN (" + conceptList + ")  OR ToConcept IN (" + conceptList + ") ))")
    from org.mbari.sql import QueryResults
    qr = QueryResults(rs)
    rs.close()
    s.close()
    db.commit()
    db.close()
    from org.mbari.seepsearch.grid import AsciiNullGridReader as reader
    r = reader('x:/gisdata/monterey/grids/utm/monterey.asc')
    r.read() 
    grid = r.getGrid()
    from org.mbari.seepsearch.io import QueryResultsAdapter as QRAdapter
    data = QRAdapter(qr);
    from org.mbari.seepsearch.grid import GridUtil
    GridUtil.populateGeoGridWithGeoNavData(grid, data, None, 10)
    from org.mbari.seepsearch.grid import AsciiRasterGridWriter as writer
    w = writer("c:/workspace/vdm/test/test.asc");
    w.write(grid, 0, 8);

def testTest():
	conceptList = "'trash', 'bait', 'wood', 'miscellany', 'clothing', 'glass-trash', 'can', 'sequence', 'shipwreck', 'recovery', 'net', 'interpretation', 'container', 'human', 'tire', 'launch'";
    test(conceptList);