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

Luciano Borges lucianosantosborges at gmail.com
Tue Jan 15 08:03:35 PST 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130115/4e1f9049/attachment.html>


More information about the postgis-users mailing list