{"id":14411722,"url":"https://github.com/gauteh/roaring-landmask","last_synced_at":"2025-04-10T01:14:34.250Z","repository":{"id":42514126,"uuid":"375342642","full_name":"gauteh/roaring-landmask","owner":"gauteh","description":"A fast and memory-limited landmask based on GSHHG and OpenStreetMap for determing whether a point on Earth is on land or in the ocean.","archived":false,"fork":false,"pushed_at":"2025-03-28T11:03:26.000Z","size":95924,"stargazers_count":24,"open_issues_count":10,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T01:14:23.497Z","etag":null,"topics":["gis","gshhg","landmask","openstreetmap","python","roaring-bitmaps","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gauteh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-09T12:11:25.000Z","updated_at":"2025-03-31T12:06:58.000Z","dependencies_parsed_at":"2024-01-26T10:01:58.844Z","dependency_job_id":"0db7407b-98bc-40be-9fe6-1e0a02f137cd","html_url":"https://github.com/gauteh/roaring-landmask","commit_stats":{"total_commits":99,"total_committers":2,"mean_commits":49.5,"dds":0.02020202020202022,"last_synced_commit":"685ed6f43e944a604545c452273ded4ab901ce42"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauteh%2Froaring-landmask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauteh%2Froaring-landmask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauteh%2Froaring-landmask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauteh%2Froaring-landmask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gauteh","download_url":"https://codeload.github.com/gauteh/roaring-landmask/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137891,"owners_count":21053775,"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":["gis","gshhg","landmask","openstreetmap","python","roaring-bitmaps","rust"],"created_at":"2024-08-29T16:01:10.063Z","updated_at":"2025-04-10T01:14:34.235Z","avatar_url":"https://github.com/gauteh.png","language":"Rust","funding_links":[],"categories":["Rust","Watchlist"],"sub_categories":[],"readme":"[![Crates.io](https://img.shields.io/crates/v/roaring-landmask.svg)](https://crates.io/crates/roaring-landmask)\n[![Documentation](https://docs.rs/roaring-landmask/badge.svg)](https://docs.rs/roaring-landmask/)\n[![PyPI](https://img.shields.io/pypi/v/roaring-landmask.svg?style=flat-square)](https://pypi.org/project/roaring-landmask/)\n[![Rust](https://github.com/gauteh/roaring-landmask/workflows/Rust/badge.svg)](https://github.com/gauteh/roaring-landmask/actions)\n[![Python](https://github.com/gauteh/roaring-landmask/workflows/Python/badge.svg)](https://github.com/gauteh/roaring-landmask/actions)\n\n# The Roaring Landmask\n\nHave you ever needed to know whether you are in the ocean or on land? And you\nneed to know it fast? And you need to know it without using too much memory or\ntoo much disk? Then try the _Roaring Landmask_!\n\nThe _roaring landmask_ is a Rust + Python package for quickly determining\nwhether a point given in latitude and longitude is on land or not. A landmask\nis stored in a tree of [Roaring Bitmaps](https://roaringbitmap.org/). Points\nclose to the shore might still be in the ocean, so a positive\nvalue is then checked against the vector shapes of the coastline.\n\n\u003cimg src=\"the_earth_gshhg.png\" width=\"100%\" /\u003e\n\n([source](https://github.com/gauteh/roaring-landmask/blob/main/src/devel/make_demo_plot.py))\n\n\nThe landmask is generated from the [GSHHG shoreline\ndatabase](https://www.soest.hawaii.edu/pwessel/gshhg/) (Wessel, P., and W. H.\nF. Smith, A Global Self-consistent, Hierarchical, High-resolution Shoreline\nDatabase, J. Geophys. Res., 101, 8741-8743, 1996) and the [OpenStreetMap](https://www.openstreetmap.org/) ([© OpenStreetMap](http://openstreetmap.org/copyright)).\n\nAn alternative is the\n[opendrift-landmask-data](https://github.com/OpenDrift/opendrift-landmask-data),\nwhich is slightly faster, is pure Python, but requires more memory and disk\nspace (memory-mapped 3.7Gb).\n\n## Performance\n\nMicrobenchmarks:\n\n```\ntest tests::test_contains_in_ocean         ... bench:          24 ns/iter (+/- 0)\ntest tests::test_contains_on_land          ... bench:       3,795 ns/iter (+/- 214)\n```\n\nMany points, through Python:\n\n```\n------------------------------------------------------------------------------------------------------ benchmark: 5 tests -----------------------------------------------------------------------------------------------------\nName (time in us)                       Min                     Max                    Mean                StdDev                  Median                   IQR            Outliers           OPS            Rounds  Iterations\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ntest_landmask_many_par          34,335.6220 (\u003e1000.0)   39,922.9660 (\u003e1000.0)   36,167.6438 (\u003e1000.0)  1,602.6359 (\u003e1000.0)   35,658.2270 (\u003e1000.0)  1,722.6990 (\u003e1000.0)       9;1       27.6490 (0.00)         30           1\ntest_landmask_many             130,760.1480 (\u003e1000.0)  131,155.3400 (\u003e1000.0)  130,863.7110 (\u003e1000.0)    137.1064 (598.03)   130,809.7410 (\u003e1000.0)    135.3770 (\u003e1000.0)       1;1        7.6415 (0.00)          8           1\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n```\n\nThe parallel version is significantly faster, while the sequential version is\nslightly slower than the equivalent benchmark in `opendrift-landmask-data`,\nwhich uses about `120 ms`.\n\n## Usage from Python\n\n```python\nfrom roaring_landmask import RoaringLandmask\n\nl = RoaringLandmask.new()\nx = np.arange(-180, 180, .5)\ny = np.arange(-90, 90, .5)\n\nxx, yy = np.meshgrid(x,y)\n\nprint (\"points:\", len(xx.ravel()))\non_land = l.contains_many(xx.ravel(), yy.ravel())\n```\n\n## Building \u0026 installing\n\nPre-built wheels are available on PyPI:\n\n1) `pip install roaring-landmask`\n\nTo build from source, you can use pip:\n\n1) `pip install .`\n\nor maturin:\n\n1) Install [maturin](https://github.com/PyO3/maturin).\n\n2) Build and install\n\n```\nmaturin build --release\npip install target/wheels/... # choose your whl\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauteh%2Froaring-landmask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgauteh%2Froaring-landmask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauteh%2Froaring-landmask/lists"}