CanalPlanAC

Adding a new region

To add a new region

These instructions are how to add a new top-level region to the data. This is something of the same level of import as North America or the UK Mainland

These examples document adding Australia in December 2020

Create the top-level waterway

> insert into waterway (id, parent, name, fullname) values('ozoz','','Australia','Waterways of Australia');

check beforehand that the 4 character code doesn't exist. With an exception, for daft historical reasons, the convention is to use something faintly mnemonic,

Give it some boundaries

> INSERT INTO "map_boundaries" VALUES('ozoz','{"sw_lng":180,"sw_lat":90,"ne_lng":-180,"ne_lat":-90}');

This will make it the whole of the earth. Once you've added a few places this will be adjusted automatically. You can make things a bit easier by using different values, but ensure you cover the whole of the area.

Stay in sqlite3...

Add a locale

> INSERT INTO "waterway_locale" VALUES('ozoz','km','metric','en','Australia/Canberra');

Create mapping files

ozoz {
      style = australia-style
      openmaptiles = australia
      canalplantiles = canalplan_australia
      description = Australia
      countries = AU
    }

notes:

Create mapping data space

sudo -u www-data bash

it is essential that you do that, otherwise you leave a lot of files around that the system needs to write to, but has no permissions.

cd mapping
touch geodata/flags/ozoz 
mkdir geodata/full/ozoz
mkdir geodata/waterways/ozoz
mkdir geodata/waterways/ozoz/lines
mkdir geodata/waterways/ozoz/points

Add first waterway

After all this it should now generate a waterway, with the appropriate map scaling.

Normal use of the region should now be possible.