Connecting to Webodm database

Is there a way that I could connect to webodm database using gdal-python api. Something similar to the example in the link. Vector Layers — Python GDAL/OGR Cookbook 1.0 documentation
Currently I’m running webodm latest version in development environment in Windows 10 with docker.
I did try to connect but was unsuccessful. The result I got was none. As far as I understand the db is inside docker container but it should be accessible via localhost with port 5432 right.?


The database is not exposed outside of the docker environment by default, but you can make it so by modifying with:

- "5432:5432"

And restarting WebODM.

I did try as you mention but got error as below. Even I tried with different port number but the error I got was same in all the cases.

One thing that I noticed with default settings is that the db container is already mapped to 5432 port of server
so do I need to do “5432:5432” in WebODM/docker-compose.yml at master · OpenDroneMap/WebODM · GitHub

Finally I was able to connect to webodm database.:sweat_smile: The problem was the 5432 port was already allocated to a user that I created when installing PostgresSql in my local machine. First number is for <host_port>:and Second is for <container_port> so I was doing the opposite. Kept on changing the container port number and wondered why it wasn’t working :rofl: Anyways thank you for helping :innocent:

One more thing is that at present I am installing GDAL-Python bindings inside the docker container by building it from source. But is there a way that I can add this to the build process so that it also gets installed when the container is created.

1 Like

need help at this level