Commit 08446724 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Bugfixes

components.CoReg_local.COREG_LOCAL:
- projectDir.getter: fix for exception in case im2shift.filePath is None

components.Tie_Point_Grid.Tie_Point_Grid:
- to_PointShapefile(): fix for not handling boolean values within GeoDataFrame to write

updated __version__
parent d53cf30e
......@@ -9,7 +9,7 @@ from .components import utilities
from .components import geometry
__author__ = 'Daniel Scheffler'
__version__= '2017-03-06_01'
__version__= '2017-03-10_01'
__all__=['COREG',
'COREG_LOCAL',
......
......@@ -248,7 +248,8 @@ class COREG_LOCAL(object):
return os.path.abspath(self._projectDir)
else:
# return a project name that not already has a corresponding folder on disk
projectDir = os.path.join(os.path.dirname(self.im2shift.filePath), 'UntitledProject_1')
root_dir = os.path.dirname(self.im2shift.filePath) if self.im2shift.filePath else os.path.curdir
projectDir = os.path.join(root_dir, 'UntitledProject_1')
while os.path.isdir(projectDir):
projectDir = '%s_%s' % (projectDir.split('_')[0], int(projectDir.split('_')[-1]) + 1)
self._projectDir = projectDir
......
......@@ -432,8 +432,15 @@ class Tie_Point_Grid(object):
:param skip_nodata_col: <str> determines which column of Tie_Point_Grid.CoRegPoints_table is used to
identify points where no valid match could be found
"""
GDF = self.CoRegPoints_table
GDF2pass = GDF if not skip_nodata else GDF[GDF[skip_nodata_col]!=self.outFillVal]
GDF = self.CoRegPoints_table
GDF2pass = GDF if not skip_nodata else GDF[GDF[skip_nodata_col]!=self.outFillVal]
# replace boolean values (cannot be written)
for col in GDF2pass.columns:
if GDF2pass[col].dtype == np.bool:
GDF2pass[col] = GDF2pass[col].astype(int)
GDF2pass = GDF2pass.replace(False, 0) # replace all remaining booleans where dtype is not np.bool but np.object
GDF2pass = GDF2pass.replace(True, 1)
path_out = path_out if path_out else get_generic_outpath(dir_out=os.path.join(self.dir_out, 'CoRegPoints'),
fName_out="CoRegPoints_grid%s_ws(%s_%s)__T_%s__R_%s.shp" % (self.grid_res, self.COREG_obj.win_size_XY[0],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment