Skip to content

Instantly share code, notes, and snippets.

View bertt's full-sized avatar

Bert Temme bertt

View GitHub Profile
@bertt
bertt / pg2b3dm_getting_started_sample.txt
Created April 9, 2024 10:30
pg2b3dm - getting started sample
Tool: pg2b3dm 2.8.0.0
Options: -h localhost -U postgres -c geom -d postgres -t sibbe -a identificatie
Password for user postgres:
Start processing 2024-04-09T12:18:51....
Input table: sibbe
Input geometry column: geom
App mode: Cesium
Spatial reference of sibbe.geom: 4979
Spatial index detected on sibbe.geom
Query bounding box of sibbe.geom...
@bertt
bertt / valuestypes.txt
Last active January 30, 2024 11:28
scalar values
[3dtiles] type / componentType -> [.net] -> [postgres]
boolean / - -> bool -> boolean
scalar / uint8 -> byte -> -
scalar / int8 -> sbyte -> -
scalar / int16 -> short -> smallint
scalar / uint16 -> ushort -> -
scalar / int32 -> int -> integer
scalar / uint32 -> uint -> -
scalar / int64 -> long -> bigint
scalar / uint64 -> ulong -> -
@bertt
bertt / tree.csv
Created August 18, 2023 12:28
tree.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 13 columns, instead of 2. in line 1.
Nederlandse naam,Wetenschappelijke naam,Plantjaar,Leeftijd,Eigenaar,Buurt,Wijk,Boomnummer,X,Y,Lat,Long,Exportdatum
Bolacacia,Robinia pseudoacacia
'Umbraculifera',2017,3,Gemeentelijk,Mariëndaalstraat e.o.,Noordwest,3022615,134958.072,457421.454,5.094669474551958,52.104669913710175,20201123
@bertt
bertt / dotnet_tagged_version
Last active August 10, 2023 13:36
dotnet tagged version
Tool: dotnetCampus.TagToVersion
https://github.com/dotnet-campus/dotnetCampus.TagToVersion
Writes a tag to file Build/Version.props
<Project>
<PropertyGroup>
<Version>0.11</Version>
</PropertyGroup>
@bertt
bertt / duckdb-open-buildings-tutorial.md
Last active July 13, 2023 08:34 — forked from cholmes/duckdb-open-buildings-tutorial.md
Tutorial on using DuckDB with the Google Open Buildings geoparquet files on source.coop

DuckDB and GeoParquet Tutorial

This is a quick tutorial on how you can use DuckDB to easily access the cloud-native version of the Google Open Buildings data set from source.coop and transform it into your favorite GIS format. A big thanks to Mark Litwintschik's post on DuckDB's Spatial Extension for lots of the key information, it's highly recommended.

About DuckDB?

DuckDB is an awesome new tool for working with data. In some ways it's a next generation 'SQLite' (which is behind GeoPackage in the geo world) - but fundamentally designed for analysis workflows. TODO: more explanation.

To install it just follow the instructions at: https://duckdb.org/docs/installation/index. This tutorial uses the command line version

// following works without gdalwarp:
$ wget https://ns_hwh.fundaments.nl/hwh-ahn/AHN3/DTM_5m/M5_65HZ2.zip
$ unzip M5_65HZ2.zip
$ gdalbuildvrt ahn.vrt M5_65HZ2.TIF
$ mkdir tiles
$ docker run -it -v D:/aaa/testdownload:/data tumgis/ctb-quantized-mesh ctb-tile -f Mesh -C -N -o tiles ahn.vrt
// following does not work with gdalwarp:
$ wget https://ns_hwh.fundaments.nl/hwh-ahn/AHN3/DTM_5m/M5_65HZ2.zip
$ unzip M5_65HZ2.zip
@bertt
bertt / 1.json
Created May 13, 2023 07:53
gmaps 1.json
{
"asset":{
"version":"1.0"
},
"geometricError":1e+100,
"root":{
"boundingVolume":{
"box":[
0,
0,
@bertt
bertt / gist:71aa40afd4c6a74e76808eeb784713dd
Created May 13, 2023 07:40
Gmaps 3D Tiles - root.json
{
"asset":{
"version":"1.0"
},
"geometricError":1e+100,
"root":{
"boundingVolume":{
"box":[
0,
0,
{
"extensions":{
"EXT_structural_metadata":{
"schema":{
"classes":{
"terrain":{
"description":"class description",
"name":"terrain",
"properties":{
"objectid":{
@bertt
bertt / gist:eb27c404149e3a5ecb9fe6499d52f99a
Created August 20, 2022 19:25
ecef2latlon using pyproj
import pyproj
lon = 1231256.4091099831
lat = -4800453.896456448
alt = 4000024.663498499
transformer = pyproj.Transformer.from_crs("EPSG:4978", "EPSG:4326")
print(transformer)
xyz = transformer.transform(lon, lat, alt)
print('Projected XY', xyz)
lonlat = transformer.transform(xyz[0], xyz[1], xyz[2], direction='INVERSE')