Skip to content

Instantly share code, notes, and snippets.

View maxcollombin's full-sized avatar

Maxime Collombin maxcollombin

View GitHub Profile
@maxcollombin
maxcollombin / parcelles_narcisses.kml
Last active November 12, 2026 10:34
Parcelles gérées par l'association Narcisses Riviera
<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="root_doc">
<Schema name="OGRGeoJSON" id="OGRGeoJSON">
<SimpleField name="Name" type="string"></SimpleField>
<SimpleField name="NO_COM_CANT" type="int"></SimpleField>
<SimpleField name="ORIGINE" type="string"></SimpleField>
<SimpleField name="GENRE_TXT" type="string"></SimpleField>
<SimpleField name="SUPERFICIE_RF" type="int"></SimpleField>
<SimpleField name="URL" type="string"></SimpleField>
@maxcollombin
maxcollombin / eCH-0056 SwissLV95CellSizes BBOX
Created September 29, 2026 06:21
BBOX eCH-0056 4.1.0 (LV95 2056)
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>eCH-0056 SwissLV95CellSizes BBOX</name>
<Style id="bbox">
<LineStyle><color>ff0000ff</color><width>2</width></LineStyle>
<PolyStyle><color>330000ff</color></PolyStyle>
</Style>
<Placemark>
<name>BBOX eCH-0056 (LV95 2056)</name>

Exercice guidé #1 - Création du modèle physique

Important

Lien vers la présentation.

L'intégralité des modèles présentés peuvent être téléchargés à partir de la ressource suivante : https://github.com/MediaComem/FGDM4GS/tree/main/WP2-WP3/model/Planungszonen_V1_1.

Sur la base des modèles créés, nous vous proposons maintenant un petit test avec ili2gpkg et GDAL afin d'analyer la portée de ce que nous venons de présenter.

Création du GPKG

@maxcollombin
maxcollombin / ili2c.sh
Last active January 30, 2025 05:44
Script for validating muliple INTERLIS .ili files in a directory.
# Truncate the ili2c.log file if it exists, otherwise create it
: > ili2c.log
# Validate each .ili file in the models directory
for file in models/*.ili; do
echo -e "Processing $file\n" >> ili2c.log
java -jar ili2c.jar "$file" >> ili2c.log 2>&1
echo "" >> ili2c.log
done
@maxcollombin
maxcollombin / json-kml.py
Created May 8, 2024 06:47
Convert JSON to KML
import json
import polyline
import simplekml
# Load the JSON file
with open('input.json') as f:
data = json.load(f)
# Create a KML object
kml = simplekml.Kml()
@maxcollombin
maxcollombin / checkzipurlcontent.py
Last active February 14, 2024 18:56
Script to check the content of a zip file from a URL.
# -*- coding: utf-8 -*-
"""
checkzipurlcontent.py
Script to check the content of a zip file from a URL.
Author: [Maxime Collombin]
Date: [14/02/2023]
"""
import requests
import zipfile
@maxcollombin
maxcollombin / TableAttributes.sql
Created February 10, 2024 08:42
PostgreSQL script to retrieve table attributes in schema
SELECT
table_name,
column_name,
is_nullable,
data_type,
character_maximum_length
FROM
information_schema.columns
WHERE
table_schema = 'siges'
@maxcollombin
maxcollombin / relations-list.sql
Last active February 10, 2024 08:19
PostgreSQL script to list relations between tables
SELECT
tc.constraint_name AS constraint_name,
tc.table_name AS table_name,
kcu.column_name AS column_name,
ccu.table_name AS foreign_table_name,
ccu.column_name AS foreign_column_name
FROM
information_schema.table_constraints AS tc
JOIN information_schema.key_column_usage AS kcu
ON tc.constraint_name = kcu.constraint_name
@maxcollombin
maxcollombin / db-to-json-schema.py
Created January 5, 2024 12:25
Script to extract a json schema from a db
import psycopg2
import json
# Connect to the PostgreSQL database
conn = psycopg2.connect(
host="localhost",
database="test",
user="postgres",
password="postgres"
)