Non-USA zip code radius lookup - zipcode

I am coding a store locator page and part of the search is to be able to enter a zip code and a mile radius and do a search. I have been able to find a free source to download a csv of all USA based zip codes and their related longitude and latitude. However does anyone know where to find a CSV of Non USA based postal codes and their related longitude and latitude?
I am looking for a free download/website where I can download a csv of all non USA zipcodes and their related lon and lat. not a saas company to use.

You should google around before you ask.
http://www.geopostcodes.com

Related

How to split a full address to city, zip code in tableau

I am using tableau's paid version. I have a lat, lon for an address and the full address it self. I want to display a map view with the ability to drill down to state and zip code code level. I cannot create a hierarchy as the state and zip code fields are not available separately. Any clue how to move forward.
If your full address is just one big text field, you have to split it into separate feilds first and then build a hierarchy. Depending on the quality of your data you can either do it outside Tableau in your original datasource or use calculated fields.

Alexa skills custom slot for date times

So, I'm working a project with the Amazon Echo. My goal is to record when I did a specific action and to record it into a DB. My issue is timezones, and I avoid this by using epoch time. However, from what I can tell of custom slots for an intent, my choices are formatted date strings with no time, or formatted time strings with no dates, and on top of all of that, I have no way of grabbing the client's timezone without specifically asking for it based on some forum posts I found with my google fu.
Does the echo just hate dates? This seems like something that should be really easy, but I'm struggling to figure out how to go about it without being really awkward and asking where they live so I can do a lookup of their timezone. I already had to make a pivot from telling them the specific time they did something to how long ago they did something because I can't pass dates back to the Echo and expect it to translate it. Is this another silly pivot I have to make?
Correct, you cannot get the client's TZ or location from Alexa. It's a privacy issue. The only way is to ask for it yourself.
There is a custom slot for "five digit number" which is perfect for ZIP code. That is the simplest way to get a user's approximate location.
If you want to get more inventive, since the Echo is (pretty much) only used in America, you only have to narrow it down to one of four time zones. (At the expense of Alaska, Hawaii and Arizona for half the year.) You could just ask which timezone they are in, which is less intrusive.
Or, if you want to get creative, make a joke out of it.
A: "Pop quiz: Are you in Eastern Standard time?"
U: "No"
A: "Drat. Let me guess again. You seem like a Mountain Time person."
...
Yes. It is an irritating limitation. But if you can find a novel way to work around it your skill will be more endearing.
It looks like you cannot (yet) detect the user's timezone, but you should still be able to achieve your goals. A few thoughts:
You could just make the system ignorant of timezones altogether. Each user may have a different timezone, but all times for a particular user will be in the same timezone so any duration calculations will work fine.
There is no DATETIME slot type, so you need to handle each slot separately as AMAZON.DATE and AMAZON.TIME. e.g. "Mark completion on {DATE} at {TIME}"
Also, if you are real-world marking completion datetime, can you just generate the timestamp inside your code, rather than making them say it?
Requesting Zip could be a quick way to set timezone, if necessary.
Hacky: If you use Account Linking you may be able to detect their timezone from the client-side on your login page.
Converting between server timetamp and spoken times in the user's timezone will be problematic, but perhaps you can work around it until amazon includes timezone data.
There is a way to find the user's timezone from country code and postal code which Amazon provides. You just need to enable the permission in the developer's console.
After that, whenever you receive a request from Alexa voice service, you will get a consent token. Which indicates that the user has given the permission.
You can then get the timezone of the user by querying Google API. The python code for the same is mentioned below.
# to get the country code and postal code of user
res = requests.get('{0}/v1/devices/{1}/settings/address/countryAndPostalCode'.format(context.System.apiEndpoint, context.System.device.deviceId),
headers = {'Authorization':'Bearer {}'.format(context.System.apiAccessToken)}).json()
postCode = res['postalCode']
countryCode = res['countryCode']
# key specific to the user
apiAccessKey = 'your-api-key'
# Google Geocoding API: provides latitude and longitude from country code and postal code
res = requests.get('https://maps.googleapis.com/maps/api/geocode/json?address={0},{1}&key={2}'
.format(countryCode, postCode, apiAccessKey)).json()
lat = res['results'][0]['geometry']['location']['lat']
lng = res['results'][0]['geometry']['location']['lng']
# Google's Time Zone API: provides timezone from latitude and longitude.
res = requests.get('https://maps.googleapis.com/maps/api/timezone/json?location={0},{1}&timestamp={2}&key={3}'
.format(lat, lng, datetime.datetime.timestamp(datetime.datetime.now()),apiAccessKey)).json()
timezone = res['timeZoneId']

Creating POI on the routes in SUMO

Is it possible to make POIs on the routes of SUMO automatically?
I want to have the locations of Base stations along the routes that cars or pedestrians move. I have manhattan.net.xml and manhattan.rou.xml as network file and route file in SUMO. I want to create the POI file that has POIs along side the routes with some distance from street.
Is it possible to create this POI file automatically?
Thanks.
No, it is not possible to generate this directly from sumo or the sumo-gui.
If you are willing to write a small python script however, you get a lot of support functions in the tools directory of your sumo installation. There is even a script which does almost what you want: tools/route/tracegenerator.py. This one generates points along the route. You will have to add the offset and adapt the output format to generate POIs. Maybe write to the mailing list for more help: http://sumo.dlr.de/wiki/Contact

Convert Timespan data from CSV to KML

Working with GoogleEarth, I am able to import CSV data that contains long, lat, name, etc., but I am unable to get Google Earth Pro to recognize timespan (begin, end) information.
I found an online App called EarthPoint, that allows me to convert a CSV file into KML that includes the timespan data, but that app is limited in its ability to recognize additional fields. Thus, I am unable to apply style templates to the EarthPoint imported data, as there is nothing for Google Earth to latch onto.
So I am looking for either a different app, that imports all three (geo, time, description), from either CSV, or straight from a spreadsheet app like Excel.
And barring the existence of such an app, I would simply like to know if there is a way to specify the headers so that Google Earth will reecognize the time series data for what it is.

Find timezone from airport code using perl code

As I am right now working on blocking the particular flight to display if the departing time is with in 3 hours of booking time. As, I need to get the timezone of the departing airport to convert it to GMT and thus get the proper difference between the time of booking and departing time of flight. I have searched for many CPAN modules to do the mapping between the airport code and the timezone but I didn't get any proper solution.It will be great if anybody will helpful to me in finding some good solution to it.
I don't know if you will find a CPAN module, but perhaps you can make a converter yourself - it should be simple enough with a small database table mapping airport codes to timezones.
I found the following link containing a CSV file of over 5,000 airport codes and their timezone relative to UTC.
http://openflights.org/data.html
You can import the CSV from that link into your own database and then have your code work around the timezones and airports in that table.