Skip to content

restructured to use docker compose #8

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

Merged
merged 12 commits into from
Apr 2, 2024
Merged

restructured to use docker compose #8

merged 12 commits into from
Apr 2, 2024

Conversation

iboates
Copy link
Collaborator

@iboates iboates commented Mar 27, 2024

Closes #1

Closes #4

Everything is shoved into a single .env file because I have had a weird amount of problems when trying to specify non-default .env file locations.

Also changed the query to use SQL instead of plpgsql

In any case, everything should work as expected, just dockerized

@iboates iboates requested a review from JakobMiksch March 27, 2024 19:17
Copy link
Owner

@JakobMiksch JakobMiksch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the pr. inline some notes and ideas

@iboates
Copy link
Collaborator Author

iboates commented Mar 28, 2024

@JakobMiksch I also included an update to the query function to use SQL instead of plpgsql in this PR

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, this is much cleaner.
IMHO we can also drop the prefix OSM_PG_FEATURESERV_
or is there a specific need to have it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just namespacing. I try to do it on all my project. If you prefer, I can remove it.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, currently I do not see an advantage of the prefix. For me it makes the config files more verbose

Comment on lines +20 to +25

Then, create the necessary function for pg_featureserv to return features via API request:

```sh
docker compose exec db psql -f /data/query_function.sql
```
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the README and apparently the function must be created after the OSM tables, because the function references the table

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we either move the creation of the function after the osm2pgsql or we revert the change of the function and handle the issue #4 in a separate PR

Comment on lines +35 to +38
* Specify slim mode to keep the "middle tables" so we can enable automatic updates [(relevant osm2pgsql docs)](https://osm2pgsql.org/doc/manual.html#middle)
* Specify output mode as "flex" so that we can use the flex output [(relevant osm2pgsql docs)](https://osm2pgsql.org/doc/manual.html#output-options)
* Use the flex style config file (`data/flex_syle.lua`) [(relevant osm2pgsql docs)](https://osm2pgsql.org/doc/manual.html#lua-library-for-flex-output)
* Specify "raw" as the prefix so that the tables being with `raw` [(relevant osm2pgsql docs)](https://osm2pgsql.org/doc/manual.html#database-layout)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we do not need this explanation. People can just read the offical docs or ask a LLM.

db:
condition: service_healthy
db:
image: postgis/postgis:16-3.4
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the official postgis docker image automatically installs the tiger extension (see postgis/docker-postgis#187), which we do not need at all.
that's why I originally used the kartoza postgis image.
if we want to stick to the officical postgis image, we must mount a sql file with the content create extension postgis to the start directory

Copy link
Owner

@JakobMiksch JakobMiksch Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a PR on this PR that fixes this: #11 just merge or approve it if you agree

@JakobMiksch
Copy link
Owner

JakobMiksch commented Mar 29, 2024

@iboates thanks for the updates, I tried it and it worked mostly as expected. See my comments inline

Copy link
Owner

@JakobMiksch JakobMiksch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am merging. We can fix the remaining stuff in follow up MRs

@JakobMiksch JakobMiksch merged commit 1071b13 into main Apr 2, 2024
@JakobMiksch JakobMiksch deleted the dockerize branch April 2, 2024 18:10
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.

postgres function: check if pl/pgsql is necessary create a basic docker-compose setup
2 participants