{"id":17280968,"url":"https://github.com/bjlittle/docker-s2geometry","last_synced_at":"2025-04-14T09:42:00.813Z","repository":{"id":41422587,"uuid":"239975652","full_name":"bjlittle/docker-s2geometry","owner":"bjlittle","description":"Dockerfile for ubuntu:bionic image containing google/s2geometry and SciTools/cartopy.","archived":false,"fork":false,"pushed_at":"2020-02-19T08:23:17.000Z","size":2571,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T23:02:19.925Z","etag":null,"topics":["conda","docker-image","python-bindings","spatial-index"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bjlittle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-12T09:39:16.000Z","updated_at":"2024-06-13T06:11:38.000Z","dependencies_parsed_at":"2022-09-07T18:31:29.160Z","dependency_job_id":null,"html_url":"https://github.com/bjlittle/docker-s2geometry","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjlittle%2Fdocker-s2geometry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjlittle%2Fdocker-s2geometry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjlittle%2Fdocker-s2geometry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjlittle%2Fdocker-s2geometry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjlittle","download_url":"https://codeload.github.com/bjlittle/docker-s2geometry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855960,"owners_count":21172673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conda","docker-image","python-bindings","spatial-index"],"created_at":"2024-10-15T09:22:38.312Z","updated_at":"2025-04-14T09:42:00.782Z","avatar_url":"https://github.com/bjlittle.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://s2geometry.io/\" style=\"display: block; margin: 0 auto;\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/bjlittle/docker-s2geometry/master/s2geometry.gif\"\n        style=\"max-width: 10%;\" alt=\"s2geometry\"\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n# docker-s2geometry\n\n[![Build Status](https://api.cirrus-ci.com/github/bjlittle/docker-s2geometry.svg)](https://cirrus-ci.com/bjlittle/docker-s2geometry)\n\nThis repository contains a recipe for building a Docker `ubuntu:bionic` base image with layers containing the `Python3.6` SWIG bindings for [google/s2geometry](https://github.com/google/s2geometry), and [SciTools/cartopy](https://github.com/SciTools/cartopy).\n\nBy default, the recipe configures an [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) to stand-up a [jupyter notebook](https://jupyter.org/) in the running container and will expose the service over container port `8888`.\n\n## Build the image\nSimply build the Docker image as follows:\n```\n\u003e cd context\n\u003e sudo docker build -t s2geometry .\n```\nIf necessary, override the default [ARG](https://docs.docker.com/engine/reference/builder/#arg) `port` for the `jupyter notebook`:\n```\n\u003e sudo docker build -t s2geometry --build-arg port=\u003ccontainer-port\u003e  .\n```\n\n## Run the container\nRun the built `s2geometry` Docker image as follows:\n```\n\u003e sudo docker container run -it -p 8888:8888 --rm s2geometry\n```\nProviding no `[COMMAND]` after the Docker `s2geometry` image will result in the `jupyter notebook` `entrypoint` executing in `--no-browser` mode.\n\nConnect to the `jupyter notebook` running within the container on your host through your browser of choice on port `8888`.\n\nIf you want to use a different host port e.g., `9999`, then start the Docker container as follows:\n```\n\u003e sudo docker container run -it -p 9999:8888 --rm s2geometry\n```\n\nTo override the `entrypoint` for an interactive `bash` session in a running container, simply:\n```\n\u003e sudo docker container run -it -p 8888:8888 --entrypoint \"/usr/bash\" --rm s2geometry\n```\n\n## Pull and run\nFor convenience, simply pull the `bjlittle/s2geometry` image from [Dockerhub](https://hub.docker.com/r/bjlittle/s2geometry) and run the container (in daemon-mode) as follows:\n```\n\u003e sudo docker image pull bjlittle/s2geometry:latest\n\u003e sudo docker container run -d -it -p 8888:8888 --rm bjlittle/s2geometry\n\u003e firefox localhost:8888\n```\n\n## Jupyter notebook\n\n### The default password\nThe `s2geometry` Docker image is configured with the `jupyter notebook` password `hello-s2!`.\n\nSee the [config/root-jupyter-notebook-config.py](https://github.com/bjlittle/docker-s2geometry/blob/master/context/config/root-jupyter-notebook-config.py#L281).\n\n### The working directory\nThe default working directory for the `jupyter notebook` instance is `/root/work`, which conatains an [example notebook](https://github.com/bjlittle/docker-s2geometry/blob/master/context/notebooks/example.ipynb) to whet your appetite.\n\nTo bind mount a volume from the host into the container, simply start the container as follows:\n```\n\u003e sudo docker container run -it -p 8888:8888 -v \u003c/absolute/path/to/host/dir\u003e:/root/work/host s2geometry\n```\nThis will allow you to create and save `jupyter notebooks` within the container into the `/root/work/host` directory, and those notebooks will then be available in your host `\u003c/absolute/path/to/host/dir\u003e` directory.\n\n## References\n### Apps\n- [Constructing the Hilbert Curve](http://bit-player.org/extras/hilbert/hilbert-construction.html)\n- [Mapping points in a line to points in a square](http://bit-player.org/extras/hilbert/hilbert-mapping.html)\n- [Planetary View](https://s2.sidewalklabs.com/planetaryview/)\n- [Region Coverer](https://s2.sidewalklabs.com/regioncoverer/)\n\n### Blogs\n- **Nick Johnson**, [Nick's Blog](http://blog.notdot.net/) blog post: [Damn Cool Algorithms: Spatial indexing with Quadtrees and Hilbert Curves](http://blog.notdot.net/2009/11/Damn-Cool-Algorithms-Spatial-indexing-with-Quadtrees-and-Hilbert-Curves)\n- **Sven Kreiss**, [Medium](https://medium.com/) blog post: [S2 cells and space-filling curves: Keys to building better digital map tools for cities](https://medium.com/sidewalk-talk/s2-cells-and-space-filling-curves-keys-to-building-better-digital-map-tools-for-cities-a312aa5e2f59)\n- **Christian Peroni**, [Terra Incognita](http://blog.christianperone.com/) blog post: [Google's S2, geometry on the sphere, cells, and Hilbert curve](http://blog.christianperone.com/2015/08/googles-s2-geometry-on-the-sphere-cells-and-hilbert-curve/)\n- **Antoine Sinton**, [Zenly](https://blog.zen.ly/) blog post: [Geospatial indexing on Hilbert curves](https://blog.zen.ly/geospatial-indexing-on-hilbert-curves-2379b929addc)\n\n### Documents\n- [Geometry on the Sphere: Google's S2 Library](https://docs.google.com/presentation/d/1Hl4KapfAENAOf4gv-pSngKwvS_jwNVHRPZTTDzXXn6Q/view#slide=id.i0)\n- [S2 Google](https://s2geometry.io/)\n\n### GitHub\n- [beyoung/s2geometry_docker](https://github.com/beyoung/s2geometry_docker)\n- [google/s2geometry](https://github.com/google/s2geometry)\n- [sidewalklabs/s2sphere](https://github.com/sidewalklabs/s2sphere)\n\n## Plans\n- [x] Push a tagged version of this `s2geometry` image on Dockerhub\n- [x] Build and push automatically to Dockerhub with CI \n- [ ] Provision a Docker image with default google/s2geometry SWIG Python bindings within a conda environment\n  - 17 Feb 2020 - WIP\n- [ ] Provision a Docker image with full API google/s2geometry Python bindings within a conda environment\n  - the goal is to provision a conda package on `conda-forge` containing the Python3.x-C++ bindings for the full google/s2geometry API\n\nEnjoy 😀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjlittle%2Fdocker-s2geometry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjlittle%2Fdocker-s2geometry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjlittle%2Fdocker-s2geometry/lists"}