How to get geolocation from Eircode/Post Code accurately - google-api

I am trying to get latitude and longitude from Ireland Eircode by using google API but I am not getting data from some postcodes given below:
A96X7F2
E45XD68
When I am trying to get data from this, It's returning status ZERO_RESULTS
https://maps.googleapis.com/maps/api/geocode/json?address=A96X7F2&key=API_KEY
Note: In most cases, I am getting data by using this API.

Try specifying the region:
https://maps.googleapis.com/maps/api/geocode/json?address=A96X7F2&region=ie&key=API_KEY
Issues with postcodes are discussed on their issue tracker here:
https://issuetracker.google.com/issues/73030863?pli=1
They say in that link that for best results use region or component filtering. [Both are ways to specify region, but the former is a hint, the latter is a filter.]

Related

Deleting labels in Prometheus

I'm using Prometheus to do some monitoring but I can't seem to find a way to delete labels I no longer want. I tried using the DELETE /api/v1/series endpoint but it doesn't remove it from the dropdown list on the main Prometheus Graph page. Is there a way to remove them from the dropdown without restarting from scratch?
Thanks
This happens to me also, try to include the metric name when querying for labels' values like this:
label_values(node_load1, instance)
ref: http://docs.grafana.org/features/datasources/prometheus/
If you delete every relevant timeseries then it should no longer be returned. If this is not the case, please file a bug.
Prometheus doesn't provide the ability to delete particular labels, because this may result to duplicate time series with identical labelsets. For example, suppose Prometheus contains the following time series:
http_requests_total{instance="host1",job="foobar"}
http_requests_total{instance="host2",job="foobar"}
If instance label is removed, then these two time series will become identical:
http_requests_total{job="foobar"}
http_requests_total{job="foobar"}
Now neither Prometheus nor user can differentiate these two time series.
Prometheus provides only the API for deleting time series matching the given series selector - see these docs for details.

Is it possible to get Google Analytic goal value by date?

Google Analytics Management API goals endpoint. this is the link showing the goal endpoint I will be using to get a value. Is it possible for me to get the goal value broken up by date? I want to know the goal value for each day so I can create a line graph with accurate data. This endpoint is apart of the management API, but I know the core reporting API is more flexible with sorting by date. I would like to know if it is possible. If it is, please enlighten me!
Any reason you can't use the reporting API? You can use dimension=ga:date and metrics=ga:goalXXCompletions (ga:goal1Completions).
See the link to the query explorer report below:
https://ga-dev-tools.appspot.com/query-explorer/?start-date=2016-01-01&end-date=2016-03-27&metrics=ga%3Agoal1Completions&dimensions=ga%3Adate&samplingLevel=HIGHER_PRECISION&max-results=10000
You can query them together.
# get report data
query.list <- Init(start.date = "XXXXXX",
end.date = "XXXXXX",
dimensions = "ga:date",
metrics = "ga:goalXXValue",
table.id = "ga:XXXXX")

Getting Location of Tweets found with Twitter Search API

Whenever I search for tweets using the geocode option, the returned tweets have "null" as their geo property. They are definitely coming from the right place because the location property has a name which is in the correct area, however I want to know what the coordinates of the tweet are so I can place on on a map (specifically Windows Phone).
I've tried a really hacky solution of searching for the location using the geo api, but this seems a really awkward way of doing it and often returns bad results (I want results from Oxford, UK but often the geo search return Oxford, IN for example).
Looking around, it seems Twitter's geolocation is currently broken, but I really need this to work for a presentation on Thursday demonstrating an app we built in a group, and it would really suck if our main feature didn't work.
Twitter's search API is broken. It will not return some information which is available through the regular API.
Once you have found a Tweet, you can try looking it up directly using statuses/show
For example, calling one of my tweets:
https://api.twitter.com/1/statuses/show.xml?id=202471009973051393&include_entities=true
gives
<geo>
<georss:point>51.52505194 -0.132582</georss:point>
</geo>
<coordinates>
<georss:point>51.52505194 -0.132582</georss:point>
</coordinates>

Find exhaustive list of restaurants around a location within a specified radius in android

I am working on an Android App. I want to get list of all restaurant around me within a specified radius(let say 5 miles). I tried using Google places API and it works, however it limits the number results returned to 20, what if there are more than 20 restaurant in that radius around me. How do I get an exhaustive list of all the restaurants? What is the best way to do this? Is there something other than Google Places API that I can use? Thanks for your help in advance.
If you want to do it server side you can use this guy's class :
http://andrenosalsky.com/blog/2011/google-places-api-php-class/
and you have to get an api key as it is explaned here :
http://code.google.com/intl/fr/apis/maps/documentation/places/
then you can send data in JSON format to your Android

how to get Route directions between two points on a map to draw driving directions?

is there a way to use core location or google or some other api to provide two points on the map and get the resulting set of latitude/longitude pairs for the route?
i have seen in this tutorial Drawing polyines or routes on a MKMapView that how to draw driving direction using core graphics...but in the sample code it has route.csv which has predefined set of longitudes and latitudes.....how do i make pair of longitudes and latitudes so that i can draw driving directions.
Companies invest millions of dollars into developing routing algorithms, so I very much doubt that you'll be able to get it for free anywhere (I'm happy to be wrong, though). For example, the Google Maps JavaScript API supports routing, so I guess you could hack that up. The results wouldn't be fast or pretty, mind you.
If you have a limited use of the directions request (less than a certain amount per day) and always display results on a Google map, you do qualify for the free Google Directions API.
https://developers.google.com/maps/documentation/directions/
Read the license part thoroughly to know the limits. You should easily be able to request a json response that will b easier to parse than an xml one (plus Apple added json parser in iOS).
For example
http://maps.googleapis.com/maps/api/directions/json?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false
If you are over the limit, you should look into their business licenses.
Old question but MTDirectionsKit was recently open sourced and it works great:
MTDirectionsKit
with Google API you can get directions from two points, the only problem is you just can use it once a day if you don't pay.
Search how to get the key API from google, there are a lots of videos on youtube talking about it.
Furthemore, i got a library which hepls you to draw the line between points this one https://github.com/jd-alexander/Google-Directions-Android
After you implemented it in build.gradle(Module:app), implement the library in the class like
public class LocationMapActivity extends AppCompatActivity implements RoutingListener
will appear a error to implemets the methods (obligatory to implement them but It's not necessary to use them).
I just did this:
public void route(){
Routing routing = new Routing.Builder()
.travelMode(/* Travel Mode */)
.withListener(/* Listener that delivers routing results.*/)
.waypoints(/*waypoints*/)
.key(/*api key for quota management*/)
.build();
routing.execute();
}
More info in the link.

Resources