简体   繁体   中英

Google Maps Polyline to Postgis with Java/Hibernate

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.

Someone can help me?

Thanks. Luciano

Usually you cannot get that polyline as vector data coordinates, because these data are provided either by Teleatlas / Tomtom (via Google service) or Microsoft Bing (Navteq data) or Nokia ( Navteq data)

Such vector data are extremly expensive, and therfore you can only request that a line is drawn on the screen, but you will not get the geographical coordinates (latitude, longitude).
Even Google would not have the right to give you that vector data (because they dont own that data, they only display it).

However, I remeber a post here showing how to use an unofficial Google server where you can request the route between two geo points, and get back a compressed encoded route. But you legally cannot use that service, nor I do know if it yet exists.

An alternative would be use open source map data, like OpenStreetMap , for these services you can get the vector data for a route. For example: the ios RouteMe library provides such things via OpenStreetMap .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM