Skip to content

Instantly share code, notes, and snippets.

Avatar

Topi Tjukanov tjukanovt

View GitHub Profile
View qlimt.xml
<!DOCTYPE qgis_style>
<qgis_style version="2">
<symbols>
<symbol clip_to_extent="1" name="qlimt" force_rhr="0" type="fill" alpha="1">
<layer enabled="1" pass="0" locked="0" class="GeometryGenerator">
<prop v="Fill" k="SymbolType"/>
<prop v="with_variable('my_geom',&#xd;&#xa;CASE WHEN &#xd;&#xa; num_geometries( $geometry)>1&#xd;&#xa; THEN &#xd;&#xa; geometry_n( $geometry, @geometry_part_num)&#xd;&#xa; ELSE&#xd;&#xa; $geometry&#xd;&#xa; END,&#xd;&#xa; with_variable('shape',rand(1,4),&#xd;&#xa; CASE WHEN &#xd;&#xa; @shape =1&#xd;&#xa; THEN &#xd;&#xa; minimal_circle( @my_geom )&#xd;&#xa; WHEN&#xd;&#xa; @shape =2&#xd;&#xa; THEN&#xd;&#xa; oriented_bbox( @my_geom )&#xd;&#xa; WHEN&#xd;&#xa; @shape =3&#xd;&#xa; THEN&#xd;&#xa; oriented_bbox( @my_geom )&#xd;&#xa; WHEN&#xd;&#xa; @shape =4&#xd;&#xa; THEN&#xd;&#xa; simplify(@my_geom, rand(1,20))&#xd;&#xa; END))&#xd;&#xa; " k="geometryModifier"/>
<data_defined_properties>
<Option type="Map">
View pencilish.xml
<!DOCTYPE qgis_style>
<qgis_style version="2">
<symbols>
<symbol alpha="1" force_rhr="0" clip_to_extent="1" type="fill" name="pencilish">
<layer class="MarkerLine" pass="0" locked="0" enabled="1">
<prop k="average_angle_length" v="4"/>
<prop k="average_angle_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="average_angle_unit" v="MM"/>
<prop k="interval" v="0.02"/>
<prop k="interval_map_unit_scale" v="3x:0,0,0,0,0,0"/>
View digital_rain.xml
<!DOCTYPE qgis_style>
<qgis_style version="2">
<symbols>
<symbol tags="Showcase" clip_to_extent="1" name="digital_rain" force_rhr="0" alpha="1" type="fill">
<layer class="SimpleLine" pass="0" enabled="1" locked="0">
<prop v="square" k="capstyle"/>
<prop v="5;2" k="customdash"/>
<prop v="3x:0,0,0,0,0,0" k="customdash_map_unit_scale"/>
<prop v="MM" k="customdash_unit"/>
<prop v="0" k="draw_inside_polygon"/>
View qartoon.xml
<!DOCTYPE qgis_style>
<qgis_style version="2">
<symbols>
<symbol name="qartoon" force_rhr="0" clip_to_extent="1" alpha="1" type="fill">
<layer class="SimpleFill" enabled="1" locked="0" pass="0">
<prop v="3x:0,0,0,0,0,0" k="border_width_map_unit_scale"/>
<prop v="0,0,0,255" k="color"/>
<prop v="round" k="joinstyle"/>
<prop v="1,1" k="offset"/>
<prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
View finnish_voting_districts_2019.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View hsl_hfp_data.py
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 14 16:54:39 2019
@author: topit
MQTT part based on: http://www.steves-internet-guide.com/into-mqtt-python-client/
API docs for HSL high-frequency positioning: https://digitransit.fi/en/developers/apis/4-realtime-api/vehicle-positions/
"""
import paho.mqtt.client as mqtt
@tjukanovt
tjukanovt / twitterbot.py
Created Jul 2, 2018
A super simple Twitter bot application posting random csv content every 2 hours
View twitterbot.py
import tweepy
import random
import pandas as pd
import time
#get your codes from https://apps.twitter.com/
consumer_key = 'your_code_here'
consumer_secret = 'your_code_here'
access_token = 'your_code_here'
access_token_secret = 'your_code_here'
View FTA_trains.py
import requests
import csv
from datetime import timedelta
import dateutil.parser
import time
i=0
sleep = 15
View marinetraffic.py
import requests
import csv
import datetime
import calendar
import time
i=0
# Change the range depending on how long you like to record the data
for i in range (0,50):
@tjukanovt
tjukanovt / api_calls.py
Last active Jun 9, 2020
Two Python scripts that can be used to create animated route maps to multiple locations
View api_calls.py
import pandas as pd
import urllib.request
# path to your csv file with the endpoint coordinates
coordinates = pd.read_csv('swe_points.csv')
# graphhopper API call building blocks. Check Graphhopper documentation how to modify these.
urlStart = 'http://localhost:8989/route?'
point = 'point='
urlEnd = '&type=gpx&instructions=false&vehicle=car'
You can’t perform that action at this time.