Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
3 changes: 3 additions & 0 deletions openaddr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
elaborate_filenames,
ADDRESSES_SCHEMA,
BUILDINGS_SCHEMA,
CENTERLINES_SCHEMA,
PARCELS_SCHEMA,
)

Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion openaddr/conform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down
4 changes: 2 additions & 2 deletions openaddr/process_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading