Skip to content
Snippets Groups Projects
gml_format.py 309 B
Newer Older
  • Learn to ignore specific revisions
  • Jesper Zedlitz's avatar
    Jesper Zedlitz committed
    import geopandas
    
    
    def is_valid(resource, file):
        """Check if the content is a readable GML file."""
    
        with open(file.name, "rb") as f:
            try:
                geopandas.read_file(f)
                return True
            except Exception as e:
                resource["error"] = str(e)
                return False