Downloading a map image using Google Map using Java -
what want do:
i want create little program in java (beginner in java here) in specify gps location , zoom level , download map image google maps showing. associated this, need have scale associated image (the size in km of x , y dimensions of rectangular image).
what know:
i know how right image displayed in browser, specifying gps location , zoom level directly in url (example: https://maps.google.com/maps?f=q&hl=de&geocode=&q=48.167432,+10.533072&z=7). there should kind of library urllib in python call url.
how download image, , how know area pictured in it? found formula relate amount of meters (or whatever unit) "contained" in pixel (this function depends on latitude , zoom level of map). in case, how know pixels used map?
thank suggestion and/or pointer!
you want use static maps api.
https://developers.google.com/maps/documentation/staticmaps/index
your particular map @ url
http://maps.googleapis.com/maps/api/staticmap?center=48.167432,10.533072&size=400x400&sensor=true&zoom=7
as image. set sensor=true if you're using gps sensor find location. otherwise set false.
to read image url:
how download image, , how know area pictured in it? found formula relate amount of meters (or whatever unit) "contained" in pixel (this function depends on latitude , zoom level of map). in case, how know pixels used map?
you pass pixels , zoom level image, information given solution, scale should easy calculate.
Comments
Post a Comment