catatom2osm.app module

Main application processes.

class catatom2osm.app.CatAtom2Osm(a_path, options)[fuente]

Bases: object

Main application class.

add_comments()[fuente]

Recover missing task files metadata after JOSM editing.

static create_and_run(a_path, options)[fuente]
exit()[fuente]

Exit properly.

export_layer(layer, filename, driver_name='GeoJSON', target_crs_id=None)[fuente]

Export a vector layer.

Parámetros
  • layer (QgsVectorLayer) – Source layer.

  • filename (str) – Output filename.

  • driver_name (str) – name of OGR driver (or get it from filename).

  • target_crs_id (int) – Defaults to source CRS.

export_poly()[fuente]
finish()[fuente]

Generate final report.

get_address()[fuente]

Read Address GML dataset.

get_auxiliary_addresses()[fuente]

Read and conflate auxiliary sources of addresses data.

get_boundary()[fuente]

Get best boundary search area for overpass queries.

get_building()[fuente]

Merge building, parts and pools.

get_cbcn()[fuente]

Read CartoBCN addresses.

get_current_ad_osm()[fuente]

Get OSM address for conflation.

get_highway()[fuente]

Get OSM highways for street names conflation.

get_parcel()[fuente]

Get parcels dataset.

get_place()[fuente]

Get OSM places for street names conflation.

get_split()[fuente]

Get boundary file for splitting.

static get_task_comment(label)[fuente]

Return comment for task with this label.

get_tasks(source)[fuente]

Put each source feature into a task layer.

get_translations(address)[fuente]

Get the translate file.

If there exists the translation file “highway_types.csv”, read it, else write one with default values. If the translations file “highway_names.csv” don’t exist, creates one parsing current OSM highways data, else reads and returns it as a dictionary.

  • “highway_types.csv” List of osm elements in json format located in the application path that contains translations from abbreviations to full types of highways.

  • “highway_names.csv” is located in the outputh folder and contains corrections for original highway names.

get_zoning()[fuente]

Get zoning data.

merge_address(building_osm, address_osm)[fuente]

Copy address from address_osm to building_osm using “ref” tag.

If there exists one building with the same “ref” that an address, copy the address tags to the building if it isn’t a “entrace” type address or else to the entrance if there exist a node with the address coordinates in the building.

Precondition: building.move_address deleted addresses belonging to multiple buildings

Parámetros
  • building_osm (Osm) – OSM data set with buildings

  • address_osm (Osm) – OSM data set with addresses

move_project()[fuente]

Move to tasks all files needed for the backup the in the repository.

Use a subdirectory if it’s a split municipality.

output_zoning()[fuente]

Generate project zoning file.

process_address()[fuente]

Fix street names, conflate and move addresses.

process_building()[fuente]

Process all buildings dataset.

process_parcel()[fuente]

Process parcels dataset.

process_tasks(source)[fuente]

Convert to osm for each task.

read_osm(*paths, **kwargs)[fuente]

Read an OSM data set from an OSM XML file.

If the file not exists, downloads data from overpass using ql query.

Parámetros
  • paths (str) – input filename components relative to self.path

  • ql (str) – Query to put in the url for overpass

Returns

Osm: OSM data set

resume_address()[fuente]

Resume processing for second run of addresses dataset.

run()[fuente]

Launch the app processing.

stop_address()[fuente]

Save current processing status and exits.

write_osm(data, *paths)[fuente]

Generate an OSM XML file for an OSM data set.

Parámetros
  • data (Osm) – OSM data set

  • paths (str) – output filename components relative to self.path (compress if ends with .gz)

class catatom2osm.app.QgsSingleton[fuente]

Bases: qgis._core.QgsApplication

Keep a unique instance of QGIS for the application (and tests).