I’m too familiar with the internals of geopandas, but it looks like your KML file might have a sentinel value for missing in it? So that does not get converted to geom type, and then when you try to use the method it chokes.
Can you try something like df['geometry_str'] = [str(x) for x in df['geometry']? Pretty sure that base Python falls back to calling repr_str or something similar so almost anything works.
Hello @randyzwitch , thank you for your reply. The KML files are not the problem, they are not missing any value. In this case I wanted to use Streamlit to display the results of a project I have done and so far the only problem I have had is with displaying the data from the KML files in a data frame, for the rest of the calculations I have no problem. It is true that the “geometry” column of the KML files is quite special, I think that simply disturbs it because it is something very specific to Geopandas. I tried what you advised me but it didn’t work either, the best result I got was using st.write, but that piece of code comes out as I show in my first post.
I think the solution to this problem is more complex to deal with and is directly related to geopandas, for now I will simply not show a data frame, the rest of the code works fine.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.