shapely

Point in polygon using shapely?

ぃ、小莉子 提交于 2021-02-04 08:21:39
问题 I am running the following script which I believe should be returning TRUE for the point being in the polygon but it is returning FALSE. from shapely import geometry polygon = [(-1571236.8349707182, 8989180.222117377), (1599362.9654156454, 8924317.946336618), (-1653179.0745812152, 8922145.163675062), (-1626237.6614402141, 8986445.107619021)] Point_X = -1627875.474 Point_Y = 8955472.968 line = geometry.LineString(polygon) point = geometry.Point(Point_X, Point_Y) print(line.contains(point))

Distance matrix between two point layers

倖福魔咒の 提交于 2021-01-29 10:19:25
问题 I have two arrays containing point coordinates as shapely.geometry.Point with different sizes. Eg: [Point(X Y), Point(X Y)...] [Point(X Y), Point(X Y)...] I would like to create a "cross product" of these two arrays with a distance function. Distance function is from shapely.geometry, which is a simple geometry vector distance calculation. I am tryibg to create distance matrix between M:N points: Right now I have this function: source = gpd.read_file(source) near = gpd.read_file(near) source

Why I'm getting this error? What can be done to install osmnx on windows 10?

蓝咒 提交于 2021-01-28 21:18:26
问题 I'm not able to install osmnx in jupyter notebook. The following problem is occurring with shapely version 1.6 I could install shapely 1.4 but osmnx needs 1.6 version The command I used is !pip install osmnx Collecting Shapely>=1.6 (from osmnx) Using cached https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz ERROR: Command errored out with exit status 1: command: 'c:\users\shrinath\anaconda3\python.exe' -c

Why “import shapely” and “import gdal” do not work together?

狂风中的少年 提交于 2021-01-28 11:13:26
问题 My code needs both of these libraries but when I import them like that: from shapely.geometry import Point from shapely.geometry.polygon import Polygon import gdal I get an error saying that gdal can not be imported. Everything works well when I run them separately. I would be thankful for any help. P.S. I am using Python 3.6 来源: https://stackoverflow.com/questions/52438313/why-import-shapely-and-import-gdal-do-not-work-together

Draw perpendicular line of fixed length at a point of another line

坚强是说给别人听的谎言 提交于 2021-01-18 06:00:42
问题 I have two points A (10,20) and B (15,30). The points generate a line AB. I need to draw a perpendicular line, CD, on point B with a length of 6 (each direction 3 units) in Python. I already have some properties of line AB using the following code: from scipy import stats x = [10,15] y = [20,30] slope, intercept, r_value, p_value, std_err = stats.linregress(x,y) How can I calculate the location of C and D. I need their X and Y value. The value of C and D will be used for accomplishing another

Shapely OSError: Could not find lib c or load any of its variants []

女生的网名这么多〃 提交于 2020-12-02 16:26:12
问题 I'm just trying to use the demo code. I run the following in Jupyter Notebook: from shapely.geometry import shape Which gives me the following: OSError Traceback (most recent call last) <ipython-input-4-cf5b4d0962ea> in <module>() ----> 1 from shapely.geometry import shape /Users/hkwik/anaconda/lib/python2.7/site-packages/shapely/geometry/__init__.py in <module>() 2 """ 3 ----> 4 from .base import CAP_STYLE, JOIN_STYLE 5 from .geo import box, shape, asShape, mapping 6 from .point import Point

Shapely OSError: Could not find lib c or load any of its variants []

让人想犯罪 __ 提交于 2020-12-02 16:14:18
问题 I'm just trying to use the demo code. I run the following in Jupyter Notebook: from shapely.geometry import shape Which gives me the following: OSError Traceback (most recent call last) <ipython-input-4-cf5b4d0962ea> in <module>() ----> 1 from shapely.geometry import shape /Users/hkwik/anaconda/lib/python2.7/site-packages/shapely/geometry/__init__.py in <module>() 2 """ 3 ----> 4 from .base import CAP_STYLE, JOIN_STYLE 5 from .geo import box, shape, asShape, mapping 6 from .point import Point

Shapely OSError: Could not find lib c or load any of its variants []

ε祈祈猫儿з 提交于 2020-12-02 16:14:16
问题 I'm just trying to use the demo code. I run the following in Jupyter Notebook: from shapely.geometry import shape Which gives me the following: OSError Traceback (most recent call last) <ipython-input-4-cf5b4d0962ea> in <module>() ----> 1 from shapely.geometry import shape /Users/hkwik/anaconda/lib/python2.7/site-packages/shapely/geometry/__init__.py in <module>() 2 """ 3 ----> 4 from .base import CAP_STYLE, JOIN_STYLE 5 from .geo import box, shape, asShape, mapping 6 from .point import Point

Shapely OSError: Could not find lib c or load any of its variants []

孤者浪人 提交于 2020-12-02 16:14:13
问题 I'm just trying to use the demo code. I run the following in Jupyter Notebook: from shapely.geometry import shape Which gives me the following: OSError Traceback (most recent call last) <ipython-input-4-cf5b4d0962ea> in <module>() ----> 1 from shapely.geometry import shape /Users/hkwik/anaconda/lib/python2.7/site-packages/shapely/geometry/__init__.py in <module>() 2 """ 3 ----> 4 from .base import CAP_STYLE, JOIN_STYLE 5 from .geo import box, shape, asShape, mapping 6 from .point import Point