Jimut123 / jimutmap

API to get enormous amount of high resolution satellite images from satellites.pro quickly through multi-threading! create map your own map dataset. Bringing data to Humans.
https://jimutmap.readthedocs.io/
GNU General Public License v3.0
145 stars 17 forks source link

Variables from longitude and latitude #13

Closed xxLisaR closed 3 years ago

xxLisaR commented 3 years ago

Hey, thanks for sharing your library :) I'm pretty new to python and I wonder if the longitude and latitude can be exchanged by variables? I'd like to get them from a city and country so I did the following combination:

from geopy.geocoders import Nominatim
default_user_agent= 'YOURUSERAGENT'
geolocator = Nominatim(user_agent="my_user_agent")
city ="YourCity"
country ="YourCountry"
loc = geolocator.geocode(varcity+','+ varcountry)
print(loc.latitude, loc.longitude)

maxlat = loc.latitude + 0.5
maxlon = loc.longitude + 0.5

print (maxlat, maxlon)

from jimutmap import api

download_obj = api (min_lat_deg = loc.longitude,
                    max_lat_deg = maxlat,
                    min_lon_deg = loc.latitude,
                    max_lon_deg = maxlon,
                    zoom = 19, verbose = False,
                    threads_ = 5,
                    container_dir = "YOUR PATH")

download_obj.download(getMasks = True)

Both parts work separate, but when I bring them together, they either give me black images or telling me
AssertionError assert min_lon_deg < max_lon_deg

Do you have any clue? :-)

welcome[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

Jimut123 commented 3 years ago

Looks like there is error in latitude longitude, which you have given in the function call.  Make sure the latitude and longitude are correct.

Sent from Yahoo Mail on Android

On Wed, 28 Apr 2021 at 12:44 am, @.***> wrote:

Thanks for opening your first issue here! Be sure to follow the issue template!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.