Geocoding problems in Google Maps module

0
While using the Google Maps module (7.0.2, but also earlier versions) we sometimes notice problems, that a correct address is not geocoded to a proper latitude/longitude location. We traced the problems via microflows BCo_Location / OCh_LocationAddress via SetCoordinatesByAddress to the Java action CalculateGeo. In the log the WARNING entry  'GEOCODE request failed: you are over your quota' is present (see below). This suggests we call it too often, but Google Geocoding API quota (see https://developers.google.com/maps/documentation/geocoding/usage-limits) show: 2,500 free requests per day, calculated as the sum of client-side and server-side queries. 50 requests per second, calculated as the sum of client-side and server-side queries.   Since we never hit these quota limits ourselves (by far!) and we did not have to specify our own Google API key to get it working, I am afraid all Mendix apps using this module share the same API key and these quota. So if other apps call it very regularly it could influence your own app. Can anybody confirm this? And is there a way to specify your own Google API key or workaround this problem in a different way?   Timestamp 2017-05-09 14:01:32.178 Level Warning Node GoogleMaps.OCh_LocationAddress Message GEOCODE request failed: you are over your quota com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.io.IOException: GEOCODE request failed: you are over your quota at GoogleMaps.SetCoordinatesByAddress (JavaAction : 'CalculateGeo') at GoogleMaps.OCh_LocationAddress (SubMicroflow : 'SetCoordinatesByAddress') Advanced stacktrace: at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:143) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.io.IOException: GEOCODE request failed: you are over your quota at com.mendix.core.component.InternalCore.execute(InternalCore.java:422) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: java.io.IOException: GEOCODE request failed: you are over your quota at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:176) Caused by: java.io.IOException: GEOCODE request failed: you are over your quota at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:40) Caused by: GEOCODE request failed: you are over your quota at googlemaps.actions.GeoCoder.getLocation(GeoCoder.java:83) at googlemaps.actions.CalculateGeo.executeAction(CalculateGeo.java:44) at googlemaps.actions.CalculateGeo.executeAction(CalculateGeo.java:23) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172) at com.mendix.core.component.InternalCore.execute(InternalCore.java:414) at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:52) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172) at com.mendix.core.component.InternalCore.executeSync(InternalCore.java:496) at com.mendix.modules.microflowengine.actions.SubMicroflowAction.execute(SubMicroflowAction.scala:43) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.CustomActionMonitorImpl$$anonfun$run$1.apply(CustomMonitoredAction.scala:14) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:143) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:145) at scala.util.Try$.apply(Try.scala:192) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:139) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:135) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)  
asked
1 answers
1

Hi Martin,

I've seen issues before with large companies as well, and there is seemed that Google was using  the IP address to see if a limit of 2500 requests was made. But that was not with a Mendix app. So I can't confirm, perhaps someone else can.

You can get a free API key to use Google Maps: https://developers.google.com/maps/documentation/javascript/get-api-key.

When you have the API key you can add it to the Google Maps widget at the following page:

 

A description about the Google Maps widget for Mendix can be found here: https://github.com/mendix/GoogleMapsWidget

 

Hope this helps.

 

Edit: I see that the GeoCode.java from the Google Maps module is not using an API key for the request. 

 

Edit 2: Download the latest Google Maps module from the app store, https://appstore.home.mendix.com/link/app/174/Mendix/Google-Maps-Module. Now it provides a constant for the API key.

answered