Way to figure address routing distance between geocodes? - distance

Is there any algorithm out there that will help give a more accurate driving distance number between two geocodes. Right now, most numbers just give a straight line number, and that may be the only way. If you type in two addresses, the straight line distance may be 15 miles, but if you put in the addresses in Google Maps or any of the others, you will see that the route driving distance is more like 21 miles.
So I am wondering if anyone knows of a way of getting a number closer to the route driving distance? I am trying to get a closer number to using Google/Mapquest/Bing APIs, without using an API if possible.

You'll obviously need a street map database similar to what Google has. They are huge and a giant pain to maintain. Then you'll need a fairly complex path finding algorithm.
Best bet is to use the Google Maps API and let them do the leg work for you.
For comparison, check out Bing Maps and Yahoo Maps (both have API's similar to Google's)
I've also heard that ArcGIS has similar API to Bing but is MUCH cheaper ($2,500 instead of $8,000 per million transactions)

Related

MKRoute shown in US only

I use MapManager to show the route. MKroute doesn't work in my country, but it does in US. Can anyone tell me if this only work in only particular countries or it does work everywhere?
The best i can tell is that, for a route, you need a destination and starting point.
When a coordinate preferably the current user position does not have a POI in map mostly due to the fact that apple maps is not completely mapped in your place. By which i mean its besides from showing some main areas and streets, you have nothing other then this feature will not work.
If you know what i mean, then the alternative solution is Google Maps. It has a vast resource and it has information about things apple does not.
But it comes with a price, you need to learn to use Google Maps API which at this point is documented for Objective-C only.
And the callout is somewhat static in Google Maps which you can customize but the hard way.

Openstreetmap how to get the shortest travel distance by car between multiple points and a target

i need to know the shortest distance (traveling by car on the map, not bird view) between let's say 10 GIS points and a target with possibly CloudMade or something else.
The points are within 10 kilometers.
So I need a way to know out of my 10 positions, which one is the closest to my target, that is travelling by car, not bird view.
thanks
You don't say if you're developing a web app, an offline app, or something else. In general, you'll need to use a routing service, or routing code - see, for example, MapQuest's web APIs or Project OSRM's code.
Then do a query for each and compare the distances. There aren't generally services that answer the question "which of these POIs is nearest?" AFAIK, so this is probably the most effective way to find which-is-nearest.

Mapping Indoor Floor Plan into OSM-XML for Use in iPhone App

I am currently working on a project at my home university to create an infrastructure-less indoor navigation iPhone application. I have a couple of questions regarding IndoorOSM and hope that experts here can steer me towards the right direction.
Given an indoor floor plan, how can I make use of JOSM to map it into OSM-XML format? I understand that the floor plan will be represented as nodes, ways, tags and relations with each node having a lat-lon value. As the indoor space I would like to map is located in Singapore where there is little existing mapping work done, I am not sure where to accurately place the floor plan in JOSM before modelling (the buildings are non-existent). The thing is, if I start modelling on a wrong location, the lat-lon values generated in the OSM-XML file will be way off from the lat-lon values in actual real world space, right? In that case I don't think I will be able to make use of the magnetometer to identify where the user is currently at on the map...
In the OSM wiki, it was mentioned that nodes represent a geospatial point and ways are simply a collection of 2-2000 nodes and can be used to represent an area. Pardon my ignorance, but how can I know what's the physical size/area of this "point" or node?
Other than IndoorOSM, is there an easier way to convert an indoor floor plan into something that my application can understand and use easily to allow navigation? I seen a project known as roodin on youtube but I'm not sure how they did the mapping (link).
I'm also working on app with similar functionalities. What I understand is:
1 - When mapping a building you should mapping with correct lat/long. It shouldn't be difficult to get building coordinates if you can go there and check coordinates with a smartphone with GPS. With you can't go there, it's more difficult. Maybe ask someone to do that helps you. But, to start drawing your floor plan, you don't need coordinates. you can do that after finish your drawing
2 - When use JOSM to drawing, it show (in status bar) the length of your way
3 - Currently, I'm sticking with IndoorOSM. I liked the way they reuse nodes, ways and relations to draw a floor plan. That's my recommendation

