Google-distancematrix-api not calculating distance for my country - django

I'm using google-distance_matrix in my web app to calculate distance and prices. The code seems to be working fine if I'm using counties other than my own country (Zimbabwe ). For example from Brooklyn Bridge to Madison Square Gardens the API is able to get the calculate distance, time, and price backend and provide results frontend resultbut for any locations within Zimbabwe, the API is unable to get distance, price nor the timeFrontendbackend.
What might be the problem?

Related

How to get lat-long values of all areas in a city

I have tried to find a lot over the Internet but I am unable to get a perfect utility/API for my requirement.
I am interested in getting the latitude, longitude values of all areas in a city.
Currently i am using this google maps api
https://developers.google.com/maps/documentation/geocoding/start
But, when i enter a city name, it is giving only one lat-long pair for that city. Is there any way that if i give a city name, i can get all the areas and their corresponding latitude, longitude values?
Thanks.
There's a nice documentation for this at: Places API
I used this to get the latitude / longitude for one of my own projects and I also have an example of this.
If you look at the example, you can just type a location and it will immediately get the lat / long of the location and zoom in, you can also do this for more locations at the same time. Remember there is a limit for the maps api so it can only process so many data at the same time. Hope this may help you out! :)

Mapbox Geocoding API V5- Get all neighborhoods in a city

Is there a way to get all neighborhoods per city by lat and lng from mapbox API V5.
For example, if I search using the lat and lng of Long Beach.
-118.1937, 33.7701
I expect to get back all the neighborhoods, instead, I only get back one result of
"place_name: "Downtown, Long Beach, California 90802, United States""
I have changed the response limit and bound box, with no results.
Here is the mapbox playground.
https://www.mapbox.com/api-playground/#/forward-geocoding
Thanks!
Mapbox doesn't really do neighborhoods, they require some sort of search data to pull either addresses or places.
However, there are services where you can get neighborhood data. I found this Stack Overflow question to have several links (sadly, most of them outdated....), with the reference to Zillow having a lot of promise.
I'd also suggest the Census Bureau data as it may have what you are looking for, but it is what I would call 'less than user friendly' to find anything - unless you are comfortable reading government spec sort of things... :)

user profiling and outlier detection

I have a dataset including 1 million customers. They are splitted into some categories like electronics customers,food and Beverage customers etc. Group names present customers' profiles.
each customer has different behaviours. For instance suppose that an electronic customer buys one electronic devices at least when he goes shopping. This transaction repeats randomly or continuously. So that I present each transaction by numerical codes.
(Value of transaction, volume of trans., transaction type, etc..) = (100,200,1)
for each transaction I have this vector above.it means every customer has a different trade behaviour.
I want to find out whether each customer has a pattern? Do we have outliers?
it is a profiling problem basically.
which analysis do you recommend?
Can you be more specific? What are you trying to get out of the analysis exactly? Buying patterns, customers that are outliers, purchases that are outliers?
If you want to determine which items are bought together, group the transactions together, just listing the items purchased at the same time and do shopping basket analysis, using the apriori algorithm or similar.
If you want to find similar customers, using k nearest neighbor or k means against a vector representing a customer's buy patterns (probably just the items bought). You can do this on individual transactions also to compare transactions.
To determine outliers, you can use a density based clustering algorithm (e.g. DBSCAN) to cluster customers together that are close to one another, and look at those customers that are not in clusters to determine outliers also.

API to get current weather conditions for any point on Earth

I'm in the planning phase of a project and one of the requirements is that the system be able to get the current weather conditions for any point on Earth, given a set of latitude-longitude coordinates.
I signed up for Wunderground.com's Weather API, but immediately realized this wouldn't work. If you enter a set of coordinates that doesn't correspond to a known city, the API returns a "querynotfound" error with the description "No cities match your search query."
Does a service like this exist?
EDIT: To clarify, I might need the current weather conditions for some arbitary point in (say) the Atlantic ocean.
Have you looked at google api?
http://www.google.com/ig/api?weather=,,,40467626,-03609910&hl=es
I think this is what you are looking for Using Google Weather API with Lat and Lon - how to format?
Edited 29th Aug 2012
As mentioned by "azgolfer" as of August 25th, 2012. Google has phased out it's API. Try http://www.wunderground.com/ instead.

Get nearby hospitals or fire stations based on your location?

Is it possible to calculate nearby hospitals or police or fire stations based on your location using geocoding? For instance: If I'm from place Chennai, India. Using Geocoding I need to get the list of all hospitals or police or fire stations nearby Chennai.
If you have a list of the latitude and longitude of those hospitals and fire and police stations (as well as your own latitude and longitude), then sure it is possible. The calculation of the distance between two points on a sphere (like Earth) is called the Haversine formula. You'd have to iterate over each one, calculating how far you were from it. To speed things up, you might want to implement a geospatial index like the ones in MongoDB, SQL Server, Oracle, SOLR, etc.
You can get nearby hospitals, police or fire stations etc based on your location by only using Google Places API though this API is paid so you need to have a billing account to use this API.