Rasterize vector features to grids
Project description
Rastafari
Rasterize vector features. This library is built to rasterize emission sources in the CLAIR air quality modelling system. In contrast to most available libraries used to rasterize vector features, this library produces rasters with weights proportional to the fraction of each cell that is covered by a feature.
Features:
- line rasterization using DDA algorithm, producing weights proportional to fraction of line intersected by each cell
- polygon rasterization using even-odd rule, producing weights proportional to fraction of polygon included in each cell
- mass-consistent resampling of a raster using inverse nearest neighbour algorithm, allowing for different projections in source and target
See rastafari/tests for examples.
Install
Use pip to install Rastafari:
python -m pip install rastafari
Development
To install Rastafari in a local venv for development, run:
git clone https://gitlab.com/foclair/rastafari.git
cd rastafari
python -m venv .venv
. .venv/bin/activate
python -m pip install -U pip
python -m pip install cython wheel
RASTAFARI_USE_CYTHON=1 python -m pip install --no-build-isolation -e .[test]
Rastafari uses pre-commit. Install it and run pre-commit install
to run its checks every time you commit. Run the checks
manually with
pre-commit run -a
pytest is used as a test runner:
pytest
Rastafari comes fully typed. Use mypy to check the type annotations:
mypy .
All these tools will be run in CI in case you forget.
Maintenance
This package is maintained by David Segersson at SMHI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for rastafari-0.2.3-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92ebccba78f4ea03afb5a3dd609a16cec2892f8edfa156fc40f6163138f4d894 |
|
MD5 | debd9f4de8d85476109027753f6bcc9e |
|
BLAKE2b-256 | 5a555d65db058e3457b000af394c252ddb54437aefc6f046327814b0b6563c1b |
Hashes for rastafari-0.2.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3f70ebee63d50fd3d330f2906da63deb0b2c6934d78247d4a8c5a2994f04a52 |
|
MD5 | 0f9d20b3ebf8ecdbe6daeb23e5421bf5 |
|
BLAKE2b-256 | d3d21f821a7c4460446d1dac2291bd3d94655332cec4d7e47630ce4d6de26b92 |
Hashes for rastafari-0.2.3-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3538bf5180e6abd12eabca76a258cff68945cdc8bdb5e81b1f8348db2df007e7 |
|
MD5 | 5c700ba8ca6682f912aade8b36074b82 |
|
BLAKE2b-256 | b1fad200c7f1009ca2220f6d765cbc532e01dd9313d36a8eed490c3349326029 |
Hashes for rastafari-0.2.3-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ded4e53c3557d342bb4dc8b328ec53e68fa3881ecdc55fe447afcecdb27808b |
|
MD5 | 30b9337c82dd35d9247130f238164a2d |
|
BLAKE2b-256 | ae06ab3ed17ed40dab40046438b84f5ff8ade5ff619d1ce127113ef4e6bb620f |
Hashes for rastafari-0.2.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029b11eb9a1c2c3537d58b4f1d930c72c94595b3abb666ffbda426208e32f500 |
|
MD5 | 543392d731e7aade57d8f7899af23cab |
|
BLAKE2b-256 | 34fe5e36c5e88c686e0260b43c15a329b8729f5e936454617b38c1441bc5d2f9 |
Hashes for rastafari-0.2.3-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd765d8151efea4d847955a24d0793d4fb8401fcf2c79f0fbefa7322d37c82f8 |
|
MD5 | 0149eb0e191064a35d5a904d5b6e2a01 |
|
BLAKE2b-256 | 6f4cfef40482eedf4ec306445cb1ed45eb76a96f83c4177536bfa1408b1aea80 |
Hashes for rastafari-0.2.3-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41e7ca667b67f9a51d8f6f4d4bfc2bddb6704afbd305a6a65d43e813f63e6a22 |
|
MD5 | dd046f6cd7cca3dea5357a8c63d1b1cd |
|
BLAKE2b-256 | d27a81ac7ca8ea10b59a65f67852d54c284233543433bd9180ad1c8d958d7b24 |
Hashes for rastafari-0.2.3-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 884ef2c06c34ea793b1d77bddbb8d8608a7e947cd8b124ad6ee649aebe4a0df4 |
|
MD5 | d4660c7c0f96bbc85d1642de7ba237a8 |
|
BLAKE2b-256 | 47ad0a992807c3d20834c314cf8805fba1a4494d4e1680fe7fccac8b2953fcea |
Hashes for rastafari-0.2.3-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3a2733db4a5f8a14f96cfc916e7f5392176ffea85d054d6fda44a058e6b7e6c |
|
MD5 | 3dcd8db2c3646fc804fdb3bf879ef519 |
|
BLAKE2b-256 | cdc7d5ebb9b2e14f87bd78d7b80820b4bfac5acaca91e8b374d708ee44c489e2 |
Hashes for rastafari-0.2.3-cp312-cp312-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c922829d4ead0e52121991bde61d6b9fb256185c2a65cff470733192a550980f |
|
MD5 | e3b9ccf2ae87757ca54154726c0844d3 |
|
BLAKE2b-256 | 78f83de36bff328a6a02fa1f2115180f211e551196de5363ac52903d03a64a51 |
Hashes for rastafari-0.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb29823d53774db5a978bc0c8276f607699c1e1d2631f2a724a4a417b6f66753 |
|
MD5 | b705a4796ed7345ead49ef83f87f99cc |
|
BLAKE2b-256 | 344cc2a9678d5e152c45d1accf6779ef58017fa624dd60085155bc0fb8421bd9 |
Hashes for rastafari-0.2.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e24a009eca7b73ad99644991098d05b59818b527340a89d689f98e60040621c |
|
MD5 | 2a6bdf49f696391f811ad771bdc04594 |
|
BLAKE2b-256 | 2739891163f1be56af34b436a0544a652199f9656d1b141d3f3ba41bffff1276 |
Hashes for rastafari-0.2.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f5d7920988de27f2754286dd67de5be070da7ee6c75059ac567de8ae92ffdc9 |
|
MD5 | 4c66367afc51f4f9235317695f1074fd |
|
BLAKE2b-256 | 72c44c80117637aab6477b81704e6ce42fbcff4160c056aac855b1280300607b |
Hashes for rastafari-0.2.3-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1282f6bb6418ac5b247869bbdf6b4db7506c6faceb5a65d9e0f7d315f7cc4d78 |
|
MD5 | 749c21f7c2e555185ceb6b3db6952ff1 |
|
BLAKE2b-256 | 62ddb87b8eb6dc69ab6d777eed971613cb0889e84f82a3b4dc9dd0be77f4227c |
Hashes for rastafari-0.2.3-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33a9019d3edafa37311346f58d9fbfba8d2c9c177110305105602fba3b81b2dd |
|
MD5 | f657d88ccbb575aaab35b49e2eaa7802 |
|
BLAKE2b-256 | 89e7bd8961e9c6c37645ab3df4182703c409141e7b3dfc314055e3cc41e85d13 |
Hashes for rastafari-0.2.3-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 702100e3e49882672996de281eca4973c0c03cd46c3c624fb00a170a517633b2 |
|
MD5 | c1120173e97595f62f2e777a0b76fa5d |
|
BLAKE2b-256 | 67bc82590466b02f960f2f9857d6da2fc55f581921ef1bdcfc0adfd91504f18b |
Hashes for rastafari-0.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f66e07064c489aab705518e706440318d83ad0f6df8ace946ef70df70b795dd2 |
|
MD5 | f4e0d8cd2eed5635584199bfbacb1814 |
|
BLAKE2b-256 | a60f19e085e28febc803ed5fde3ab0f7ab4a74fa7cbe9a1483febfd2db7d8519 |
Hashes for rastafari-0.2.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76b80e78200bc52532a78297b5daeb98d9f27c464d573cf15a807a8da875d761 |
|
MD5 | 8f4ead58599ec619a315f8e2e3c4df5e |
|
BLAKE2b-256 | 31267df564be02af1c27c1b710a73c9d8b0b6839c09fc5f08d83a53c494b7d18 |
Hashes for rastafari-0.2.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b89741f9deee91fde4c801b88d79690885f88b19bd1845ed49180ff169b26d3 |
|
MD5 | c61fd66aad2269bd6a89b0f95e09aba7 |
|
BLAKE2b-256 | 0cf679699dbe07c041f62093d58e93312b46ba9d30fc0a163cdb1dc48e9f8c11 |
Hashes for rastafari-0.2.3-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9195ba64b1b9663f6b3a9e0f22dcf54b732dd808c22f52cf02388422270559b |
|
MD5 | 90988dd9784e40ae8c13c3c5879dc72a |
|
BLAKE2b-256 | 36f83d5483bd3fb16a3437b4d3e8bed49e69337832ef7afe257d4b1697527cff |
Hashes for rastafari-0.2.3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c2a1ba2bd4296a89d9135ea2de8f67c45b547c143886f4a2bbfa5308b6b57cc |
|
MD5 | 253f2124e8ffb12ff0752821c462a13b |
|
BLAKE2b-256 | 82fecc28857d47fb57f97da7f0aa9fcc7711263a5773bb7793a037845961848d |
Hashes for rastafari-0.2.3-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f27895cffca31e075ce8f6b086773dc2f2997679d9c7b8218ed1983e5209dc0 |
|
MD5 | a5b8bbd40ce64bc00490835a1fd8aed8 |
|
BLAKE2b-256 | d41c631edb87a7d8ba9bbdac4a06afdbbaac6b6a23399068e4e747173767ac61 |
Hashes for rastafari-0.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2ee13167ad1127706703e99a04c9eb9ddb1c8508f54fc27cbe6993176eb8225 |
|
MD5 | f4825c53c9e1c82e9a8f99c2629fdd2b |
|
BLAKE2b-256 | d94a1e7136d43ee4afd5d5e60450c3811ac3fb868082ecbbfc85da4cd8ae82da |
Hashes for rastafari-0.2.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 331dbdc3867324af25298a6121341b78604ace8326f97da74704740425e81cc5 |
|
MD5 | c8829401c7bd75d665b09150fb725534 |
|
BLAKE2b-256 | 2f1d7d648bb37fcee92e1e97319e90b18158348d353ee6fb37cfa128f036f82a |
Hashes for rastafari-0.2.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8034bccd7966c06c09f3facdaab9a97fcbf6bcc6a70f1577eb7ea76d7d45ff1 |
|
MD5 | da54fb1c07be0ab5a85c6534cbf6be6f |
|
BLAKE2b-256 | 35152f51bff8fc4931af2e9d5c114b5b19ae584e2f18e50673ee756d7c987ec6 |
Hashes for rastafari-0.2.3-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a11a87c336163b83b4098ccfa2dab4e6fb3e9ddb1b957fdaa0b9c99880803158 |
|
MD5 | 0b664d9879f16f9ce0520afb4d0652ed |
|
BLAKE2b-256 | a615db92c91f99f6121433bfae63c8f20385deeefc431b31e57fe987c90672da |
Hashes for rastafari-0.2.3-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 279bae582a0f8aefc8f2fba4404780e9fe7cc23a053da57a4551074a8d59cdd0 |
|
MD5 | 0095803faa22fdda680a01960ace841d |
|
BLAKE2b-256 | 66dc21a7f458438b91d6166077d2c40d1dae82dd3f8f40cce565d5320783065e |
Hashes for rastafari-0.2.3-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b8404a18f61d44a3d309f9aaf33fe9573edefc43dfca3270951a648f24617eb |
|
MD5 | c47ebc85f0f65572a3cd284171d0d7d6 |
|
BLAKE2b-256 | 7fcfcaebe49fe1e04e5bd83b0ff8b9ff1b7faace7f2c0c3474ded468c7260295 |
Hashes for rastafari-0.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d605e464dcffea889c29d0604e7b1ebabf38052e039dbb35c2ea9d598182853f |
|
MD5 | 3b3d48aad2706b196fb78676ab33ac69 |
|
BLAKE2b-256 | 8fec5ce4857dfac6d044381b34e2f9d7c6891c54c66ebfd13cef6c822ab7d488 |
Hashes for rastafari-0.2.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4003a59228bf20b8b6a1e01330070640b8b10a91d97dc1fe99e53e5843dd39f7 |
|
MD5 | 0431056d6a628a094bfaf252a6e3992d |
|
BLAKE2b-256 | c720e11d3d7a744fced7b1431b2c045e70c83b6e2ed6a26809563b24c216d415 |