pg_tileserv

pg_tile_serv

by Paul Ramsey, so it must be good, right?

to run it:

    cd openmaptiles/pg_tileserv/
    ./serve_pg_tileserv.sh

then: openlayers-tiles.html

git

opal4 git was too old, needed to get our own:

from notes here: https://gist.github.com/samrocketman/8671036

    git clone https://github.com/git/git.git
    cd git
    autoconf
    ./configure --prefix=/home/wendell/usr/local
    make
    make install

download & compile

straightforward enough (after up-to-date git installed):

    git clone https://github.com/CrunchyData/pg_tileserv.git
    cd pg_tileserv/

    make check
    make build

and to try out:

    > ./pg_tileserv --help
    Usage: pg_tileserv [-dhv] [-c config.toml] [parameters ...]
     -c, --config=config.toml
                    full path to config file
     -d, --debug    log debugging information
     -h, --help     display help output
     -v, --version  display version number

seems ok

running

1) edit config file as appropriate

    vim config/ilc_config.toml

        DbConnection = "postgresql://tiles:opentiles@localhost:55432/openmaptiles"
        AssetsPath = "/home/wendell/openmaptiles/pg_tileserv/assets"

        HttpPort = 2760
        HttpsPort = 2760

        UrlBase = "http://tiles.ilikecarrots.com/"

        CORSOrigins = ["*"]

        Debug = true

        [CoordinateSystem]
        SRID = 3857
        Xmin = -20037508.3427892
        Ymin = -20037508.3427892
        Xmax = 20037508.3427892
        Ymax = 20037508.3427892

2) stop postile

    vim restart_everything_all_the_time.sh

3) run

    cd ~/openmaptiles/pg_tileserv

    ./pg_tileserv  --debug --config=/home/wendell/openmaptiles/pg_tileserv/config/ilc_tileserv.toml

    INFO[0000] pg_tileserv latest
    INFO[0000] Run with --help parameter for commandline options
    INFO[0000] Using config file: /home/wendell/openmaptiles/pg_tileserv/config/ilc_tileserv.toml
    INFO[0000] Serving HTTP  at http://0.0.0.0:2760/
    INFO[0000] Serving HTTPS at http://0.0.0.0:2760/
    INFO[0000] Using CoordinateSystem.SRID 3857 with bounds [-2.00375083427892e+07, -2.00375083427892e+07, 2.00375083427892e+07, 2.00375083427892e+07]
    INFO[0000] Dialing PostgreSQL server                     host=localhost
    INFO[0000] Connected as 'tiles' to 'openmaptiles' @ 'localhost'
    DEBU[0000] Connected to PostGIS version 2.5.5            event=connect geos=3.9.1-CAPI-1.14.2 libprotobuf=1.4.0 pgsql=120 postgis=2.5.5 topic=versions
    INFO[0000] Serving HTTP  at 0.0.0.0:2760

looking good...

local index.html

d/l the git release, then:

    cd ~/gis/openmaptiles/pg_tileserv/examples/openlayers
    vim openlayers-tiles.html

        var vectorServer = "https://tiles.ilikecarrots.com/"

and then access it:

    file:///C:/cygwin64/home/wendell/gis/openmaptiles/pg_tileserv/examples/openlayers/openlayers-tiles.html

my first screenshot

status

and there was something at:

https://tiles.ilikecarrots.com/index.html

my first screenshot

HOWEVER, all of the previews are from cdn.cartodb.com, not ilc !!! :-(

(resolved)

and ADD Web Mercator (yuck!)

(SEE merc_pg_tileserv notes file)