[OSM-dev] Turning boundaries to linestrings

2016-12-12 Thread Paul Norman

A common problem with rendering administrative boundaries from
OpenStreetMap data is the need to create non-overlapping linestrings
from the admin relations. This is necessary for many styles,
particularly any which want to use dashes. Ideally the information would
be present in on way tags, but this is inconsistently done. A second
need is to figure out which boundaries are disputed, which is
information on the ways.

For my work on the Wikimedia map styles I've written OSMBorder, software
which extracts the admin boundary data from the planet file and assmbles
it into linestrings along with

- the lowest admin_level value from the boundary relation that boundary
  line section is in

- if the boundary line is disputed

- if the boundary line is a maritime one

The output is a CSV file which can be loaded into PostgreSQL. I've put an
example up on my server at 

along with a Shapefile version at 
.


Instructions for loading the data are at 
https://github.com/pnorman/osmborder#output


I'm still looking for somewhere to regularly run the conversion and host
the output, and expect to find some bugs and change output details.

Feedback from anyone interested in using this output is welcome, as well
as any additional information that should be added to the linestrings.

The code is at https://github.com/pnorman/osmborder, as well as
documentation on the tags used and how to run it. Parts of the code are
based on OSMCoastline by Jochen Topf.



___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Main database wiki page

2016-12-12 Thread Andy Allan
On 12 December 2016 at 11:54, Darafei "Komяpa" Praliaskouski
 wrote:

> I've been googling for current human-readable document that describes what
> OSM database currently is.

As far as I'm aware, there's no up-to-date human-readable description
of the primary OSM database. The database contains 40+ tables, and a
bunch of foreign keys, sequences, and of course, many columns, so
maintaining any documentation is not a trivial task. That's likely why
any documentation you find is unlikely to have been kept up to date
over the years.

> Can someone with deeper knowledge update this page, and/or make it point to
> a better place to read about current OSMF database cluster setup?

There are two aspects to the database - A) the internal structure
(tables, columns etc) and B) the production cluster setup
(replication, backups etc)

A) The internal structure is governed by the openstreetmap-website
code base, specifically the db/structure.sql definition.

https://github.com/openstreetmap/openstreetmap-website/blob/master/db/structure.sql

This is not very human-friendly, but it is accurate. I never use this
myself, since I find it easier to read the definitions in app/models/
to find how the different tables relate to each other, and I use the
postgresql command line to find out the details of the structure, if
necessary.

B) The cluster configuration is managed via the Chef configuration, found at:

https://github.com/openstreetmap/chef

What happens on each machine is defined in the roles, and the set-up
of database-related machines is controlled by the "db" cookbook.

https://github.com/openstreetmap/chef/tree/master/roles
https://github.com/openstreetmap/chef/tree/master/cookbooks/db

Again, these are not particularly human-readable, but since they are
the real code that controls the configuration, they are always
accurate. Again, I don't usually read the role files directly, but I
would use https://hardware.openstreetmap.org/ , which is generated
from the Chef configuration automatically, as a starting point and a
more human-friendly approach.

Please let me know if you have any questions and I'll do what I can to help.

Thanks,
Andy

___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


[OSM-dev] Main database wiki page

2016-12-12 Thread Komяpa
Hello,

I've been googling for current human-readable document that describes what
OSM database currently is.

I found https://wiki.openstreetmap.org/wiki/Database - but it is not
up-to-date: the database schema image there is from 2008, and it references
smaug as primary database server, not mentioning any replicas.

Can someone with deeper knowledge update this page, and/or make it point to
a better place to read about current OSMF database cluster setup?
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev