Closed jimpaulobautista closed 1 year ago
do not comment out the parameters in the dictionary, just leave them as by default. Then it will work.
Hi Kilian @kvos ! Thank you for your response. I have tried your suggestion but I keep on getting this error:
Thanks.
it's missing a comma in the 'save_figure' line
Thanks for the swift response Kilian @kvos . I think I am having the same issue with @lexterspiritus97 based on the recently opened thread. I followed your advice there and it worked! I have moved forward in reference shoreline digitization, but similar to his/her/their problem, I also got this error: AttributeError: 'GeoDataFrame' object has no attribute 'append'. Can't find any solution yet but I hope we can figure this out.
`--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[10], line 2 1 get_ipython().run_line_magic('matplotlib', 'qt') ----> 2 settings['reference_shoreline'] = SDS_preprocess.get_reference_sl(metadata, settings) 3 settings['max_dist_ref'] = 100 # max distance (in meters) allowed from the reference shoreline
File ~\Downloads\CoastSat-master\coastsat\SDS_preprocess.py:848, in get_reference_sl(metadata, settings) 846 gdf_all = gdf 847 else: --> 848 gdf_all = gdf_all.append(gdf) 849 gdf_all.crs = CRS(image_epsg) 850 # convert from image_epsg to user-defined coordinate system
File ~\anaconda3\envs\coastsat\lib\site-packages\pandas\core\generic.py:5989, in NDFrame.getattr(self, name) 5982 if ( 5983 name not in self._internal_names_set 5984 and name not in self._metadata 5985 and name not in self._accessors 5986 and self._info_axis._can_hold_identifiers_and_holds_name(name) 5987 ): 5988 return self[name] -> 5989 return object.getattribute(self, name)
AttributeError: 'GeoDataFrame' object has no attribute 'append'`
Hi Jim Paulo Bautista, I see that you got the same AttributeError that I got. I'll try to find out what happens with this, maybe like Kilian says the .append is deprecated for geodataframe. Let's hope to find the answer soon on the web. I'm using the coastsat 2.2 version, what version are you using? Maybe an older version works without these errors. Well, thankyou Jim, by your comment. keep in touch, greetings, Lexter.
El vie, 21 abr 2023 a las 9:29, Jim Paulo Bautista (< @.***>) escribió:
Thanks for the swift response Kilian @kvos https://github.com/kvos . I think I am having the same issue with @lexterspiritus97 https://github.com/lexterspiritus97 based on the recently opened thread. I followed your advice there and it worked! I have moved forward in reference shoreline digitization, but similar to his/her/their problem, I also got this error: AttributeError: 'GeoDataFrame' object has no attribute 'append'. Can't find any solution yet but I hope we can figure this out.
`--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[10], line 2 1 get_ipython().run_line_magic('matplotlib', 'qt') ----> 2 settings['reference_shoreline'] = SDS_preprocess.get_reference_sl(metadata, settings) 3 settings['max_dist_ref'] = 100 # max distance (in meters) allowed from the reference shoreline
File ~\Downloads\CoastSat-master\coastsat\SDS_preprocess.py:848, in get_reference_sl(metadata, settings) 846 gdf_all = gdf 847 else: --> 848 gdf_all = gdf_all.append(gdf) 849 gdf_all.crs = CRS(image_epsg) 850 # convert from image_epsg to user-defined coordinate system
File ~\anaconda3\envs\coastsat\lib\site-packages\pandas\core\generic.py:5989, in NDFrame.getattr(self, name) 5982 if ( 5983 name not in self._internal_names_set 5984 and name not in self._metadata 5985 and name not in self._accessors 5986 and self._info_axis._can_hold_identifiers_and_holds_name(name) 5987 ): 5988 return self[name] -> 5989 return object.getattribute(self, name)
AttributeError: 'GeoDataFrame' object has no attribute 'append'`
— Reply to this email directly, view it on GitHub https://github.com/kvos/CoastSat/issues/396#issuecomment-1517838386, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7JEGEJIIPMMDP5G7MOOLJ3XCKDVNANCNFSM6AAAAAAXDXQUSE . You are receiving this because you were mentioned.Message ID: @.***>
ok seems to be a recurring error, I'll troubleshoot next week. But you can still continue with the notebook, don't worry if you don't have then .geojson
Hello! Based on my web search the frame.append (gdf.append) has already been deprecated since panda v1.4.0.
(The frame.append method is depreciated and will be removed from pandas in a future version. Use pandas.concat instead.)
Some users made mention about using concat
but I haven't figured it out as of this moment.
Thank You Jim!!! Good to know this. Now I'm aware of this. I searched in the web now, and is like you said, it is being deprecated. Someone posted a new issue (29) in the CoastSat GitHub, with the same situation: AttributeError: 'GeoDataFrame' object has no attribute 'append. So, maybe Kilian is now aware of this too, and can find a solution for this part of the code. Greetings, Lexter.
El lun, 24 abr 2023 a las 4:29, Jim Paulo Bautista (< @.***>) escribió:
Hello! Based on my web search https://github.com/geopandas/geopandas/issues/2606 the frame.append (gdf.append) has already been deprecated since panda v1.4.0.
(The frame.append method is depreciated and will be removed from pandas in a future version. Use pandas.concat instead.)
Some users made mention about using concat but I haven't figured it out as of this moment.
— Reply to this email directly, view it on GitHub https://github.com/kvos/CoastSat/issues/396#issuecomment-1519620055, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7JEGEN6ZH2ENLEWQZCUMOTXCY2VHANCNFSM6AAAAAAXDXQUSE . You are receiving this because you were mentioned.Message ID: @.***>
Update: @kvos @lexterspiritus97
I followed the changes made in the thread I mentioned last time. I traced the error to line 714 of SDS_tools.py gdf_all = gdf_all.append(gdf)
and replaced it with the code
At the start:
import pandas as pd
At line 714, replace the code with:
res = pd.concat([gdf_all, gdf]) type(res)
I was able to extract the GEOJSON shoreline. However, upon loading in QGIS, it seems that there's a minor error with the extracted shoreline (see photo below). I don't know if this is caused by the changes I made on the code, or it is caused by the "broken shoreline" where the river drains towards the sea.
May I know this solution works on your end? Or do you know how to fix this using the adjustments on the code? Eitherway, I think the error on the GEOJSON file can be fixed manually using the tools in QGIS. Thanks.
hi @jimpaulobautista , thanks for the solution, this works! can you pls make a pull request with that change? directly to the master branch. The issue with the way the linestrings are connected is a separate one and existed before as well. To overcome it, you can choose points
instead of lines
. Thanks for the nice contribution!
This solution also solves issues #398 #397
this has been fixed by @jimpaulobautista ! #400 thanks
Hello! Excellent work in automating shoreline extraction.
I was able to successfully retrieve satellite images using the workflow you established. However, upon applying the preprocessing parameters and attempting to execute outputs = SDS_shoreline.extract_shorelines(metadata, settings), the screen keeps on showing: Can you please help me figure out what's wrong?
Here's the code I used:
Also, it seems that the advanced shoreline detection parameters are not working and jupyter keeps on telling me "Syntax Error". Moreover, I tried executing the example on Narrabeen beach using solely the code you developed but I am stuck with this problem:
Thank you so much!