Blazing fast and lightweight PostGIS vector tiles server

Overview

Martin

CI Security audit Docker pulls Metadata

Martin is a PostGIS vector tiles server suitable for large databases. Martin is written in Rust using Actix web framework.

Martin

Requirements

Martin requires PostGIS >= 2.4.0.

Installation

You can download martin from Github releases page.

Platform Downloads (latest)
Linux 64-bit
macOS 64-bit
Windows 64-bit

If you are using macOS and Homebrew you can install martin using Homebrew tap.

brew tap urbica/tap
brew install martin

You can also use official Docker image

docker run -p 3000:3000 -e DATABASE_URL=postgres://postgres@localhost/db urbica/martin

Usage

Martin requires a database connection string. It can be passed as a command-line argument or as a DATABASE_URL environment variable.

martin postgres://postgres@localhost/db

API

Method URL Description
GET /index.json Table Sources List
GET /{schema_name}.{table_name}.json Table Source TileJSON
GET /{schema_name}.{table_name}/{z}/{x}/{y}.pbf Table Source Tiles
GET /rpc/index.json Function Sources List
GET /rpc/{schema_name}.{function_name}.json Function Source TileJSON
GET /rpc/{schema_name}.{function_name}/{z}/{x}/{y}.pbf Function Source Tiles
GET /healthz Martin server health check: returns 200 OK

Using with Mapbox GL JS

Mapbox GL JS is a JavaScript library for interactive, customizable vector maps on the web. It takes map styles that conform to the Mapbox Style Specification, applies them to vector tiles that conform to the Mapbox Vector Tile Specification, and renders them using WebGL.

You can add a layer to the map and specify martin TileJSON endpoint as a vector source URL. You should also specify a source-layer property. For Table Sources it is {schema_name}.{table_name} by default.

map.addLayer({
  id: 'public.points',
  type: 'circle',
  source: {
    type: 'vector',
    url: 'http://localhost:3000/public.points.json',
  },
  'source-layer': 'public.points',
  paint: {
    'circle-color': 'red',
  },
});

Using with Leaflet

Leaflet is the leading open-source JavaScript library for mobile-friendly interactive maps.

You can add vector tiles using Leaflet.VectorGrid plugin. You must initialize a VectorGrid.Protobuf with a URL template, just like in L.TileLayers. The difference is that you should define the styling for all the features.

L.vectorGrid
  .protobuf('http://localhost:3000/public.points/{z}/{x}/{y}.pbf', {
    vectorTileLayerStyles: {
      'public.points': {
        color: 'red',
        fill: true,
      },
    },
  })
  .addTo(map);

Using with deck.gl

deck.gl is a WebGL-powered framework for visual exploratory data analysis of large datasets.

You can add vector tiles using MVTLayer. MVTLayer data property defines the remote data for the MVT layer. It can be

  • String: Either a URL template or a TileJSON URL.
  • Array: an array of URL templates. It allows to balance the requests across different tile endpoints. For example, if you define an array with 4 urls and 16 tiles need to be loaded, each endpoint is responsible to server 16/4 tiles.
  • JSON: A valid TileJSON object.
const pointsLayer = new MVTLayer({
  data: 'http://localhost:3000/public.points.json', // 'http://localhost:3000/public.table_source/{z}/{x}/{y}.pbf'
  pointRadiusUnits: 'pixels',
  getRadius: 5,
  getFillColor: [230, 0, 0]
});

const deckgl = new DeckGL({
  container: 'map',
  mapStyle: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',
  initialViewState: {
    latitude: 0,
    longitude: 0,
    zoom: 1
  },
  layers: [pointsLayer]
});

Table Sources

Table Source is a database table which can be used to query vector tiles. When started, martin will go through all spatial tables in the database and build a list of table sources. A table should have at least one geometry column with non-zero SRID. All other table columns will be represented as properties of a vector tile feature.

Table Sources List

Table Sources list endpoint is available at /index.json

curl localhost:3000/index.json

Note: if in watch mode, this will rescan database for table sources.

Table Source TileJSON

Table Source TileJSON endpoint is available at /{schema_name}.{table_name}.json.

For example, points table in public schema will be available at /public.points.json

curl localhost:3000/public.points.json

Table Source Tiles

Table Source tiles endpoint is available at /{schema_name}.{table_name}/{z}/{x}/{y}.pbf

For example, points table in public schema will be available at /public.points/{z}/{x}/{y}.pbf

curl localhost:3000/public.points/0/0/0.pbf

Function Sources

Function Source is a database function which can be used to query vector tiles. When started, martin will look for the functions with a suitable signature. A function that takes z integer, x integer, y integer, and query_params json and returns bytea, can be used as a Function Source.

Argument Type Description
z integer Tile zoom parameter
x integer Tile x parameter
y integer Tile y parameter
query_params json Query string parameters

Hint: You may want to use TileBBox function to generate bounding-box geometry of the area covered by a tile.

For example, if you have a table public.table_source in WGS84 (4326 SRID), then you can use this function as a Function Source:

CREATE OR REPLACE FUNCTION public.function_source(z integer, x integer, y integer, query_params json) RETURNS bytea AS $$
DECLARE
  mvt bytea;
BEGIN
  SELECT INTO mvt ST_AsMVT(tile, 'public.function_source', 4096, 'geom') FROM (
    SELECT
      ST_AsMVTGeom(ST_Transform(geom, 3857), TileBBox(z, x, y, 3857), 4096, 64, true) AS geom
    FROM public.table_source
    WHERE geom && TileBBox(z, x, y, 4326)
  ) as tile WHERE geom IS NOT NULL;

  RETURN mvt;
END
$$ LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE;

The query_params argument is a JSON representation of the tile request query params. For example, if user requested a tile with urlencoded params:

curl \
  --data-urlencode 'arrayParam=[1, 2, 3]' \
  --data-urlencode 'numberParam=42' \
  --data-urlencode 'stringParam=value' \
  --data-urlencode 'booleanParam=true' \
  --data-urlencode 'objectParam={"answer" : 42}' \
  --get localhost:3000/rpc/public.function_source/0/0/0.pbf

then query_params will be parsed as:

{
  "arrayParam": [1, 2, 3],
  "numberParam": 42,
  "stringParam": "value",
  "booleanParam": true,
  "objectParam": { "answer": 42 }
}

You can access this params using json operators:

...WHERE answer = (query_params->'objectParam'->>'answer')::int;

Function Sources List

Function Sources list endpoint is available at /rpc/index.json

curl localhost:3000/rpc/index.json

Note: if in watch mode, this will rescan database for function sources.

Function Source TileJSON

Function Source TileJSON endpoint is available at /rpc/{schema_name}.{function_name}.json

For example, points function in public schema will be available at /rpc/public.points.json

curl localhost:3000/rpc/public.points.json

Function Source Tiles

Function Source tiles endpoint is available at /rpc/{schema_name}.{function_name}/{z}/{x}/{y}.pbf

For example, points function in public schema will be available at /rpc/public.points/{z}/{x}/{y}.pbf

curl localhost:3000/rpc/public.points/0/0/0.pbf

Command-line Interface

You can configure martin using command-line interface

Usage:
  martin [options] [<connection>]
  martin -h | --help
  martin -v | --version

