{"id":24055696,"url":"https://github.com/tebben/topobaas","last_synced_at":"2025-10-06T10:16:34.779Z","repository":{"id":202763558,"uuid":"708049379","full_name":"tebben/topobaas","owner":"tebben","description":"quickly thrown together topo game to guess dutch places","archived":false,"fork":false,"pushed_at":"2024-11-22T09:25:26.000Z","size":446,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T04:09:19.836Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tebben.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-21T11:21:18.000Z","updated_at":"2024-11-22T09:25:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a3bba1f-265d-4d69-a83f-a2446f2ad67f","html_url":"https://github.com/tebben/topobaas","commit_stats":null,"previous_names":["tebben/topobaas"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tebben%2Ftopobaas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tebben%2Ftopobaas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tebben%2Ftopobaas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tebben%2Ftopobaas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tebben","download_url":"https://codeload.github.com/tebben/topobaas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240840104,"owners_count":19866168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-09T04:09:23.932Z","updated_at":"2025-10-06T10:16:29.757Z","avatar_url":"https://github.com/tebben.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# topobaas\n\nA quickly thrown together small Dutch topo game since woonplaatsgame seems to be offline.\n\nvisit [TOPOBAAS](https://tebben.github.io/topobaas) on github pages.\n\n![Topobaas](./img/topobaas.jpg)\n\n## Woonplaats data\n\nWe get places from the BAG and rank a place by the amount of BAG objects in a `woonplaats`, we can use the rank for the diffuculty level. The ranking is not perfect yet...\n\nQuery to create GeoJSON.\n\n```sql\nCREATE TABLE woonplaats_latest AS\nWITH places AS (\n\tSELECT \n        t1.gid as id, \n        t1.woonplaatsnaam as name, \n        t1.woonplaatsstatus,\n        t1.documentdatum,\n        t1.documentnummer,\n        t1.tijdstipregistratie,\n        t1.geovlak as geom,\n        (SELECT COUNT(*) FROM bagactueel.pand WHERE ST_Contains(t1.geovlak, pand.geovlak)) AS object_count\n    FROM \n        bagactueel.woonplaats t1\n    LEFT JOIN \n        bagactueel.woonplaats t2\n    ON \n        t1.woonplaatsnaam = t2.woonplaatsnaam AND t1.tijdstipregistratie \u003c t2.tijdstipregistratie\n    WHERE \n        t2.woonplaatsnaam IS NULL\n)\nSELECT \n    id,\n    name,\n    woonplaatsstatus,\n    documentdatum,\n    documentnummer,\n    tijdstipregistratie,\n    geom,\n    object_count\nFROM places;\n\n\nSELECT \n    jsonb_build_object(\n        'type', 'FeatureCollection',\n        'features', jsonb_agg(\n            jsonb_build_object(\n                'type', 'Feature',\n                'properties', jsonb_build_object(\n                    'id', a.id,\n                    'name',\ta.name,\n                    'rank', a.rank\n                ),\n                'geometry', a.geom\n            )\n        )\n    ) AS geojson\nFROM (\n\tSELECT \n\t    id,\n\t    name,\n\t    geom,\n\t    NTILE(20) OVER(ORDER BY object_count) AS rank\n\tFROM (\n\t    SELECT \n\t        id,\n\t        name,\n\t        ST_AsGeoJSON(ST_Transform(ST_SimplifyPreserveTopology(geom, 400), 4326), 5)::json as geom,\n\t        object_count,\n\t        ROW_NUMBER() OVER (PARTITION BY name ORDER BY id DESC) as rn\n\t    FROM woonplaats_latest\n\t) sub\n\tWHERE rn = 1\n) as a;\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftebben%2Ftopobaas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftebben%2Ftopobaas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftebben%2Ftopobaas/lists"}