Android OpenStreetMap all streets within a bounding box - java

I am writing an android application that needs to display street data only, stuff like max-speed etc. For this reason I want to extract all street data within a bounding box that I pass to the API of OSM.
Right now I get a rather large file that includes all the information that is stored in OSM. Is there a way to only query street data?

According to the API documentation, the only parameters for bounding box are the left, bottom, right, and top. There appears to be no other way to retrieve regions of the map. You could get nodes individually by ID, but I think that will be tremendously useless.
You could implement your own webservice that hits the OSM api and strips it down, then hit your own webservice from your app. Extra work, but takes load off your mobile client.
http://wiki.openstreetmap.org/wiki/API_v0.6

Related

Create a Synthetic Vision System

I would like to add this feature to my android app:
https://en.wikipedia.org/wiki/Synthetic_vision_system
In short it I believe it is a terrain heightmap. I specifically need help with rendering the terrain. The rest of the display I can accomplish.
After a day of google I appear to be no closer. My research seems to point to using opengl, heightmaps and SRTM. However I have no clue how to tie it all together. None of the java examples are android specific.
Alternatively maybe using openstreetmaps and a tile overlay but I cant establish if it is possible in 3D.
The app will be a moving map based on GPS position of the aircraft. As the aircraft moves over the earth the terrain ahead will be updated.
Can someone point me in the right direction?
I can recommend you to use a vector format with few layers. For example, layer of depth, layer of landscape type and layer of objects. To build 3D from this data you need to divide the map in small tiles and load data in memory for visible area only. Your 3D builder will parse this data. E.g. a simple renderer (using OpenGL)... You create mesh as large as tile size and with enough count of vertexes. Next, you parse depth layer and move each vertex along Z-axis like it need. After you need to set color like it specified in type layer. And finally, you need create and locate objects like object layer data (it's already built-in meshes). When you build needed tiles you pass it to renderer.

Tracking position on google maps via GPS

I'm working on a project, which is basically to track a person in real-time via GPS. His position has to be updated at all times on Google maps (or any other). Here is how it looks like:
We are already set to receive the co-ordinates of the person (via GPS).
We want the maps available offline. (We're receiving GPS co-ordinates (X,Y) through a wire so lack of internet won't be a problem in that aspect).
Then we code in Java, such that the map is visible to us and the position of the person is marked by a dot (or circle).
My questions are:
Is it possible to download the Google maps (or any other) and then work on them to achieve what I've mentioned?
I'll be making the framework in swing. But for the dot-action, which other components will be required?
How will be the co-ordinates that I receive from GPS, interpreted on the maps? I mean in code I'll have to tell the program where to draw the dot, right? As of now I'm thinking, I'll program the position of the dot, such that (co-ordinates received from GPS = co-ordinates on google maps). But I've a feeling it won't be as simple. So please guide how can this be achieved.
From my research, no. It is not possible. The only 'offline' features is offline map caching INSIDE the Google Maps App for iOS and Android. If you're on Windows, you may want to try these applications that claim they can grab the maps. I'm on OSX, so I can't test them.
Since you'll have the offline map (a folder with an HTML), in Swing you will simply create a Browser component (it exists in SWT, don't know if they are in Swing too). The browser should have APIs like setUrl or/and setHtml. You will extract the HTML from the maps, draw the dots directly in the HTML code (with JavaScript), then include the resulting HTML in the Swing browser.
This is the easiest part. You can draw on the map with JavaScript (with GoogleMarker components - google it). When you instantiate those markers, you pass a latitude and a longitude from your GPS. Then the map will know where to draw them.

How could I turn coordinates x,y,z coordinates of several objects into an Android app that displays the position of these objects?

I am using eclipse with the adk android plugin and I am completely lost
That would depend on what do you mean by displaying their location:
Relative to each other on a blank screen.
Read up on distance calculation in coordinates and draw the locations relative to their distance from each other.
On a map, each one separately from the other or together.
Use a web/binary API for map display like Google Maps (don't want to spam and post links with my reputation), or write your app to display Open map data from sources like OpenStreetMap.
On a satellite/aerial images.
Pretty much the same as #3 just you have less options to investigate and try.
If you were a bit clearer in your question, I could have been more specific with the answers, if you edit your question and clarify more, I could be more specific.

Usage of OpenMapStreet API/GoogleMap API in Java /Swing Application

I need to solve a simple problem regarding Showing Map on Swing based application in java.
I am having list of latitudes and longitudes (GPS Tracks) , I need to draw some routes using these routes and probably want to draw maps like GoogleMaps.
Is it possible to draw Google Maps using GPS info (latitude, longitude) via OpenMapStreet API. Based on different user selection over JFrame control (e.g Row containing Route Info) one of specific area (panel) a map should be drawn (probably a Google Map).
I read the OpenMapStreet API. But I don't found a concrete example drawing the map over the Swing application using given latitudes/longitudes (GPS Info).
Any idea (probably some code sample) I would be obliged and thankful.
Edit:
Let say I have the following longitudes/latitudes info.
Longitudes Latitudes
2546789.510 ,7894125.10 ( Linhaeim)
1547897.111 ,4569872.10 ..
2546789.510 ,2365478.79 ..
2314561.510 ,7894125.11
5467891.510 ,7894125.22
4578933.510 ,2647835.33
6547891.510 ,2254776.44
3211457.510 ,7899901.37
6987888.510 ,2010009.78
3654789.510 ,9876510.61
5547890.510 ,3145678.39
1789000.510 ,4698333.58
2778900.510 ,3254788.97
7455555.510 ,3378945.27 ( XYZ )
Moreover some StopNames of Journey also associates with these gps coordinates ( like Linhaeim, Im Saal, KreiserStr, ABC,XYZ, ........)
I have above data stored inside databases with some other additional information ( e.g JourneyId,JourneyStartTime,JourneyEndTime.....). So, I need the map like which shows above coordinates as route connecting these coordinates.
If GoogleMap API works for this , then it would too be acceptable for me. Usage of Google Maps API for this context , Please point me small tutorial even to look for for incarporating above map problem.
If still not clear, I would happy to edit it again :-)

How can I create a custom map in Google Maps?

I am trying to create a Google Maps application that has the map of my house. (bedroom, wash room, kitchen etc)
Using GPS, I will find my present location in my house and try to get the direction/walking-distance to my bedroom. (You could use Google's API to get the direction)
What I need to know is:
How can I add a custom map of my house?
To get the direction and walking-distance? You will have to provide your current geo-coordinates (where I am right now) and your destinations (kitchen) geo-coordinates, so will Google be able to find the walking-distance and direction from where I am to the next place I want to go (to the kitchen)?
Using GPS, I will find my present location in my house and try to get the direction/walking-distance to my bedroom.
Considering that the error range of GPS (~30m diameter circle) might be bigger than the footprint of your house, this seems unlikely to work well.
How can I add a custom map of my house?
You don't. You are welcome to create your own activity with its own images and such, but that will not have anything to do with Google Maps.
To get the direction and walking-distance?
You will need to calculate that yourself.

Categories