diff --git a/README.md b/README.md index ef094e8c..e6798a5e 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,8 @@ mkdir my-output openaddr-process-one --skip-preview --layer addresses --layersource state example.json my-output ``` +Supported layer types are `addresses`, `parcels`, `buildings`, and `centerlines`. + Review https://github.com/openaddresses/openaddresses/blob/master/CONTRIBUTING.md for input json syntax. Supported conform formats include `shapefile`, `geojson`, `csv`, `xml`, `gdb`, and `gpkg`. diff --git a/openaddr/__init__.py b/openaddr/__init__.py index b3a593cf..b3fc1098 100644 --- a/openaddr/__init__.py +++ b/openaddr/__init__.py @@ -23,6 +23,7 @@ elaborate_filenames, ADDRESSES_SCHEMA, BUILDINGS_SCHEMA, + CENTERLINES_SCHEMA, PARCELS_SCHEMA, ) @@ -48,6 +49,8 @@ def __init__(self, source, layer, layersource): self.SCHEMA = BUILDINGS_SCHEMA elif self.layer == 'parcels': self.SCHEMA = PARCELS_SCHEMA + elif self.layer == 'centerlines': + self.SCHEMA = CENTERLINES_SCHEMA def cache(source_config, destdir, extras): ''' Python wrapper for openaddress-cache. diff --git a/openaddr/conform.py b/openaddr/conform.py index 25e123a0..cc1a29ef 100644 --- a/openaddr/conform.py +++ b/openaddr/conform.py @@ -49,7 +49,8 @@ def gdal_error_handler(err_class, err_num, err_msg): ADDRESSES_SCHEMA = [ 'hash', 'number', 'street', 'unit', 'city', 'district', 'region', 'postcode', 'id', 'accuracy' ] BUILDINGS_SCHEMA = [ 'hash', 'height', 'levels'] PARCELS_SCHEMA = [ 'hash', 'pid' ] -RESERVED_SCHEMA = ADDRESSES_SCHEMA + BUILDINGS_SCHEMA + PARCELS_SCHEMA + [ +CENTERLINES_SCHEMA = [ 'hash', 'id', 'name' ] +RESERVED_SCHEMA = ADDRESSES_SCHEMA + BUILDINGS_SCHEMA + PARCELS_SCHEMA + CENTERLINES_SCHEMA + [ "lat", "lon" ] diff --git a/openaddr/process_one.py b/openaddr/process_one.py index 06bc130a..4ed9cab3 100644 --- a/openaddr/process_one.py +++ b/openaddr/process_one.py @@ -106,8 +106,8 @@ def process(source, destination, layer, layersource, _L.error('explicit --layersource arg is required for v2 sources') raise ValueError('explicit --layersource arg is required for v2 sources') - # Only Address Layers are supported right now - if (layer != 'addresses' and layer != 'parcels' and layer != 'buildings'): + # Only these layers are supported right now + if layer not in ('addresses', 'parcels', 'buildings', 'centerlines'): _L.error('Nothing processed: \'{}\' layer not currently supported'.format(layer)) raise ValueError('Nothing processed: \'{}\' layer not currently supported') elif source['layers'].get(layer, None) == None: