Skip to content

Instantly share code, notes, and snippets.

View maxcollombin's full-sized avatar

Maxime Collombin maxcollombin

View GitHub Profile
@maxcollombin
maxcollombin / GeoCat_CSW.py
Last active October 13, 2023 13:39
This script allows to harvest all the records from the GeoCat CSW service
"""
CSW harvesting script for the GeoCat CSW service.
This script allows to harvest all the records from the GeoCat CSW service
Author: [Maxime Collombin]
Date: [14/08/2023]
"""
# -*- coding: utf-8 -*-
@maxcollombin
maxcollombin / BBOXconverter.py
Last active August 18, 2023 15:00
This script allows to convert a bounding box from WGS84 to EPSG:2056.
"""
BBOX converter
This script allows to convert a bounding box from WGS84 to EPSG:2056.
Author: [Maxime Collombin]
Date: [14/08/2023]
"""
# -*- coding: utf-8 -*-
import pyproj
@maxcollombin
maxcollombin / SwissLV95CellSizes.py
Last active February 26, 2024 07:19
This script generates a JSON and XML representation of a an OGC 2D tile matrix set definition for use with geographical data services.
"""
Swiss Tile Matrix Set Generation Script
This script generates a JSON and XML representation of a an OGC 2D tile matrix set definition
for use with geographical data services.
Author: [Maxime Collombin]
Date: [14/08/2023]
"""
@maxcollombin
maxcollombin / docker-gdal.md
Created August 2, 2023 13:35
Tutorial on using gdal with docker

Step 1: Install Docker

Step 2: Pull the GDAL Image

docker pull geodata/gdal:latest

Step 3: Prepare Data Volume

@maxcollombin
maxcollombin / git-commands.md
Created August 2, 2023 12:23
Git useful commands

lists all the remote repositories associated with the local repository.

git remote -v

fetches all the changes made to the upstream remote repository to the local

git fetch upstream

This command merges the changes that were fetched in the previous step into the local repository's current branch. The --ff-only option ensures that the merge is only performed if it is a fast-forward merge, which means that the local branch has not diverged from the upstream branch.

git merge --ff-only upstream/main

@maxcollombin
maxcollombin / linux commands.md
Last active August 30, 2023 10:18
Useful linux commands

useful linux commands

download all the files listed in a csv file:

wget -i filename.csv

find a file by name

find ~/ -name "filename.txt"

@maxcollombin
maxcollombin / ran_points.sql
Last active August 2, 2023 11:57
Create random geometries
-- create points1 table
CREATE TABLE points1 (
id SERIAL PRIMARY KEY,
geom GEOMETRY(Point, 4326),
attr1 TEXT,
attr2 INTEGER
);
-- insert random data into points1 table
INSERT INTO points1 (geom, attr1, attr2)
@maxcollombin
maxcollombin / LayerFeatureConstraints_LinearRing.SLD
Created July 27, 2023 08:22
LayerFeatureConstraints LinearRing example file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<StyledLayerDescriptor version="1.0.0"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>ch.bafu.klima-co2_ausstoss_gebaeude</Name>
<LayerFeatureConstraints>
@maxcollombin
maxcollombin / LayerFeatureConstraints_DWithin.SLD
Last active July 27, 2023 08:03
LayerFeatureConstraints DWithin example file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<StyledLayerDescriptor version="1.0.0"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>ch.bafu.klima-co2_ausstoss_gebaeude</Name>
<LayerFeatureConstraints>
@maxcollombin
maxcollombin / co2_ausstoss_gebaeude_LayerFeatureConstraints_typo.SLD
Created July 7, 2023 09:14
WMS swisstopo co2_ausstoss_gebaeude LayerFeatureConstraints sur typo
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<StyledLayerDescriptor version="1.0.0"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>ch.bafu.klima-co2_ausstoss_gebaeude</Name>
<LayerFeatureConstraints>