Options:
  -h --help                         Show this screen.
  -v --version                      Show version.
  --config=<path>                   Path to config file.
  --keep-alive=<n>                  Connection keep alive timeout [default: 75].
  --listen-addresses=<n>            The socket address to bind [default: 0.0.0.0:3000].
  --pool-size=<n>                   Maximum connections pool size [default: 20].
  --watch                           Scan for new sources on sources list requests.
  --workers=<n>                     Number of web server workers.
  --danger-accept-invalid-certs     Trust invalid certificates. This introduces significant vulnerabilities, and should only be used as a last resort.

Environment Variables

You can also configure martin using environment variables

Environment variable Example Description
DATABASE_URL postgres://postgres@localhost/db postgres database connection
WATCH_MODE true scan for new sources
DANGER_ACCEPT_INVALID_CERTS false Trust invalid certificates

Configuration File

If you don't want to expose all of your tables and functions, you can list your sources in a configuration file. To start martin with a configuration file you need to pass a path to a file with a --config argument.

martin --config config.yaml

You can find an example of a configuration file here.

# Database connection string
connection_string: 'postgres://postgres@localhost/db'

# Maximum connections pool size [default: 20]
pool_size: 20

# Connection keep alive timeout [default: 75]
keep_alive: 75

# Number of web server workers
worker_processes: 8

# The socket address to bind [default: 0.0.0.0:3000]
listen_addresses: '0.0.0.0:3000'

# Enable watch mode
watch: true

# Trust invalid certificates. This introduces significant vulnerabilities, and should only be used as a last resort.
danger_accept_invalid_certs: false

# associative arrays of table sources
table_sources:
  public.table_source:
    # table source id
    id: public.table_source

    # table schema
    schema: public

    # table name
    table: table_source

    # geometry column name
    geometry_column: geom

    # geometry srid
    srid: 4326

    # tile extent in tile coordinate space
    extent: 4096

    # buffer distance in tile coordinate space to optionally clip geometries
    buffer: 64

    # boolean to control if geometries should be clipped or encoded as is
    clip_geom: true

    # geometry type
    geometry_type: GEOMETRY

    # list of columns, that should be encoded as a tile properties
    properties:
      gid: int4

# associative arrays of function sources
function_sources:
  public.function_source:
    # function source id
    id: public.function_source

    # schema name
    schema: public

    # function name
    function: function_source

Using with Docker

You can use official Docker image urbica/martin

docker run \
  -p 3000:3000 \
  -e DATABASE_URL=postgres://postgres@localhost/db \
  urbica/martin

If you are running PostgreSQL instance on localhost, you have to change network settings to allow the Docker container to access the localhost network.

For Linux, add the --net=host flag to access the localhost PostgreSQL service.

docker run \
  --net=host \
  -p 3000:3000 \
  -e DATABASE_URL=postgres://postgres@localhost/db \
  urbica/martin

For macOS, use host.docker.internal as hostname to access the localhost PostgreSQL service.

docker run \
  -p 3000:3000 \
  -e DATABASE_URL=postgres://[email protected]/db \
  urbica/martin

For Windows, use docker.for.win.localhost as hostname to access the localhost PostgreSQL service.

docker run \
  -p 3000:3000 \
  -e DATABASE_URL=postgres://[email protected]/db \
  urbica/martin

Using with Docker Compose

You can use example docker-compose.yml file as a reference

version: '3'

services:
  martin:
    image: urbica/martin
    restart: unless-stopped
    ports:
      - 3000:3000
    environment:
      - WATCH_MODE=true
      - DATABASE_URL=postgres://postgres:password@db/db
    depends_on:
      - db

  db:
    image: postgis/postgis:13-3.1-alpine
    restart: unless-stopped
    environment:
      - POSTGRES_DB=db
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
    volumes:
      - ./pg_data:/var/lib/postgresql/data

First, you need to start db service

docker-compose up -d db

Then, after db service is ready to accept connections, you can start martin

docker-compose up -d martin

By default, martin will be available at localhost:3000

Using with Nginx

If you are running martin behind nginx proxy, you may want to rewrite request URL, to properly handle tile urls in TileJSON endpoints.

location ~ /tiles/(?<fwd_path>.*) {
    proxy_set_header  X-Rewrite-URL $request_uri;
    proxy_set_header  X-Forwarded-Host $host:$server_port;
    proxy_set_header  X-Forwarded-Proto $scheme; # or $http_x_forwarded_proto
    proxy_pass        http://martin:3000/$fwd_path$is_args$args;
}

Building from Source

You can clone the repository and build martin using cargo package manager.

git clone [email protected]:urbica/martin.git
cd martin
cargo build --release

The binary will be available at ./target/release/martin.

cd ./target/release/
./martin postgres://postgres@localhost/db

Debugging

Log levels are controlled on a per-module basis, and by default all logging is disabled except for errors. Logging is controlled via the RUST_LOG environment variable. The value of this environment variable is a comma-separated list of logging directives.

This will enable verbose logging for the actix_web module and enable debug logging for the martin and postgres modules:

export RUST_LOG=actix_web=info,martin=debug,postgres=debug
martin postgres://postgres@localhost/db

Development

Clone project

git clone [email protected]:urbica/martin.git
cd martin

Start db service using docker-compose

docker-compose up -d db

Then, after db service is ready to accept connections, you can start martin with

DATABASE_URL=postgres://postgres@localhost/db cargo run

By default, martin will be available at localhost:3000

Make your changes, and check if all the tests are running

