I am working on an iOS App in which i want to get the temperature of different cities in different countries. I am able to get the country list which is a local csv file, but i would like to get the cities list against the country which i selected. Is there any way to do so ? Any help will be appreciated.
Related
For country and state, there are ISO numbers. With City, there is not.
Method 1:
Store in one column:
[Country ISO]-[State ISO]-[City Name]
Method 2:
Store in 3 separate columns.
Also, how to handle city names if there is no unique identifier?
First and foremost, three separate columns to keep your data. If you want to create a unique identifier, the easiest way would be giving a random 3-10 digit code depending on the size of your data set. However, I would suggest concatenating [country-code]-[state-code]-[code] if you have a small data set and if you want human readability to a certain point. code can be several things. Here are some ideas:
of course a random id or even a database row id
licence plate number/code if there is for a city
phone area code of the city or the code of the center
same logic may apply to zip codes
combination of latitude and longitude of the city center up to certain degree
Here are also more references that can be used:
ISO 3166 is a country codes. In there you can find codes for states or cities depending on the country.
As mentioned IATA has both Airport and City codes list but they are hard to obtain.
UN Location list is a good mention but it can be difficult to gather the levels of differentiation, like the airport code or city code or a borough code can be on the same list, but eventually the UN/LOCODE must be unique. (Airport codes are used for ICAO, similar to IATA but not the same)
there are several data sets out there like OpenTravelData or GeoNames that can be used for start but may require digging and converting. They provide unique codes for locations. And many others can be found.
Bonus:
I would suggest checking Schema.org's City Schema and other Place Schemas for a conscious setup.
Most of the larger cities have a table with climate data. I think Wikipedia calls them weatherbox.
Is there a way to retrieve these tables via the API?
For instance, to get the climate section for NYC I do:
https://en.wikipedia.org/w/api.php?action=parse&prop=wikitext&pageid=645042§ion=18&format=json
I get the text but not the actual table which is referred to as {{New York City weatherbox}}.
There seems to be another way to retrieve some weatherboxes but this isn't working for many cities.
This one works:
https://en.wikipedia.org/wiki/Template:New_York_City_weatherbox
but this one doesn't:
https://en.wikipedia.org/wiki/Template:Turin_weatherbox
Good day everyone,
Am using amadeus self-service for the first time, i wanted to know if it was possible to get list of airports by their country.
Thanks for the assist.
We do not have a specific API that retrieves airports in given countries. However, you could use our Airport Nearest Relevant API.
This API allows you to find all the airports around specific coordinates (latitude & longitude). You can query the API with the coordinates of the specific country (like the center) and play with the radius parameter (note that the maximum value is 500 kms). This will give you all the airports in this search radius. You can then filter the response by countryName to only retrieve airports in the given country. Of course depending on the size of the country you may need to do this process with multiple geocoordinates.
I do have in my project model 3 datasets showing stores (DS_SITE), cities (Cidades) and weather (DS_DADOS_CLIMA) like in the image below:
datasets
And I want to see the name of the store with it's respectively weather information, but when I try select the store name to the report, it's not permitted:
report
how
There is some way to show the weather with the store name in the same report? I've changed the model and the metric several times trying to do it, but it didn't work.
Here is the metric I used in the example above (DS_DC_TEMP_MAX = weather fact):
metric
The direction of the arrow between City and Weather is what's preventing you from slicing temperature by Store.
Are you're sure about it? (as modeled, each city can have multiple weathers, each weather belongs to at most one city)?
If the direction is correct (you're probably tracking history of weathers), you'll need to lift weather to city, see explicit lifting:
https://help.gooddata.com/display/doc/Explicit+Lifting.
If you don't need to track history, just reverse the direction of the arrow between city & weather and you should be able to slice temperature by store (show them side by side).
Hope that helps.
I am using Alteryx to extract weather data for a handful of cities and it works great. I'd like to expand this to able to download data for all weather stations in the UK. At the moment I am specifying which cities I want, e.g. London / Manchester.
Is there a way of specifying in the api call to download all stations in 'GB' or 'UK'?
Ideally I'd like to do this in one call rather than listing all locations which will be very laborious
Get a list of stations or cities that you want to retrieve weather data from. I found some good sources from openweather here: http://bulk.openweathermap.org/sample/
Then build a url request using the list of id's above that retrieves specific weather information. Using an id for the weather station in Cairns, id=2172797, the url ends up looking like:
http://api.openweathermap.org/data/2.5/weather?id=2172797&appid=843798874aac0ef138e6f77c72f3af80
Note that this url will return an error because this isn't a real appid. If you replace the appid with your own, this url will give you data for that station.
Putting this process into Alteryx lets you put the list of station id's together with the url and the appid to make many calls into openweather and then process all of the data together. I could not find information from the API on rate limits, so be conscious of how many requests you are posting to the service.
There is an example of this process here: https://www.dropbox.com/s/yoppbx3bw0p4rug/Get%20individual%20stations.yxzp?dl=0
Keep in mind that you have to update the Appid in the text input tool within this sample as well.