Skip to content

Instantly share code, notes, and snippets.

View tmcw's full-sized avatar
💭
merging your prs

Tom MacWright tmcw

💭
merging your prs
View GitHub Profile
import { Context } from "https://edge.netlify.com/";
const DOMAIN = "macwright.com";
const USERS = new Map([
[
`acct:photos@macwright.com`,
{
subject: `acct:photos@${DOMAIN}`,
aliases: [],
@tmcw
tmcw / index.html
Created June 4, 2013 21:54
My Starting-Point Index File
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel='stylesheet' type='text/css' href='' />
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<meta name='viewport' content='initial-scale=1.0 maximum-scale=1.0'>
</head>
<body>
<script src=''></script>
@tmcw
tmcw / xyz_vs_tms.md
Last active April 3, 2024 06:18
The difference between XYZ and TMS tiles and how to convert between them

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

There are two options for the Placemark Globe dataset:

Visionscarto

This is "Visionscarto’s “World Atlas”, which is very well-described by the linked document. It's based on Natural Earth but includes some changes:

  • Western Sahara as the UN point of view
  • Crimea as part of Ukraine
  • Increased width of Gaza strip to avoid it being removed by simplification

These are the two main commits used to transition part of Placemark to Deck.gl. It may make sense to reverse these: Deck caused some bugs, and while the performance was a little better, there was no way to transition fully.

@tmcw
tmcw / mapcss_cartocss_cascadenik.md
Created December 17, 2012 16:33
MapCSS vs CartoCSS

In which I begrudglingly compare MapCSS and CartoCSS because people keep asking.

I hate this kind of writing - it's annoying to try to describe one bit of software versus another, and this can and will fall out of date every time that somebody makes a big change to their library. But people want it, or whatever, so here it is.

Since CartoCSS and Cascadenik are weird cousins, the big difference is between them and MapCSS.

Let's see, differences:

  • CartoCSS is designed for Mapnik. That is, it tries to expose every possible Mapnik style option and ability, and supports every Mapnik datasource.
  • MapCSS is designed for OSM. That is, it makes it easy to style based on OpenStreetMap data types, tags, and so on.
import {
encodeBase64,
decodeBase64,
} from "https://deno.land/std@0.210.0/encoding/base64.ts";
import process from "node:process";
import SuperJSON from "npm:superjson@2.1.0";
SuperJSON.registerCustom<Function, string>(
{
isApplicable: (v: any): v is Function => typeof v === "function",

The Utility Token Puzzle

I've written about IPFS twice: in 2017 and 2019. If I were sticking to a biyearly schedule, this would be my time to try it again. After all, one of the key pieces of Protocol Labs infrastructure, Filecoin, launched late last year. The tokens that run Filecoin are now worth billions of dollars.

I looked at the state of Filecoin from the perspective of using it, and I'm sure there's a funny post to be written about someone actually trying to do that - use it - maybe with a five-hour YouTube walkthrough. But I have a deeper question.

How is any of this supposed to work?

I imagine that Filecoin, and other "utility token" systems, work like this:

@tmcw
tmcw / README.md
Last active October 8, 2023 19:00

OSM Lab

OSM Lab is an organization for OpenStreetMap related projects - libraries, applications, and other code. We're liberal with membership.

Project Guidelines

  • Use semver where appropriate
  • README.md is required
export default 42;