DATABASE_URL=postgres://postgres@localhost/db cargo test
Comments
  • CORS policy: No 'Access-Control-Allow-Origin' within localhost and

    CORS policy: No 'Access-Control-Allow-Origin' within localhost and "http://0.0.0.0:3000"

    Running in some internal issue. I'm running a local docker docker run \ -p 3000:3000 \ -e DATABASE_URL=postgres://[email protected]/db \ urbica/martin on my Mac OS. I've added a table with points. I made a website with mapbox GL and followed the directions in the README. The website is running on localhost.

    Looks like I am running into a CORS issue and need help to solve.

    Screen Shot 2019-08-26 at 5 11 04 PM

    Looks like the table is loading but when it fetched the "pbf" files is unreachable.

    I'll appreciate the help.

    Thanks

    bug 
    opened by rrlara 32
  • Container keeps restarting

    Container keeps restarting

    Dear devs,

    I have set up a small using docker-compose to see if martin plays nicely with our geodata. Pretty much like the example, just added traefik to it:

    version: '3.4'
    
    networks:
      proxy:
        external: true
      intern:
        internal: true
        name: "martin_intern"
    
    services:
      db:
        image: postgis/postgis:14-3.1-alpine
        hostname: postgis
        container_name: martin_postgis
        labels:
          autoheal: "true"
        volumes:
          - "/srv/docker/volumes/martin/db/data:/var/lib/postgresql/data"
          - "/srv/docker/volumes/martin/db/dump:/var/lib/postgresql/dump"
        networks:
          - intern
        expose:
          - 5432
        environment:
          - POSTGRES_DB=db
          - POSTGRES_USER=postgres
          - POSTGRES_HOST_AUTH_METHOD=trust
        restart: unless-stopped
        healthcheck:
          test: "exit 0"
        deploy:
          resources:
            limits:
              memory: "5G"
    
      martin:
        image: maplibre/martin
        hostname: martin
        container_name: martin_martin
        networks:
          - intern
          - proxy
        expose:
          - 3000
        environment:
          - DATABASE_URL=postgres://postgres@db/db
          - RUST_LOG=actix_web=info,martin=debug,tokio_postgres=debug
        labels:
          - "traefik.enable=true"
          - "traefik.docker.network=proxy"
          - "traefik.http.routers.martin-web.entrypoints=web"
          - "traefik.http.routers.martin-web.rule=Host(`martin.my.host`)"
          - "traefik.http.middlewares.martin-web-redirect-web-secure.redirectscheme.scheme=https"
          - "traefik.http.routers.martin-web.middlewares=martin-web-redirect-web-secure"
          - "traefik.http.routers.martin.entrypoints=websecure"
          - "traefik.http.routers.martin.rule=Host(`martin.my.host`)" 
          - "traefik.http.services.martin.loadbalancer.server.port=3000"
        restart: unless-stopped
        depends_on:
          - db
    

    Unfortunately, the container keeps on crashing. It seems to be unable to connect to the database. Here's the log output:

    $ docker-compose logs -f martin
    Attaching to martin_martin
    martin_1  | [2022-09-30T11:26:55Z INFO  martin] Starting martin v1.0.0-alpha.0
    martin_1  | [2022-09-30T11:26:55Z INFO  martin] Config is not set
    martin_1  | [2022-09-30T11:26:55Z INFO  martin] Connecting to database
    martin_1  | [2022-09-30T11:26:58Z INFO  martin] Starting martin v1.0.0-alpha.0
    martin_1  | [2022-09-30T11:26:58Z INFO  martin] Config is not set
    martin_1  | [2022-09-30T11:26:58Z INFO  martin] Connecting to database
    martin_1  | [2022-09-30T11:27:01Z INFO  martin] Starting martin v1.0.0-alpha.0
    martin_1  | [2022-09-30T11:27:01Z INFO  martin] Config is not set
    martin_1  | [2022-09-30T11:27:01Z INFO  martin] Connecting to database
    martin_1  | [2022-09-30T11:27:04Z INFO  martin] Starting martin v1.0.0-alpha.0
    martin_1  | [2022-09-30T11:27:04Z INFO  martin] Config is not set
    martin_1  | [2022-09-30T11:27:04Z INFO  martin] Connecting to database
    martin_1  | [2022-09-30T11:27:07Z INFO  martin] Starting martin v1.0.0-alpha.0
    martin_1  | [2022-09-30T11:27:07Z INFO  martin] Config is not set
    martin_1  | [2022-09-30T11:27:07Z INFO  martin] Connecting to database
    martin_1  | [2022-09-30T11:27:10Z INFO  martin] Starting martin v1.0.0-alpha.0
    martin_1  | [2022-09-30T11:27:10Z INFO  martin] Config is not set
    martin_1  | [2022-09-30T11:27:10Z INFO  martin] Connecting to database
    martin_1  | [2022-09-30T11:27:15Z INFO  martin] Starting martin v1.0.0-alpha.0
    martin_1  | [2022-09-30T11:27:15Z INFO  martin] Config is not set
    martin_1  | [2022-09-30T11:27:15Z INFO  martin] Connecting to database
    martin_1  | [2022-09-30T11:27:23Z INFO  martin] Starting martin v1.0.0-alpha.0
    martin_1  | [2022-09-30T11:27:23Z INFO  martin] Config is not set
    martin_1  | [2022-09-30T11:27:23Z INFO  martin] Connecting to database
    martin_1  | [2022-09-30T11:27:37Z INFO  martin] Starting martin v1.0.0-alpha.0
    martin_1  | [2022-09-30T11:27:37Z INFO  martin] Config is not set
    martin_1  | [2022-09-30T11:27:37Z INFO  martin] Connecting to database
    martin_martin exited with code 139
    

    Any help would be much appreciated!

    opened by sukamare 20
  • id column not included in properties

    id column not included in properties

    I have noticed following behavior with martin:

    the data

    geodata=> \d poverty 
                                                Table "zambia.poverty"
             Column          |            Type             | Collation | Nullable |            Default             
    -------------------------+-----------------------------+-----------+----------+--------------------------------
     id                      | integer                     |           | not null | nextval('zp_id_seq'::regclass)
     country_name            | character varying(6)        |           |          | 
     province                | character varying(254)      |           |          | 
     district                | character varying(254)      |           |          | 
     constituency            | character varying(254)      |           |          | 
     poverty                 | double precision            |           |          | 
     absolute_number_of_poor | double precision            |           |          | 
     geom                    | geometry(MultiPolygon,3857) |           |          | 
    Indexes:
        "zp_pkey" PRIMARY KEY, btree (id)
        "zp_geom_geom_idx" gist (geom)
    
    
    

    the config

    table_sources:
      zambia.poverty:
        id: zambia.poverty
        schema: zambia
        table: poverty
        bounds: [21.99937075303238, -18.07947347592123, 33.705705741754244, -8.224359676087436]
        srid: 3857
        geometry_column: geom
        id_column: id
        extent: 4096
        buffer: 64
        geometry_type: MULTIPOLYGON
        clip_geometry: true
        properties:
          id: int4
          poverty: float8
          district: varchar
          province: varchar
          constituency: varchar
          country_name: varchar
          absolute_number_of_poor: float8
    
    

    the index.json image

    the featureID and available props (first 10)

    
    1 {'absolute_number_of_poor': 22101.0, 'district': 'Mpika', 'poverty': 0.82, 'province': 'Muchinga', 'constituency': 'Mfuwe', 'country_name': 'Zambia'}
    2 {'absolute_number_of_poor': 36685.0, 'district': 'Kawambwa', 'poverty': 0.77, 'province': 'Luapula', 'constituency': 'Kawambwa', 'country_name': 'Zambia'}
    4 {'absolute_number_of_poor': 53678.0, 'district': 'Solwezi', 'poverty': 0.62, 'province': 'North Western', 'constituency': 'Solwezi West', 'country_name': 'Zambia'}
    5 {'absolute_number_of_poor': 175504.0, 'district': 'Kapiri-Mposhi', 'poverty': 0.68, 'province': 'Central', 'constituency': 'Kapiri Mposhi', 'country_name': 'Zambia'}
    56 {'absolute_number_of_poor': 76280.0, 'district': 'Katete', 'poverty': 0.79, 'province': 'Eastern', 'constituency': 'Mkaika', 'country_name': 'Zambia'}
    3 {'absolute_number_of_poor': 70049.0, 'district': 'Nyimba', 'poverty': 0.78, 'province': 'Eastern', 'constituency': 'Nyimba', 'country_name': 'Zambia'}
    6 {'absolute_number_of_poor': 64100.0, 'district': 'Lufwanyama', 'poverty': 0.81, 'province': 'Copperbelt', 'constituency': 'Lufwanyama', 'country_name': 'Zambia'}
    79 {'absolute_number_of_poor': 55507.0, 'district': 'Lusaka', 'poverty': 0.19, 'province': 'Lusaka', 'constituency': 'Matero', 'country_name': 'Zambia'}
    80 {'absolute_number_of_poor': 73578.0, 'district': 'Lusaka', 'poverty': 0.2, 'province': 'Lusaka', 'constituency': 'Kanyama', 'country_name': 'Zambia'}
    7 {'absolute_number_of_poor': 41139.0, 'district': 'Kalabo', 'poverty': 0.89, 'province': 'Western', 'constituency': 'Sikongo', 'country_name': 'Zambia'}
    8 {'absolute_number_of_poor': 52477.0, 'district': 'Kafue', 'poverty': 0.43, 'province': 'Lusaka', 'constituency': 'Kafue', 'country_name': 'Zambia'}
    

    as you can see the id is not in the list of props.

    is this a feature or a bug?

    thanks

    bug help wanted 
    opened by iferencik 11
  • Usage query_params in Function Source Tiles

    Usage query_params in Function Source Tiles

    How can I pass query_params in Function Source Tiles from tile source url MapBox?

    source: { type: 'vector', url: 'http://localhost:3000/rpc/public.function_source.json?param1=param1' // doesn't work for me }

    And how do I need to use query_params here? I want to filter my table by condition from query_params.

    CREATE OR REPLACE FUNCTION public.function_source_test(z integer, x integer, y integer, query_params json) RETURNS bytea AS ...

    opened by liskaole 11
  • Set up Martin documentation site at maplibre.org

    Set up Martin documentation site at maplibre.org

    Urbica used to have an awesome site, viewable at wayback machine. It would be awesome to have something similar set up under maplibre.org.

    @stepankuzmin do you know how it was done, or if that code can be adapted somehow?

    help wanted good first issue docs 
    opened by nyurik 10
  • Test Docker image in CI

    Test Docker image in CI

    The goal of this issue is to catch issues such as #423 before they reach production users.

    The biggest issue with this is that the tests are not build as part of the docker image.

    enhancement 
    opened by gbip 8
  • feat: add composite sources support WIP

    feat: add composite sources support WIP

    This PR allows composing multiple table sources into one composite source. Table sources endpoints now support multiple tables in one request. E.g you can request tiles that contain data from multiple tables by listing the tables separated by a comma:

    /{schema_name1}.{table_name1},{schema_name2}.{table_name2}.json
    /{schema_name1}.{table_name1},{schema_name2}.{table_name2}/0/0/0.pbf
    

    Using with Mapbox GL JS

    map.addSource('points', {
      type: 'vector',
      url: `http://0.0.0.0:3000/public.red_points,public.blue_points.json`
    });
    
    map.addLayer({
      id: 'red_points',
      type: 'circle',
      source: 'points',
      'source-layer': 'public.red_points',
      paint: {
        'circle-color': 'red'
      }
    });
    
    map.addLayer({
      id: 'blue_points',
      type: 'circle',
      source: 'points',
      'source-layer': 'public.blue_points',
      paint: {
        'circle-color': 'blue'
      }
    });
    

    You can try this docker image with composite sources support and give any feedback on this

    docker pull urbica/martin:pr-107-merge
    

    Relates: #36

    opened by stepankuzmin 8
  • can not parse

    can not parse "{z}" to a u32

    Hello I just installed in manual mode Martin. But I have this error:

    http://185.216.25.216:3000/public.perimeters/{z}/{x}/{y}.pbf
    can not parse "{z}" to a u32
    

    Do you have any idea what is blocking. Thank you

    opened by diouck 7
  • Support for multi-layer tiles

    Support for multi-layer tiles

    I would like your thoughts on how to generate multi-layer tiles.

    My idea is to allow requests like /{schema_name}.{table_name},{schema_name}.{table_name}/{z}/{x}/{y}.pbf and use binary concatenation of ST_AsMVT statements to produce the tile, see https://postgis.net/docs/ST_AsMVT.html

    I believe the only way to do this now is via function source, for example:

    CREATE OR REPLACE FUNCTION
      public.assets(z integer, x integer, y integer, query_params json)
    RETURNS bytea
    AS
    $$
    -- Prefer z,x,y inputs over z,x,y table columns.
    #variable_conflict use_variable
    DECLARE
      poles_mvt bytea;
      meters_mvt bytea;
    BEGIN
      SELECT INTO poles_mvt
        ST_AsMVT(tile, 'public.poles', 4096, 'geom')
        FROM (
          SELECT
            ST_AsMVTGeom(shape, TileBBox(z, x, y, 3857), 4096, 64, true) AS geom
            ,"pole_number"
          FROM public.switches
          WHERE shape && TileBBox(z, x, y, 3857)
        ) AS tile
        WHERE geom IS NOT NULL;
    
      SELECT INTO meters_mvt
        ST_AsMVT(tile, 'public.meters', 4096, 'geom')
        FROM (
          SELECT
            ST_AsMVTGeom(shape, TileBBox(z, x, y, 3857), 4096, 64, true) AS geom
            ,"meter_number"
          FROM public.meters
          WHERE shape && TileBBox(z, x, y, 3857)
        ) AS tile
        WHERE geom IS NOT NULL;
    
      RETURN poles_mvt || meters_mvt;
    END
    $$
    LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE;
    

    I have never developed in Rust, but Martin's codebase is so clean I could probably make these changes and issue a decent PR. What do you think?

    enhancement 
    opened by robert-claypool 7
  • Wrong scheme? (TMS Shows nothing, XYZ works)

    Wrong scheme? (TMS Shows nothing, XYZ works)

    Im trying to use martin with some Dutch public data in EPSG 28992 but when adding it to the map i get no data. After some troubleshouting i got it to work by changing the scheme in the tilejson from TMS to XYZ. Am i doing something wrong, or could this actually be different, and if so, should this be configurable?

    bug 
    opened by wslaghekke 7
  • Caching with nginx not working/slow

    Caching with nginx not working/slow

    Hello dear folks,

    we are currently testing martin to render a network of cycle paths. Unfortunately even though we are using nginx to cache tile requests, it takes quite a long time (up to 20s) each time to render the network (even when switching off/on which should be covered by the cashing mechanism). Any ideas on how to debug this? Our setup is quite similiar to the example on the github page. In fact we are using the very same nginx.conf.

    martin:
        image: maplibre/martin:main
        hostname: martin
        container_name: project_martin
        networks:
          - intern
        environment:
          - DATABASE_URL=postgres://martin:verysecretpassword@postgres/project
          - RUST_LOG=actix_web=info,martin=debug,tokio_postgres=debug
        restart: unless-stopped
        depends_on:
          - postgres
    
      nginx_martin:
        image: nginx:alpine
        hostname: martin_nginx
        container_name: project_martin_nginx
        volumes:
          - "./data/martin_nginx/cache:/var/cache/nginx"
          - "./data/martin_nginx/log:/var/log/nginx"
          - "./data/martin_nginx/nginx.conf:/etc/nginx/nginx.conf:ro"
        networks:
          - intern
          - traefik
        labels:
          traefik.enable: "true"
          traefik.http.routers.project-nginxmartin-websecure.entrypoints: "websecure"
          traefik.http.routers.project-nginxmartin-websecure.rule: "Host(`maps.project.our.server`)"
          traefik.http.routers.project-nginxmartin-websecure.tls: true
          traefik.http.routers.project-nginxmartin-websecure.tls.certresolver: httpResolver
          traefik.http.services.project-nginxmartin-websecure.loadbalancer.server.port: 80
          traefik.docker.network: "traefik"
        restart: unless-stopped
        depends_on:
          - martin
    
    

    Any help would be much appreciated!

    question 
    opened by eftas-gka 6
  • Implement postgres auto-publish

    Implement postgres auto-publish

    • NEW: support for #512 - pg table/function auto-discovery
      • can filter schemas
      • can use patterns like {schema}.{table}.{column} and {schema}.{function}
    • NEW: add calc_bounds bool flag to allow disabling of the bounds computation
    • reworked integration tests to use yaml
    opened by nyurik 1
  • Warn if a table geometry column has no geometry index

    Warn if a table geometry column has no geometry index

    During table detection, check if the table's geometry column has an associated GIST index, and if not, give a warning.

    Volunteers: if you only know how to change SQL, that would be a great help too!

    • modify table searching SQL to add another bool column to it.
    • handle the warning in the query result parser
    enhancement help wanted 
    opened by nyurik 0
  • For pg tables, allow users to skip auto-bounds detection

    For pg tables, allow users to skip auto-bounds detection

    Auto-bounds detection could be a relatively slow process. We may want to introduce some way to skip it.

    martin --ignore-bounds postgres://...
    

    In config, we have the option of specifying the bounds, but we don't want to force users to always supply them as [-180.0, -90.0, 180.0, 90.0]. Instead, we may want to allow max keyword.

    Skipping bounds param in a config would always cause auto-detection. We may want to add another connection-wide config parameter to skip detection.

    enhancement 
    opened by nyurik 0
  • Why don't you take the front part??

    Why don't you take the front part??

    the version 0.6.1 Configured table source "aaaa" from "public.aaaa" with "geom" column (GEOMETRY, SRID=3857) Configured table source "aaaa.1" from "test.aaaa" with "geom" column (GEOMETRY, SRID=3857)

    Who knows what aaaa.1 is???? This is very difficult to understand!!!!!

    question 
    opened by BigData-YC 2
  • Improve MapLibre demo to show all available lines/points/polygons from all sources

    Improve MapLibre demo to show all available lines/points/polygons from all sources

    Current martin demo page shows a list of all available sources (by first calling the /catalog API), and allows the users to turn on/off each source individually. There are some limitations that need to be addressed:

    • it relies on the tilejson to tell it which type of information is in the data. Instead, it should allow all types (points / lines / ...), and visualize them all
    • it shows everything in the same color - each layer should get its own color, e.g. randomly when the layer is enabled, and possibly with a color picker for extra bonus.
    • it requires to know the name of each layer in the MVT. Instead, it should use the "inspection" mode, where all layers are shown regardless of their name
      • it could use multiple colors if the MVT has more than one layer
    • make the left sidebar resizable
    • make the list of the sources substring-filterable with an input box at the top
    • ...?

    Requirements

    • keep it to a single javascript file
    • keep it as simple as possible

    Instructions for those who may want to help with this

    • install rust
    • install docker and docker-compose
    • run rust install just
    • run just run
    • open tests/debug.html file in your browser by copy/pasting the full path to it
    enhancement help wanted 
    opened by nyurik 0
Releases(v0.6.2)
  • v0.6.2(Dec 13, 2022)

  • v0.6.1(Nov 21, 2022)

  • v0.6.0(Nov 19, 2022)

    Notable Changes

    • Martin joins MapLibre
    • Composite sources support
    • Secure PostgreSQL SSL/TLS connections
    • Apple Silicon support (M1 ARM)
    • Improved CI/CD pipelines
    • Improved test coverage
    • Updated documentation
    • Migrate to latest dependencies such as Actix

    BREAKING

    • Remove watch support.
    • Docker now uses entrypoint instead of command. Use command to just pass the arguments.

    What's Changed

    • fix clippy errors by @stepankuzmin in https://github.com/maplibre/martin/pull/64
    • feat: upgrade to actix-web 2.0 by @stepankuzmin in https://github.com/maplibre/martin/pull/80
    • feat: upgrade postgres crates by @stepankuzmin in https://github.com/maplibre/martin/pull/85
    • ci: refactor CI by @stepankuzmin in https://github.com/maplibre/martin/pull/86
    • feat: add ssl/tls support #63 by @stepankuzmin in https://github.com/maplibre/martin/pull/90
    • Add nginx server port by @frodrigo in https://github.com/maplibre/martin/pull/147
    • docs: ✏️ update README.md by @stepankuzmin in https://github.com/maplibre/martin/pull/154
    • chore: 🤖 update dependencies by @stepankuzmin in https://github.com/maplibre/martin/pull/153
    • chore: drop mdillon postgis in favor of official image by @stepankuzmin in https://github.com/maplibre/martin/pull/157
    • ci: uphgrade to docker/build-push-action@v2 by @stepankuzmin in https://github.com/maplibre/martin/pull/169
    • Detect Martin server heartbeat for monitoring the service health by @yamaszone in https://github.com/maplibre/martin/pull/168
    • Docs for healthz endpoint by @yamaszone in https://github.com/maplibre/martin/pull/170
    • Update some deps (the most important is actix-web to 3.x) by @mdtrooper in https://github.com/maplibre/martin/pull/183
    • docs: add Leaflet example by @stepankuzmin in https://github.com/maplibre/martin/pull/185
    • docs: add deckgl example by @AdriSolid in https://github.com/maplibre/martin/pull/186
    • Deckgl example by @AdriSolid in https://github.com/maplibre/martin/pull/187
    • feat: add composite sources support by @stepankuzmin in https://github.com/maplibre/martin/pull/184
    • fix: fix clippy errors by @stepankuzmin in https://github.com/maplibre/martin/pull/203
    • update dependencies by @stepankuzmin in https://github.com/maplibre/martin/pull/204
    • Upgrade to GitHub-native Dependabot by @dependabot-preview in https://github.com/maplibre/martin/pull/205
    • fix: escape table and schema in function source tiles url by @gbip in https://github.com/maplibre/martin/pull/216
    • Fix invalid json escaping by @gbip in https://github.com/maplibre/martin/pull/224
    • Update README.md by @stepankuzmin in https://github.com/maplibre/martin/pull/228
    • Remove intermediate heap allocations by @JayKickliter in https://github.com/maplibre/martin/pull/211
    • chore: add benchmarks by @stepankuzmin in https://github.com/maplibre/martin/pull/230
    • docs by @stepankuzmin in https://github.com/maplibre/martin/pull/255
    • chore: improve debug.html by @stepankuzmin in https://github.com/maplibre/martin/pull/257
    • Possible fix for complex geoms by @christianversloot in https://github.com/maplibre/martin/pull/218
    • chore: improve logging by @stepankuzmin in https://github.com/maplibre/martin/pull/258
    • feat: add bounds to tilejson endpoints by @stepankuzmin in https://github.com/maplibre/martin/pull/260
    • fix: skip null serialization in tilejson endpoints by @stepankuzmin in https://github.com/maplibre/martin/pull/261
    • test: test with config and different zoom levels by @stepankuzmin in https://github.com/maplibre/martin/pull/262
    • refactor: improve debug logging by @stepankuzmin in https://github.com/maplibre/martin/pull/264
    • feat: add minzoom and maxzoom support by @stepankuzmin in https://github.com/maplibre/martin/pull/265
    • fix: tiles attribute in tilejson with x-rewrite-url by @stepankuzmin in https://github.com/maplibre/martin/pull/266
    • feat: use openssl for tls connections, add CA_ROOT_FILE support by @stepankuzmin in https://github.com/maplibre/martin/pull/268
    • feat: add multiple geometry columns support in table sources by @stepankuzmin in https://github.com/maplibre/martin/pull/269
    • test: add table source tests by @stepankuzmin in https://github.com/maplibre/martin/pull/270
    • test: add function source tests by @stepankuzmin in https://github.com/maplibre/martin/pull/271
    • CORS - Add GET to the list of allowed_methods by @AndreaGiardini in https://github.com/maplibre/martin/pull/274
    • fix: #279 500 error on Uppercase Table name by @kzima in https://github.com/maplibre/martin/pull/285
    • Fix get_bound.sql to return Polygon everytime by @HackJack-101 in https://github.com/maplibre/martin/pull/300
    • feat: add default SRID support by @stepankuzmin in https://github.com/maplibre/martin/pull/308
    • ci: improve docker job by @stepankuzmin in https://github.com/maplibre/martin/pull/334
    • Use 2021 edition, modern format by @nyurik in https://github.com/maplibre/martin/pull/331
    • Migrate to TileJSON v0.3 by @nyurik in https://github.com/maplibre/martin/pull/330
    • ci: enable dependabot auto-merge by @stepankuzmin in https://github.com/maplibre/martin/pull/337
    • Add maplibre-gl-js example by @sharkAndshark in https://github.com/maplibre/martin/pull/340
    • Remove extern, optimize use, fmt str by @nyurik in https://github.com/maplibre/martin/pull/338
    • Use tilejson 0.3.1 and simplify by @nyurik in https://github.com/maplibre/martin/pull/341
    • Migrate some urbica/martin -> maplibre/martin by @nyurik in https://github.com/maplibre/martin/pull/347
    • Use squash instead of merge when auto-merging Dependabot PRs by @stepankuzmin in https://github.com/maplibre/martin/pull/360
    • typo in README.md by @DevinNorgarb in https://github.com/maplibre/martin/pull/361
    • Optimize prettify_error function by @sharkAndshark in https://github.com/maplibre/martin/pull/352
    • Fix clippy in benchmarks, and adjust CI by @nyurik in https://github.com/maplibre/martin/pull/363
    • Clean up licensing per on-boarding by @nyurik in https://github.com/maplibre/martin/pull/364
    • Auto approve Dependabot semver patch PRs by @stepankuzmin in https://github.com/maplibre/martin/pull/368
    • sort use-statements during fmt by @nyurik in https://github.com/maplibre/martin/pull/376
    • remove a few minor code dups by @nyurik in https://github.com/maplibre/martin/pull/375
    • feat!: remove --watch support by @nyurik in https://github.com/maplibre/martin/pull/381
    • feat: clean up readme and code of conduct by @nyurik in https://github.com/maplibre/martin/pull/382
    • feat: use latest actix, switch to bb8 (async everywhere), remove actions by @nyurik in https://github.com/maplibre/martin/pull/377
    • minor docker fixes by @nyurik in https://github.com/maplibre/martin/pull/396
    • Rework dockerfile to use rust-alpine by @nyurik in https://github.com/maplibre/martin/pull/398
    • cargo update by @nyurik in https://github.com/maplibre/martin/pull/395
    • [noop] Include readme code in the unit tests by @nyurik in https://github.com/maplibre/martin/pull/402
    • Attempt to migrate CI to maplibre/martin by @nyurik in https://github.com/maplibre/martin/pull/408
    • Lint code based on clippy suggestions by @nyurik in https://github.com/maplibre/martin/pull/417
    • Clean up actix routes, HEAD support by @nyurik in https://github.com/maplibre/martin/pull/416
    • Add missing libc6-compat in Dockerfile by @stepankuzmin in https://github.com/maplibre/martin/pull/419
    • Clean up configuration system to use Clap by @nyurik in https://github.com/maplibre/martin/pull/415
    • Breakup config for pg and srv by @nyurik in https://github.com/maplibre/martin/pull/420
    • Compatible with case sensitive PostgreSQL identifiers by @sharkAndshark in https://github.com/maplibre/martin/pull/428
    • Configuration cleanup: step 2 by @nyurik in https://github.com/maplibre/martin/pull/425
    • Vendor openssl by @gbip in https://github.com/maplibre/martin/pull/435
    • Migrate to MapLibre documentation by @nyurik in https://github.com/maplibre/martin/pull/407
    • Mostly noop code refactorings by @nyurik in https://github.com/maplibre/martin/pull/439
    • Migrate tests to use maplibre-gl by @pjsier in https://github.com/maplibre/martin/pull/449
    • Remove automated docker builds for PRs by @pjsier in https://github.com/maplibre/martin/pull/450
    • Consolidate and simplify linting CI by @nyurik in https://github.com/maplibre/martin/pull/458
    • Remove Eq trait on config by @nyurik in https://github.com/maplibre/martin/pull/459
    • Add separate build job in CI by @stepankuzmin in https://github.com/maplibre/martin/pull/438
    • Warn on unknown cfg, CI cleanup by @nyurik in https://github.com/maplibre/martin/pull/461
    • Refactor CI tests into separate scripts by @nyurik in https://github.com/maplibre/martin/pull/432
    • Avoid using 3rd party GH actions if possible by @nyurik in https://github.com/maplibre/martin/pull/464
    • Consolidate DB init and tests by @nyurik in https://github.com/maplibre/martin/pull/463
    • Rework and consolidate CI by @nyurik in https://github.com/maplibre/martin/pull/467
    • Docker improvements and CI tests by @nyurik in https://github.com/maplibre/martin/pull/472
    • Add Apple M1 target aarch64-apple-darwin to CI by @stepankuzmin in https://github.com/maplibre/martin/pull/486
    • fix docker bld on release by @nyurik in https://github.com/maplibre/martin/pull/487
    • Make SSL support optional by @nyurik in https://github.com/maplibre/martin/pull/488
    • fix CI tests to include all targets and docs by @nyurik in https://github.com/maplibre/martin/pull/483

    New Contributors

    • @frodrigo made their first contribution in https://github.com/maplibre/martin/pull/147
    • @yamaszone made their first contribution in https://github.com/maplibre/martin/pull/168
    • @mdtrooper made their first contribution in https://github.com/maplibre/martin/pull/183
    • @AdriSolid made their first contribution in https://github.com/maplibre/martin/pull/186
    • @dependabot made their first contribution in https://github.com/maplibre/martin/pull/207
    • @gbip made their first contribution in https://github.com/maplibre/martin/pull/216
    • @JayKickliter made their first contribution in https://github.com/maplibre/martin/pull/211
    • @christianversloot made their first contribution in https://github.com/maplibre/martin/pull/218
    • @AndreaGiardini made their first contribution in https://github.com/maplibre/martin/pull/274
    • @kzima made their first contribution in https://github.com/maplibre/martin/pull/285
    • @HackJack-101 made their first contribution in https://github.com/maplibre/martin/pull/300
    • @nyurik made their first contribution in https://github.com/maplibre/martin/pull/331
    • @sharkAndshark made their first contribution in https://github.com/maplibre/martin/pull/340
    • @DevinNorgarb made their first contribution in https://github.com/maplibre/martin/pull/361
    • @pjsier made their first contribution in https://github.com/maplibre/martin/pull/449

    Full Changelog: https://github.com/maplibre/martin/compare/v0.5.0...v0.6.0

    Source code(tar.gz)
    Source code(zip)
    martin-Darwin-aarch64.tar.gz(4.08 MB)
    martin-Darwin-x86_64.tar.gz(3.30 MB)
    martin-Linux-x86_64.tar.gz(3.51 MB)
    martin-Windows-x86_64.zip(4.51 MB)
  • v0.6.0-rc.4(Nov 18, 2022)

    What's Changed

    • Warn on unknown cfg, CI cleanup by @nyurik in https://github.com/maplibre/martin/pull/461
    • Refactor CI tests into separate scripts by @nyurik in https://github.com/maplibre/martin/pull/432
    • Avoid using 3rd party GH actions if possible by @nyurik in https://github.com/maplibre/martin/pull/464
    • Consolidate DB init and tests by @nyurik in https://github.com/maplibre/martin/pull/463
    • Rework and consolidate CI by @nyurik in https://github.com/maplibre/martin/pull/467
    • Docker improvements and CI tests by @nyurik in https://github.com/maplibre/martin/pull/472
    • Add Apple M1 target aarch64-apple-darwin to CI by @stepankuzmin in https://github.com/maplibre/martin/pull/486

    • chore(deps): bump serde_yaml from 0.9.13 to 0.9.14 by @dependabot in https://github.com/maplibre/martin/pull/462
    • chore(deps): bump actix-cors from 0.6.3 to 0.6.4 by @dependabot in https://github.com/maplibre/martin/pull/468
    • chore(deps): bump tilejson from 0.3.1 to 0.3.2 by @dependabot in https://github.com/maplibre/martin/pull/469
    • chore(deps): bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 by @dependabot in https://github.com/maplibre/martin/pull/475
    • chore(deps): bump env_logger from 0.9.1 to 0.9.3 by @dependabot in https://github.com/maplibre/martin/pull/477
    • chore(deps): bump clap from 4.0.18 to 4.0.22 by @dependabot in https://github.com/maplibre/martin/pull/478
    • chore(deps): Bump clap from 4.0.22 to 4.0.23 by @dependabot in https://github.com/maplibre/martin/pull/479
    • chore(deps): Bump clap from 4.0.23 to 4.0.24 by @dependabot in https://github.com/maplibre/martin/pull/481
    • chore(deps): Bump clap from 4.0.24 to 4.0.25 by @dependabot in https://github.com/maplibre/martin/pull/482
    • chore(deps): Bump clap from 4.0.25 to 4.0.26 by @dependabot in https://github.com/maplibre/martin/pull/484

    Full Changelog: https://github.com/maplibre/martin/compare/v0.6.0-rc.3...v0.6.0-rc.4

    Source code(tar.gz)
    Source code(zip)
    martin-Darwin-aarch64.tar.gz(4.08 MB)
    martin-Darwin-x86_64.tar.gz(3.30 MB)
    martin-Linux-x86_64.tar.gz(3.51 MB)
    martin-Windows-x86_64.zip(4.51 MB)
  • v0.6.0-rc.2(Oct 7, 2022)

  • v0.6.0-rc.1(Oct 7, 2022)

    This is an auto-generated list of changes. We should have a proper one for the non-RC version

    What's Changed

    • feat: add multiple geometry columns support in table sources by @stepankuzmin in https://github.com/maplibre/martin/pull/269
    • test: add table source tests by @stepankuzmin in https://github.com/maplibre/martin/pull/270
    • test: add function source tests by @stepankuzmin in https://github.com/maplibre/martin/pull/271
    • CORS - Add GET to the list of allowed_methods by @AndreaGiardini in https://github.com/maplibre/martin/pull/274
    • chore: update dependencies by @stepankuzmin in https://github.com/maplibre/martin/pull/278
    • chore: update dependencies by @stepankuzmin in https://github.com/maplibre/martin/pull/280
    • fix: #279 500 error on Uppercase Table name by @kzima in https://github.com/maplibre/martin/pull/285
    • chore: update dependencies by @stepankuzmin in https://github.com/maplibre/martin/pull/297
    • chore: update dependencies by @stepankuzmin in https://github.com/maplibre/martin/pull/307
    • Fix get_bound.sql to return Polygon everytime by @HackJack-101 in https://github.com/maplibre/martin/pull/300
    • feat: add default SRID support by @stepankuzmin in https://github.com/maplibre/martin/pull/308
    • chore: update dependencies by @stepankuzmin in https://github.com/maplibre/martin/pull/323
    • ci: improve docker job by @stepankuzmin in https://github.com/maplibre/martin/pull/334
    • Use 2021 edition, modern format by @nyurik in https://github.com/maplibre/martin/pull/331
    • Migrate to TileJSON v0.3 by @nyurik in https://github.com/maplibre/martin/pull/330
    • ci: enable dependabot auto-merge by @stepankuzmin in https://github.com/maplibre/martin/pull/337
    • Add maplibre-gl-js example by @sharkAndshark in https://github.com/maplibre/martin/pull/340
    • Remove extern, optimize use, fmt str by @nyurik in https://github.com/maplibre/martin/pull/338
    • Use tilejson 0.3.1 and simplify by @nyurik in https://github.com/maplibre/martin/pull/341
    • Migrate some urbica/martin -> maplibre/martin by @nyurik in https://github.com/maplibre/martin/pull/347
    • Use squash instead of merge when auto-merging Dependabot PRs by @stepankuzmin in https://github.com/maplibre/martin/pull/360
    • typo in README.md by @DevinNorgarb in https://github.com/maplibre/martin/pull/361
    • Optimize prettify_error function by @sharkAndshark in https://github.com/maplibre/martin/pull/352
    • Fix clippy in benchmarks, and adjust CI by @nyurik in https://github.com/maplibre/martin/pull/363
    • Clean up licensing per on-boarding by @nyurik in https://github.com/maplibre/martin/pull/364
    • Auto approve Dependabot semver patch PRs by @stepankuzmin in https://github.com/maplibre/martin/pull/368
    • sort use-statements during fmt by @nyurik in https://github.com/maplibre/martin/pull/376
    • remove a few minor code dups by @nyurik in https://github.com/maplibre/martin/pull/375
    • feat!: remove --watch support by @nyurik in https://github.com/maplibre/martin/pull/381
    • feat: clean up readme and code of conduct by @nyurik in https://github.com/maplibre/martin/pull/382
    • feat: use latest actix, switch to bb8 (async everywhere), remove actions by @nyurik in https://github.com/maplibre/martin/pull/377
    • minor docker fixes by @nyurik in https://github.com/maplibre/martin/pull/396
    • Rework dockerfile to use rust-alpine by @nyurik in https://github.com/maplibre/martin/pull/398
    • cargo update by @nyurik in https://github.com/maplibre/martin/pull/395
    • [noop] Include readme code in the unit tests by @nyurik in https://github.com/maplibre/martin/pull/402
    • Attempt to migrate CI to maplibre/martin by @nyurik in https://github.com/maplibre/martin/pull/408
    • Lint code based on clippy suggestions by @nyurik in https://github.com/maplibre/martin/pull/417
    • Clean up actix routes, HEAD support by @nyurik in https://github.com/maplibre/martin/pull/416
    • Add missing libc6-compat in Dockerfile by @stepankuzmin in https://github.com/maplibre/martin/pull/419
    • Clean up configuration system to use Clap by @nyurik in https://github.com/maplibre/martin/pull/415
    • Breakup config for pg and srv by @nyurik in https://github.com/maplibre/martin/pull/420
    • Compatible with case sensitive PostgreSQL identifiers by @sharkAndshark in https://github.com/maplibre/martin/pull/428
    • Configuration cleanup: step 2 by @nyurik in https://github.com/maplibre/martin/pull/425
    • Vendor openssl by @gbip in https://github.com/maplibre/martin/pull/435
    • Migrate to MapLibre documentation by @nyurik in https://github.com/maplibre/martin/pull/407

    New Contributors

    • @AndreaGiardini made their first contribution in https://github.com/maplibre/martin/pull/274
    • @kzima made their first contribution in https://github.com/maplibre/martin/pull/285
    • @HackJack-101 made their first contribution in https://github.com/maplibre/martin/pull/300
    • @nyurik made their first contribution in https://github.com/maplibre/martin/pull/331
    • @sharkAndshark made their first contribution in https://github.com/maplibre/martin/pull/340
    • @DevinNorgarb made their first contribution in https://github.com/maplibre/martin/pull/361

    Full Changelog: https://github.com/maplibre/martin/compare/v1.0.0-alpha.0...v0.6.0-rc.1

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-alpha.0(Oct 18, 2021)

    ⚠ BREAKING CHANGES

    • drop null serialization in tilejson endpoints (#261) (cee9b2b)

    Features

    Bug Fixes

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Oct 26, 2019)

  • v0.4.0(Sep 30, 2019)

  • v0.3.0(Mar 16, 2019)

  • v0.2.0(Nov 2, 2018)

  • v0.1.0(Oct 10, 2018)

    Bug Fixes

    • rename function source query argument to query_params (2f2b743c)
    • pass query string from tilejson endpoint to tiles (ef7ddace)
    • add schema to function_sources (a7092bc3)
    • properly encode query as json into function_sources (cc75ab4a)
    • handle x-rewrite-url header (63c976e8)
    • handle tables with no properties (d6aee81b)
    • skip tables with SRID 0 (241dda31)
    • set default tile buffer to 64 (612ecddb)
    • revert to plain columns in tile properties request (ea8f7aba)
    • use json instead of jsonb for tile request (e6a19773)
    • tileset property types query (e81cd4bb)
    • remove iron-cors (0fe335f4)

    Features

    • generate function_sources from database (63114a8a)
    • add function_sources tilejson endpoint (95d92c51)
    • implement function sources (241994a5)
    • split sources into table_sources and function_sources (3c3d88b1)
    • add config support (c55e61d2)
    • rewrite using actix (0080deb9)
    • add MVT handler (204b132a)
    Source code(tar.gz)
    Source code(zip)
    martin-darwin-x86_64.zip(2.64 MB)
    vtzero-check(174.02 KB)
    vtzero-show(654.83 KB)
  • v0.1.0-alpha(Nov 2, 2018)

Owner
Urbica
We are focused on human experience design in the cities.
Urbica
Library for serializing the GeoJSON vector GIS file format

geojson Documentation Library for serializing the GeoJSON vector GIS file format Minimum Rust Version This library requires a minimum Rust version of

GeoRust 176 Dec 27, 2022
A TinyVG vector graphics format parsing library.

tinyvg-rs A TinyVG vector graphics format parsing library. Testing This library uses the example files from the TinyVG/examples repo for integration t

null 2 Dec 31, 2021
A single-binary, GPU-accelerated LLM server (HTTP and WebSocket API) written in Rust

Poly Poly is a versatile LLM serving back-end. What it offers: High-performance, efficient and reliable serving of multiple local LLM models Optional

Tommy van der Vorst 13 Nov 5, 2023
An fast, offline reverse geocoder (>1,000 HTTP requests per second) in Rust.

Rust Reverse Geocoder A fast reverse geocoder in Rust. Inspired by Python reverse-geocoder. Links Crate 2.0.0 Docs 1.0.1 Docs Description rrgeo takes

Grant Miner 91 Dec 29, 2022
Fast Geospatial Feature Storage API

Hecate OpenStreetMap Inspired Data Storage Backend Focused on Performance and GeoJSON Interchange Hecate Feature Comparison Feature Hecate ESRI MapSer

Mapbox 243 Dec 19, 2022
Fast 2D Delaunay triangulation in Rust. A port of Delaunator.

delaunator-rs A very fast static 2D Delaunay triangulation library for Rust. A port of Delaunator. Documentation Example use delaunator::{Point, trian

Vladimir Agafonkin 123 Dec 20, 2022
Fast shortest path calculations for Rust

Fast Paths The most famous algorithms used to calculate shortest paths are probably Dijkstra's algorithm and A*. However, shortest path calculation ca

Andi 226 Jan 2, 2023
A fast R-tree for Rust. Ported from an implementation that's designed for Tile38.

rtree.rs A fast R-tree for Rust. Ported from an implementation that's designed for Tile38. Features Optimized for fast inserts and updates. Ideal for

Josh Baker 102 Dec 30, 2022
A fast, offline, reverse geocoder

Rust Reverse Geocoder A fast reverse geocoder in Rust. Inspired by Python reverse-geocoder. Links Crate Changelog Latest Docs v2.0 Docs v1.0 Docs Desc

Grant Miner 82 Dec 3, 2022
Trees for fast location-to-value lookup.

HexTree hextree provides tree structures that represent geographic regions with H3 cells. The primary structures are: HexTreeMap: an H3 cell-to-value

Jay Kickliter 38 Dec 15, 2022
Optimized geometry primitives for Microsoft platforms with the same memory layout as DirectX and Direct2D and types.

geoms Geometry for Microsoft platforms - a set of geometry primitives with memory layouts optimized for native APIs (Win32, Direct2D, and Direct3D). T

Connor Power 2 Dec 11, 2022
Geospatial primitives and algorithms for Rust

geo Geospatial Primitives, Algorithms, and Utilities The geo crate provides geospatial primitive types such as Point, LineString, and Polygon, and pro

GeoRust 989 Dec 29, 2022
Geospatial primitives and algorithms for Rust

geo Geospatial Primitives, Algorithms, and Utilities The geo crate provides geospatial primitive types such as Point, LineString, and Polygon, and pro

GeoRust 990 Jan 1, 2023
Zero-Copy reading and writing of geospatial data.

GeoZero Zero-Copy reading and writing of geospatial data. GeoZero defines an API for reading geospatial data formats without an intermediate represent

GeoRust 155 Dec 29, 2022
TIFF decoding and encoding library in pure Rust

image-tiff TIFF decoding and encoding library in pure Rust Supported Features Baseline spec (other than formats and tags listed below as not supported

image-rs 66 Dec 30, 2022
OpenStreetMap flatdata format and compiler

osmflat Flat OpenStreetMap (OSM) data format providing an efficient random data access through memory mapped files. The data format is described and i

null 31 Dec 7, 2022
A traffic simulation game exploring how small changes to roads affect cyclists, transit users, pedestrians, and drivers.

A/B Street Ever been stuck in traffic on a bus, wondering why is there legal street parking instead of a dedicated bus lane? A/B Street is a game expl

A/B Street 6.8k Jan 4, 2023
Calculates a stars position and velocity in the cartesian coordinate system.

SPV Calculates a stars position and velocity in the cartesian coordinate system. Todo Expand the number of available operation Batch processing by tak

Albin Sjögren 11 Feb 18, 2022
Didactic implementation of the type checker described in "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism" written in OCaml

bidi-higher-rank-poly Didactic implementation of the type checker described in "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorph

Søren Nørbæk 23 Oct 18, 2022