Skip to content

Instantly share code, notes, and snippets.

View chingchai's full-sized avatar
:octocat:
Focusing

Chingchai Humhong chingchai

:octocat:
Focusing
View GitHub Profile
@sebastian-meier
sebastian-meier / branches.txt
Last active March 22, 2024 02:36
QGIS Geometry Generators - CartoHack #9
collect_geometries(
array_foreach(
generate_series(1, to_int("count"), 1),
translate(
geom_from_wkt(
concat(
'LINESTRING(0 50,',
to_string(rand(-25, 25, concat("fid", '_x', @element))),
' ',
to_string(rand(-5, 5, concat("fid", '_y', @element))),
@giohappy
giohappy / deploy-geoserver
Created June 21, 2021 20:05
Install GeoServer on cloud server with Ubuntu 20.04
# Install GeoServer on cloud server
________________
## 1. Install Java JDK
apt install openjdk-11-jdk
You can check the installation using `$ java -version`. Now you can see something like this:
openjdk version "11.0.7" 2020-04-14
@rbanick
rbanick / QGIS_Advanced_Atlas_Techniques.md
Last active March 5, 2024 09:06
QGIS Advanced Atlas Techniques

Background

QGIS's Atlas feature and ArcGIS's Data Driven Pages allow you to create a series of maps, one per geography, based off a single map style. Titles, labels, and styles within the maps can be created based on the attributes of key layers and/or the scale of the map, imparting some customization and flexibility to an otherwise automated process. Atlas geographies can be points, polygons, and scales can be adjusted.

But what if you want to create multiple maps for a single geography, or multiple maps for multiple geographies? How can you vary not just the extent but the contents of what's shown?

This walkthrough will detail two complementary methods for filtering the display of datasets across multiple geographies using QGIS's Atlas Tool. This is a deep dive into a few specific Atlas techniques that I thought were poorly documented elsewhere and useful, not an exhaustive guide to the Atlas Tool. I have no idea if any or all of these techniques can be replicated using ArcGIS's Data Driven Pages.

@luipir
luipir / camera_calculator.py
Last active February 29, 2024 16:45
Camera Footprint Calculator
"""
***************************************************************************
camera_calculator.py
---------------------
Date : August 2019
Copyright : (C) 2019 by Luigi Pirelli
Email : luipir at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
@pigreco
pigreco / randomPointsInBBox.sql
Created May 15, 2019 11:58
Genera 1000 punti random all'interno di un BoundingBox di un poligono
-- creo una tabella vuota che conterrà i random point
CREATE TABLE point_bb
(id INTEGER PRIMARY KEY AUTOINCREMENT,cir_id INTEGER);
-- popolo ID tabella
INSERT INTO point_bb
WITH RECURSIVE
cnt(id) AS ( SELECT 1 UNION ALL SELECT id + 1 FROM cnt LIMIT 1000)
SELECT id,0 FROM cnt;
-- aggiorno tabella con i punti casuali usando bounding box del poligono
SELECT AddGeometryColumn ('point_bb','geom',4326,'POINT','XY');
@pigreco
pigreco / map_tips_qgis341.html
Created November 11, 2018 10:51
QGIS 3.4.1 map tips with photo
per percorsi assoluti:
<img src="[% 'file:///' || "path" %]" width = "400">
per percorsi relativi:
<img src="[% 'file:///' || @project_folder || '/' ||"filename" %]" width = "200">
@RWaltersMA
RWaltersMA / ProdReviewFunc.cs
Last active November 9, 2020 14:42
Azure Function - HTTP Trigger that leverages MongoDB Atlas database
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
#!/usr/bin/env bash
echo "
----------------------
PM2
----------------------
"
# install pm2 with npm
sudo npm install -g pm2
@adilsoncarvalho
adilsoncarvalho / docker-compose.yml
Created September 13, 2018 16:58
Example of a docker-compose.yml mounting cloud_sql_proxy as a service
version: '3'
services:
app:
build: .
# your own configurations for that app
depends_on:
- cloud-sql-proxy
environment:
# You must set an URL to access your database. On sequelize (nodejs) it follows this