Skip to main content

Create Service areas from a city or postal code

This article explains how to create a GeoJSON file for a Service area by using city or postal code borders.

Support avatar
Written by Support
Updated yesterday

Overview


Step 1: Find the right geographical area

To find a geographical area that you’d like to use as a Service area on MotionTools, visit the Nominatim service. On Nominatim, you can view the borders of a city or a postal code. Here's an example of the borders of Berlin:

example_4.png

Click on the Details button and copy the relation ID number from the search bar. Copy only the string of numbers; leave out the R.


Step 2: Download the area as GeoJSON

Go to http://polygons.openstreetmap.fr/ and enter the relation ID you just copied. In the table, click on the GeoJSON link in the first row and copy the JSON content.


Step 3: Format the GeoJSON file

Right now, the GeoJSON is in the MultiPolygon format, which cannot be uploaded to the Dashboard.

To format the JSON content, download this GeoJSON file. Open the file with a simple text editor, paste the JSON content you copied in Step 2, and save the file.

Next, go to https://geojson.io/. Click Open and choose your GeoJSON file. You can also open multiple files at once to combine them into one area.

Click on Save and choose GeoJSON from the dropdown to save your final GeoJSON file.


Step 4: Import the Service Area

Make sure the GeoJSON file doesn't exceed the 20kb limit. If it does, follow the steps in the How to reduce the file size section.

You can now import the file to the service area in the Dashboard. If you don't know how to do that, you can find a step-by-step guide here.


How to reduce the file size

If your GeoJSON file size exceeds the 20kb limit, follow these steps:

Remove the inner zones if they exist

Import the geoJSON file, open the Vector menu, select Geoprocessing Tools, click Dissolve, and then click Run.

The inner border should now be gone. Right-click on the layer on the bottom left and select Export → Save Features As.

Next to the File name, click on the “…” button and choose a name and directory. Click Save.

Simplify the GeoJSON file

Use Mapshaper to simplify the GeoJSON file. Follow this guide for details.

Did this answer your question?