Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema for WHSE_LAND_USE_PLANNING RMP_LANDSCAPE_RSRV_DESIGN_SP is in resource of format oracle_sde, not wms #181

Closed
smnorris opened this issue Jun 6, 2024 · 5 comments
Milestone

Comments

@smnorris
Copy link
Owner

smnorris commented Jun 6, 2024

$ bcdata list | grep WHSE_LAND_USE_PLANNING.RMP_LANDSCAPE_RSRV_DESIGN_SP
WHSE_LAND_USE_PLANNING.RMP_LANDSCAPE_RSRV_DESIGN_SP

$ bcdata info WHSE_LAND_USE_PLANNING.RMP_LANDSCAPE_RSRV_DESIGN_SP
Traceback (most recent call last):
  File "/Users/snorris/Projects/repo/harvest-restrictions/harvest_env/bin/bcdata", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/snorris/Projects/repo/harvest-restrictions/harvest_env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/snorris/Projects/repo/harvest-restrictions/harvest_env/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/snorris/Projects/repo/harvest-restrictions/harvest_env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/snorris/Projects/repo/harvest-restrictions/harvest_env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/snorris/Projects/repo/harvest-restrictions/harvest_env/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/snorris/Projects/repo/harvest-restrictions/harvest_env/lib/python3.11/site-packages/bcdata/cli.py", line 137, in info
    table_definition = bcdata.get_table_definition(dataset)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/snorris/Projects/repo/harvest-restrictions/harvest_env/lib/python3.11/site-packages/bcdata/bcdc.py", line 144, in get_table_definition
    raise ValueError(
ValueError: BCDC search for WHSE_LAND_USE_PLANNING.RMP_LANDSCAPE_RSRV_DESIGN_SP does not return a table schema
@smnorris
Copy link
Owner Author

smnorris commented Jun 6, 2024

details key is empty for the wms resource.

@smnorris
Copy link
Owner Author

smnorris commented Jun 6, 2024

There are resources in the result (wms,kml,oracle_sde), and the resource with the schema details is the oracle_sde - not a format bcdata currently scans for details.

@smnorris
Copy link
Owner Author

smnorris commented Jun 6, 2024

https://catalogue.data.gov.bc.ca/api/3/action/package_search?q=%22WHSE_LAND_USE_PLANNING.RMP_LANDSCAPE_RSRV_DESIGN_SP%22

 "resources": [
          {
            "cache_last_updated": null,
            "package_id": "bdaf676e-200d-462a-9bc4-7bda79bda58f",
            "datastore_active": "false",
            "id": "6d8b0a7e-79b8-4e97-bd70-980e06bf5828",
            "description": "The Distribution Service allows for data to be downloaded in various file formats from the B.C. Geographic Warehouse (BCGW), a central government repository of spatial and non-spatial data.",
            "spatial_datatype": "SDO_GEOMETRY",
            "iso_topic_category": [
              "environment",
              "planningCadastre"
            ],
            "object_name": "WHSE_LAND_USE_PLANNING.RMP_LANDSCAPE_RSRV_DESIGN_SP",
            "temporal_extent": "{\"[object Object]\":\"\"}",
            "state": "active",
            "details": "[{\"data_precision\": 10, \"column_comments\": \"A system generated unique identification number.\", \"short_name\": \"RMP_LRD_SD\", \"data_type\": \"NUMBER\", \"column_name\": \"RMP_LRD_SYSID\"}, {\"data_precision\": 80, \"column_comments\": \"The Landcape Unit name as per the Landscape Units of British Columbia.\", \"short_name\": \"LU_NAME\", \"data_type\": \"VARCHAR2\", \"column_name\": \"LU_NAME\"}, {\"data_precision\": 7, \"column_comments\": \"The date that the Landscape Reserve Design was offically accepted by the Great Bear Rainforest G2G (Government to Government).\", \"short_name\": \"LRD_EST_DT\", \"data_type\": \"DATE\", \"column_name\": \"LRD_ESTABLISHMENT_DATE\"}, {\"data_precision\": 7, \"column_comments\": \"The date of most recent Great Bear Rainforest G2G (Government to Government) approval.\", \"short_name\": \"AMEND_DATE\", \"data_type\": \"DATE\", \"column_name\": \"LATEST_AMENDMENT_DATE\"}, {\"data_precision\": 10, \"column_comments\": \"The status of the Landscape Reserve Design area, i.e., current, retired.\", \"short_name\": \"LRD_STATUS\", \"data_type\": \"VARCHAR2\", \"column_name\": \"LRD_STATUS\"}, {\"data_precision\": 19, \"column_comments\": \"The system calculated area of a two-dimensional polygon in square meters.\", \"short_name\": \"FEAT_AREA\", \"data_type\": \"NUMBER\", \"column_name\": \"FEATURE_AREA_SQM\"}, {\"data_precision\": 19, \"column_comments\": \"The system calculated length or perimeter of a geometry in meters.\", \"short_name\": \"FEAT_LEN\", \"data_type\": \"NUMBER\", \"column_name\": \"FEATURE_LENGTH_M\"}, {\"data_precision\": 1, \"column_comments\": \"The column used to reference the spatial coordinates defining the feature.\", \"short_name\": \"SHAPE\", \"data_type\": \"SDO_GEOMETRY\", \"column_name\": \"SHAPE\"}, {\"data_precision\": 38, \"column_comments\": \"A column required by spatial layers that interact with ESRI ArcSDE. It is populated with unique values automatically by SDE.\", \"short_name\": \"OBJECTID\", \"data_type\": \"NUMBER\", \"column_name\": \"OBJECTID\"}, {\"data_precision\": 4000, \"column_comments\": \"A binary column used by spatial tools to store annotation, curve features and CAD data when using the SDO_GEOMETRY storage data type.\", \"short_name\": null, \"data_type\": \"BLOB\", \"column_name\": \"SE_ANNO_CAD_DATA\"}]",
            "bcdc_type": "geographic",
            "size": null,
            "resource_access_method": "indirect access",
            "hash": "",
            "object_short_name": "RMP_LRD",
            "format": "oracle_sde",
...

@smnorris
Copy link
Owner Author

smnorris commented Jun 6, 2024

bcdata can just be updated to add formats to scan for details as users find datasets that fail, but there must be a better way?

@smnorris
Copy link
Owner Author

smnorris commented Jun 6, 2024

@ateucher - before I get too deep into scanning the R source, do you have any guidance on whether schema details for this package are successfully picked up by R bcdata? And if so, do you just scan all resource formats, looking for a details key? I've just been looking at resources of "format"= "wfs"

@smnorris smnorris changed the title no schema available for WHSE_LAND_USE_PLANNING.RMP_LANDSCAPE_RSRV_DESIGN_SP schema for WHSE_LAND_USE_PLANNING RMP_LANDSCAPE_RSRV_DESIGN_SP is in resource of format oracle_sde, not wms Jun 6, 2024
@smnorris smnorris added this to the 0.10.3 milestone Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant