Documentation
Create a geocoding web service

Create a geocoding web service

In this tutorial, we demonstrate how to create a geocoding index and then serve it in a simple web application.

Dataset

The data we will be using comes from Geonames (opens in a new tab).

Generate the index

The following workflow (opens in a new tab) will download the Geonames data, decompress it, and finally build the index.

cd examples/geocoding
baremaps workflow execute --file workflow.js

Serve the data

The following command will serve the Geonames index over HTTP in a simple web application.

baremaps geocoder serve --index geocoder-index --port 9000

Go to your browser (http://localhost:9000/) to see it in action.

Conclusion

In this tutorial, we learnt how to create a Geocoding index and serve it in a simple web application. This will be very useful in a map application to find places quickly by writing an address in a prompt.