• Stars
    star
    135
  • Rank 269,297 (Top 6 %)
  • Language
    Scheme
  • License
    MIT License
  • Created about 5 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OSM Bright styles for GeoServer (at last!)

OSM Bright styles

Introduction

This is a GeoServer data directory with OSM layer and styles mimicking a OSM-bright style.

Sample output map

Live example here

For the impatient

Do you just want to give this data directory a quick spin? We have prepared a couple of options for you, with a sample dataset covering the New York state:

Samples contain the April 22nd 2020 version of the data directory.

Getting started

The data directory is meant to work as follows:

Data directory usage

Thus, in order to use this data directory, one would need to:

  • Have a Linux machine handy (GeoServer can run on whatever operating system, but Imposm requires Linux)
  • Setup a GeoServer with the necessary extensions
  • Download a GeoPackage with low resolution information
  • Setup a OSM PostGIS database using Imposm
  • Parametrize the GeoServer with the database access information.

Every step is explained below.

GeoServer

In order to use this data directory a GeoServer 2.16 or newer is recommended. In addition, the following plugins need to be included:

The low resolution GeoPackage

For world-wide views the map does not show the accurate OSM data, but a set of simplified layers that are meant to be viewed at low zoom levels.

These layers have been collected in a (large) GeoPackage for your convenience:

  • Download the data - 1.9 GB
  • Place the GeoPackage in the data folder of the data directory:
  osm-styles
  +---data
      +---keepme.txt
      +---osm-lowres.gpkg 

The data directory is already configured to lookup the GeoPackage from this location.

The OSM PostGIS database

The large part of the data comes from OpenStreetMap. The import process can be very long for large areas, it is recommended to start with a small country to practice the process, before moving to larger imports.

To provide a reference, on a Ryzen 1700x with local SSD (Samsung EVO 960) and 32 of memory, on a Linux Mint 19.2 with stock PostgreSQL 9.5.4 and PostGIS 2.21, importing the full Europe OpenStreetMap dataset required:

  • 250GB of disk space (allocated fully on SSD), split between 22.5GB of OSM PBF file, 45GB of Imposm working cache, and over 130GB of resulting PostgreSQL database (the Imposm cache can be removed at the end of the process)
  • 4 hours of processing

Also, the tool used to parse, reclassify and import the data into PostgreSQL, called imposm, works only on Linux. We have prepared a command line tool that can be run on Linux to prepare a PostgreSQL database dump, which can then be moved to a Windows machine and restored.

With this in mind:

  1. Download a Imposm binary as linked from the documentation site

  2. Download the preferred OSM extract from the Geofabrik download server, in pbf format.

  3. Get into into the imposm folder of the data directory, and perform the "read" portion of the import (replace the $IMPOSM_DIR and $OSM_PBF_DUMP with the actual values from your machine):

    $IMPOSM_DIR/imposm import -mapping mapping.yml -read $OSM_PBF_DUMP

  4. Run the "write" part of the import process (replace the $user, $password, $host and $database with actual values for your database). The optimize parameter includes a long process of table clustering for optimal serve performance, it's not mandatory and can take a lot of time.

    $IMPOSM_DIR/imposm import -mapping mapping.yml -write -connection postgis://$user:$password@$host/$database -overwritecache

    It's possible to add a -optimize extra option at the end of the above command to have optimal record layout in the database. However, caution is recommended, that step can take much more time than importing the data itself.

  5. Congratulations, you have succesfully imported the data in PostGIS

Optionally, one can also run the "production deploy" steps, which involve moving the tables from the import schema to the public one, while moving eventual pre-existing tables to a backup schema, and eventually removing the backup schema itself. This allows continued usage of the database while the import is running:

  1. $IMPOSM_DIR/imposm import -mapping mapping.yml -connection postgis://$user:$password@$host/$database -deployproduction

  2. $IMPOSM_DIR/imposm import -mapping mapping.yml -connection postgis://$user:$password@$host/$database -removebackup

imposm also support incremental updates of the data using OSM change files. Please consult the imposm guide to learn more about this functionality.

Setting up the Fonts

OSM data can have labels in many languages. The styles use the following fonts to support rendering in the many scripts labels need:

The fonts can be downloaded from the respective web sites and installed separately. For your convenience, we have prepared a zip file with the subset of fonts that you'll need (not each single font available in the web sites above are needed, e.g., Google Noto contains hundreds of different fonts).

