I have CSV file where in a column there are some KML geometries. These geometries can be points, lines, polygons etc. I would like to validate them and check if they are correctly written.
I'm reading the CSV with Pandas
import pandas as pd csv = read_csv('file.csv') #Let's take into account just the first location coordinates = csv.['location'].loc[0]
coordinates would be:
<Point><coordinates>2.34880,48.85341</coordinates></Point>
I tried to proceed with fastKML, but it searches for a complete KML file to check and not just the string I got.
So I'm wondering, is there any possibility to validate directly the sting?
Regex would probably be the way to go. If you have a standard valid example of how each type should be, you can set up a regex match to validate, similar to how email addresses are validated.