Skip to content

Instantly share code, notes, and snippets.

@tkwant
tkwant / docker-compose.yml
Last active October 4, 2019 15:25
zigbee2mqtt mosquitto nodered docker compose
version: '3'
services:
mosquitto:
image: eclipse-mosquitto
container_name: mosquitto
restart: always
volumes:
- ~/smarthome/mosquitto:/mosquitto/
ports:
- 1883:1883
@tkwant
tkwant / polygonTransformHierarchy.py
Last active October 2, 2019 18:05
transforms a list of polygons into a list of levels with the polygons.
from shapely.geometry import Point
from shapely.geometry.polygon import Polygon
def isPolygonInPolygon(poly1,poly2):
poly2 = Polygon(poly2)
for poi in poly1:
poi = Point(poi)
if(poly2.contains(poi)):
return True