CSIRO-Precision-Agriculture / pyprecag

A suite of tools for Precision Agriculture
Other
21 stars 9 forks source link

strip trial points gets a geometry error #15

Closed cratcliff closed 5 years ago

cratcliff commented 5 years ago

The following error is occurring when using create_points_along_line.

QGIS Version:           2.18.24
Python Version:         2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]
pyPrecAg: 0.2.1, GeoPandas: 0.3.0, RasterIO: 1.0.13, Fiona: 1.8.4

Processing Create strip trial points Parameters:--------------------------------------- Line layer: strip Distance between points (m): 20.0 Line offset distance (m): 30.0 Output coordinate system: GDA94 / MGA zone 55 - EPSG:28355 Output points : C:\QGIS\PAT_sample_data\Output_Data\strip_strip-trial-points.shp

2019-02-18 15:04:32,894 pyprecag CRITICAL 'geometry' Traceback (most recent call last): File "C:/Users/xinxins/.qgis2/python/plugins\pat\gui\stripTrialPoints_dialog.py", line 478, in accept out_lines_shapefile = out_lines) File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\pyprecag\processing.py", line 1803, in create_points_along_line gdf_lines['geometry'] = gdf_lines['geometry'].apply(lambda x: drop_z_from_linestring(x)) File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\pandas\core\frame.py", line 2139, in getitem return self._getitem_column(key) File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\pandas\core\frame.py", line 2146, in _getitem_column return self._get_item_cache(key) File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\pandas\core\generic.py", line 1842, in _get_item_cache values = self._data.get(item) File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\pandas\core\internals.py", line 3843, in get loc = self.items.get_loc(item) File "C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\pandas\core\indexes\base.py", line 2527, in get_loc return self._engine.get_loc(self._maybe_cast_indexer(key)) File "pandas_libs\index.pyx", line 117, in pandas._libs.index.IndexEngine.get_loc File "pandas_libs\index.pyx", line 139, in pandas._libs.index.IndexEngine.get_loc File "pandas_libs\hashtable_class_helper.pxi", line 1265, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas_libs\hashtable_class_helper.pxi", line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'geometry'

cratcliff commented 5 years ago

due to a difference between geopandas 0.3.0 and 0.4.0