0

I am following instructions in this link to make mvt file https://blog.jawg.io/how-to-make-mvt-with-postgis/

When I did the setup and ran generate-tiles.sh , I get the error that bbox function does not exist ERROR: function bbox(integer, integer, integer) does not exist LINE 8: BBox(16596, 11273, 15)

If you scroll that page, he is mentioning he is using a helper function and also has given the link. https://raw.githubusercontent.com/jawg/blog-resources/master/how-to-make-mvt-with-postgis/bbox.sql

I do not have experience with postgis and docker and hence I am stuck. So my question is, how do I load/install/mount the .sql file so that the script does not produce the error and can call the bbox function ?

madan kandula
  • 460
  • 5
  • 22
  • On what step do you have this error ? Seems like you have not create function on database just open pgadmin or other tool to connect with DB and use the code from the helper first then do your steps. – Grzegorz Grabek Oct 21 '18 at 17:13
  • copy/create the file within the container. See https://stackoverflow.com/questions/3393961/how-to-import-existing-sql-files-in-postgresql-8-4 on how to load sql file via psql (you'll have to login to container's bash terminal first). – jimmu Oct 21 '18 at 21:34

1 Answers1

0

Thanks for the comments.

Adding this line to the script file helped.

psql -h /var/run/postgresql -p 5432 -U postgres -d [dbName] -f [scriptsDir]/bbox.sql;

Replace [dbName] with your actual database name and [scriptsDir] where bbox.sql is present.

To verify the port, run this command

sudo lsof -U -a -c postgres
madan kandula
  • 460
  • 5
  • 22