question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vendoring descartes? (or take over functionality)

See original GitHub issue

Triggered by https://github.com/conda-forge/geopandas-feedstock/pull/59, where matplotlib and descartes are removed from the packages that are automatically installed for geopandas (note: only for conda of course, not for pip), I was wondering if it would be an idea to vendor descartes. In the end, it is less than 100 lines of code and rather stable (not much changes over the last years).

Reason I was thinking this: people installing geopandas will quite often have matplotlib installed as well. But, plotting (polygons) still does not work out of the box in such a case, for that people have to install descartes as well. It would be nice if plotting “just works” (in case if matplotlib is already installed of course).

On the other hand, doing a conda/pip install descartes is also not that hard (it’s an easy pure python package to install), certainly if we give a good error message. And you could say the same for mapclassify …

cc @sgillies

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
jorisvandenbosschecommented, Jan 3, 2022

PR is merged, so with the next geopandas release, we will no longer require descartes for plotting polygons!

A note to people / other pojects using the descartes package directly: it is no longer maintained, so you should best stop using it as well (@sgillies indicated above he doesn’t intent to make more releases, and the repo on bitbucket also got lost in bitbucket’s aggressive mercurial sunsetting). Now, the alternattive is only a few lines with matplotlib for a polygon:

from matplotlib.patches import PathPatch
from matplotlib.path import Path

patch = PathPatch(
    Path.make_compound_path(
        Path(np.asarray(polygon.exterior.coords)[:, :2]),
        *[Path(np.asarray(ring.coords)[:, :2]) for ring in polygon.interiors]
    )
)

(for multipolgyon, need to repeat the compound path for each part)

3reactions
martinfleiscommented, Oct 15, 2020

Getting back to this. After seeing the discussion in https://github.com/matplotlib/matplotlib/issues/16662 it seems that the best solution would be to include that snippet above in geopandas.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Descartes Editrade™ Compliance
Descartes Editrade™ Compliance is an on-demand compliance solution that enables members of the importer community to ensure compliance with U.S. Customs filing ...
Read more >
Descartes MacroPoint vs Overhaul 2022 | Gartner Peer Insights
Compare Descartes MacroPoint vs Overhaul based on verified reviews from real ... See side-by-side comparisons of product capabilities, customer experience, ...
Read more >
How to Identify a Best-In-Class Denied Party Screening Software
This due diligence must include screening for denied parties on a ... Choosing a vendor who has the capability and disposition to build...
Read more >
Descartes pays $30 million to acquire delivery route planning ...
The latest takeover is Orlando, Florida-based GreenMile, which says its software helps food and beverage companies to digitalize their ...
Read more >
Logistics management vendor Descartes buys shipment ...
“Descartes continues to invest in our ecommerce capabilities to make sure that our customers, large and small, can fulfill orders and meet ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found