Skip to content

Instantly share code, notes, and snippets.

@patrickyin
Created August 26, 2017 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickyin/c0a87b1816dad46a6a3514d655a545a8 to your computer and use it in GitHub Desktop.
Save patrickyin/c0a87b1816dad46a6a3514d655a545a8 to your computer and use it in GitHub Desktop.
getGridBLOBData
private byte[] getGridBLOBData(TilePosition tilePosition) {
String[] columns = { "grid" };
String[] args = { Integer.toString(tilePosition.getZoom()), Integer.toString(tilePosition.getX()), Integer.toString(tilePosition.getY()) };
Cursor cursor = this.db.query("grids", columns, "zoom_level=? AND tile_column=? AND tile_row=?", args, null, null, null);
if (cursor == null || cursor.getCount() == 0)
return null;
cursor.moveToFirst();
byte[] data = cursor.getBlob(0);
cursor.close();
return data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment