Open evecchi opened 3 weeks ago
hi @evecchi , I remember there was another issue where someone was loading the geojson in QGIS/Arc, cleaning it up and wanted to continue with the cleaned geometry. I'll flag it as an enhacement. I would suggest that you add a section where you do the follow:
gdf = gpd.read_file(filename_geojson)
np.array(gdf.iloc[0].geometry.coords)
. Make sure that the index is matching with the right date. Then you can save output.pkl again and continue with the notebook.While writing this I'm realising that it may be much easier to bring in your polygon shapefile with geopandas and then clip all the shoreline points based on the polygon. Have a go at either option and let me know if you need help, should be feasible. Also make sure that the coordinate system is not altered when going in and out of QGIS/Arc.
Hi @kvos,
thank you for the advice! The first method is working!!!
Hi @kvos,
I'm writing you to ask a question about the output geojson and pkl files (SITENAME_output.geojson/pkl). I'm trying to add a new section of the script where the extracted shorelines are clipped basing on a given polygon, to clean possible incorrect points which are not related to the shoreline. Thus, I'm using the output geojson, clipping it using a polygon shapefile and I want to load the clipped geojson back to your script. For the following steps, I would need the clipped output to be read again as a dictionary and as a pkl file, right? But the exported output.geojson seems to have only the following keys: (['type', 'crs', 'features']), and to be not complete having: (['dates', 'shorelines', 'filename', 'cloud_cover', 'geoaccuracy', 'idx', 'MNDWI_threshold', 'satname']).
What do you suggest?
Thank you in advance
Enrica