- HQTA Areas: metadata feature server or map server
- HQTA Stops: metadata feature server or map server
- CA Transit Routes: metadata feature server or map server
- CA Transit Stops: metadata feature server or map server
- CA Average Transit Speeds by Stop-to-Stop Segments: metadata feature server or map server
- CA Average Transit Speeds by Route and Time of Day: metadata feature server or map server
- All GTFS datasets metadata/data dictionary
Traffic Ops had a request for all transit routes and transit stops to be published in the open data portal.
- Update
update_vars.pyfor current month - In terminal:
make create_gtfs_schedule_geospatial_open_data- prep_traffic_ops: helper functions for creating
routesandstopsdatasets - create_routes_data: functions to assemble routes that appear in
shapes - create_stops_data: functions to assemble stop data
- prep_traffic_ops: helper functions for creating
- If this is the first time running, do the following:
- Create a new ArcGIS Pro project. In its home folder, place the HQRail .sde file, which you will need provided to you.
- Download and install Microsoft SQL Server. This will require assistance from IT.
- Add all datasets that are to be pulished to the
RUN_MElist inupdate_vars.py. - Add all datasets that are to be published to
catalog.ymland rungcs_to_esri.- In terminal:
cd open_datafollowed bypython gcs_to_esri.py - Since this file is under source control, it only needs to be changed if new datasets are being added.
- The log will show basics like column names and EPSG. Make sure the metadata reflects the same info!
- Only use EPSG:4326 (WGS84). All open data portal datasets will be in WGS84.
- In terminal:
- If there are new datasets to add or changes to make, make them in
metadata.ymland/ordata_dictionary.yml.- If there are changes to make in
metadata.yml, make them. Afterwards, in terminal, run:python supplement_meta.py
- If there are changes to make in
- If there are changes to be made to metadata.yml (adding new datasets, changing descriptions, change contact information, etc), make them. This is infrequent. An updated analysis date is already automated and does not have to be updated here.
- In the JupyterHub terminal:
python supplement_meta.py - In the JupyterHub terminal:
python update_data_dict.py.- Check the log results, which tells you if there are columns missing from
data_dictionary.yml. These columns and their descriptions need to be added. Every column in the ESRI layer must have a definition, and where there's an external data dictionary website to cite, provide a definition source.
- Check the log results, which tells you if there are columns missing from
- In the JupyterHub terminal:
python update_fields_fgdc.py. This populates fields withdata_dictionary.ymlvalues.- Only run if
update_data_dicthad changes to incorporate
- Only run if
- Download all zipped shapefiles created by
gcs_to_esri.pyandmetadata.jsonto your ArcGIS project directory. Delete any existing xml files in this directory that may have been generated in prior runs. - Open ArcGIS Pro to the project with the .sde file.
- In ArcGIS, run the ArcGIS Notebook to create XML files.
- Download
arcgis_pro_script.pyandarcgis_pro_notebook_sample.ipynbto your ArcGIS project. - Open the notebook in ArcGIS and update the value of
arcpy.env.workspaceto match the path to your ArcGIS working directory. This is likely the directory created as your ArcGIS "project", and should contain your downloaded files. - Run the notebook up to the markdown instructions to "Do field data dictionary updates in Jupyter Hub".
- Check that two xml files have been updated per dataset, one should have have the same name of the dataset and one should be suffixed
_fgdc.
- Download
- Upload the non-fgdc XML files to JupyterHub at
open_data/xml/. - In the JupyterHub terminal:
python metadata_update_pro.py.- The overwritten XML is stored in
open_data/xml/run_in_esri/. - Download the overwritten XML files locally to run in ArcGIS.
- The overwritten XML is stored in
- For each dataset, update the FGDC XML:
- From the ribbon, select "View", then "Catalog view" (not to be confused with the Catalog pane)
- From the tab that opens, open "Folders", then your project's working directory, then open
staging.gdb - You should see a list of each dataset. For each dataset, select it (click once), then from the ribbon select "Catalog" then Import in the metadata section. There will likely be several identically labeled buttons that say "Import", but only the one within the metadata section is useful here.
- You should see a popup window with two display boxes - one that says "Import metadata from", and one that says "The type of metadata to import". In "Import metadata from" box, enter the path to the
*_fgdc.xmlfile that was generated earlier. You should be able to open a file browser with the little folder icon. In the "The type of metadata to import" box, select the option containing "FGDC". - Please also add the corresponding thumbnail image, via the "edit metadata" option.
- Repeat this process for each dataset.
- Run the remainder of the ArcGIS notebook after importing the updated XML metadata for each feature class.
- Note that since you re-started ArcGIS, the notebook's kernel will restart and you will need to re-run the first few cells.
- We no longer have an enterprise geodatabase (.sde) for this workflow, instead zip and upload the completed file geodatabase
dds_data_sci_open_data.gdb, fill out the open data request form with a link to that file. - There are steps to create FGDC templates for each datasets to store field information, but this only needs to be done once when a new dataset is created.
- In terminal:
python cleanup.pyto clean up old XML files and remove zipped shapefiles.- The YAML and XML files created/have changes get checked into GitHub.
- Metadata
- Data dictionary
- update_vars contains a lot of the variables that would frequently get updated in the publishing process.
- Apply standardized column names across published datasets, even they differ from internal keys (
org_idin favor ofgtfs_dataset_key,agencyin favor oforganization_name). - Since we do not save multiple versions of published datasets, the columns are renamed prior to exporting the geoparquet as a zipped shapefile.
- Apply standardized column names across published datasets, even they differ from internal keys (
- Do a final check of datasets uploaded to the enterprise geodatabase (column names? metadata? record counts?).
- Check that column names match your expectations
- Check that metadata is correct.
- To view all metadata, you may need to select "Project" from the ArcGIS ribbon, then "Options", then "Metadata", then from the dropdown labeled "Metadata style" select "FGDC CSDGM Metadata"
- The CRS should be EPSG:4326, and all columns should have a description
- Check that the geographic extent of each layer seems plausible
- Check that the number of records is comparable to the number of records for the prior month.
- Open a ticket on the Intranet to update or add new services and provide justification