# coding=UTF8

# Usage of catastro reader

import etl, config, dataformat
reload(etl)
reload(config)
reload(dataformat)

# Process a shapefile package
# a = etl.ShapeReader(config.config["pgconn"], "default")
# a.pgOpen()
# a.read("Test-Data/Rustico/ALMERIA_RUS/04_01_RA_2014-09-26_SHF.zip", filter=["parcela", "subparce"])
# a.pgClose()

# Process al shapefile packages in a root
a = etl.CatastroShapeBatchProcess('Test-Data', config.config["pgconn"], "default", filter=["parcela", "constru"])
a.process()

# Process a CAT package and get the lines
# a = etl.CatReader(dataformat)
# a.read("Test-Data/Rustico/04_01_R_2014-09-26.CAT.gz")
# print a.lines

# Process a CAT package and store it in the database
# a = etl.CatastroCatProcess()
# a.read("Test-Data/Rustico/04_01_R_2014-09-26.CAT.gz", dataformat)
