Skip to content

Instantly share code, notes, and snippets.

<Map background-image="../../data/images/pattern.png" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<Parameters>
<Parameter name="sizes">1000,1000</Parameter>
<Parameter name="bbox">-20037508.3427892476320267,-8283343.6938826972618699,20037508.3427892439067364,18365151.3630704730749130</Parameter>
</Parameters>
<Style name="world">
<Rule>
<PolygonSymbolizer fill="green"/>
</Rule>
</Style>
@talaj
talaj / dummy.png
Last active October 12, 2016 15:32
comp-op
dummy.png
@talaj
talaj / luks.md
Last active May 19, 2022 23:01
Accessing an encrypted full disc image (LUKS;LVM)
@talaj
talaj / svg2png
Created June 29, 2017 12:07
svg2png
inkscape -z -e zvonice.png -w 128 zvonice.svg
@talaj
talaj / gdal-test.cpp
Last active July 28, 2017 10:58
gdal-test
#include <memory>
#include <iostream>
#include <gdal/gdal_priv.h>
main()
{
GDALAllRegister();
const char * dem = "/home/talaj/dev/gdal-leak/world_aster2_srtmgl1_gmerc_38m_dfs40a.tif";
@talaj
talaj / test.py
Last active August 17, 2017 12:49
python async mvt
import mapnik
m=mapnik.Map(256,256)
mapnik.load_map(m, 'style.xml')
t = mapnik.create_mvt_merc(m, 75528, 47928, 17, style_level_filter=True, threading_mode=mapnik.threading_mode.async)
m.layers[-1].datasource.params()['max_size']
@talaj
talaj / libtiff-fork-test.cpp
Last active December 5, 2017 13:20
libtiff fork test
#include <tiffio.h>
#include <unistd.h>
#include <iostream>
#include <memory>
int main()
{
const char * dem = "/home/tlj/sandbox/world_robin_611m_ocean_hss20.tif";
@talaj
talaj / rev-list
Created January 2, 2018 09:18
git - get object hash
git rev-list --abbrev-commit --max-count=1 HEAD -- plugins/input/csv/
@talaj
talaj / spherical-mercator.lisp
Created January 4, 2018 09:10
Envelope of a tile in Spherical Mercator
(defconstant EARTH_RADIUS 6378137.0)
(defconstant HALF_OF_EQUATOR (* PI EARTH_RADIUS))
(defun tile-size (zoom) (/ (* 2 HALF_OF_EQUATOR) (expt 2 zoom)))
(defun tile-envelope (x y z)
(let ((size (tile-size z)))
(list
(+ (- HALF_OF_EQUATOR) (* x size))
(- (+ HALF_OF_EQUATOR) (* (+ y 1) size))
@talaj
talaj / 3.0.20.rst
Created August 10, 2018 14:28
api/mapnik/3.0.20.rst

3.0.20

Style

image-filters