Facilities to produce meaningful maps

xoolive, updated 🕥 2023-02-05 23:16:03

Cartes

build docs Code Coverage Checked with mypy Code style: black License\ PyPI version PyPI downloads Conda version Conda Downloads

Cartes is a Python library providing facilities to produce meaningful maps.

Cartes builds on top of most common Python visualisation libraries (Matplotlib/Cartopy, Altair, ipyleaflet) and data manipulation libraries (Pandas, Geopandas) and provides mostly:

  • a comprehensive set of geographic projections, built on top of Cartopy and Altair/d3.js;
  • an interface to OpenstreetMap Nominatim and Overpass API. Result of requests are parsed in a convenient format for preprocessing and storing in standard formats;
  • beautiful default parameters for quality visualisations;
  • advanced caching facilities. Do not download twice the same content in the same day.

The cartes library is a powerful asset to publish clean, lightweight geographical datasets; and to produce decent geographical visualisations in few lines of code.

Gallery

More in the documentation

Installation

Latest release:

Recommended, with conda:

sh conda install -c conda-forge cartes

or with pip:

sh pip install cartes

Development version:

sh git clone https://github.com/xoolive/cartes cd cartes pip install .

Documentation

docs

Documentation available at https://cartes-viz.github.io/

Issues

Bump pytest from 7.2.0 to 7.2.1

opened on 2023-02-01 22:15:26 by dependabot[bot]

Bumps pytest from 7.2.0 to 7.2.1.

Release notes

Sourced from pytest's releases.

7.2.1

pytest 7.2.1 (2023-01-13)

Bug Fixes

  • #10452: Fix 'importlib.abc.TraversableResources' deprecation warning in Python 3.12.
  • #10457: If a test is skipped from inside a fixture, the test summary now shows the test location instead of the fixture location.
  • #10506: Fix bug where sometimes pytest would use the file system root directory as rootdir <rootdir>{.interpreted-text role="ref"} on Windows.
  • #10607: Fix a race condition when creating junitxml reports, which could occur when multiple instances of pytest execute in parallel.
  • #10641: Fix a race condition when creating or updating the stepwise plugin's cache, which could occur when multiple xdist worker nodes try to simultaneously update the stepwise plugin's cache.
Commits
  • 1ae778f Prepare release version 7.2.1
  • cb07711 Merge pull request #10656 from pytest-dev/backport-10641-to-7.2.x
  • 9440702 Merge pull request #10657 from pytest-dev/backport-10640-to-7.2.x
  • e8055c1 [7.2.x] Fix regen tox environment
  • f22fbbf [7.2.x] Dont update cache from xdist worker
  • 211d08e Merge pull request #10638 from pytest-dev/backport-10607-to-7.2.x
  • a6f85a0 [7.2.x] Mitigate directory creation race condition
  • 08d0dd0 Merge pull request #10637 from pytest-dev/backport-10632-to-7.2.x
  • 405fd15 [7.2.x] Fix tests pygments 2.14.0
  • c16315f Merge pull request #10586 from nicoddemus/backport-10578
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bump altair from 4.2.0 to 4.2.2

opened on 2023-02-01 22:12:53 by dependabot[bot]

Bumps altair from 4.2.0 to 4.2.2.

Release notes

Sourced from altair's releases.

Version 4.2.2

