You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, pygeoapi's PostgreSQL provider does not support querying across multiple tables using a configurable ForeignKey relationship. This limits users who need to join tables dynamically based on external configurations.
I propose adding support for external table relationships. At a minimum I would want this to support 1:1 and N:1 relationships. Use cases are an observations table with external relationships to a site table with geometry, a table providing additional parameter metadata, or context inclusion from a table of encompassed geometry.
Describe the solution you'd like
A user may want to join counties with states using counties.statefp = states.geoid. From some tinkering I am thinking the relationship could be expressed in the config.yml as follows:
There are obviously a myriad of ways to format the configuration and the response but I would support something simple.
Describe alternatives you've considered
I am working with a Postgres database that will not support materialized views.
I understand that automap might be able to include these types of relationships for a postgres database with the table relation defined as a foreign key (https://www.postgresql.org/docs/current/tutorial-fk.html), but this type of relationship does not work well for N:1.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, pygeoapi's PostgreSQL provider does not support querying across multiple tables using a configurable ForeignKey relationship. This limits users who need to join tables dynamically based on external configurations.
I propose adding support for external table relationships. At a minimum I would want this to support 1:1 and N:1 relationships. Use cases are an observations table with external relationships to a site table with geometry, a table providing additional parameter metadata, or context inclusion from a table of encompassed geometry.
Describe the solution you'd like
A user may want to join counties with states using counties.statefp = states.geoid. From some tinkering I am thinking the relationship could be expressed in the config.yml as follows:
and provide a response like:
There are obviously a myriad of ways to format the configuration and the response but I would support something simple.
Describe alternatives you've considered
I am working with a Postgres database that will not support materialized views.
I understand that
automap
might be able to include these types of relationships for a postgres database with the table relation defined as a foreign key (https://www.postgresql.org/docs/current/tutorial-fk.html), but this type of relationship does not work well for N:1.Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: