Comments (17)
I checked the points manually. It looks like pytzwhere is not dealing with polygons within polygons correctly. Your results are indeed correct.
from pytzwhere.
Thanks for the info. As far as I remember that area of Arizona is a mess due to the Navajo Nation and the Hopi. I will check it out though :)
from pytzwhere.
I also think it is because of polygons within polygons. My algorithms is stopping when the point was found to be included in a polygon, too. I decided not to change my algorithm, because actually this is a mistake within the data and correcting it would make it ugly and slow.
from pytzwhere.
That makes sense. However, it is actually not a mistake in the data. It is legitimate for timezones to have timezones within them.
from pytzwhere.
Why? Then your data would suggest that this area is in two timezones... I don't think that makes sense.
from pytzwhere.
I should rephrase this for clarity. I didn't mean to say that a point would actually be in two polygons, but within the American/Denver timezone there is a part that is American/Phoenix. This video does a much better job at explaining it than I ever could.
from pytzwhere.
But still a timezone has to be unique and therefore the surrounding timezone would need to be excluded from the surrounded tz. Otherwise algorithms don't really have a chance of deciding which timezone it is (except hardcoding it) or am I wrong here?
from pytzwhere.
Polygons can't have holes in them. To ensure every coordinate was located within exactly one polygon would require changing the data to have a "seam" connecting the hole with the outer boundary. So it's just a matter of convention. We pull the data from http://efele.net/maps/tz/world/ and they follow one convention. The only solution here would be to reprocess the data to remove all layered polygons.
from pytzwhere.
The original data from Eric Muller does have holes though. I just checked.
from pytzwhere.
"Holes" as in the polygon defines both an outer and inner boundary?
from pytzwhere.
For me the ideal solution would be to convince them to correct the data (for me layered polygons are mistakes), but I don't know realistic this is.
By the way do you have a way of automatically creating your .csv from efele.net data?
I thought about that issue , but I just decided to leave it that way for now. There are just a few points where this matters and the effort for fixing this seemed to big.
from pytzwhere.
Yes a "hole" as in having an outer and inner boundary
from pytzwhere.
I remember running into issues with "holes" when initially working on this project. I can dig in next week to see if I can figure it out
from pytzwhere.
@MrMinimal64 I wrote a very short shell script that converts Eric Muller's shapefiles into a GEOjson.
@pegler Maybe it makes sense to use the multi-polygon timezone data? I used the polygon one so far but this discussion makes me wonder if we shouldn't use the other.
from pytzwhere.
I think I know how to fix this. I am working on it.
from pytzwhere.
This should now be fixed in the development branch. The development branch now correctly deals with holes. There are a few other little things I would like to add to that branch before we can release it but for testing timezonefinder
it should already be sufficient
from pytzwhere.
@cstich @pegler hi guys, is there any new progress on this?
from pytzwhere.
Related Issues (20)
- Upload 2.3 to pypi? HOT 3
- forceTZ returning unexpected result HOT 5
- all of China should be +0800, but some are showing up as +0600 HOT 5
- tzNameAt bombs with a KeyError on certain latitudes / longitudes HOT 1
- Outdated data HOT 1
- `tz_world_shortcuts.json` is missing from setup.py HOT 8
- package_data are not installed when installing pytzwhere with pip in a venv HOT 5
- tz_world.json.gz does not exits HOT 1
- What happened to tzOffsetAt?
- can't insatll pytzwhere on Win 10
- Add tests to PyPI source tarball? HOT 1
- With latest numpy update, generates an error on initialization HOT 7
- No timezone for Dubai HOT 1
- how to return this format as "GMT +9" or "GMT -5"οΌThx
- VisibleDeprecationWarning HOT 1
- ValueError due to shapely update HOT 5
- ModuleNotFoundError: No module named 'shapely.lib' HOT 2
- Constructor fails with value error
- Is this project still maintained?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytzwhere.