Maps Are Beautiful

Right?

... but we're using this

Clutter

Redistricting

map

How does it work?

How Quadtrees Work

... and we end up with

So where'd you get the tiles?

We wrote our own mapping server.

(For kicks mostly)

In C!

  ...

  simplet_map_t*
  simplet_map_new(){
    simplet_init();
    simplet_map_t *map;
    if(!(map = malloc(sizeof(*map))))
      return NULL;

    if(!(map->layers = simplet_list_new())){
      free(map);
      return NULL;
    }

    map->bounds       = NULL;
    map->proj         = NULL;
    map->bgcolor      = NULL;
    map->error.status = SIMPLET_OK;
    map->height       = 0;
    map->width        = 0;
    map->valid        = SIMPLET_OK;
    return map;
  }
  ...
  

The API

  #include <simple-tiles/simple_tiles.h>

  int
  main(){
    simplet_map_t *map;
    if(!(map = simplet_map_new()))
      exit(1);

    simplet_map_set_slippy(map, 0, 0, 0);
    simplet_map_add_layer(map, "../data/ne_10m_admin_0_countries.shp");
    simplet_map_add_filter(map, "SELECT * from 'ne_10m_admin_0_countries'");
    simplet_map_add_style(map, "weight", "0.1");
    simplet_map_add_style(map, "fill",   "#061F3799");
    if(simplet_map_is_valid(map))
      simplet_map_render_to_png(map, "./out.png");
    simplet_map_free(map);
  }
  

In Ruby!

    require 'simpler_tiles'

    map = SimplerTiles::Map new do |m|
      m.slippy 0, 0, 0
      m.add_layer  "../data/ne_10m_admin_0_countries.shp"
      m.add_filter "SELECT * from 'ne_10m_admin_0_countries'"
      m.styles "weight" => "0.1",
                 "fill" => "#061F3799"
    end
    map.to_png