Questions tagged [descartes]

Descartes is a Python library for using geometric objects as matplotlib paths and patches.

Descartes is available under the BSD licence.

13 questions
3
votes
1 answer

Plotting disconnected entities with shapely descartes and matplotlib

I need to plot a list of disconnected circles which I have created for other purposes in shapely. I was trying to do exactly as the example in http://toblerity.org/shapely/manual.html#cascading-unions shows (see code) but that works only if the…
Davide
  • 17,098
  • 11
  • 52
  • 68
2
votes
2 answers

IndexError - Descartes PolygonPatch wtih shapely

I used to use shapely to make a cirle and plot it on a previously populated plot. This used to work perfectly fine. Recently, I am getting an index error. I broke my code to even the simplest of operations and it cant even do the simplest of…
Abilash
  • 95
  • 10
2
votes
1 answer

Python matplotlib: animation made of several pyplot.figure-s

I made a 'plotter(x)' function that reads a timeseries in a pd.DataFrame and returns a figure (return fig) made of two axes. One is a pyplot.figure.add_subplot(111), in which I add descartes.PolygonPatch(shapely.Polygon(y))-es. The second one is a…
Jaqo
  • 329
  • 1
  • 5
  • 15
1
vote
1 answer

Drawing filled polygons on basemap throws __getitem__ error

I'm working on learning my way around using geospatial data in the base Python mapping libraries, and this is my first time working with Shapely/Polygons/Basemap/etc. I have a set of polygons that describe the neighborhoods in a given area. If I…
Zach
  • 341
  • 1
  • 3
  • 14
1
vote
1 answer

Foreman start script

I'm facing an issue with my Foreman script. I've installed it following the installation path from Descartes article in GitHub (https://github.com/obfuscurity/descartes). The scripts functions great but I have two things going on. 1- How can I run…
marianogg9
  • 184
  • 1
  • 13
1
vote
1 answer

No 'Access-Control-Allow-Origin' header is present on the requested resource, graphite/descartes environment

Has anyone got this error? There's a workaround in https:// github. com/obfuscurity/descartes editing the http.conf (apache webserver) and adding the following: Header set Access-Control-Allow-Origin "ip" Header set Access-Control-Allow-Methods…
marianogg9
  • 184
  • 1
  • 13
1
vote
1 answer

Plotting using basemap and descartes doesn't show PolygonPatch

I can plot some Shapely buffered points like so: import matplotlib.pyplot as plt from matplotlib.collections import PatchCollection from mpl_toolkits.basemap import Basemap from shapely.geometry import Point from descartes import PolygonPatch fig =…
urschrei
  • 25,123
  • 12
  • 43
  • 84
0
votes
1 answer

descartes, python package, error in polygonpatch

I have installed the latest Descartes package using pip3. But I cannot seem to run the example code provided in the website. ` IndexError Traceback (most recent call last) /tmp/ipykernel_500743/916321365.py in…
user252935
  • 317
  • 3
  • 15
0
votes
1 answer

Detect distance of measurement used for radius while drawing circle in python

I have a code in Python which creates a circle. However I am unsure about the distance of measurement used while drawing the circle. Can someone please recommend how to check that. Tried changing the radius to value of 5000 to see if the size of…
caliGeek
  • 409
  • 2
  • 7
  • 19
0
votes
2 answers

How to plot a polygon with holes/voids in bokeh

System - Python 3.6.5, Bokeh 1.1.0, Shapely 1.6.4 I'm trying to plot a polygon with voids/holes in Bokeh. Here's my code: from shapely.geometry import LineString import numpy as np from bokeh.plotting import figure from bokeh.io import output_file,…
Izak Joubert
  • 906
  • 11
  • 29
0
votes
0 answers

matplotlib image: map-like zooming?

Finally I found a nice way to visualize all the postal code areas of germany using the following code: import json import matplotlib.pyplot as plt from descartes import PolygonPatch jfile = open('postal_code_areas.geojson', 'r') jdata =…
user3182532
  • 1,097
  • 5
  • 22
  • 37
0
votes
1 answer

Descartes Modeling Language, overview?

Descartes Modeling Language vs. Palladio Component Model I really have to know what especially the first one (DML) IS and what you can do with it. Pretty hard to google information about this stuff.. I found some papers about is with…
-3
votes
1 answer

How to display Polygon List into one Graph with For Loops

so I'm working on a Line of Sight script where the Polygons act as buildings and return a boolean value based on whether a line intersects with a Polygon. The logic behind it works, but when I try to integrate more Polygons from a list called…