Skip to content

Instantly share code, notes, and snippets.

View ZKingDRFN's full-sized avatar

ZKingDRFN

View GitHub Profile
@kgjenkins
kgjenkins / readme.md
Last active February 12, 2023 13:29
Labels with callout lines in QGIS

Labels with callout lines in QGIS


UPDATE: As of October 2019, QGIS 3.10 has built-in support for label callout lines!


Callouts, sometimes called leader lines, are lines between labels and features on a map. They are useful when constraints of space force a label to be moved away from the

@esseti
esseti / checkbox.html
Created March 30, 2018 15:27
Beautiful widget for django multiple select
{% with id=widget.attrs.id %}
{% for group, options, index in widget.optgroups %}
{% for option in options %}
{% with widget=option %}
{% include widget.template_name%}
{% endwith %}
{% endfor %}
{% endfor %}
{% endwith %}
@djq
djq / unions
Created November 22, 2014 21:23
How to union a list of geometries in GeoDjango
from django.contrib.gis.geos import GEOSGeometry
# sample data
geom_1 = GEOSGeometry('POLYGON((-71.8 42.1,-70.6 42.1,-70.5 41.2,-71.8 41.2,-71.8 42.1))')
geom_2 = GEOSGeometry('POLYGON((-71.12 42.23,-71.48 42.34,-71.52 42.55,-71.12 42.23))')
geom_3 = GEOSGeometry('POLYGON((-73.12 42.23,-71.48 42.34,-71.52 42.55,-73.12 42.23))')
polygons = [geom_1, geom_2, geom_3]
# get first polygon
polygon_union = polygons[0]