[postgis-users] Google Maps Polyline to Postgis with Java/Hibernate

Luciano Borges lucianosantosborges at gmail.com
Tue Jan 15 08:38:36 PST 2013


Hi Steve,

I took a look at GMapToGPX, but one of the functions it has and I need the
version 3 of Google Maps already provides me.

Ex:  arrayPoints =
google.maps.geometry.encoding.decodePath(response.routes[0].overview_polyline.points);

I need to know how to take that route (array) and convert it into a polygon
that the postgis can understand.

Thank you,
Luciano


2013/1/15 Luciano Borges <lucianosantosborges at gmail.com>

> I have a page where the user enters the starting point and ending point
> and I show de route in the map.
>
> I would like to know how to get this polygon (polyline) and save it in
> Postgis through the Java / Hibernate.
>
> For example, I have this code:
>
> var request = {
>         origin: ptoPartida,
>         destination: ptoChegada,
>         //provideRouteAlternatives: true,
>         travelMode: google.maps.DirectionsTravelMode.DRIVING};
>
> directionsService.route(request, function(response, status) {
>     if (status == google.maps.DirectionsStatus.OK) {
>         directionsDisplay.setDirections(response);
>         console.log(response);
>         var *x* =  google.maps.geometry.encoding.decodePath(response.routes[0].overview_polyline.points);
>         console.log(x);
>     }});
>
> The variable *X* is an array of point.
>
> Now I am looking for send this array to database (postgis).
>
> After I wiil try recover this data from database and print it on map.
>
> Thanks, Luciano
>
>  Someone can help me?
>
> Thanks. Luciano
>



-- 
Luciano Borges
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130115/d92fa64e/attachment.html>


More information about the postgis-users mailing list