Skip to content

Latest commit

 

History

History
103 lines (78 loc) · 3.23 KB

data-yml.adoc

File metadata and controls

103 lines (78 loc) · 3.23 KB

Input file format

tileigi uses the tm2source yml file format. The filename can be whatever you want. It must be a YAML file. Only the first document in a file is used, and it must be a mapping (a.k.a. hash, dictionary)

Top level

The following keys must be present at the top level.

minzoom

The global minimum zoom.

maxzoom

The global maximum zoom.

Layer

Sequence (list) of all the layers.

Layer

Each layer corresponds to one layer in the vector tile.

Every Layer must have a Datasource key which controls where the data comes from.

properties

An optional mapping/dict for this layer.

minzoom

Minimum (i.e. first) zoom level for this layer. This layer will not be generated for zoom levels less than this. If omitted, the global minzoom is used.

maxzoom

Maximum (i.e. last) zoom level for this layer. This layer will not be generated for zoom levels greater than this. If omitted, the global maxzoo is used.

buffer-size

Buffer of geometry for this layer in whole number of 'pixels' (where one tile is 256 'pixels' wide & high). How much outside the border of this tile to take and to cut.

Datasource

dbname

Database name

table

PostgreSQL table to read data from. You can use a select query to do advanced querying, but it must be in 'table form' (e.g. (select * from mypoints where shop='yes') as t). It must return a column called way of type geometry. It doesn’t check the SRID, but tileigi only works with Google Mercator.

Currently it only connects to the postgresql server on localhost, and using the current unix user.

All columns returned from the table are used as attributes for the vector tile object. The following PostgreSQL types are converted to a Vector Tile Number type: float4, float8, int4, int8, numeric. The following PostgreSQL types are converted to a Vector Tile String type: text, varchar.

Available text substitions

Within the table option the following text substitions are made:

!pixel_width!/!pixel_height!

Width/Height of one pixel, in units of the spherical mercator projection. This can be used to filter object that correspond to more than X pixels in an image (presuming a 256×256 image)

!scale_denominator!

Taken from mapnik and can allow filtering based on zoom level.

!bbox!

The bounding box of the tile. This will always be added to the query, but this could allow more fine grained control. Unlike mapnik, if you use this substitution, tileigi will still add a bbox filter later.

Table 1. Table Scale Denominator for zoom levels
Zoom Scale Denominator

0

250000000000

1

500000000

2

200000000

3

100000000

4

50000000

5

25000000

6

12500000

7

6500000

8

3000000

9

1500000

10

750000

11

400000

12

200000

13

100000

14

50000

15

25000

16

12500

17

5000

18

2500

Example

minzoom: 0
maxzoom: 14
Layer:
- Datasource:
      dbname: gis
      table: (select way from simplified_land_polygons) as t
  id: world
  properties:
    maxzoom: 9
    buffer-size: 2
- Datasource:
      type: postgis
      dbname: gis
      table: (select way from land_polygons) as t
  id: coast-poly
  properties:
    maxzoom: 22
    minzoom: 10
    buffer-size: 4