Requirements to do reverse Geocoding in Genexus Smart Devices - genexus

I need to make a Reverse Geocoding for my SD app with Genexus X Ev3 U7, to show a location through aa given address in the map within the app. I've struggled for some time figuring out how to make it work with no luck.
I've already read all the documentation, followed the steps to get the API key from google (with Geocoding and Geolocation APIs enabled) and tried different ways with the methods shown in it and i haven't made it work.
Should I consider something else? Does anyone have done this before?
thanks before hand

Yes, there are two methods in Geolocation external object: GetAddress() and GetLocation().
If you are using it on the client-side, then both Android and iOS implementations use the platform's native implementation.
If the code runs on the server-side (C# or Java), then the implementation uses Google's geocoding services. The problem here is that there is no way to provide an API Key, so the number of allowed requests by day may be too low (depending on your usage).

Well, the main problem was that i was capturing the values of the Address Domain Collection variable all wrong.
All i had to do was to declare an &Address variable that read an &Addresses collection variable and to give it to a &Adrs VarChar variable:
For &Address in &Addresses
&Adrs = &Address
Load
EndFor
where &Addresses = GeoLocationAPI.GetAddress(&GeoLocation)
I don't know how i didn't come up with this before.
Thanks everyone :)

Related

Ruby viewpoint with EWS

I am trying to get started using viewpoint against EWS within Ruby, and it's not making a lot of sense at the moment. I am wondering where I can get some good example code, or some pointers? I am using 1.0.0-beta.
For example: I know the name of the calendar folder I want to use, so I could search for it, but how to access methods in that folder once I find it? What are the appropriate parameters, etc...
Any advice?
If you haven't read it yet I would recommend the README file in the repository. It has a couple of examples that should put you on the right path. Also, the generated API documentation should give you enough to work with.
http://rubydoc.info/github/WinRb/Viewpoint/frames
At a very basic level you can get all of your calendar events with the following code:
calendar = client.get_folder :calendar
events = calendar.items
I hope that gives you a little more to get started with.
Follow-up:
Again, I would point you to the API docs for concrete methods like #items. There are however dynamically added methods depending on the type that you can fetch with obj.ews_methods. In the case of CalendarItem one of those methods is #name so you can call obj.name to get the folder name. The dynamic methods are all backed by a formatted Hash based on the returned SOAP packet. You can see it in its raw format by issuing obj.ews_item
Cheers,
Dan

Using Address class for geocoding in bing maps ajax control

I am using bing maps ajax control in a webapplication with a bing maps enterpise key.One of the modules include a functionality to geocode a list of addresses requested by the user.I am using the following code snippet to do the geocoding.
for (var i = 0, j = addresses.length; i < j; i++) {
searchManager.geocode({
where : addresses[i],/*<address>,<city>,<state>,<country>,<zip>*/
count : 5,
callback : success,
errorCallback : failure
});
};
The success% is very less.Close to 10% even after multiple tries(about 150 addresses to geocode).
So,I wanted to know if there is any way we can use the Address class(http://msdn.microsoft.com/en-us/library/hh868069.aspx) for geocoding instead of giving address as a string.The official documentation mentions only about giving address as a string(http://msdn.microsoft.com/en-us/library/hh868060.aspx). The reason I wanted to check with address class instead of string is because,with the bing maps SOAP api in a silverlight application,i had found the success% to be more while using Address class.
Thanks in advance for any help in this issue.
First off, if you have the address data somewhere you should geocode it ahead of time. Geocoding all your address in JavaScript with your map is slow and it also uses a lot of transactions thus making you run out of free usage fast. Is there a reason why you are geocoding addresses in a loop in a JavaScript app rather than geocoding a head of time?
It is often better to pass in the address as a single string and allow the geocoder to parse it. This is actually a tip the is used for the REST services as well when geocoding.

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

Easiest way to display location?

What is the most up to date, accurate, turn-key code to inject into a page to automatically read a user's IP and spit out their city... on this page we are borrowing from goingtorain.com I want it to display ... within 3 miles of (dynamic city)
http://www.drillavailable.neighborrow.com/
Another one we've been looking at to use is http://www.maxmind.com/app/geolitecity. Looks to be fairly simple to setup and is open source/free with apis for most popular languages.
Not done much other than play with it for 5 mins but looks promising.
I'd go with location aware browsing. Look into the W3C GeoLocation API.
For example, try Google Gears Geolocation module.
These technologies allow your clients to be geolocalized not only by looking and their IP (which can have 200km offsets) but also by triangulating SSID information from nearby wireless Access Points, and this can be extremely precise.
Once you have the (lon,lat) coordinates, it's just a matter of calling some webservice to get the nearest city's name.
I would choose the locator API at http://ipinfodb.com You can access it via XML or JSON, send it your API key and an IP and it will return the city, state, zip, country, etc. You can then parse the results in your language of choice. Its the simplest way to achieve this without actually storing any information about IP/location routing.
Yes, you only need to use the ClientLocation object in the google.loader namespace. In total the whole code is.
<script src="http://www.google.com/jsapi" language="javascript"></script>
<script language="javascript">
if (google.loader.ClientLocation != null) {
alert(google.loader.ClientLocation.address.city);
} else {
alert("Not found");
}
</script>
The properties available are
google.loader.ClientLocation.latitude
google.loader.ClientLocation.longitude
google.loader.ClientLocation.address.city
google.loader.ClientLocation.address.country
google.loader.ClientLocation.address.country_code
google.loader.ClientLocation.address.region

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