Bug Fixes

  • Fix incompatibility with jsonschema < 4.5 which got introduced in Altair 4.2.1 (#2860).

Full Changelog: https://github.com/altair-viz/altair/compare/v4.2.1...v4.2.2

Version 4.2.1

Note: This version requires jsonschema>=4.5.0 see (altair-viz/altair#2857).

Bug Fixes

  • Disable uri-reference format check in jsonsschema (#2771).
  • Replace iteritems with items due to pandas deprecation (#2683).

Maintenance

  • Add deprecation and removal warnings for Vega-Lite v3 wrappers and Vega v5 wrappers (#2843).
Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bump isort from 5.11.4 to 5.12.0

opened on 2023-02-01 22:11:10 by dependabot[bot]

Bumps isort from 5.11.4 to 5.12.0.

Release notes

Sourced from isort's releases.

5.12.0

Changes

5.11.5 January 30 2023 [hotfix]

  • Fixed incompatiblity with latest poetry version
Changelog

Sourced from isort's changelog.

5.12.0 January 28 2023

  • Removed support for Python 3.7
  • Fixed incompatiblity with latest poetry version
  • Added support for directory limitations within built in git hook

5.11.5 January 30 2023 [hotfix]

  • Fixed incompatiblity with latest poetry version
Commits
  • e44834b Fix changelog / version to a minor bump due to the size of the change
  • 82569d9 Bump version to 5.11.5
  • e00db96 Formatting fix
  • e833931 Merge pull request #2078 from jooola/fix_poetry_validation
  • 0d219a6 fix: poetry pip-shims extras dependency
  • ae0cc1c Merge pull request #1967 from vkomarov-r7/feature/directory-hooks
  • 06d8ef5 Merge pull request #1948 from timgates42/bugfix_typo_determination
  • 0c8a8b8 Merge pull request #2076 from marksmayo/main
  • 5b63fba Clean up
  • a0cb1b8 Fix tmuxp test
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bump pandas from 1.5.2 to 1.5.3

opened on 2023-02-01 22:09:45 by dependabot[bot]

Bumps pandas from 1.5.2 to 1.5.3.

Release notes

Sourced from pandas's releases.

Pandas 1.5.3

This is a patch release in the 1.5.x series and includes some regression and bug fixes. We recommend that all users upgrade to this version.

See the full whatsnew for a list of all the changes.

The release will be available on the defaults and conda-forge channels:

conda install pandas

Or via PyPI:

python3 -m pip install --upgrade pandas

Please report any issues with the release on the pandas issue tracker.

Thanks to all the contributors who made this release possible.

Commits
  • 2e218d1 RLS: 1.5.3
  • 659de5f DOC: Fix whatsnew (#50821)
  • 5aff5c9 Manual backport fix github quota (#50827)
  • c2ab902 Manually Backport PR #50809 (#50813)
  • 24316d0 Backport PR #50800 on branch 1.5.x (DOC: Clean up 1.5.x whatsnews) (#50807)
  • 4ea0840 BUG: Change FutureWarning to DeprecationWarning for inplace setitem with Data...
  • d9dec94 Backport PR #50682 on branch 1.5.x (BUG: pivot_table with nested elements and...
  • ce123cd REGR: NumPy func warning when dropping nuisance in agg, apply, transform (#50...
  • 54b4037 Backport PR on Branch 1.5.x (REV: revert deprecation of Series.getitem sl...
  • 71db310 Backport PR #50396 on branch 1.5.x (BUG/COMPAT: fix assert_* functions for ne...
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bump black from 22.12.0 to 23.1.0

opened on 2023-02-01 22:08:22 by dependabot[bot]

Bumps black from 22.12.0 to 23.1.0.

Release notes

Sourced from black's releases.

23.1.0

Highlights

This is the first release of 2023, and following our stability policy, it comes with a number of improvements to our stable style, notably improvements to empty line handling and the removal of redundant parentheses in several contexts.

There are also many changes to the preview style; try out black --preview and give us feedback to help us set the stable style for next year.

In addition to style changes, Black now automatically infers the supported Python versions from your pyproject.toml file, removing the need to set Black's target versions separately.

Stable style

  • Introduce the 2023 stable style, which incorporates most aspects of last year's preview style (#3418). Specific changes:
    • Enforce empty lines before classes and functions with sticky leading comments (#3302) (22.12.0)
    • Reformat empty and whitespace-only files as either an empty file (if no newline is present) or as a single newline character (if a newline is present) (#3348) (22.12.0)
    • Correctly handle trailing commas that are inside a line's leading non-nested parens (#3370) (22.12.0)
    • --skip-string-normalization / -S now prevents docstring prefixes from being normalized as expected (#3168) (since 22.8.0)
    • When using --skip-magic-trailing-comma or -C, trailing commas are stripped from subscript expressions with more than 1 element (#3209) (22.8.0)
    • Fix a string merging/split issue when a comment is present in the middle of implicitly concatenated strings on its own line (#3227) (22.8.0)
    • Docstring quotes are no longer moved if it would violate the line length limit (#3044, #3430) (22.6.0)
    • Parentheses around return annotations are now managed (#2990) (22.6.0)
    • Remove unnecessary parentheses around awaited objects (#2991) (22.6.0)
    • Remove unnecessary parentheses in with statements (#2926) (22.6.0)
    • Remove trailing newlines after code block open (#3035) (22.6.0)
    • Code cell separators #%% are now standardised to # %% (#2919) (22.3.0)
    • Remove unnecessary parentheses from except statements (#2939) (22.3.0)
    • Remove unnecessary parentheses from tuple unpacking in for loops (#2945) (22.3.0)
    • Avoid magic-trailing-comma in single-element subscripts (#2942) (22.3.0)
  • Fix a crash when a colon line is marked between # fmt: off and # fmt: on (#3439)

Preview style

  • Format hex codes in unicode escape sequences in string literals (#2916)
  • Add parentheses around if-else expressions (#2278)
  • Improve performance on large expressions that contain many strings (#3467)
  • Fix a crash in preview style with assert + parenthesized string (#3415)
  • Fix crashes in preview style with walrus operators used in function return annotations and except clauses (#3423)
  • Fix a crash in preview advanced string processing where mixed implicitly concatenated regular and f-strings start with an empty span (#3463)
  • Fix a crash in preview advanced string processing where a standalone comment is placed before a dict's value (#3469)
  • Fix an issue where extra empty lines are added when a decorator has # fmt: skip applied or there is a standalone comment between decorators (#3470)
  • Do not put the closing quotes in a docstring on a separate line, even if the line is too long (#3430)
  • Long values in dict literals are now wrapped in parentheses; correspondingly unnecessary parentheses around short values in dict literals are now removed; long string lambda values are now wrapped in parentheses (#3440)
  • Fix two crashes in preview style involving edge cases with docstrings (#3451)
  • Exclude string type annotations from improved string processing; fix crash when the return type annotation is stringified and spans across multiple lines (#3462)
  • Wrap multiple context managers in parentheses when targeting Python 3.9+ (#3489)
  • Fix several crashes in preview style with walrus operators used in with statements or tuples (#3473)
  • Fix an invalid quote escaping bug in f-string expressions where it produced invalid code. Implicitly concatenated f-strings with different quotes can now be merged or quote-normalized by changing the quotes used in expressions. (#3509)

... (truncated)

Changelog

Sourced from black's changelog.

23.1.0

Highlights

This is the first release of 2023, and following our stability policy, it comes with a number of improvements to our stable style, including improvements to empty line handling, removal of redundant parentheses in several contexts, and output that highlights implicitly concatenated strings better.

There are also many changes to the preview style; try out black --preview and give us feedback to help us set the stable style for next year.

In addition to style changes, Black now automatically infers the supported Python versions from your pyproject.toml file, removing the need to set Black's target versions separately.

Stable style

  • Introduce the 2023 stable style, which incorporates most aspects of last year's preview style (#3418). Specific changes:
    • Enforce empty lines before classes and functions with sticky leading comments (#3302) (22.12.0)
    • Reformat empty and whitespace-only files as either an empty file (if no newline is present) or as a single newline character (if a newline is present) (#3348) (22.12.0)
    • Implicitly concatenated strings used as function args are now wrapped inside parentheses (#3307) (22.12.0)
    • Correctly handle trailing commas that are inside a line's leading non-nested parens (#3370) (22.12.0)
    • --skip-string-normalization / -S now prevents docstring prefixes from being normalized as expected (#3168) (since 22.8.0)
    • When using --skip-magic-trailing-comma or -C, trailing commas are stripped from subscript expressions with more than 1 element (#3209) (22.8.0)
    • Implicitly concatenated strings inside a list, set, or tuple are now wrapped inside parentheses (#3162) (22.8.0)
    • Fix a string merging/split issue when a comment is present in the middle of implicitly concatenated strings on its own line (#3227) (22.8.0)
    • Docstring quotes are no longer moved if it would violate the line length limit (#3044, #3430) (22.6.0)
    • Parentheses around return annotations are now managed (#2990) (22.6.0)
    • Remove unnecessary parentheses around awaited objects (#2991) (22.6.0)
    • Remove unnecessary parentheses in with statements (#2926) (22.6.0)
    • Remove trailing newlines after code block open (#3035) (22.6.0)
    • Code cell separators #%% are now standardised to # %% (#2919) (22.3.0)
    • Remove unnecessary parentheses from except statements (#2939) (22.3.0)
    • Remove unnecessary parentheses from tuple unpacking in for loops (#2945) (22.3.0)
    • Avoid magic-trailing-comma in single-element subscripts (#2942) (22.3.0)

... (truncated)

Commits
  • b0d1fba Prepare release 23.1.0 (#3536)
  • 69ca0a4 Infer target version based on project metadata (#3219)
  • c4bd2e3 Draft for Black 2023 stable style (#3418)
  • 226cbf0 Fix unsafe cast in linegen.py w/ await yield handling (#3533)
  • f4ebc68 Upgrade isort (#3534)
  • 6407ebb Remove Python version in the_basics.md (#3528)
  • 196b1f3 Fix black --help output for --python-cell-magics option to be reproducibl...
  • d950f15 Update document now that paren wrapping CMs on Python 3.9+ is implemented (#3...
  • a36878e Fix an invalid quote escaping bug in f-string expressions (#3509)
  • eabff67 Format hex code in unicode escape sequences in string literals (#2916)
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Geometry missing while overpass shows the geometry

opened on 2023-01-08 15:54:28 by MTRNord

Hi I am trying to do this query where I have some admin_level=6 parts and some level=7:

sh_area = Overpass.request( area={"name": "Schleswig-Holstein", "admin_level": 4}, rel=dict(boundary="administrative", admin_level=dict(regex="[6-7]")), )

However I run into the issue that for some reason the admin_level=6 areas dont have data in the geometry column while on overpass they do get rendered as expected. https://overpass-turbo.eu/s/1pU9

image

image

Any ideas why this happens and how I fix this issue?

Releases

cartes v0.7.4 2022-12-29 22:26:25

Full Changelog: https://github.com/xoolive/cartes/compare/v0.7.3...v0.7.4

cartes v0.7.3 2022-11-18 22:08:38

Full Changelog: https://github.com/xoolive/cartes/compare/v0.7.2...v0.7.3

cartes v0.7.2 2022-06-29 21:39:45

Version update

cartes v0.7.1 2022-01-22 13:07:32

Consistency adjustments for conda-forge build

cartes v0.7 2022-01-21 21:26:53

  • switch to poetry for better dependency management
  • atlas of maps
  • bounds and projections for altair
  • .extent() method patched to geodataframe
  • leaflet methods on geo objects

Full Changelog: https://github.com/xoolive/cartes/compare/v0.6...v0.7

cartes v0.6 2021-12-14 10:30:06

mostly fixes for recent versions of shapely projections compatible with Altair

Full Changelog: https://github.com/xoolive/cartes/compare/v0.5...v0.6

Xavier Olive

I like maps 🌍, code 🐍 and data visualisation 😎. I keep an eye on anything that can fly 🛩️.

GitHub Repository Homepage

maps openstreetmap gis altair cartopy geopandas geospatial