How to do routing "walking path" inside specific premises? - android

I'm trying to achieve routing "walking path" inside specific premises (Hospital). I'm using osmdroid and osmdroid bonus pack. I have spend losts of time. Still not success. Does anyone achieved like this.
By now i tried
roadManager.addRequestOption("routeType=pedestrian");
and all other available rooting types available here
and it gives result only where roads available.
Can someone suggest the right way to do this?
Thanks in advance.
I'm trying something as below.

This is a tough one for a few reasons.
Osmdroid has issues as zoom levels > 20. In fact, 20 should be your max. Finding a map source for zoom 20 is also difficult, however the mapsforge adapter should help with that. You'll need a high zoom level in order for this to be useful to the user.
OSM data is generally a series of nodes and paths that connect the nodes called ways. The vast majority of these nodes and ways are for roadways. These nodes and ways are the only thing we have for calculating walking or driving directions. You should be able to get directions to the closest address.
If you have osm data for inside the building, that's great, but now you have a GPS/location issue. GPS generally doesn't penetrate indoors.
So no real answers here, but hopefully this will help you identify some of the challenges ahead.

Related

Optimal path between more than 23 points

I know that google api provide a way to provide 23 way points where it optimize the route for you.
If I have more than 23 points, how can I achieve that? I can divide them into 2 groups but how do I know which 2 ones should be connected between the groups
The other way I thought about it is to find which point is the closest to me. Then determine the next closest point and so on.
I basically want to build an optimal path that connects all the points (optimal being shortest distance)
Thanks
It's Travelling salesman problem problem. The time complexity of this problem is really huge, that's why, I think, Google limited number of waypoints to 23. You can check this article to get know how to solve this problem. There are several examples written in most popular languages.
Also, I had solved this problem before, I used Ant colony optimization for that. This algorithm gives you the ability to build path through ~100 waypoints for an acceptable time, but it can fail sometimes, e.g. you didn't build path at all

Storing (caching) Google map with given radius and using it while offline

First of all if this one is a duplicate, please refer me to the original thread(s), as I have failed to find the exact thing I was searching for.
Basically for some time now I am developing an application for the client and it was all going well up until this point.
The client requests to be able to
I) While online:
Access Google map
Set the point by clicking on map
Store a portion of the map around the above mentioned point locally as per the radius he/she selected (eg. 3km)
II) While offline:
Access the map he stored in above steps.
The application should draw the path as he moves as per GPS coords received from another device via BT.
The ability to zoom in/out, scroll around map and everything else that standard google map allows.
I am completely lost on this one and would like at least someone to point out the right direction for something like this.
I'm well aware how to handle most of the above while Android device is online, but have no idea how to do this while offline.
I pretty much need help with I-3, II-1, and maybe II-3.
PS. I don't really need BT tutorials and guidance (mentioned in II-2), that part is handled, I just pointed out the source of coords.
Cheers
You can use TileProvider. The TileProvider provides the images that are used in the tile overlay. You should be able to save portion of map and create your own tileprovider and access tiles locally.

Alternative(To Google Maps) Open Source Map API that provides a database of nodes and Arcs on roads

