Skip to content

Instantly share code, notes, and snippets.

View marklit's full-sized avatar

Mark Litwintschik marklit

View GitHub Profile
@marklit
marklit / README.md
Last active March 3, 2025 15:23
Satellogic's Open Satellite Feed
@marklit
marklit / runbook.md
Last active February 25, 2025 10:54
Planet Labs TLE Feed
$ python3 -m venv ~/.sats
$ source ~/.sats/bin/activate
$ python3 -m pip install astropy

$ wget https://ephemerides.planet-labs.com/planet_mc.tle
from   datetime import datetime
@marklit
marklit / results.txt
Created November 21, 2024 13:39
Overture 2024-09-18.0 buildings vs 2024-11-13.0
┌─────────────────────────────────────────────┬────────┐
│ osm │ delta │
│ varchar │ int128 │
├─────────────────────────────────────────────┼────────┤
│ asia │ 550678 │
│ gcc-states │ 152516 │
│ europe │ 144383 │
│ myanmar │ 94939 │
│ china │ 75607 │
│ india │ 69950 │
@marklit
marklit / umbra.india.md
Created November 14, 2024 17:32
Umbra's India SAR Imagery
select s3_key from umbra where osm_region like '%zone%' and s3_key like '%GEC.tif' ORDER BY 1;
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                               s3_key                                                                                │
│                                                                               varchar                                                                               │
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ sar-data/tasks/ad hoc/0ce837c5-e3a8-4b30-b5a4-5420c5fedfba/2024-06-06-15-20-13_UMBRA-04/2024-06-06-15-20-13_UMBRA-04_GEC.tif                                        │
@marklit
marklit / roads.md
Created October 7, 2024 10:01
MS Roads Detection in Parquet
$ wget https://usaminedroads.blob.core.windows.net/road-detections/MiddleEast-Full.zip
$ unzip MiddleEast-Full.zip
$ ~/duckdb roads.duckdb
CREATE OR REPLACE TABLE roads AS
    SELECT column0 as iso2,
 ST_GEOMFROMGeoJSON(column1::JSON->'$.geometry') geom
@marklit
marklit / japan.gis.parquet.md
Last active August 22, 2024 16:58
Pacific Spatial Solutions: Japanese GIS Data
@marklit
marklit / airport_amenities_osm.md
Last active August 20, 2024 08:12
Airport Amenities

Airport Shops on OSM

Tallinn Airport is said to be the 'cosiest' airport in the world. If you search for that on Google they come up first. I noticed none of the shops or other amenities around the gates are marked in OSM.

I wrote some code to see if this was an issue at airports of a similar size or larger nearby in other EU countries. I got a lot of false-positives but this code might help anyone else looking to enrich the Airport metadata in OSM.

TLL is surrounded by dense urban areas and a major shopping mall so I built a polygon mask around the airport gates and counted the shops within it.

Airports that came back with no shops within their gate area mask where:

@marklit
marklit / partition.md
Last active August 7, 2024 11:40
Partition Denmark by Address
$ aws s3 --no-sign-request sync \
    s3://overturemaps-us-west-2/release/2024-07-22.0/theme=addresses/type=address/ \
    ~/addresses
$ cd ~/addresses
$ ~/duckdb
INSTALL spatial;
@marklit
marklit / old town.md
Created July 28, 2024 16:20
Old Town
SELECT ADOB_ID,
       ADS_OID,
       ADOB_LIIK,
       ORIG_TUNNUS,
       ADS_KEHTIV,
       VIITEPUNKT_X,
       VIITEPUNKT_Y,
@marklit
marklit / issue.md
Created July 21, 2024 17:46
Overture July 2024 Canadian Addresses

DuckDB v1.0.0 1f98600c2c

$ cd '/mnt/j/gis/Global/overture/2024_07/theme=addresses/type=address'
$ COUNTRY=CA
$ echo "COPY (
              SELECT h3_cell_to_boundary_wkt(
                          h3_latlng_to_cell(bbox.ymax, bbox.xmax, 5))::geometry geom,
                      COUNT(*)
 FROM read_parquet('*.parquet')