Skip to content

Commit 141623b

Browse files
authored
Merge pull request #95 from openaddresses/add-centerlines
Add centerlines layer support
2 parents bf118a6 + 9286f60 commit 141623b

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ mkdir my-output
5959
openaddr-process-one --skip-preview --layer addresses --layersource state example.json my-output
6060
```
6161

62+
Supported layer types are `addresses`, `parcels`, `buildings`, and `centerlines`.
63+
6264
Review https://github.com/openaddresses/openaddresses/blob/master/CONTRIBUTING.md for input json syntax.
6365

6466
Supported conform formats include `shapefile`, `geojson`, `csv`, `xml`, `gdb`, and `gpkg`.

openaddr/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
elaborate_filenames,
2424
ADDRESSES_SCHEMA,
2525
BUILDINGS_SCHEMA,
26+
CENTERLINES_SCHEMA,
2627
PARCELS_SCHEMA,
2728
)
2829

@@ -48,6 +49,8 @@ def __init__(self, source, layer, layersource):
4849
self.SCHEMA = BUILDINGS_SCHEMA
4950
elif self.layer == 'parcels':
5051
self.SCHEMA = PARCELS_SCHEMA
52+
elif self.layer == 'centerlines':
53+
self.SCHEMA = CENTERLINES_SCHEMA
5154

5255
def cache(source_config, destdir, extras):
5356
''' Python wrapper for openaddress-cache.

openaddr/conform.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def gdal_error_handler(err_class, err_num, err_msg):
4949
ADDRESSES_SCHEMA = [ 'hash', 'number', 'street', 'unit', 'city', 'district', 'region', 'postcode', 'id', 'accuracy' ]
5050
BUILDINGS_SCHEMA = [ 'hash', 'height', 'levels']
5151
PARCELS_SCHEMA = [ 'hash', 'pid' ]
52-
RESERVED_SCHEMA = ADDRESSES_SCHEMA + BUILDINGS_SCHEMA + PARCELS_SCHEMA + [
52+
CENTERLINES_SCHEMA = [ 'hash', 'id', 'name' ]
53+
RESERVED_SCHEMA = ADDRESSES_SCHEMA + BUILDINGS_SCHEMA + PARCELS_SCHEMA + CENTERLINES_SCHEMA + [
5354
"lat",
5455
"lon"
5556
]

openaddr/process_one.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ def process(source, destination, layer, layersource,
106106
_L.error('explicit --layersource arg is required for v2 sources')
107107
raise ValueError('explicit --layersource arg is required for v2 sources')
108108

109-
# Only Address Layers are supported right now
110-
if (layer != 'addresses' and layer != 'parcels' and layer != 'buildings'):
109+
# Only these layers are supported right now
110+
if layer not in ('addresses', 'parcels', 'buildings', 'centerlines'):
111111
_L.error('Nothing processed: \'{}\' layer not currently supported'.format(layer))
112112
raise ValueError('Nothing processed: \'{}\' layer not currently supported')
113113
elif source['layers'].get(layer, None) == None:

0 commit comments

Comments
 (0)