I need a Map API for Android that can provide me with indexed nodes and indices that make up the road network. The main idea is to determine if two GPS devices are on the same road. Thank you in advance
A Map API by itself will not have that information. Anyway, you can get it from OpenStreetMap freely. You can download it from here.
I don't understand from your question if you intend on displaying the results on a map. If so, and you want a nice and free map API, I would suggest Leaflet. It's not as mature as the likes of OpenLayers but, as you've tagged this post with "android", Leaflet just kicks ass in the mobile department.
OpenStreetMap is definitely a good source of data for this kind of project. Unlike google maps, it gives developers access to the underlying vector data of a map (fully open). This allows interesting new use cases which simply are not possible with google maps, and something involving geometric calculations like this would definitely fit into that category. You either need OpenStreetMap or some other source of "vector" map data, and beyond OpenStreetMap this can be expensive.
Unfortunately that's not the full answer to your question. You still have a lot of work to do to use the data in the way you intend. You need to calculate the proximity of two points (GPS readings from two devices?) to nearby roads, and figure out which road the point lies closest to. It's the kind of powerful geo calculation you might do using a GIS package such as QGIS or a functions of a geo-aware database system PostGIS.
But that's not the answer to your question, because you need to do these calculations on device. I'm not aware of an off-the-shelf library to do this on android. I think you would have to roll your own.
But another challenge is to get the vector data onto the device in a suitable format in the first place, and this is the first thing to solve. You'd want the vector data either as a large download for a whole country, or perhaps a smaller area, perhaps with an on-the-fly download feature within this app. Whole countries are not infeasible when working with maps in vector form (ever tried the awesome MayDroyd app?), but require some compact formatting. Happily some of these problems are starting to be solved in open source off-the-shelf libraries. You could try to build on top of MapsForge for example.
So then you're back to the challenge of writing on-device code to poke around in this data and do the calculations you want to do. I suppose it could be rather good if projects like MapsForge included generic PostGIS style geo-functions to make this easier. Something to ask the mapsforge developers about perhaps.

Camera/Compass/GPS

I was wondering if anyone could explain or clear me out -- I am currently doing some project to identify trees using android. I suppose the main components I must use at this project is GPS, Camera API and Compass (Please let me know if anyone can think anything) -- I am still in a middle of researching about the project and the possible problems that might arise during implement the project for example if there are two trees are in the same line of sight or same line (overlapping), what information is going to be displayed? How I can tell my software that I am actually want to display the front tree not the back of the tree? What sort of information or API will determine this? I mean does the camera or compass or GPS or even the database of the location of tree will determine it?
Can anyone please give me some idea, how I can tackle this kind of problem? Or perhaps if anyone know any tutorials that I can learn etc?
Much appreciated.
theBorneo
There is no existing api that would let you determine this specifically. I can image that you could estimate object identifications based on gps location. If you had waypoints in front, you could use the compass to get a direction and then approximate the gps region in front of you. Then try to see if you know of any prior waypoints that are in that area. Obviously, the one you see in direct line sight is the closest, and this would probably be the heuristic.
The camera will have almost no use in this case other than a view finder. If you are looking to segment images in order to differentiate between different objects, consider this impossible with google api, or any mobile application. This is difficult enough to do for professional researchers who can isolate variables..
The gps approximations are pretty trivial, however I am not confident as to how accurate or often a compass returns direction.

KML scalability? Use KML to show and filter 1600+ points in Android?

Will you guys tell me whether or not this solution will work before I spend a lot of time learning/researching KML? (It looks like I need to learn it at some point, but I have a deadline to meet, first.)
Background - I need to plot 1662 points on a map that fall into 7 categories. I would like to show all, as well as filter/show only categories that the user chooses.
My first attempt at this used the Google Maps API. I created GeoPoints, added them to an ItemizedOverlay, and then added the ItemizedOverlay to the map. That works great for a few points. 100 points only took 3 seconds. By the time I got up to 400 points, things really started to slow down (like 30 seconds or so). I loaded all 1662, and it took 15 minutes!
1) Why does this take so long? Does the API make a call to Google Maps for each point?
2) I found KML as a possible alternative. How well does KML scale? Will it be able to plot and load 1600+ points? If not, can you recommend another solution?
3) How do you recommend I go about filtering my categories? Currently, I plan on loading each category to a layer. I found references to hiding/showing layers, so I'm going to try to do that. Is this a good approach?
4) How can I add buttons? Can/should I add them to an overlay? If not, is it possible to have the map open in a MapView and then control the filter/show with Android Buttons?
I'm sorry if my questions sound basic. I will continue researching and learning on my own. However, I want to know whether or not my solution will work at all before I waste another week going down another dead end.
Thanks in advance! :)
I don't know anything about Android, but I am working on a project where I generate KML output from a Java application. I'm not sure what kind of constraints you have when working with Android Java, but if you can you should try the following open source library:
JAK - Java API for KML
It will make the KML creation fairly easy. I can't answer your question about scalability on Android since I have no experience with it.

Categories

Resources