catatom2osm.catatom module

Reader of Cadastre ATOM GML files.

class catatom2osm.catatom.Reader(a_path)[fuente]

Bases: object

Class to download and read Cadastre ATOM GML files.

download(layername)[fuente]

Download the file for a Cadastre layername.

Parámetros

layername (str) – Short name of the Cadastre layer. Any of “building”, “cadastralzoning”, “address”

fix_amp(gml_path, zip_path)[fuente]

Test if source needs to be escape ampersand.

fix_encoding(gml_path, zip_path)[fuente]

Test if source needs to be converted to utf-8.

get_atom_file(url)[fuente]

Try to download the ZIP file for self.zip_code.

Given the url of a Cadastre ATOM service.

get_file_object(gml_path, zip_path='')[fuente]

Get handler for gml_path (if exist) or for zip_path.

get_gml_from_zip(gml_path, zip_path, group, layername)[fuente]

Return gml layer from zip if exists and is valid or none.

get_layer_paths(layername)[fuente]
get_metadata(md_path, zip_path='')[fuente]

Get the metadata of the source file.

get_path(*paths)[fuente]

Get path from components relative to self.path.

get_path_from_zip(zf, a_path)[fuente]

Return full path in zip of this file name.

is_empty(gml_path, zip_path)[fuente]

Detect if the file is empty.

Cadastre empty files (usually otherconstruction) comes with a null feature and results in a non valid layer in QGIS.

read(layername, allow_empty=False, force_zip=False)[fuente]

Create a QGIS vector layer for a Cadastre layername.

Derive the GML filename from layername. Downloads the file if not is present. First try to read the ZIP file, if fails try with the GML file.

Parámetros
  • layername (str) – Short name of the Cadastre layer. Any of “building”, “buildingpart”, “otherconstruction”, “cadastralparcel”, “cadastralzoning”, “address”, “thoroughfarename”, “postaldescriptor”, “adminunitname”

  • allow_empty (bool) – If False (default), raise a exception for empty layer, else returns None

  • force_zip (bool) – Force to use ZIP file.

Devuelve

Vector layer.

Tipo del valor devuelto

QgsVectorLayer