shapely

numpy meshgrid to Shapely polygons

佐手、 提交于 2020-07-29 03:46:16
问题 I'm trying to create a numpy meshgrid and convert it to Shapely polygons. I can likely solve this with a very brute force method but it feels like there has to be a good trick to accomplish this but I haven't come up with it, yet. This gets me the grid of points (assumed running in Jupyter) - import numpy as np from matplotlib import pyplot fig = pyplot.figure(figsize=(10, 10)) ax = fig.add_subplot(111, aspect='equal') x,y = np.mgrid[-5:-1:8j, 1:5:8j] ax.plot(x,y, 'o', color='#000000') pyplot

numpy meshgrid to Shapely polygons

北战南征 提交于 2020-07-29 03:45:49
问题 I'm trying to create a numpy meshgrid and convert it to Shapely polygons. I can likely solve this with a very brute force method but it feels like there has to be a good trick to accomplish this but I haven't come up with it, yet. This gets me the grid of points (assumed running in Jupyter) - import numpy as np from matplotlib import pyplot fig = pyplot.figure(figsize=(10, 10)) ax = fig.add_subplot(111, aspect='equal') x,y = np.mgrid[-5:-1:8j, 1:5:8j] ax.plot(x,y, 'o', color='#000000') pyplot