/posts  ·   /talks  ·   /boat  ·   /#30DayMapChallenge 2020 | 2022  ·  /About

2020 / Day 29: globe

Data

Tools

PostGIS, QGIS (+ GlobeBuilder plugin)

Summary

Going full-on estonian again with stretching the country limits. Essentially the stretchout followed the line of

drop table if exists globe.water;
create table globe.water as
with
  minmax as (
    select
      325000 as st_xmin,
      6250000.0 as st_ymin,
      775000.0 as st_xmax,
      6750000.0 as st_ymax
  )
select
  gid, name, type, ringnumber,
  st_buildarea(
    st_transform(
      st_setsrid(
        st_makeline(
          array_agg(
            st_setsrid(
              st_point(x, y),
              3857
            ) order by pointnumber
          )
        ),
        3857
      ),
      4326
    )
  ) as geom
from (
  select
    gid, name, type, ringnumber, pointnumber,
    (20026376.39-(-20026376.39))*
      ((i.x-minmax.st_xmin)/(minmax.st_xmax-minmax.st_xmin))+
      (-20026376.39) as x,
    (20048966.10-(-20048966.10))*
      ((i.y-minmax.st_ymin)/(minmax.st_ymax-minmax.st_ymin))+
      (-20048966.10) as y
  from (
    select
      gid, name, type, ringnumber, path[1] as pointnumber,
      st_x(geom) as x,
      st_y(geom) as y
    from (
      select
        gid, name, type, path[1] as ringnumber,
        (st_dumppoints(st_exteriorring(geom))).*
      from (
        select
          w.oid as gid, name, type,
          (st_dumprings(w.geom)).*
        from
          vectiles.water w
          w.type != 'sea'
      ) g
    ) h
  ) i, minmax
) j

hi-res

A very improbable Globe. Based (again) on the Kartogramm vector-tiles set data.

This is #30DayMapChallenge - Day 29, Globe, which allowed me to stretch my PG sql skills out of the ordinary bbox, befriended me with Globe Builder, and made me use Python in QGIS for the 1st time. pic.twitter.com/dpNASjUq3D

— Tõnis Kärdi (@tkardi) November 30, 2020