Skip to content

Instantly share code, notes, and snippets.

View ImreSamu's full-sized avatar
🗺️

ImreSamu ImreSamu

🗺️
View GitHub Profile
@ImreSamu
ImreSamu / Dockerfile
Created November 4, 2023 01:39 — forked from tobwen/Dockerfile
PostGIS Debian OCI
# commits to be built
ARG CGAL55_GIT_COMMIT=tags/v5.6 # https://github.com/CGAL/cgal/tags
ARG SFCGAL_GIT_COMMIT=tags/v1.5.0 # https://github.com/Oslandia/SFCGAL_CI/tags
ARG PROJ_GIT_COMMIT=tags/9.3.0 # https://github.com/OSGeo/PROJ/tags
ARG GEOS_GIT_COMMIT=tags/3.12.0 # https://github.com/libgeos/geos/tags
ARG GDAL_GIT_COMMIT=tags/v3.7.3 # https://github.com/OSGeo/gdal/tags
ARG POSTGIS_GIT_COMMIT=tags/3.4.0 # https://github.com/postgis/postgis/tags
# base container with build-dependencies
FROM docker://postgres:16-bookworm AS build-deps
-----
-----
-- original code: http://web.archive.org/web/20111006010109/http://blog.cleverelephant.ca/2010/07/network-walking-in-postgis.html
----
----
DROP TABLE IF EXISTS network;
DROP TABLE
Time: 5.564 ms
BEGIN;
BEGIN
@ImreSamu
ImreSamu / addcolumns.py
Created November 13, 2022 01:38
extending ne_10m_admin_0_countries.shp
from shapely.geometry import mapping, shape
import fiona
with fiona.open('./10m_cultural/ne_10m_admin_0_countries.shp', 'r', encoding='utf-8' ) as input:
schema = input.schema.copy()
input_crs = input.crs
# add area_sqkm property if not present in the schema add it
if not hasattr( schema['properties'], 'area_sqkm'):
schema['properties']['area_sqkm'] = 'float:22.2'
#!/bin/bash
set -Eeuo pipefail
# bash test_st_astext_precision.bash > test_st_astext_precision.log
# related? https://trac.osgeo.org/postgis/ticket/4947
function postgistest {
dockername="$1"
dockerimages="$2"
echo ""
@ImreSamu
ImreSamu / id_langDups_all.md
Created October 5, 2018 19:58
2018-October-05 - 21:50CET - iD Editor unclear translations - Testing
language nameTransl nameEn presetKey searchable icon tags0 tags1 tags2 tags3 tags4 geometryArea geometryLine geometryPoint geometryVertex geometryRelation
af Begrafplaas Graveyard amenity/grave_yard maki-cemetery amenity=grave_yard area point
af Begrafplaas Cemetery landuse/cemetery maki-cemetery landuse=cemetery area
af Dorpie Hamlet place/hamlet maki-triangle-stroked place=hamlet area point
af Dorpie Village place/village maki-village place=village area point
af Fontein Fountain amenity/fountain temaki-fountain amenity=fountain area point
af Fontein Spring natural/spring maki-water natural=spring point vertex
af Kroeg Bar amenity/bar maki-bar amenity=bar area point
af Kroeg Pub amenity/pub maki-beer amenity=pub area point
@ImreSamu
ImreSamu / check_idpresets.sh
Created September 21, 2018 03:15
check_idpresets.sh [ 2018.Sep.21]
#!/bin/bash
# name: check_idpresets.sh [ 2018.Sep.21]
# check iD Editor Translations
# --- Determine Duplicate Elements,
# --- Export presets to CSV
#
# License: same as iD Editor / available under the WTFPL : http://sam.zoy.org/wtfpl/
# Created by ImreSamu for helping hungarian translations
#
# requirements :
@ImreSamu
ImreSamu / wof-lau-compare2018.md
Last active September 19, 2018 13:38
Compare whosonfirst-data and EU LAU data ( "eu_lau_n" last column )
wof country country macroregion region macrocounty county localadmin locality eu_lau_n
"AL" 1 0 12 0 61 4 150 57
"AT" 1 0 9 0 98 2103 2427 2098
"BA" 1 0 12 0 142 0 300 143
"BE" 1 2 11 0 42 1306 2866 589
"BG" 1 0 29 0 0 0 1055 265
"CH" 1 0 26 0 141 2804 7110 2240
"CY" 1 0 6 0 0 0 661 615
"CZ" 1 0 14 0 0 811 6326 6258
@ImreSamu
ImreSamu / test.c
Created September 8, 2018 10:24
julia - test.c
#include <julia.h>
JULIA_DEFINE_FAST_TLS() // only define this once, in an executable (not in a shared library) if you want fast code.
int main(int argc, char *argv[])
{
/* required: setup the Julia context */
jl_init();
/* run Julia commands */
jl_eval_string("print(sqrt(2.0))");
@ImreSamu
ImreSamu / Dockerfile
Created September 2, 2018 15:46
fresh libosmium_log.txt ( ubuntu 18.04 )
FROM ubuntu:18.04
RUN date
RUN apt-get update \
&& apt-get install -q -y \
cmake \
doxygen \
g++ \
git \
graphviz \
libboost-dev \
@ImreSamu
ImreSamu / budapest_poly.osc
Created July 22, 2018 20:25
osmium extract - example for debugging.
<?xml version='1.0' encoding='UTF-8'?>
<osmChange version="0.6" generator="osmium/1.8.0">
<delete>
<node id="277285" version="9" timestamp="2011-09-11T22:56:15Z"/>
<node id="277286" version="7" timestamp="2011-09-11T22:56:15Z"/>
<node id="277290" version="3" timestamp="2011-01-16T21:20:27Z"/>
<node id="26733986" version="11" timestamp="2014-12-12T16:15:25Z"/>
<node id="26733991" version="10" timestamp="2014-12-12T16:15:25Z"/>
<node id="26883617" version="8" timestamp="2016-08-17T09:28:03Z"/>
<node id="26884330" version="4" timestamp="2015-02-22T15:04:42Z"/>