Specifically for Windows, make sure the fonts are installed for all users, it's possible to do by selecting the font file, right click, and then selecting "install for all users". The Java runtime will not see the fonts installed for the current user alone. To facilitate setup, the zip file contains a batch script that can be used to mass-install the fonts with a single action. After un-packing the fonts, right click the fonts-install.bat file, and then choose "Run as administrator".

For Debian-based linux distributions, try:

sudo apt install fonts-noto fonts-dejavu unifont fonts-hanazono

For other common operating systems, the Noto web site has instructions on how to install the fonts.

Failing to install the fonts won't prevent the map from showing up, but will result in a fallback to be chosen instead.

Parameterizing GeoServer and starting it up

The data directory contains paramers in place of database connection values for user, password, host and database. This is to make it easy to move it around, in different environment, without changing its contents.

You have two options:

  1. Start GeoServer without any parametrization, find the osm store, and manually change user, password, host and database
  2. Setup the necessary system variables to start up GeoServer in parametric mode.

If you decide to follow the second, make sure to pass the following to the command line starting up the Java virtual machine (e.g., startup.sh if running the GeoServer binary package, Tomcat own catalina.sh or JAVA_OPTS variable, and os on). Replace the variables to match your setup:

POSTGRES_ENDPOINT=127.0.0.1;POSTGRES_PORT=5432;POSTGRES_PASSWORD=$password;POSTGRES_USER=$user;OSM_DB=$database;OSM_SCHEMA=$schema

Communication

We have setup a forum to discuss improvements to this data directory and the associated styles. Everyone interested in contributing to the project is welcomed to join and discuss:

https://groups.google.com/d/forum/geoserver-osm-styling

Found an issue? Contribute a fix!

If you find any issue with instructions or styling, pull requests with fixes and improvements are more than welcomed!

License

This data directory is licensed as MIT, as per the license file.

More info

You can find additional information in the wiki. As an instance, you can find info on the the GeoPackage branch which contains a variant of the configuration where both the low and high resolution datasets are stored in GeoPackage files.

More Repositories

1

MapStore2

The solution to create and share maps, dashboards, geostories with 3D support on the web. And it is open-source too!
JavaScript
509
star
2

geoserver-manager

Java client library for GeoServer
Java
231
star
3

imageio-ext

Additional plugins and extension for the standard Java ImageIO library
Java
131
star
4

jai-ext

Java Advanced Imaging Open Source Replacement Wannabe
Java
86
star
5

docker-geoserver

Docker Image for GeoServer
Shell
56
star
6

digital-twin-toolbox

Open source solution for inspecting and generating 3D Tiles for urban environments
TypeScript
46
star
7

evo-odas

Code Repository for the EVO-ODAS
Python
31
star
8

MapStore

The code of the most recent version of mapstore is hosted as geosolutions-it/MapStore2
JavaScript
31
star
9

geostore

Open Source Java enterprise application for storing, searching and retrieving data
Java
28
star
10

geobatch

Open Source GeoSpatial Processing Simplified
Java
22
star
11

http-proxy

Lean and Mean HTTP Proxy written in Java
Java
20
star
12

scripts

A collection of watchdog scripts used for monitoring/restart web services
Shell
15
star
13

keycloak-lambda-authorizer

JavaScript
13
star
14

ckanext-geonetwork

GeoNetwork harvester for CKAN
Python
11
star
15

mapsforge

Fork of mapsforge - https://code.google.com/p/mapsforge/
Java
11
star
16

ckanext-dcatapit

CKAN extension for the Italian Open Data Portals (DCAT_AP-IT)
Python
10
star
17

geoserver-enterprise

geoserver-enterprise
Java
10
star
18

geonetwork-manager

GeoSolutions Java client library for GeoNetwork
Java
10
star
19

geoserver-restconfig

``geoserver-restconfig`` is a python library for manipulating a GeoServer instance via the GeoServer RESTConfig API.
Python
9
star
20

MapStoreMobile

an Android Application for mobile mapping
Java
9
star
21

openmaptiles

Rendering OpenMapTiles styles and data with GeoServer
Scheme
9
star
22

geonode-training

8
star
23

mapstore-covid-us

Experimental MapStore Dashboard for COVID-19 US Emergency
JavaScript
8
star
24

ne-styles

Simple styles based on Natural Earth data
Scheme
5
star
25

ckanext-azure-auth

Python
4
star
26

geogwt

Geospatial GWT widgets based on OpenLayers and Ext-GWT
JavaScript
4
star
27

shp2oracle

