This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
table_name, | |
column_name, | |
is_nullable, | |
data_type, | |
character_maximum_length | |
FROM | |
information_schema.columns | |
WHERE | |
table_schema = 'siges' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
import json | |
# Connect to the PostgreSQL database | |
conn = psycopg2.connect( | |
host="localhost", | |
database="test", | |
user="postgres", | |
password="postgres" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd"> | |
<NamedLayer> | |
<se:Name>mf_ste_equipements_publics_poubelle</se:Name> | |
<UserStyle> | |
<se:FeatureTypeStyle> | |
<se:Rule> | |
<se:Name>Poubelle</se:Name> | |
<se:MinScaleDenominator>3000.000000</se:MinScaleDenominator> | |
<se:MaxScaleDenominator>80000.000000</se:MaxScaleDenominator> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- WKT TO BBOX | |
-- This script allows to convert a WKT geometry to a BBOX string with WIDTH and HEIGHT to be used in a WMS request. | |
WITH input_geom AS ( | |
SELECT ST_SetSRID('POLYGON((7.210196256637572 46.079631239023286,7.2218477725982675 46.07266495408345,7.22425103187561 46.07465966398232,7.212899923324584 46.08162569712192,7.210196256637572 46.079631239023286))'::geometry, 4326) AS geom | |
) | |
SELECT | |
'BBOX='|| | |
ST_XMin(ST_Transform(geom, 2056)) ||','|| | |
ST_YMin(ST_Transform(geom, 2056)) ||','|| | |
ST_XMax(ST_Transform(geom, 2056)) ||','|| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
wfs-geopandas.py | |
Script to read data from an OGC WFS service to GeoPandas | |
Author: [Maxime Collombin] | |
Reference: https://gis.stackexchange.com/questions/299567/reading-data-to-geopandas-using-wfs | |
Date: [14/08/2023] | |
""" | |
import geopandas as gpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
wms_wmts_swisstopo.py | |
Script to get the bounding box of all the layers of WMTS and WMS services. | |
Author: [Maxime Collombin] | |
Date: [14/08/2023] | |
""" | |
# -*- coding: utf-8 -*- | |
from owslib.wmts import WebMapTileService |
NewerOlder