Setting up Graphhopper (open source version) - graphhopper

I am looking for an alternative to the Google Directions API and run into Graphhopper, as I need to get matrices that provide the distances and travel times between a group of points given by coordinates.
I have installed the Graphhopper server in Java following these instructions, and it seems to be running fine.
As I need to send the requests using Python, I also installed the Python client as shown here. However, it asks for an API key and refers me to the Graphhopper website to get one.
How can I get the client to make a call to the machine where I have installed the server, instead of trying to reach the Graphhopper API? Is this possible? I have been going through the client files but haven't found any place to enter this information.
Thanks in advance!

For anybody in my same situation, I have found an answer. The Matrix API is not open source, so you need to get an API key regardless. Then, you can use the client code (like the one I linked to above) to send queries. The chart of features that are available via the open source code can be found here.
I hope that helps!

Related

Program/tool for reading/logging http requests and responses?

I'm trying to log autocomplete responses from a gmail "people" server, and I'm trying to find a program or tool to do this, like the network section in chrome dev tools. I tried using a web crawler script, but authentication would be a mess. I also tried Wireshark, but it was all garble to me and probably the wrong way to go. Is this even possible? Can somebody help me, I'm totally out of my comfort zone here. please see attached image
It would be best to find an API that google makes public for the data that you need and use that to query the data. For people, google does have an API. Have a look here: https://developers.google.com/people
Tools commonly used to make HTTP queries are https://www.postman.com/ and https://curl.haxx.se/

Enable google maps api key in production environment

I made a flask app and deployed it to a linux server on Linode. It is running and some of my pages are working. For example, the contact page works. However, some of them have an inset google map. Upon loading one of these pages, my map is visible for a split second, then a big gray exclamation! and the map is blocked.
While testing the app using Flask's built in development server in my remote environment, all my functionality worked. When moving to a production environment, I used nginx and gunicorn. And I think I did it correctly. Judging that I do see the google maps working for just a second, it looks like this is not the issue.
Do I need to enable my google maps javascript api key for the production environment somehow?
When I have a look at your source code, I see
https://maps.googleapis.com/maps/api/js?key=None&callback=initMap
So, you did not add the API key, so it cannot work.
Please see https://developers.google.com/maps/documentation/javascript/get-api-key for how to get a key.

How to request internal API in App Script

I have a project in GCP with some internal APIs (in VMs), Databases, and so on.
Now, I'm trying to create a GAS to obtain data from one of those internal APIs (Druid, in my case) to print some data in a Google Spreadsheet.
My point here is that I link the GAS to my GCP project, expecting to be able to connect to my internal IP (10.1.0.x) which is in a VPC, shared with the default one. So, if I start a new VM attached to the default network, I could be able to ping and connect to it. Seems reasonable.
But, when I execute the GAS function, the following pice of code fails: UrlFetchApp.fetch('http://10.1.0.3:8082/druid/v2/?pretty', options);.
Should I configure something else in the GCP project to be able to connect to internal APIs?
Should I change the way and use another GCP service to do so?
Any help would be more than appreciated!
Thanks
That is not supported in Apps Script. You could request a feature request in the bug tracker. See https://developers.google.com/apps-script/support#missing_features
Internal APIs run client-side and need to be incorporated within JavaScript code.
Within Apps Script you can run JavaScript code, if you deploy your project as a Web App.
You can then either embed the JS code within the HTML file attached to the project, or directly insert it within the <script></script> tags within HtmlService.createHtmlOutput().

Google Maps API for both localhost & production server, as of April 2019

TLDR
My code works fine on my laptop when accessed as file://<path>/index.html, but neither on my laptop with an Apache server running when accessed as http://<path>/index.html, nor on my real (production) server. I see no errors on the console, but the map is just a grey rectangle.
[Update] I moved to LeafletJS shortly after asking this question, and recommend others to do so too.
It has been a few years since I coded any Google Maps applications.
It seems that, as of last year, it is now necessary to have an API key, by providing it with credit card details, and to provide it with each API call.
Unfortunately, there is a lot of of information about this, much/most of it out of date and/or contradictory.
Can anyone point to the canonical guide, preferably with screenshots, of how to configure this?
I wish to draw a map, and add some makers, which will require reverse geocoding, such that I provide a street address and convert it to lat/long in order to place the markers.
Sounds simple enough, but which of the many thousands of "helpful" site has gotten it right?
For instance, what seems to be the current Google help page speaks of
From the Navigation menu, select APIs & Services > Credentials.
On the Credentials page, click Create credentials > API key
But I can't even see that menu option :-(
[Update] If it helps any, the error message in the developer console said :
Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key
[Update] I am trying to access the API like this
<script src="maps.google.com/maps/api/…>
and
var url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + comapnyLocation +'&key=XXXX';
$http.get(url)
[Update++] in the developer console, I see a bunch of errors along the lines of:
aliextension.com/wp-content/uploads/2017/08/JAR.png:1 GET https://aliextension.com/wp-content/uploads/2017/08/JAR.png net::ERR_CONNECTION_TIMED_OUT
I have no idea what aliextension is, nor does it appear in my code (maybe in some minified JS?)
Ok, it is something to do with AliExpress (Ali Baba). I removed it & the timeout messages go away, but I still have problems.
If I load the index.html into Chrome as a file://, then it works just fine. But, if I load it `as http://, where I have a Xampp Apache server running, the map box remains grey, although I see no error messages. The same thing happens on my real server :-(
This page should be your starting point:
https://developers.google.com/maps/documentation/javascript/tutorial
it helps you working with Google map javascript API.
To embedded a google map to your website read the overview page in the above link.
To add markers to your google map read this page:
https://developers.google.com/maps/documentation/javascript/adding-a-google-map
To do reverse geocoding read this page:
https://developers.google.com/maps/documentation/javascript/geocoding
That all i need to work with google map. I think you can do the same too.
The cause for this is quite likely an API key restriction.
In order to permit these host-names or IP addresses, you have to:
a) go to the credentials panel and select the according project, then click on "Api key".
b) there you can loosen the restrictions, for HTTP referrers (for web-sites)
... or for IP addresses (in case these are server-side requests).

How to get a Google Place using a placeId on Flutter?

I'm trying to find a function that would allow me to get a Google Place only using a placeId (and the apiKey of course).
I found the function GeoDataClient.getPlaceById(placeId) but unfortunately this doesn't seem to be available on Flutter. I am currently using the flutter_google_places dart package but am open to using something different if necessary.
I can't find one. It seems like something of a large gap in the ecosystem -- if you store a Google Place ID in your local database, you should be able to convert that into a place name and a location when you reload it.
The iOS equivalent of GeoDataClient is the Places SDK for iOS: https://developers.google.com/places/ios-sdk/intro.
I may write a plugin for this and add it to pub.dev. Unless you've found a better solution since you posted this question, this seems like the best available approach at the moment.
With that said, however, connecting to the Google Places SDK requires a network connection, so if you want optimal performance, you should try to keep invocations of the SDK bridge to a bare minimum, and ideally keep place details in a local SQLite database. This way, users will only be invoking the SDK bridge after loading the app on a new device.