Skip to content

Write glue code to connect product-metadata to fgdb metadata utils #2303

@jackrosacker

Description

@jackrosacker

todos

  • Amend existing dcpy/lifecycle/package/shapefiles.py::write_shapefile_xml_metadata function to handle shapefile and file geodatabase metadata
  • Restructure module: move from shapefiles.py to package.py or similar
  • Update lifecycle code to handle product-metadata, including file_id arg (related to prev. item)
  • Confirm CLI works
  • Full test coverage

optional

  • Add lifecycle-level bindings for other functionality of utils (read_md, md_exists, etc.)
  • Clean up pre-existing code in shapefiles.py, if not used anywhere

examples

Calling lifecycle fn could go from this:

write_shapefile_xml_metadata(
    product_name="pluto",
    dataset_name="pluto",
    path="path/to/shp/or/zip",
    shp_name="pluto.shp",
    zip_subdir=None,
    org_md=None,
)

To something like this:

# shp example
write_metadata(
    product_name="pluto",
    dataset_name="pluto",
    path="path/to/shp/parent/or/zip",
    layer="pluto.shp",
    zip_subdir=None,
    org_md=None,
)

# fgdb example
write_metadata(
    product_name="pluto",
    dataset_name="pluto",
    path="path/to/fgdb.gdb(.zip)",
    layer="pluto",
    zip_subdir=None,            # only 'None' supported for FGDB
    org_md=None,
)
Supported file path variations

unzipped gdb

  • path/to/geodatabase.gdb/layer_name

zipped gdb, unnested

  • path/to/geodatabase.gdb.zip/geodatabase.gdb/layer_name

unzipped shapefile

  • path/to/shapefile/layer_name.shp

zipped shapefile, unnested

  • path/to/shapefile/layer_name.shp.zip/layer_name.shp

zipped shapefile, nested

  • path/to/shapefile/layer_name.shp.zip/subdir/layer_name.shp
Unsupported file path variations

zipped gdb, nested

  • path/to/geodatabase.gdb.zip/subdir/geodatabase.gdb/layer_name

gdb (zipped or unzipped), with feature dataset:

  • path/to/geodatabase.gdb(.zip)/feature_dataset/layer_name

Metadata

Metadata

Assignees

Labels

GISRelated to the GIS team

Type

No type

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions