I have list of more than 10,000 cities , I need to find out corresponding state and country of this city. If any built in service or any web services is available for this ,please let me know .
Your help will be appreciated.
Thank you in Advance.
Maybe this free database can help you:
http://www.maxmind.com/en/worldcities
Includes the following fields:
- Country Code
- ASCII City Name
- City Name
- Region
- Population
- Latitude
- Longitude
If you need the states, you can use the database from here: http://download.geonames.org/export/dump/ (the file cities1000.zip has a LOT of cities)
Related
So if I have three users: Tom, Dick, and Harry, and they have been assigned group colors. I'd like them to be able to see everyone's data in their own group.
Name Group Email
----- ----- -----
Tom Green t#acme.com
Dick Red d#acme.com
Harry Red h#acme.com
So I create a measure
RLS_SecurityKey = CALCULATE(FIRSTNONBLANK(People[Group],People[Group]),
USERPRINCIPALNAME() = People[Email])
And when I log in as the separate users, I can see in a card visual that I'm getting the expected group.
But when I set row level security on the People table, [Group] = [RLS_SecurityKey], I only get back the one row that matches the email address and not the user that matches his Group.
It seems I'm missing something fairly apparent, but I can't see it. How can I get back all the rows relating to Group and not the email?
Yep, it was pretty straight forward.
RLS_SecurityKey = CALCULATE(FIRSTNONBLANK(People[Group],People[Group]),
FILTER(ALL('PEOPLE'),USERPRINCIPALNAME() = People[Email]))
I adjusted the filter expression and made it a proper filter over the whole table.
Im trying to show provinces and then drill down to show cities in powerbi map (Aug, 2018 version).
My problem is it does show provinces but when I drill down to get a look at cities, it doesnt show anything.
I also changed column "city" to "place", but nothing happened.
(Note: they are Iran's province/cities, maybe this problem is related to that. because when I change for example my city "Kāshān" from province of "Isfahan" to "Redcar" or "London" it loads nicely on these two cities)
So, what is the solution?
Thanks a lot in advance.
Create a new column called "Location" or "Place" by merging the City and Province columns. You can use a comma (,) as a separator. For example - "Alabama, USA".
Then change the category of the new column to Place. This will solve your issue. The map will be plotted correctly.
I have a lot of small towns (<15.000 population) from Germany in my data set, so Tableau (Desktop 10.3 Pro Version) has no geographical coordinates for them.
For this reason I made a .csv file (CustomGeo.csv is attached) with the following rows: Country (Name), State/Province, City, Latitude, Longitude. Also I created a schema.ini with the following content:
[CustomGeo.csv]
ColNameHeader=True
DecimalSymbol=,
Format=Delimited(;)
Col1="Country (Name)" Text
Col2="State/Province" Text
Col3="City" Text
Col4="Latitude" Double
Col5="Longitude" Double
Now, after I imported the csv file into Tableau (Map -> Geocoding -> Import Custom Gecoding), I have more than 600 ambiguous cities and I don't understand why. There are big cities like Stuttgart and München which are tagged as ambiguous. Bigger cities in Germany can have more than one Postcode (PLZ).
The possibility to select the field State/Province under Edit Locations and State/Province does not change anything.
Here you can download the csv file and my data set with for geocoding important columns [hosted on google drive]:
Custom Geocoding csv
Data set
Be careful if you want to open the csv file with Excel. Excel could change the column format so the latitude and longitude data could be fucked up :)
I hope anyone can help me with that problem. I do not know how to continue.
I have the solution:
If you use the column names (Country (Name), State/Province, City, Latitude, Longitude) then you will extend an existing role. For bigger cities (>15000 population) Tableau has geo data. So if you extend the existing role with all cities in Germany you will have the bigger cities as well in your custom geocoding file. Because of that, the error with ambiguous cities will show up and bigger cities like München (Munich) or Stuttgart can not be displayed on the map.
Please suggest a way to add an extra Region /State in checkout which is not there in Opencart default .
You can add region for any country from admin panel also.
settings->localisation->zone
The region/states are in the oc_zone table. You can add extra entries into this table but make sure you get the right country code and put that into the record too.
The country codes are in the oc_country table.
So, for example, if you wanted to add a new Region called "The People's Republic of Cleckheaton" to the United Kingdom, first look up the country code for the United Kingdom in oc_country. The code is 222.
Then you can add the new zone to oc_zone with something like the following:
INSERT INTO `oc_zone` (`zone_id`, `country_id`, `name`, `code`, `status`) VALUES (NULL, '222', 'The Peoples Republic of Cleckheaton', 'PRC', '1');
Finally there's another slight issue. Opencart actually caches all the country and zone data so if you add a new field like this it probably won't show up because the old data will be cached.
You should probably be able to fix this by clearing your browser's cache but failing that update the following line in \catalog\model\localisation\zone.php Warning: This is in opencart 1.5.6 but should be similar in 2.0
$zone_data = $this->cache->get('zone.' . (int)$country_id);
to
zone_data = false;
Once you've confirmed it's working ok update that line back to it's original content.
At present the tax seems to display based on the location of the logged in customer.
This can't work for me for 2 reasons. I have an extension that auto displays the currency based on the customers ip plus there is no option for logging in, it's guest checkout only.
So I really need it to display the correct price based on the currency displayed instead.
Does anyone have any idea where the code is for this please or how to adjust the displayed price properly?
Any help is greatly appreciated.
Thanks
-James
I guess You should extend the extension You are using for displaying of currency based on IP address.
Find the line of code where the currency based on user's IP address is populated and call this:
$this->currency->set($currency_code);
where $currency_code should be a 3 character currency ISO code (e.g. USD, EUR, etc) of currency set in the administration.
This way You set the currency to use for price calculation - and that reflects the currency based on user's IP address. This currency code is then saved to session and cookie so it should work on any page within OpenCart frontend.
I think so
Returns 3-character ISO 4217 currency code for the currently set currency.
// Return when Pound Sterling is the set currency
$currency_code = $this->currency->getCode();
var_dump($currency_code); // string 'GBP' (length=3)
also you can
$this->currency->set($currency_code);
and please find currency file https://github.com/opencart/opencart/blob/master/upload/system/library/currency.php
Thanks
I think I have found the correct way to do this: Go to file system/library/tax.php.
Line 27:
if(!$reg){
if($currentCurrency == "CHF"){
$country_id = 204;
}else if($currentCurrency == "EUR"){
$country_id = 81;
}
}
This will set the country the user is in according to the selected currency and will set the country for tax calculation.