Static maps with routing on iOS

Is there a way to have static maps on the iPhone, with either MapKit or a third-party framework? By this I mean fixed area of say, 5 sq miles, which can by zoomed/panned etc, but which doesn't require an internet connection to load the map.
Additionally, is it possible to get route directions, and draw them on the map?
You can of course always roll your own solution with CATiledLayer if the area you want to display is that small, but it's probably better and easier to have a look at routing frameworks like MapBox (http://mapbox.com/blog/introducing-mapbox-ios-sdk/), which provides offline support for iOS.
The MapKit framework doesn't offer offline maps currently.
It is possible to define an area on the maps, and lock the user into that area, but an internet connection is still required.
Maybe a more direct way to do what you want is to download a static image for the zone you are interested in and cache it, using the image of that map area to zoom and pan around in. Of course this would require an initial internet connection but that is really not such an obstacle, after all, one must have a connection to download your application.
You could also provide this image directly into your applications bundle, but you've not really told us much to conclude that the latter option is feasible.
As for routing, it's also not supported currently. You could however retrieve a list of waypoints from point A to B directly from the Google maps remote API - note you cannot do this with MapKit framework.
With these waypoints (which contain coordinates) and the current zoom level value, it's possible for you to plot these points and draw between each one in order to implement your own routing, this get a little ugly or maybe better to say "laggy" when the user begins to zoom in and out as it's only possible to know how to redraw your route when the user ends zooming (lifts their fingers from the screen), but of course like most things in programming, there is a solution to this which is, I feel out of scope for this question.
I hope this helps.

Largest possible group of friends in common?

I'm trying to come up with the largest possible group of friends that would theoretically get along with each other, i.e., each person in the group should know at least 50% of the other people in the group.
I'm trying to come up with an algorithm for this that doesn't take ridiculously long; Facebook's API/cross-server talk is pretty slow as is.
I was thinking I could start with the friend that has the most mutual friends with me first, and then add people to the group one by one. But who would I choose next?
Just interested in the theory, no code is necessary.
Edit: When I said "theory", what I really meant what's the next logical step in plain english :) I was hoping I could code this up in an afternoon, but I guess this is a bit more complicated than I anticipated, and I'm not sure I want to spend weeks delving into heavy graph theory. Nevertheless, maybe someone else will find this interesting.
MIT did some work on social graphing a while back. Although it used mobile phone data, the clustering algorithms and other systems should still apply, even though they are constructed using different inputs and criteria.
There is more MIT chatter about social graphing going on at the moment. Definitely the place to look for technical pointers on this kind of thing.
Whilst the problem of graph enumeration from a given node to it's edges is NP complete for most useful problems ... the application of the graph traversal and the wealth of information might help you make this more efficient:
For any node (profile) N, you could data-scrape using Google or something to find associated edges out. This means that you can harness a cache of the pages and Googles search technology to mitigate having to traverse the edges yourself.
Social profiles contain tons of meta-data. Developing a statistical analysis method for working out the likelyhood of A knowing B without a direct path might be useful. Afterall friends have a) similar locations and b) similar interests
Other data, seemingly irrelevant can provide a means for locating people likely to know eachother and then you can double check the edges. Things such as chatter on boards about a band or gig, or people mentioning "cat fight" when Kate smacked Mary in the mouth.
The data just needs looking at in the right way, in the same way MIT looked at geographical statistics to determine relationships through phones.
Good Luck
There is an Algorithm called SCAN-Algorithm with some precalculations the algorithm can cluster a network in a good speed.
You can find informations about the algorithm here: SCAN: A Structural Clustering Algorithm for Networks
This is more "broad", but see if it helps to get ideas.