I have a spatial table from which I want to map its objects on canvas in Android. This is in a SpatiaLite database.
I can get object data out in an SVG format and create a map from it, but it is not very efficient. The original object data is kept in blob format.
My question is, how do GIS systems map their data. I would like to map the objects and be able to touch on them to pull up their attribute information.
This is a very simple question with a huge answer. But I’m just looking for a place to start.
I am not looking to build a GIS system, just create some similar functionalty.
Any information would be greatly appreciated.
I have found that there are a couple of options other than svg:
Query out the data and parse it into a JTS geometry object, the object through JTS can then be manipulated into coordinate arrays if neccessary. JTS-1.8.jar is the latest current library.
using this to parse: Geometry geometry = new WKBReader().read(stmt.column_bytes(2));
Instead of using Canvas, OpenGL 1 or 2 seem like the way to go for flexibility in producing highly configurable maps. To use this all geometries must be converted to float arrays then float buffers, there are alot of tutorials on OpenGL
Android OpenGL
and
Android OpenGL getting started are two very good ones.
Habib: A good place to start for spatialite and android is this example: spatialite-android
In order to select geometry objects on the map with OpenGL a mixture of selecting a buffer or region around the clicked point, changing the color of object clicked on and creating metadata on object that can be displayed, is required. This may be a little broad but I haven’t got to this point yet so alot is theorical.