I am trying to create an app which will allow a user to view an OSM map hosted on my own tile server and also have the ability to edit it.
I currently have a tile-server which delivers the map tiles (png images) to my android app which is displayed using OSMDroid.
I also have a PostGIS database which is storing the OSM data.
What I am thinking of doing is have an OSMDroid mapview as a base which allows the user to see the fully rendered map, but then have the app download the OSM data from the PostGIS DB and draw the road lines as an overlay on top of the MapView so the user can manipulate these lines and then submit them back to the database. It would look similar to the way Vespucci does it.
Does this sound like a good way of doing this? Also, does anyone know how I can connect Android to a PostGIS DB and download this data?
Thanks
Connecting to a Database In order to connect to a database you need to know the name of your target database, the host name and port number of the server, and what user name you want to connect as. psql can be told about those parameters via command line options, namely -d , -h , -p , and -U respectively.
PostGIS is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL.
Open FME Data InspectorOpen FME Data Inspector and in the top left corner, click on Open. In the Select Dataset to View dialog, select PostGIS as the Format, and then for Connection, select the PostGIS connection that was already created.
Having Android clients connect directly to your database is not a good idea. Creating a web service (such as a REST service) as you mention in your comment is the way to go.
There are several reasons to take this approach:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With