evansiroky / timezone-boundary-builder Goto Github PK
View Code? Open in Web Editor NEWA tool to extract data from Open Street Map (OSM) to build the boundaries of the world's timezones.
License: MIT License
A tool to extract data from Open Street Map (OSM) to build the boundaries of the world's timezones.
License: MIT License
Add new zones:
IMO it would be nice to add newline characters to the .json (after every tz or even polygon).
I am trying to parse it with python atm and with the file just having one line this is way more complicated.
With 120MB a few more characters wouldn't hurt I think. Or are there any cases where having just one line is helpful?
Just as an example (see image below), Asia/Baku (pink) is in GMT+4 while the timezone covering the adjacent Caspian Sea (green) shows Etc/GMT-3. I think the signs for water areas must be reversed to positive (+) in easterly direction and negative (-) the way around in order to comply with other (land) time zones.
Hey,
thanks for your great work!
I found a small issue in the shp release with oceans: The tzid's of two polygons in Greenland are switched: America/Danmarkshavn and America/Scoresbysund. America/Danmarkshavn should be the more northern one.
Greetings
From my reading of Xinjiang Time, it seems to me that Asia/Shanghai
and Asia/Urumqi
should overlap, since both time zones are in use in Xinjiang.
I'm guessing this is a deliberate choice, but maybe there should be some alias zone created for Asia/Shanghai
that includes the entire zone?
Hi, would it be possible to update to 2018c any time soon?
I happened to notice that the polygons for Africa/Johannesburg contain an odd vertical slice of Antarctica. I doubt that's intentional, but I could be mistaken.
Thanks for compiling this data, it has been really useful.
I am using it on a project written in Golang, the source of the timezone lookup API is at: https://github.com/evanoberholster/timezoneLookup
Feel free to add it to the list of libraries if it will be useful.
Cheers!
Add new zone for Asia/Famagusta
2017b
is just released!
Announcement - http://mm.icann.org/pipermail/tz-announce/2017-March/000046.html
I guess, only Haiti change is required now?!
Is it possible?
I was hoping to build this into a Gradle plugin to automate downloading timezone data into an Android app (along with another library to convert to Java) but ran into an error running the script per instructions in readme:
getting data for Argentina
downloading from overpass
waiting 4 seconds
Success, decreasing overpass request gap
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
combining border
error converting geojson to geometry
error converting overpass result to geojson
n {}
/Users/phil/.../timezone-boundary-builder/index.js:210
throw e
^
[object Object]
The borders in OSM in this area have changed again and the boundary building process needs to be fixed. This should be the last blocking issue before 2018d is released.
there's PYT โ KST change for North Korea
One of my users pointed out that my library is returning Asia/Rangoon
instead of Asia/Yangon
for locations in Myanmar. mattjohnsonpint/GeoTimeZone#28
This appears to stem from the data in the timezones.json
file here.
Could you please check that the time zone ids are all canoncialized to the current Zone
entries instead of Link
entries?
Thanks.
The website at http://efele.net/maps/tz/ says that the maps there are no longer maintained and directs visitors to this project as an alternative.
I think that the section of the README "How is this different from the shapefile over at efele.net?" should either be removed, since it is no longer so relevant, or a note should be added that the other project says to use this one.
There's been a report at https://github.com/darkskyapp/tz-lookup/issues/7 that the town of Page, AZ is resolving to America/Denver
when it should be America/Phoenix
.
As of right now, it appears that the area around Page, AZ relies on data that was imported into OpenStreetMap from the efele.net shapefile. The shaded area is America/Phoenix.
I've read a few online articles here and there that suggest that Page, AZ and surrounding areas should be in America/Phoenix. So, I'm creating this issue to try and figure out the best way to draw the boundaries in Northeastern Arizona. Shown below are the current boundaries:
All of the shaded area is America/Phoenix
and the unshaded is America/Denver
. In OSM, the boundary appears to be an import of the efele.net shapefile outlining the boundary of the Navajo Nation enclaving the Hopi Reservation. Unfortunately, I'm not sure if an OSM relation exists for either the Navajo Nation or Hopi Reservation.
Hi,
is there a way to merge with timezones on water? Die Oceans are covered with timezone stripes aswell and i'd need them.
Flo
I am getting an error when processing data for France (all preceding regions consistently work as expected). The error is repeatable when resuming the script. If I delete other regions generated json files (in downloads directory) and resume the script the deleted regions are correctly generated and the script fails on France again.
getting data for France
downloading from overpass
waiting 4 seconds
Success, decreasing overpass request gap
/Users/eric_hansen/dev/timezone-boundary-builder/node_modules/jsts/dist/jsts.min.js:17
if(null!==t._sym||null!==e._sym||null!==t._next||null!==e._next)throw new IllegalStateException("Edges are already initialized");return t.init(e),t},Li.create=function(t,e){var n=new Li(t),i=new Li(e);return n.init(i),n},ro(wi,Li),io(wi.prototype,{mark:function(){this._isMarked=!0},setMark:function(t){this._isMarked=t},isMarked:function(){return this._isMarked},interfaces_:function(){return[]},getClass:function(){return wi}}),wi.setMarkBoth=function(t,e){t.setMark(e),t.sym().setMark(e)},wi.isMarked=function(t){return t.isMarked()},wi.setMark=function(t,e){t.setMark(e)},wi.markBoth=function(t){t.mark(),t.sym().mark()},wi.mark=function(t){t.mark()},io(Ri.prototype,{insert:function(t,e,n){var i=this.create(t,e);null!==n?n.insert(i):this.vertexMap.put(t,i);var r=this.vertexMap.get(e);return null!==r?r.insert(i.sym()):this.vertexMap.put(e,i.sym()),i},create:function(t,e){var n=this.createEdge(t),i=this.createEdge(e);return Li.
TypeError: Cannot read property 'getGeometryType' of undefined
at Fi.write (/Users/eric_hansen/dev/timezone-boundary-builder/node_modules/jsts/dist/jsts.min.js:17:10307)
at qi.write (/Users/eric_hansen/dev/timezone-boundary-builder/node_modules/jsts/dist/jsts.min.js:17:13980)
at geomToGeoJsonString (/Users/eric_hansen/dev/timezone-boundary-builder/index.js:110:39)
at asynclib.auto.saveSingleMultiPolygon (/Users/eric_hansen/dev/timezone-boundary-builder/index.js:187:38)
at runTask (/Users/eric_hansen/dev/timezone-boundary-builder/node_modules/async/dist/async.js:1619:13)
at /Users/eric_hansen/dev/timezone-boundary-builder/node_modules/async/dist/async.js:1559:13
at processQueue (/Users/eric_hansen/dev/timezone-boundary-builder/node_modules/async/dist/async.js:1569:13)
at taskComplete (/Users/eric_hansen/dev/timezone-boundary-builder/node_modules/async/dist/async.js:1588:9)
at /Users/eric_hansen/dev/timezone-boundary-builder/node_modules/async/dist/async.js:1612:17
at /Users/eric_hansen/dev/timezone-boundary-builder/node_modules/async/dist/async.js:906:16
How is osmBoundarySources.json
generated, is it done by hand?
Great project - thanks!
Hi Evan,
I think your rendering of the time zone maps would fit better than the older image of the tz_world data shown on Wikipedia here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Would you either please grant permission to release the rendered image under one of the Creative Commons licenses accepted on Wikimedia Commons, or perhaps just upload it there yourself?
Thanks a lot.
-Matt
Those overlap are not necessary. These islands are disputed, but they are just being disputed in the same way as the entire territory of Taiwan is being disputed.
node --max-old-space-size=8192 index.js
....[some expected output]...
getting data for Atikokan-tz
downloading from overpass
waiting 4 seconds
Success, decreasing overpass request gap
combining border
error converting geojson to geometry
error converting overpass result to geojson
/timezone-boundary-builder/index.js:202
throw e
^
[object Object]
Enviroment:
Windows 10
node --version
v6.9.4
EDIT: File: debug_geojson_read_error.json contains a Polygon representing the border of Atikokan timezone
These will be made with manually created polygons using this Wikipedia article as a reference.
Hi there,
When opening the shapefile in Google Earth v7.3.3832 and selecting any timezone area, GE normally navigates to that area showing tzid under the left-side 'Places' window. But this is only partially true for Asia/Krasnoyarsk - in fact, only a group of island polygons are visible/selectable while the rest of the Krasnoyarsk Krai remains in focus but without any noticeable polygon boundaries. No navigation is possible. I wonder if the issue is somehow related to unclosed polygon?
EDIT: I have the same issue with continental Chile (America/Santiago) except a group of Pacific islands lying westwards the country.
See the image: https://i.imgur.com/EJaYdLE.jpg
Thanks!
The bounding box for Pacific/Auckland seems to be incorrect:
-29.03033,-179.059153
-29.03033,179.364359
-52.821369,179.364359
-52.821369,-179.059153
-29.03033,-179.059153
The calculations used to create America/Argentina/Rio_Gallegos
incorrectly assume that the border to America/Argentina/Catamarca
is always along the 46ยฐ S latitude when in fact it is not although the difference is very small. Therefore, there is actually very small gap in certain areas and very small overlap in others.
See https://github.com/darkskyapp/tz-lookup/issues/14
Mexico Beach, FL is in the Central timezone, but tz-lookup incorrectly returns America/New_York:
tz(29.941389, -85.406389)
'America/New_York'
The readme states:
The script has only been verified to run with Node.js 6 on the MacOS platform
Is this still true? Node has evolved considerably. I don't expect folks running the script would want to downgrade. Node 6 (Boron) is still in "Maintenance LTS" status, but not for much longer.
Thanks.
First of all, let me say THANK YOU very much for creating this! This seems like a much more viable and accurate option than efele.net maps. In particular, I love that you've included territorial waters, as this eliminates all the complex shoreline data in Alaska and Canada (for example).
However, I'm curious if something more can be done in defining territorial waters better for island chains? For example, the waters in the Hawaiian Islands are all probably in the Pacific/Honolulu
time zone, but since the territorial waters are drawn around the individual islands, only the areas where the boundaries overlap are merged. There's a small gap between Maui and Hawaii and a larger gap between Oahu and Kauai that should also be considered part of these waters, IMHO.
Same goes for Micronesia, Marshall Islands, and many other places.
Any thoughts on how to reconcile this without manually drawing polygons? I really like the approach of using OpenStreetMaps as a primary source.
i want to find a way to produce the geojson file from your shapefile.
but i find that ,the tool from the web or ogr2ogr can not produce the same content compared with your shapfile.geojson.zip released on the web.
EG:
The geojson i produced (the same shapefile) :
{ "tzid": "Africa/Abidjan" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -5.440683, 4.896553 ], [ -5.555659, 4.882248 ]...
-- WGS84
different with your data
{"tzid":"Africa/Abidjan"},"geometry":{"type":"Polygon","coordinates":[[[-5.440683,4.896553],[-5.303699,4.912035]
Can you tell me which way you used to produce the geojson file
Thanks.
For some applications it might not be feasible to have a 120MB .json file as data basis.
With certain simplifications and tricks it should theoretically be possible to compress the data to around 7MB (cf. timezonefinderL data, consisting of simplified tz_world data).
Without trying to go into those extremes the question is how reduce data size while still keeping an acceptable level of accuracy.
@evansiroky do you have any plan to releases? I need some fixes from master and I am interesting should wait release from you or build release by myself.
Hello,
I noticed that there is a hole at 89.0714, 27.5442 for the 2018d release of timezones.shapefile.zip vs timezones-with-oceans.shapefile.zip. I assume that this is a disputed area based on some comments on openstreetmap.org; however, the hole exists in the timezones.shapefile.zip file but not the timezones-with-oceans.shapefile.zip file.
area at 89.0714, 27.5442 for timezones-with-oceans.shapefile.zip
Hey ,
Thank you for the amazing project, and we will have a maintained timezone service.
Just have a small question:
Is that possible to have timezone Abbreviation Name and code, like EST, Eastern Standard Time.
Thanks
I Try to download the Time zone datasheet,but it shows the log;
waiting 4 seconds
{ message: 'Request failed: HTTP 400', statusCode: 400 }
Increasing overpass request gap
waiting 8 seconds
{ message: 'Request failed: HTTP 400', statusCode: 400 }
Increasing overpass request gap
waiting 16 seconds
{ message: 'Request failed: HTTP 400', statusCode: 400 }
Increasing overpass request gap
waiting 32 seconds
{ message: 'Request failed: HTTP 400', statusCode: 400 }
Increasing overpass request gap
waiting 64 seconds
{ message: 'Request failed: HTTP 400', statusCode: 400 }
Increasing overpass request gap
waiting 128 seconds
{ message: 'Request failed: HTTP 400', statusCode: 400 }
Increasing overpass request gap
waiting 256 seconds
I can't generate shape file because of validation errors.
load zones into memory
do validation
Validation error: America/Argentina/Rio_Gallegos intersects America/Punta_Arenas area: 0.08795638367089173
Validation error: Asia/Chita intersects Asia/Shanghai area: 0.0007959703837724789
Validation error: Asia/Manila intersects Asia/Shanghai area: 0.21316446632400018
Validation error: Asia/Ust-Nera intersects Asia/Yakutsk area: 2.9578565029596997
Validation error: Europe/Ljubljana intersects Europe/Zagreb area: 0.005178844060499668
done
error! Zone validation unsuccessful
See https://www.haaretz.com/israel-news/.premium-israel-moves-clock-but-palestinians-dont-1.5453010 it seems like their usage overlap in more places than just Jerusalem. I think there were also some mail in tz database mailing list that talked about it.
Topic include:
Firstly, this is great! I've been trying to figure out how to get territorial waters into the efele data set for a while, now I don't have to!
I downloaded the 2017a release, and I have some issues with the geoJson version of the data.
It looks like Africa/Lubumbashi has one negative polygon with only 4 points (3 if you don't count the dupe at the end), it also looks like it's area is 0. Also, the points go beyond 6 significant digits. Here is the json w/ a most of the points of the positive area removed for readability :
{
"type" : "Feature",
"properties" : {
"tzid" : "Africa/Lubumbashi"
},
"geometry" : {
"type" : "Polygon",
"coordinates" : [ [ [ 23.8940358, 4.8313928 ], .... a ton of points removed .... [ 23.8940358, 4.8313928 ] ], [ [ 24.4123887, -1.7179482 ], [ 24.440029068012333, -1.735314196891881 ], [ 24.440029068012333, -1.7353141968918806 ], [ 24.4123887, -1.7179482 ] ] ]
}
}
Hi,
I only need a timezone extract subset (just Europe)
I modify timezone.json and remove all timezones I don't need
is it the good solution ?
The ocean time zones, i.e. the ones named like ETC/Gmt+X
or ETC/Gmt-X
, seem to be inverted. That is, to the east of Greenwich the ETC/Gmt-X
is used, whereas it must be ETC/Gmt+X
. For more detailed and visual illustration of what I mean, see this issue: RomanIakovlev/timeshape#4 (comment). This is consistent in both shape files and geojson releases.
Thanks for your projet
I try to execute your script like recommanded in the doc
node --max-old-space-size=8192 index.js
but I got this error at validation step
validating zones
load zones into memory
do validation
Validation error: America/Argentina/Rio_Gallegos intersects America/Punta_Arenas area: 0.2113007296132473
Validation error: America/Argentina/Rio_Gallegos intersects America/Santiago area: 0.4102222149999935
Encountered TopologyException, retry with GeometryPrecisionReducer
Validation error: America/Punta_Arenas intersects America/Santiago area: 0.21130072961324728
I'm doing something wrong ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.