Skip to content

Instantly share code, notes, and snippets.

@tkardi
tkardi / flightradar.html
Last active April 11, 2023 08:09
Code companion to 'Building a flightradar in Leaflet (pt II)'
<!DOCTYPE html>
<html>
<!-- The following HTML page together with the accompanying
javascript is published under the Unlicense.
SPDX-License-Identifier: Unlicense
-->
<head>
<meta charset="utf-8">
<title>Air traffic map</title>
@tkardi
tkardi / lt-update.sh
Created December 21, 2020 15:23
download and prepare LT address data
echo 'Apskritys geometries (from geojson) to lt.adr_gra_apskritys'
ogr2ogr -f PostgreSQL "PG:host=localhost user=postgres dbname=postgres" -lco overwrite=yes -lco schema=lt -lco launder=yes -lco geometry_name=geometry -lco fid=oid -nln adr_gra_apskritys -a_srs epsg:3346 -t_srs epsg:3346 https://www.registrucentras.lt/aduomenys/?byla=adr_gra_apskritys.json -progress
echo 'Apskritys props (from csv) to lt.adr_apskritys'
ogr2ogr -f PostgreSQL "PG:host=localhost user=postgres dbname=postgres" -lco overwrite=yes -lco schema=lt -lco launder=yes -lco fid=oid -nln adr_apskritys https://www.registrucentras.lt/aduomenys/?byla=adr_apskritys.csv
echo 'Savivaldybės geometries (from geojson) to lt.adr_gra_savivaldybes'
/* https://twitter.com/tkardi/status/1521366132371902465 */
drop table if exists tc;
create table tc as
select gid, path,
st_lineinterpolatepoint(
st_scale(
st_rotate(
st_exteriorring(
st_buffer(