Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapping spatial data in Android

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.

like image 428
Hank Avatar asked Sep 06 '12 05:09

Hank


People also ask

What is spatial data mapping?

1.3. Spatial data comprise the relative geographic information about the earth and its features. A pair of latitude and longitude coordinates defines a specific location on earth. Spatial data are of two types according to the storing technique, namely, raster data and vector data.

What are the three types of spatial data?

In these GIS fields, the spatial data becomes much more complex and difficult to use. In addition to raster and vector data, there is also LiDAR data (also known as point clouds) and 3D data.

Can ArcGIS run on Android?

ArcGIS for Android is a native application that serves as a mobile gateway into the ArcGIS system. It provides an intuitive user experience for querying map layers and data. People can also use the app to edit features and attribute information on the fly while collecting field data and performing inspections.

What is spatial data in mobile?

Spatial data is any type of data that directly or indirectly references a specific geographical area or location. Sometimes called geospatial data or geographic information, spatial data can also numerically represent a physical object in a geographic coordinate system.


1 Answers

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.

like image 179
Hank Avatar answered Oct 21 '22 16:10

Hank