Getting point coordinates onclick to Python API (Google Earth Engine plugin in QGIS) - onclick

I am working with Google Earth Engine plugin in QGIS and trying to get a point geomtry from QGIS to use in the python API code.
I wrote some code that needs point coordinates to start the process. I can do that by generating the point inside the script (point = ee.Geometry.Point([Xcoord, Ycoord])), but I actually need to generate that point interctively, that means I click on the map and point coordinates are passed to the code.
Only string I could find that seems related to what I'm seeking is map.onclick(callback), but I'm not sure that's what I need and anyway that throws the error AttributeError: type object 'map' has no attribute 'onclick'.
Does anyone have any suggestion about that?
Many thanks

Related

How to decode polyline from HERE Routing API 8?

In ABAP, we need to fetch detailed route from HERE API https://router.hereapi.com/v8/routes?transportMode=car&origin=21.11336,39.21516&destination=21.52779,39.25381&return=polyline&app_id={APPID}&apiKey={APIKEY}.
This API returns polyline which we need to decode to get GeoCordinates. We tried to decode using the algorithm given at https://github.com/heremaps/flexible-polyline, but it does not provide correct coordinates.
Can I get exact algorithm that HERE is using to encode polyline, so that to decode polyline in ABAP?
I know this is a bit old but found this answer on HERE help pages. An example of an encoded polyline is:
BGo9llkDg_rzZkF0G8LoQ4NoQgP8QoLgKgyB0tB4XoVoLsJ0K4IwWoQsOsJ8LwHoLoGkS0KkN8GsJ0F8GgF4D4DsE0FwHoLUgK8BkIkDkI7B0eTgUT0KjDkhBvCoa7BsT3DwgBvCoVnGg8BjNg4D3D8zB_EsxBjDwgBzFs2BrEgyBvC8V7G8uB7G4wBnBwMkI8BoBnLgP_hEgKz1CsE_nBsJrjD4E1tB
I found the following on developer.here.com page:
"This polyline is encoded using a flexible polyline. You can encode this polyline easily in many major languages using examples available in the flexible polyline repository."
GitHub repo: https://github.com/heremaps/flexible-polyline
"HERE Maps API for Javascript provides wrappers which can do the decoding for you."
I am not using HERE on the client side (even thought it is awesome), I am using some legacy mapping plugin.
I was able to use this code in this file to figure out how to decode the polyline.
https://github.com/heremaps/flexible-polyline/blob/master/javascript/index.js
My code takes the encoded polyline, sends it through the decode method and I end up with a cute object that contains the polyline array as expected.
Below is a screenshot of the console.log of the decoded object pasted above.

Geolocation: UTM to Geodetic translation

Maybe there's a better place to ask this, but I figured maybe someone has come into this problem before and can give me a hand with it.
I have a bunch of locations (36k) and they are represented using SIRGAS2000 (UTM 21s) coordinates. I need some way of converting them to traditional LatLng (Geodetic) format so I can upload them to my database and use those coords with Google Maps API.
Has any of you ever bumped into something similar?
Ok, I just found a JS library for this task. It will convert from and to various types of coordinates.
Here's a link to it in case anyone needs it ...
http://www.jstott.me.uk/jscoord/
Some examples in there too

Google maps api v3 get lat long from file with addresses in java code

I am trying to make an application which draws a heatmap. I have a file with home addresses which I am going to put on the map. Every address is a new line in this file.
I know how to create a heatmap layer when have coordinates.
What is the best way to get coordinates for these addresses?
I know there are couple ways of doing that, but the one that I am looking for is the way to do it on a server. I know that I have to send a request to the server. Can you please provide an example code in Java which gets a lat long coordinates for it.
You could use this library:
http://code.google.com/p/geocoder-java/
It has documented examples as well.

Access to KML tree

I have some rutes in KML format and I can't modify them. I want to draw them on a map but I also want to get the fist and last points to check for near cities and interesting places.
The problem that Google Maps API does server-side procesing and I cannot access individual elements form it. I searched and tried to use a parser like GeoXML but it's not exactly what I want because it uses its own map style an so on and I have to use Google API maps. I only do need to acces certain elements of KML tree and i will draw them using Google Maps API.
Can anyone help please? Thanks in advance for answer in these vacation days(for some).
You can use the standard KmlLayer in Google Maps for rendering, and then use a 3rd party library like GeoXML (or your own code to read the XML) to grab whatever data you need from the KML and run additional functions based on that.

Geographical Data Visualization in a Web Application

I've got a request to implement a visualization service for geographical related data.
I have a list of Italian ZIP Codes (they are called CAP in Italian). I've already found a table which maps these ZIP codes to geographical coordinates (lat/long).
So, the data I have to visualize as map is structured the following way:
ZIPcode Latitude Longitude RequestCount
------- -------- --------- ------------
Is there an easy way (using a web service or implementing it myself using a component - preferably in .NET) for creating a map chart similar to the image i inserted below? It needn't to be that pretty and not necessarily geo-political.
I just need a indicator for every point which shows a smaller or bigger circle and next to it the value of RequestCount. I think this could be done either using the coordinates or, if there is some service which maps the Italian ZIP codes, using the ZIP code.
Thank you in advance!
alt text http://img515.imageshack.us/img515/3814/carsalesuh6.png
GeoNames offers a data set and open source libraries for geo mapping
Take a look at .net Charting and Chart FX Maps (I've never used these before).
Maybe...
Use the Google Map API. You can't draw circle overlays, but you can draw polygons. Here's the API for drawing polygons. An 8-sided polygon already looks pretty circle like. You could experiment with more sides to see how that looks.
Here's the API reference for the Google GPolygon class:
http://code.google.com/apis/maps/documentation/reference.html#GPolygon
I've used MapServer for many projects and it works well and is very flexible. Haven't tried the .NET bindings though:
http://www.paolocorti.net/2006/09/20/mapserver-tutorial-for-c-mapscript-asp-net/
I've used Fusion Maps for things like this. It is flash based with a javascript API. You can easily feed it either a static XML file to start, but I've also built various webservices to give it dynamic capabilities. There are many options to change the look and feel of the map as well.
take a look at Mapv - a library of geography visualization
enter image description here

Resources