Skip to content

fmidev/smartmet-engine-geonames

Repository files navigation

Table of Contents

SmartMet Server

SmartMet Server is a data and procut server for MetOcean data. It provides high capacity and high availability data and product server for MetOcean data. The server is written in C++.

#Introduction

SmartMet engine geonames (geoengine) provides location services for other services. It resolves the location information for coordinates and vice versa.

Geoengine provides shared access to the location database in the SmartMet server. The location database is a PostGIS database and it is based on the Geonames, a geographical database that covers all countries and contains over eleven million placenames that are available for download free of charge. The location database has to be synced with the the Geonames database from time to time.

#Configuration

The configuration file consists of the configuration of several parameters that are needed for specifying the location services. These parameter include the following:

  • Station names

This configuration states whether the station names should be splittable into words or not. For example,


remove_underscores = true;
  • Locale

Locale defines the user's format for the specification of language. This link gives the GNU document on locale for C and C++. In the configuration file, we can specify for example the locale for Finnish language as


locale = "fi_FI.UTF-8";

Using en_US would mean the characters Ä and A would be considered equivalent. The language used affects the autocomplete feature.

  • maxdemresolution for the data

maxdemresolution = 0;

The setting of 0 meters allow highest possible resolution. Do not use too high resolution data to avoid page faults

  • LandCover data directory

landcoverdir = "directory_name";
  • Database settings

Do NOT use the full name, use the alias only because different networks use different full host names but the same alias.


database:
{
        host     = "localhost";
        user     = "username";
        database = "databasename";
        pass     = "password";

};

  • Cache Maximum size

cache:
{
       max_size        = cache size in bytes;
};

  • Priorities

Priorities specify the priorities of countries, priorities of areas within a country, priorities of features and priorities of country specific features.

Use some criteria to prioritize the countries. The priority index along with the country code from the ISO 3166-1 alpha-2 codes is given in the configuration file.


priorities: 
{
      FI = priority index;        // Finland
      EE = priority index;       // Estonia
      SE = priority index;       // Sweden
      ...
      default = 100000;
   };
  • Feature priorities

Feature priority for a particular region or country


 {
        default = "default_features";
        FI      = "FI_features"; // specific features for Finland
   };
   default_features:
   {
	PPLC    = priority index;  // populated place
        SKI     = priority index;  // skiing place
	...

   };
  • Country specific features

FI_features:
   {
	PPLC    = priority index;  // populated place
        SKI     = priority index;  // skiing place
	...
    };
  • Areas

Priorities of areas within a country


   areas:
   {
        Area1 = 2;
        Area2    = 1;
	...

        default  = 0;
   };
  • Countries

   countries:
   {
        FI = priority index;
        SE = priority index;
        NO = priority index;
        ...

	default = 0;
   };

Docker

SmartMet Server can be dockerized. This tutorial explains how to explains how to configure the GeoNames engine of the SmartMet Server when using Docker.