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
coordinates would be:
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.