Canada and US GEO coordinates cities Lat and Long database table - geolocation

I'm working on a simple BI map chart using Metabase and I need to show the orders and customers by City.
I need to get one table,csv or Json file from Cities on Canada and US.
Example:
Example Canada Vancouver
Richmond LAT:49.17405764459043,LONG:-123.13465522094917
Vancouver LAT:49.28326571687911,LONG:-123.13001443031924
Burnaby LAT:49.24892902969132,LONG:-122.98271933450602
I need to create one table in Database and populate with our Latitude and Longitude.
I have for Provinces, but I need by Cities.
Unfortunately we don't Insert this information's in Customer SignUp or Orders.I need to create a table and Join by City.Name and get the Lat and Long to show in the chart.
Where Can I Find? Everybody know? I know the Google GeoCoordinates but I need one table with all informations.
Hi guys. I'm working on a simple BI chart using Metabase and I need to show the orders and customers by City.

Related

Imported data into Google Sheets, match and change one Column of Data

I have a google sheet that users input data on. These sheet has complete town names. Eventually the data they input gets uploaded into a program which has the town names abbreviated. Im looking for a way to automate basically doing find and replace.
Sheet1- Users input
Town
Data
Washington Town Center
123345
Washington Town Center
988765
Fairland Heights
12345
Sheet2 - Reference to the correct names for program.
User
Program
Washington Town Center
Washington Twn Ctr
Fairland Heights
Fair Heights
I basically need to replace the Town names in Sheet1 with the names the Program uses and then all data with that row. A new sheet worth of data is sent every week, so Im looking for the most efficient way to change those names.
I have tried using QUERY and FILTER but cannot seem to find the best way to go about this.QUERY would find all the matches and add as multiple rows as the user sheets can have multiple entries for same town
=QUERY('Sheet1'!A:G,"select * where A like '%"&A2&"%'",0)
you need VLOOKUP:
={INDEX(IFNA(VLOOKUP(Sheet1!A:A, Sheet2!A:B, 2, ))), Sheet1!B:G}

How to show list of records with order which displays nearby latitude and longitude data first in list

I am trying to order records of list to show nearby some latitude and longitude first and then display another remaining data in list, but can't achieve this because I have not much knowledge of order by query. If anyone can help it will be grateful to me. Thanks in advance.
I have one customer class on which I am trying to add order query like this:
customer = Customer.all
customer.where(state: "New york").order('within_radius(41.73061, 72.935242, 20000)' is first)
I want to show all records of newyork state but want to display near by results first in list. How can I do this. Can anyone guide me

Need to find border co-ordinates and near by cities, villages and towns

I am looking to plot the boundary region of current user and nearby villages and cities border. I am using ruby on rails.
For that I have downloaded a kml file from the site having the co-ordinate informations of all cities in japan. I have parsed the kml file and inserted it into database.
To find nearby cities I have used the logic 'Two boundary cities have same co-ordinate point'. But when I queried to find the nearby cities of a city I couldn't get all the nearby cities as in google.
So please suggest me a better way to do this.

Get a list of cities around a city with a given radius with google places api

I'm using google places api for autocomplete on a RoR project.
I want to get a list of cities around the typed city with a given radius.
For instance:
I type "Paris, France" in the input. I want to have a list (JSON or whatever) which contains all the cities around the city with a given radius (maybe 10 miles or more, it'll be a constant in the project).
How can I do that?
Thanks!
-EDIT-
I've end up with this:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=48.534031,2.632121999999981&language=fr&types=locality&sensor=false&rankby=distance&key=YOUR_KEY_HERE
The lat and lng must point to a town near Paris called "Le Mee sur Seine" (https://maps.google.fr/maps?hl=fr&q=48.534031,2.632121999999981).
I want to list the towns surrouding this city ordered by distance but I have "ZERO_RESULTS" as a result...
The type you're tying to filter on, "locality" is specifically listed as not supported. That is, Google will not let you specifically search for locality or a number of other political geo types. See the full list of unsupported types here: https://developers.google.com/places/documentation/supported_types#table2

Database or List of latitudes,longitudes and time zone for different cities in world

I need to create a mysql database for different cities in the world with following details
Longitude
Latitude
City
Time Zone
I have tried lots of search results and found Geolite
As the database contains nearly 400 thousand records, i am afraid to save those data in my database.Also time zone is not there with this list.
Is there any online API/XML to get the details by passing city name to get details or do i have to use the geolite data to saved in my database.
Thanks you.

Resources