Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tibetan cities display on China's city map #12103

Merged
merged 2 commits into from Mar 12, 2018

Conversation

fengkaijia
Copy link
Contributor

@fengkaijia fengkaijia commented Sep 22, 2017

#11930 only changed country and region level archive data. This PR remaps the city data so Tibetan cities are correctly displayed. Before the patch, no visits from Tibetan city is on the city level map (but visits from Tibet can be seen on the region level map).

image

Above is a screenshot on my server after applying the patch (Lhasa is now on the map).

@sgiehl sgiehl added this to the 3.1.2 milestone Sep 22, 2017
@sgiehl
Copy link
Member

sgiehl commented Sep 22, 2017

I'm wondering if those 8 cities are the only cities that geoip is able to detect for Tibet.

@fengkaijia
Copy link
Contributor Author

@sgiehl Yes you made the right guess. I used the CSV database from http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity-latest.tar.xz and run a grep, but somehow a binary character made grep stopped at the 8th record. I just tried to open the CSV in Excel and got like 50 more records. Let me figure out how to do this. Are there any getRowFromLabelEndWith alike method available?

@fengkaijia fengkaijia changed the title Fix Tibetan cities display on China's city map [WIP] Fix Tibetan cities display on China's city map Sep 22, 2017
@fengkaijia
Copy link
Contributor Author

@sgiehl Do you think it's OK to add a get-the-protected-rowsIndexByLabel method to DataTable? I guess otherwise we will just do the GroupBy every time without checking the IF condition.

@sgiehl
Copy link
Member

sgiehl commented Sep 22, 2017

Are there any getRowFromLabelEndWith alike method available?

No there isn't. Guess we should add the GroupBy filter always, without checking if it's needed. Even with having rowsIndexByLabel public we would need to iterate over all items in order to check if one ends with ti

@fengkaijia fengkaijia changed the title [WIP] Fix Tibetan cities display on China's city map Fix Tibetan cities display on China's city map Sep 22, 2017
@fengkaijia
Copy link
Contributor Author

Added a new patch, again have tested to be working on my server.

I'm not sure what the GroupBy does. If it's costly then I guess it's still better to run an checking iteration. We can avoid doing the GroupBy in most cases since there are not many Internet users (or simply a large population) in Tibet (I myself run a Chinese tech blog and got less than 50 visits from Tibet in 4 years).

@sgiehl
Copy link
Member

sgiehl commented Sep 22, 2017

@fengkaijia
Copy link
Contributor Author

Well, to me, it does seem worth it to run a pre-check on rowsIndexByLabel. What do you think?

@mattab mattab modified the milestones: 3.1.2, 3.2.0 Sep 25, 2017
@sgiehl
Copy link
Member

sgiehl commented Sep 26, 2017

Well, to me, it does seem worth it to run a pre-check on rowsIndexByLabel. What do you think?

I agree, but we should avoid to make rowsIndexByLabel public accessible.

@fengkaijia
Copy link
Contributor Author

Yes, fair point. I guess then we don't need to change the PR since adding getRowFromLabelStartsWith and getRowFromLabelEndsWith to DataTable is too redundant, while a getRowFromLabelRegex also cost performance.

@mattab mattab removed this from the 3.3.0 milestone Dec 14, 2017
@fengkaijia
Copy link
Contributor Author

Happy new year. Just had a quick follow-up: why is this out of 3.3 milestone?

@mattab mattab added this to the 3.4.0 milestone Jan 2, 2018
@mattab
Copy link
Member

mattab commented Jan 2, 2018

Happy new year. moved it back to 3.4 milestone

@sgiehl sgiehl merged commit d400318 into matomo-org:3.x-dev Mar 12, 2018
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
* Fix Tibetan cities missing from the Chinese city map

* Apply the filter without checking every city
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants