(output, geomtype)
return gdf_all
Saves the mapped shorelines as a gpd.GeoDataFrame    
    
    KV WRL 2018

    Arguments:
    -----------
    output: dict
        contains the coordinates of the mapped shorelines + attributes
    geomtype: str
        'lines' for LineString and 'points' for Multipoint geometry      
                
    Returns:    
    -----------
    gdf_all: gpd.GeoDataFrame
        contains the shorelines + attirbutes
Saves the mapped shorelines as a gpd.GeoDataFrame    
    
    KV WRL 2018
Saves the mapped shorelines as a gpd . GeoDataFrame KV WRL 2018
def output_to_gdf(output, geomtype):
    """
    Saves the mapped shorelines as a gpd.GeoDataFrame    
    
    KV WRL 2018

    Arguments:
    -----------
    output: dict
        contains the coordinates of the mapped shorelines + attributes
    geomtype: str
        'lines' for LineString and 'points' for Multipoint geometry      
                
    Returns:    
    -----------
    gdf_all: gpd.GeoDataFrame
        contains the shorelines + attirbutes
  
    """    
     
    # loop through the mapped shorelines
    counter = 0
    for i in range(len(output['shorelines'])):
        # skip if there shoreline is empty 
        if len(output['shorelines'][i]) == 0:
            continue
        else:
            # save the geometry depending on the linestyle
            if geomtype == 'lines':
                geom = geometry.LineString(output['shorelines'][i])
            elif geomtype == 'points':
                coords = output['shorelines'][i]
                geom = geometry.MultiPoint([(coords[_,0], coords[_,1]) for _ in range(coords.shape[0])])
            else:
                raise Exception('geomtype %s is not an option, choose between lines or points'%geomtype)
            # save into geodataframe with attributes
            gdf = gpd.GeoDataFrame(geometry=gpd.GeoSeries(geom))
            gdf.index = [i]
            gdf.loc[i,'date'] = output['dates'][i].strftime('%Y-%m-%d %H:%M:%S')
            gdf.loc[i,'satname'] = output['satname'][i]
            gdf.loc[i,'geoaccuracy'] = output['geoaccuracy'][i]
            gdf.loc[i,'cloud_cover'] = output['cloud_cover'][i]
            # store into geodataframe
            if counter == 0:
                gdf_all = gdf
            else:
                gdf_all = gdf_all.append(gdf)
            counter = counter + 1
            
    return gdf_all
def output_to_gdf ( output , geomtype ) : # loop through the mapped shorelines counter = 0 for i in range ( len ( output [ 'shorelines' ] ) ) : # skip if there shoreline is empty  if len ( output [ 'shorelines' ] [ i ] ) == 0 : continue else : # save the geometry depending on the linestyle if geomtype == 'lines' : geom = geometry . LineString ( output [ 'shorelines' ] [ i ] ) elif geomtype == 'points' : coords = output [ 'shorelines' ] [ i ] geom = geometry . MultiPoint ( [ ( coords [ _ , 0 ] , coords [ _ , 1 ] ) for _ in range ( coords . shape [ 0 ] ) ] ) else : raise Exception ( 'geomtype %s is not an option, choose between lines or points' % geomtype ) # save into geodataframe with attributes gdf = gpd . GeoDataFrame ( geometry = gpd . GeoSeries ( geom ) ) gdf . index = [ i ] gdf . loc [ i , 'date' ] = output [ 'dates' ] [ i ] . strftime ( '%Y-%m-%d %H:%M:%S' ) gdf . loc [ i , 'satname' ] = output [ 'satname' ] [ i ] gdf . loc [ i , 'geoaccuracy' ] = output [ 'geoaccuracy' ] [ i ] gdf . loc [ i , 'cloud_cover' ] = output [ 'cloud_cover' ] [ i ] # store into geodataframe if counter == 0 : gdf_all = gdf else : gdf_all = gdf_all . append ( gdf ) counter = counter + 1 return gdf_all