Skip to content

Instantly share code, notes, and snippets.

View Swahhillie's full-sized avatar

David Hoogenbosch Swahhillie

View GitHub Profile
@Sacristan
Sacristan / push_commits_by_chunks.sh
Last active July 18, 2024 15:03
Push commits by chunks
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=10
# check if the branch exists on the remote
# if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# # if so, only push the commits that are not on the remote already
# range=$REMOTE/$BRANCH..HEAD
# else
# # else push all the commits
@romanshuvalov
romanshuvalov / tesselate_to_multipolygon.sql
Created September 7, 2016 13:41
Postgis ST_Tesselate to a multipolygon
-- thank to http://gis.stackexchange.com/questions/209825/converting-tin-to-multipolygon-in-postgis
CREATE OR REPLACE FUNCTION tesselate_to_multipolygon(
geometry)
RETURNS geometry AS
$BODY$
SELECT ST_Collect(geom) AS geom
FROM (
SELECT ST_MakePolygon(ST_ExteriorRing((ST_Dump(ST_Tesselate($1))).geom)) AS geom) as geom_item;
$BODY$
LANGUAGE sql