Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
naming; English usage
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

creating Creating a line stringlinestring from points using shapely

I am creating a line stringlinestring from points using shapely, but I could not generate the line stringlinestring using the points on my local system, but this. This code is running fine on google colab, isGoogle Colab. Is there any package dependency which i dontI don't have installed on my system?

import shapely
from shapely import speedups
from shapely import geometry
from shapely.geometry import shape, Point, LineString, Polygon

a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
a

Error massage 
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-18-02826fee6746> in <module>
----> 1 a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
      2 a

c:\python37\lib\site-packages\shapely\geometry\linestring.py in __init__(self, coordinates)
     46         BaseGeometry.__init__(self)
     47         if coordinates is not None:
---> 48             self._set_coords(coordinates)
     49 
     50     @property

c:\python37\lib\site-packages\shapely\geometry\linestring.py in _set_coords(self, coordinates)
     95     def _set_coords(self, coordinates):
     96         self.empty()
---> 97         ret = geos_linestring_from_py(coordinates)
     98         if ret is not None:
     99             self._geom, self._ndim = ret

c:\python37\lib\site-packages\shapely\speedups\_speedups.pyx in shapely.speedups._speedups.geos_linestring_from_py()

ValueError: GEOSGeom_createLineString_r returned a NULL pointer

creating a line string from points using shapely

I am creating a line string from points using shapely, but I could not generate the line string using the points on my local system, but this code is running fine on google colab, is there any package dependency which i dont have installed on my system?

import shapely
from shapely import speedups
from shapely import geometry
from shapely.geometry import shape, Point, LineString, Polygon

a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
a

Error massage 
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-18-02826fee6746> in <module>
----> 1 a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
      2 a

c:\python37\lib\site-packages\shapely\geometry\linestring.py in __init__(self, coordinates)
     46         BaseGeometry.__init__(self)
     47         if coordinates is not None:
---> 48             self._set_coords(coordinates)
     49 
     50     @property

c:\python37\lib\site-packages\shapely\geometry\linestring.py in _set_coords(self, coordinates)
     95     def _set_coords(self, coordinates):
     96         self.empty()
---> 97         ret = geos_linestring_from_py(coordinates)
     98         if ret is not None:
     99             self._geom, self._ndim = ret

c:\python37\lib\site-packages\shapely\speedups\_speedups.pyx in shapely.speedups._speedups.geos_linestring_from_py()

ValueError: GEOSGeom_createLineString_r returned a NULL pointer

Creating a linestring from points using shapely

I am creating a linestring from points using shapely, but I could not generate the linestring using the points on my local system. This code is running fine on Google Colab. Is there any package dependency which I don't have installed on my system?

import shapely
from shapely import speedups
from shapely import geometry
from shapely.geometry import shape, Point, LineString, Polygon

a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
a

Error massage 
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-18-02826fee6746> in <module>
----> 1 a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
      2 a

c:\python37\lib\site-packages\shapely\geometry\linestring.py in __init__(self, coordinates)
     46         BaseGeometry.__init__(self)
     47         if coordinates is not None:
---> 48             self._set_coords(coordinates)
     49 
     50     @property

c:\python37\lib\site-packages\shapely\geometry\linestring.py in _set_coords(self, coordinates)
     95     def _set_coords(self, coordinates):
     96         self.empty()
---> 97         ret = geos_linestring_from_py(coordinates)
     98         if ret is not None:
     99             self._geom, self._ndim = ret

c:\python37\lib\site-packages\shapely\speedups\_speedups.pyx in shapely.speedups._speedups.geos_linestring_from_py()

ValueError: GEOSGeom_createLineString_r returned a NULL pointer
Source Link
SWAT
  • 141
  • 3
  • 14

creating a line string from points using shapely

I am creating a line string from points using shapely, but I could not generate the line string using the points on my local system, but this code is running fine on google colab, is there any package dependency which i dont have installed on my system?

import shapely
from shapely import speedups
from shapely import geometry
from shapely.geometry import shape, Point, LineString, Polygon

a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
a

Error massage 
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-18-02826fee6746> in <module>
----> 1 a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
      2 a

c:\python37\lib\site-packages\shapely\geometry\linestring.py in __init__(self, coordinates)
     46         BaseGeometry.__init__(self)
     47         if coordinates is not None:
---> 48             self._set_coords(coordinates)
     49 
     50     @property

c:\python37\lib\site-packages\shapely\geometry\linestring.py in _set_coords(self, coordinates)
     95     def _set_coords(self, coordinates):
     96         self.empty()
---> 97         ret = geos_linestring_from_py(coordinates)
     98         if ret is not None:
     99             self._geom, self._ndim = ret

c:\python37\lib\site-packages\shapely\speedups\_speedups.pyx in shapely.speedups._speedups.geos_linestring_from_py()

ValueError: GEOSGeom_createLineString_r returned a NULL pointer