timezone-boundary-builder
timezones-api
Our great sponsors
timezone-boundary-builder | timezones-api | |
---|---|---|
7 | 2 | |
818 | 27 | |
- | - | |
8.0 | 0.0 | |
about 1 month ago | over 1 year ago | |
JavaScript | Python | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
timezone-boundary-builder
-
Falsehoods programmers believe about time zones
They don't really bother me. They aren't AI spam, and some folks may enjoy them. It's pretty easy to not click on a link, for me.
TZ are a fun project. I found that it's difficult to translate a long/lat into a TZ ID, so I wrote this[0].
Works a charm. It's based on the Timezone Boundary Builder[1].
[0] https://github.com/LittleGreenViper/LGV_TZ_Lookup
[1] https://github.com/evansiroky/timezone-boundary-builder
-
SpatiaLite: Library extending SQLite to support Spatial SQL capabilities
I wrote a tutorial on SpatiaLite here: https://datasette.io/tutorials/spatialite - "Building a location to time zone API with SpatiaLite"
It shows how to use SpatiaLite + Datasette to build an API that can tell you what timezone a latitude/longitude point is in, using data derived from OpenStreetMap via https://github.com/evansiroky/timezone-boundary-builder
Here's a demo: https://timezones.datasette.io/timezones/by_point?longitude=... - add ".json" to the URL for the JSON output.
- Does a country's legislated time zones extend to the limit of its territorial sea or its exclusive economic zone?
-
Falsehoods programmers believe about time
I have never had an opportunity to deploy this tool, but here's a program for generating a TZ shapefile from OpenStreetMap data:
https://github.com/evansiroky/timezone-boundary-builder
In principle a calendar program could use its output to perform GIS lookups of locations then use the tzinfo DB to get the correct timezone at the given location and specified time.
-
How can I get a user's timezone based on location and create a DateTime() based on that timezone?
You could ask google. Amazon or Microsoft probably offer similar APIs. Or you can do it yourself. It's a very complicated topic, though.
-
Big problems at the timezone database
There is a separate timezone boundary builder which maps geography to timezones using a shapefile, and the shapefile is >35MB uncompressed. By comparison the latest tzdata is 1.2M uncompressed.
- how do i konw the datum for a country? in postgis?
timezones-api
-
SpatiaLite: Library extending SQLite to support Spatial SQL capabilities
I wrote a tutorial on SpatiaLite here: https://datasette.io/tutorials/spatialite - "Building a location to time zone API with SpatiaLite"
It shows how to use SpatiaLite + Datasette to build an API that can tell you what timezone a latitude/longitude point is in, using data derived from OpenStreetMap via https://github.com/evansiroky/timezone-boundary-builder
Here's a demo: https://timezones.datasette.io/timezones/by_point?longitude=... - add ".json" to the URL for the JSON output.
-
SpatiaLite: A Spatial Extension to SQLite
It had been quite a while since a major release, but then SpatiaLite 5.0 came out a couple of months ago with some very significant new features - the K-Nearest-Neighbor stuff is particularly interesting. https://www.gaia-gis.it/fossil/libspatialite/wiki?name=5.0.0...
I've built a few fun demos using SpatiaLite and Datasette. Here's an API that tells you the timezone for a latitude longitude point:
https://timezones-api.datasette.io/timezones/by_point?longit... - implementation here: https://github.com/simonw/timezones-api
And here's the same thing for which US county a point is within: https://us-counties.datasette.io/counties/county_for_latitud... - implementation here: https://github.com/simonw/us-counties-datasette
I've also built an experimental Datasette plugin that lets you draw a shape on a Leaflet map to generate a GeoJSON polygon, then uses SpatiaLite to show you geometries that are contained by that drawn polygon. I wrote about that here: https://simonwillison.net/2021/Jan/24/drawing-shapes-spatial...
What are some alternatives?
geolocator - A utility for getting geo-location information via HTML5 and IP look-ups, geocoding, address look-ups, distance and durations, timezone information and more...
us-counties-datasette - A Datasette instance exposing names, FIPS codes and polygons of US counties
OpenRailwayMap - An OpenStreetMap-based project for creating a map of the world's railway infrastructure.
sqlite-utils - Python CLI utility and library for manipulating SQLite databases
openinframap - Open Infrastructure Map
js-joda - :clock2: Immutable date and time library for javascript
awesome-falsehood - 😱 Falsehoods Programmers Believe in