Command line tool to ingest shapefiles into oracle database
Java
4
star
28

charts

HELM Charts by GeoSolutions
Smarty
3
star
29

C198-KRIHS

Python
3
star
30

gfdrr-det

Data Exploration Tool
JavaScript
3
star
31

geonode-generic

Generic Geonode-project based app, to be used with docker/rancher
Python
3
star
32

ckanext-geonode

CKAN harvester for GeoNode instances
Python
3
star
33

ckanext-mapstore

CKAN Extension for MapStore Preview and GeoStore Harvesting
JavaScript
2
star
34

geoserver-pluggable-access-manager

Java
2
star
35

MapStore2-C028

Sistema Informativo Territoriale del Comune di Bolzano
JavaScript
2
star
36

decat_geonode

GeoNode theme for Decatastrophize (DECAT GSS) EU project
CSS
2
star
37

eastwood-charts

eastwood-charts
2
star
38

geoserver-playbook

An ansible playbook to deploy geoserver on a cluster
Ruby
2
star
39

geonode-workshop

A GeoNode Project for wokshops
Python
2
star
40

ckan-docker-dcatapit

Shell
2
star
41

smb-android

GoodGo Android app
Java
2
star
42

ibf-airflow

Python
2
star
43

vibi

VIBI - MapStore application and server backend code
JavaScript
2
star
44

lhtac-webgis

CSS
2
star
45

clevmetro-nfd

Cleveland Metroparks - Natural Features Database
Python
2
star
46

doc-geonode

GeoNode Training Documentation Portal http://training.geonode.geo-solutions.it/
Python
2
star
47

ckanext-multilang

A CKAN extension that manages multilingual contents
Python
2
star
48

hale-appschema-plugin

GeoServer App-Schema plug-in for HALE
Java
2
star
49

geonode-auth0

Auth0 authentication backend for GeoNode
Python
1
star
50

OpenSDI-Manager

Tool to manage other OpenSDI Suite products
Java
1
star
51

geonode-mapstore-client

MapStore Client for GeoNode
JavaScript
1
star
52

analytics

Shell
1
star
53

ckanext-tableauview

A CKAN extension to display tableau vizzes in resources
Python
1
star
54

django-wfe

Multi-step Workflow Engine
Python
1
star
55

ogc-testbed14-styles

GeoServer data directory with styles for ogc-testbed14
Scheme
1
star
56

DATEX-Utilities

DATEX Utilities
Java
1
star
57

C195-azure-workspace

Shell
1
star
58

pyfulcrum

Python module for Fulcrum Webhooks and Fulcrum forms backup
Python
1
star
59

GeoCollect

field based asset management made simple
1
star
60

crop-information-portal

Java
1
star
61

smb-backend

SaveMyBike backend
Python
1
star
62

sciadro-backend

Python
1
star
63

figis-tools

Tools and utilities mainly for the management of the FIGIS Oracle Spatial Datasets
1
star
64

smb-portal

SaveMyByke portal
JavaScript
1
star
65

MapStoreExtension

A MapStore project to develop mapstore extensions
HTML
1
star
66

mapstore-static-examples

collection of mapstore frontend only custom apps
JavaScript
1
star
67

ringojs

RingoJS customized for MapStore
JavaScript
1
star
68

opencl-experiments

OpenCL/Aparapi tests
Java
1
star
69

style-editor

SLD Style Editor
1
star
70

MapStore2-Mockups

MapStore2 Mockups
JavaScript
1
star
71

soil_sealing

The project contains WPS extensions for the Soil Sealing indexes computation
Java
1
star
72

SaveMyBike

Issue tracker for the SaveMyBike project
1
star
73

MapStore2-theme

Working place for the Look&Feel of MapStore 2
HTML
1
star
74

geonode-rndt

Geonode-RNDT is a Django App to let GeoNode be able to expose the metadata compliant to the RNDT standard
XSLT
1
star
75

mapstore-playground

a sample mapstore project to learn and do exercises
HTML
1
star
76

eumetsat-sentinel3

Scripts for eumetsat Sentinel3 products georectification
Python
1
star
77

docker-gs-base

Base Docker image for GeoServer to be used as a template
Dockerfile
1
star
78

OpenSDI-Manager2

Tool to manage other OpenSDI Suite products. This is a new version that uses a modular architecture.
Java
1
star
79

geonode-subsites

Python
1
star
80

events-tracker

events-tracker-demos
JavaScript
1
star
81

C106-2017

Ansible Automation
1
star