Skip to content

Conversation

@ehinman
Copy link
Collaborator

@ehinman ehinman commented Jan 15, 2026

I realized I initially built the reference table function to match dataRetrieval, thinking that there was a reason we couldn't reuse the get_ogc_data() function, but I think this is inefficient and incorrect. Swapped out the repeated code for get_ogc_data and changed the "id" column to the singular subject name of the reference table, e.g. "site-type-codes" has the "id" column changed to "site_type_code" (the rest of the columns swap underscores for dashes, so keeping consistent).

I also learned that if there aren't any geometries present in the dataframe, geopandas will simply return a pandas DataFrame. This avoids the issue I created in the last MR where I thought I had to specify "no geopandas" to get back a regular dataframe, and the logger was yelling about geopandas not being installed due to my oversight.

The only risk is that URLs contain the argument skipGeometry=FALSE, like this:
https://api.waterdata.usgs.gov/ogcapi/v0/collections/time-zone-codes/items?skipGeometry=False&limit=50000

However, it doesn't seem to actually affect what comes back.

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

Successfully merging this pull request may close these issues.

1 participant