# Trying to create my own version of openpoiservice

**URL:** <https://ask.openrouteservice.org/t/trying-to-create-my-own-version-of-openpoiservice/4461>\
**Category:** openpoiservice\
**Created:** [January 9, 2023, 5:42pm UTC](https://ask.openrouteservice.org/t/trying-to-create-my-own-version-of-openpoiservice/4461 "2023-01-09T17:42:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatsGej](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/matsgej/32/1947_2.png) [@MatsGej](https://ask.openrouteservice.org/u/MatsGej)\
**Post date:** [January 9, 2023, 5:42pm UTC](https://ask.openrouteservice.org/t/trying-to-create-my-own-version-of-openpoiservice/4461/1 "2023-01-09T17:42:14Z")

</div>

I am trying to follow the description in README.

I first tried to create the docker from a windows 11 machine, but it fails to execute the run.sh script

I then followed the advice from someone here to do this in my virtual Ubuntu environment instead and that error disappeared.

But when it start working the sequence of steps to do becomes a bit unclear.

I start by updating categories\_docker.yml file with some additional tags and download a pdf file for Sweden and store it in the osm folder

I then use the all-in-one docker container command

`docker-compose -f /path/to/docker-compose.yml up api -d`

And it works and creates an openpoiservice-api image, an openpoiservice-api container (called charming\_mestof) and a kortoza/postgis image and a obs-db container.

The log for the charming\_mestof (openpoiservice-api) contains the following:

```auto
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [7] [INFO] Starting gunicorn 20.0.4
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [7] [INFO] Listening at: http://0.0.0.0:5000 (7)
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [7] [INFO] Using worker: gevent
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [8] [INFO] Booting worker with pid: 8
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [9] [INFO] Booting worker with pid: 9
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [10] [INFO] Booting worker with pid: 10
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [11] [INFO] Booting worker with pid: 11

```

I then run the command init command  
`docker-compose -f /path/to/docker-compose.yml up init`  
which runs awhile and I assume updates the database according to the configuration. It completes successfully.

An image is created called openpoiservice-init and a container ops\_init is created. The logfile for that is:

```auto
2023-01-09 17:24:43 INFO Found directory: /deploy/app/osm
2023-01-09 17:24:43 INFO Starting to import OSM data (1 files in batch)
2023-01-09 17:24:43 INFO Starting to read /deploy/app/osm/sweden-latest.osm.pbf
2023-01-09 17:24:43 INFO Parsing and importing nodes...
2023-01-09 17:31:48 INFO Found 404460 nodes
2023-01-09 17:31:48 INFO Parsing relations...
2023-01-09 17:31:52 INFO Found 18891 ways in relations
2023-01-09 17:31:52 INFO Parsing ways...
2023-01-09 17:32:20 INFO Found 981135 ways (including the ones found in relations)
2023-01-09 17:32:20 INFO Importing ways...
2023-01-09 17:55:16 INFO Found 1385595 POIs
2023-01-09 17:55:16 INFO Finished import of /deploy/app/osm/sweden-latest.osm.pbf
2023-01-09 17:55:16 INFO File import completed in 1832688.6 ms
2023-01-09 17:55:16 INFO Import complete.
2023-01-09 17:55:16 INFO Batch of 1 files completed in 1832704.51 ms
2023-01-09 17:24:42 Initializing POI database

```

Which looks great !!

Then it becomes confusing. Am I done now or should I run any more commands.  
There is talk about BuufProtocolers (protobuf) for imposm.parser which is unclear if I need to do something

There is also talk about the `openpoiservice/server/ops_settings.yml` and to export these settings, but I did the settings needed in the `ops_setting_docker.yml`

After this comes a section with c´Creating, Dropping and Parsing and importing data, which I assume is not necessary. And if I try to run any of those I need to install a lot of other python packages.

And then it is mentioned that I can access the application at `localhost:5000`. If i put this in the browser, it states that it cannot be found.

What did I do wrong?

When I run my application to use the api, I get this error:

```auto
HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: //pois (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000022B8D21AB80>: Failed to establish a new connection: [WinError 10061]

```

---

<div class="post-metadata">

**Author:** ![jschnell](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jschnell/32/971_2.png) [@jschnell](https://ask.openrouteservice.org/u/jschnell)\
**Post date:** [January 11, 2023, 2:48pm UTC](https://ask.openrouteservice.org/t/trying-to-create-my-own-version-of-openpoiservice/4461/2 "2023-01-11T14:48:51Z")

</div>

Hey,

as far as I understand, the app will not respond to a GET request (which is what you’re issuing when trying to access localhost:5000.

However, running a POST request as stated in [the example in the README](https://github.com/GIScience/openpoiservice#examples) or having a look at the apidocs at [http://localhost:5000/apidocs/](http://localhost:5000/apidocs/) should work.

Best regards

---

<div class="post-metadata">

**Author:** ![MatsGej](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/matsgej/32/1947_2.png) [@MatsGej](https://ask.openrouteservice.org/u/MatsGej)\
**Post date:** [January 11, 2023, 3:50pm UTC](https://ask.openrouteservice.org/t/trying-to-create-my-own-version-of-openpoiservice/4461/3 "2023-01-11T15:50:09Z")

</div>

Thanks but  
[http://localhost:5000/apidocs/](http://localhost:5000/apidocs/) does not work. Connection is refused.

The log for the container openpoiservice is this, which look ok. What else coud it be?

2023-01-11 16:40:13 [2023-01-11 15:40:13 +0000] [7] [INFO] Starting gunicorn 20.0.4  
2023-01-11 16:40:13 [2023-01-11 15:40:13 +0000] [7] [INFO] Listening at: [http://0.0.0.0:5000](http://0.0.0.0:5000) (7)  
2023-01-11 16:40:13 [2023-01-11 15:40:13 +0000] [7] [INFO] Using worker: gevent  
2023-01-11 16:40:13 [2023-01-11 15:40:13 +0000] [8] [INFO] Booting worker with pid: 8  
2023-01-11 16:40:14 [2023-01-11 15:40:14 +0000] [9] [INFO] Booting worker with pid: 9  
2023-01-11 16:40:14 [2023-01-11 15:40:14 +0000] [10] [INFO] Booting worker with pid: 10  
2023-01-11 16:40:14 [2023-01-11 15:40:14 +0000] [11] [INFO] Booting worker with pid: 11

---

<div class="post-metadata">

**Author:** ![MatsGej](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/matsgej/32/1947_2.png) [@MatsGej](https://ask.openrouteservice.org/u/MatsGej)\
**Post date:** [January 11, 2023, 9:56pm UTC](https://ask.openrouteservice.org/t/trying-to-create-my-own-version-of-openpoiservice/4461/4 "2023-01-11T21:56:14Z")

</div>

I got both openrouteservice and openpoiservice to work on one server. Not really sure how. Installed a new version of Ubuntu and started from scratch. And they both work

But now I want to move the docker images to another server and run them there. So I added the images to the docker hub and push them down to the other server and nothing worked.

openrouteservice:  
Had problems with the car directory, could not create a lock file there. What can I do about that?

openpoiservice:  
Even more an issue here. I can move the openpoiservice-api over and I can move the postgis image. But nothing happens. They just sit there listening !

Then I moved openpoiservice-init over as well hoping it would start loading the database, but It just sits there listening to localhost:5000.

So now I do not know how to continue from here. One assumtion is that there must be a connection between openpoiservice-api/openpoiservice-init and the postgis database, but do not know how to connected them

Please help!!!

---

<div class="post-metadata">

**Author:** ![MatsGej](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/matsgej/32/1947_2.png) [@MatsGej](https://ask.openrouteservice.org/u/MatsGej)\
**Post date:** [January 27, 2023, 2:14pm UTC](https://ask.openrouteservice.org/t/trying-to-create-my-own-version-of-openpoiservice/4461/5 "2023-01-27T14:14:03Z")

</div>

What can I do about the issue with openpoiservice in docker. How deploy them in a new environment?

---

<div class="post-metadata">

**Author:** ![amandus](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/amandus/32/669_2.png) [@amandus](https://ask.openrouteservice.org/u/amandus)\
**Post date:** [February 21, 2023, 2:08pm UTC](https://ask.openrouteservice.org/t/trying-to-create-my-own-version-of-openpoiservice/4461/7 "2023-02-21T14:08:15Z")

</div>

Hi @MatsGej

the image might only be there for easier deployment and not necessarily contain all the stuff to run the service.  
Is this the same problem as [the issue](https://github.com/GIScience/openpoiservice/issues/133) you created?

For now there might be no way around setting it up natively on the server as well -.-

Best regards
