This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
umask go= | |
wg genkey | tee wg_${1}.key | wg pubkey > wg_${1}.pub | |
wg genpsk > wg_${1}.psk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import os | |
import shutil | |
import math | |
import psycopg2 | |
from flask import Flask, render_template, make_response | |
app = Flask(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project = QgsProject.instance() | |
manager = project.layoutManager() | |
layoutName = 'KIERUNKI' | |
layoutMain = [layout for layout in manager.printLayouts() if layout.name() == layoutName][0] | |
maps = [item for item in layoutMain.items() if hasattr(item, 'extent')] | |
[m.extent() for m in maps] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<gml:FeatureCollection xmlns="http://www.w3.org/2001/XMLSchema" | |
xmlns:gco="http://www.isotc211.org/2005/gco" | |
xmlns:gmd="http://www.isotc211.org/2005/gmd" | |
xmlns:gml="http://www.opengis.net/gml/3.2" | |
xmlns:gsr="http://www.isotc211.org/2005/gsr" | |
xmlns:gss="http://www.isotc211.org/2005/gss" | |
xmlns:gts="http://www.isotc211.org/2005/gts" | |
xmlns:xlink="http://www.w3.org/1999/xlink" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:bt="urn:gugik:specyfikacje:gmlas:modelPodstawowy:1.0" xmlns:mz="urn:gugik:specyfikacje:gmlas:mapaZasadnicza:1.0" targetNamespace="urn:gugik:specyfikacje:gmlas:modelPodstawowy:1.0" elementFormDefault="qualified" attributeFormDefault="unqualified"> | |
<import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/> | |
<import namespace="http://www.isotc211.org/2005/gmd" schemaLocation="http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd"/> | |
<import namespace="http://www.isotc211.org/2005/gmd" schemaLocation="http://schemas.opengis.net/iso/19139/20070417/gmd/citation.xsd"/> | |
<import namespace="urn:gugik:specyfikacje:gmlas:mapaZasadnicza:1.0" schemaLocation="MZ_MapaZasadnicza.xsd"/> | |
<!--======================================--> | |
<element name="BT_ObiektPrzestrzenny" type="bt:BT_Obie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT row_number() OVER () rn, * | |
FROM ( | |
SELECT (ST_Dump(ST_Difference(ST_Snap(luse, lparcels, tolerance), lparcels))).* | |
FROM ( | |
SELECT | |
ST_Union(DISTINCT land_use_only.geom) AS luse, | |
ST_Union(DISTINCT land_parcels_only.geom) AS lparcels, | |
1e-5 AS tolerance | |
FROM ( | |
SELECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function unblendColorChanel(value, opacity){ | |
return Math.round((value - 255*(1-opacity))/opacity) | |
} | |
export function unblendColor(rgbA, opacity){ | |
return rgbA.map(ch=> unblendColorChanel(ch, opacity)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qgis.core import * | |
from PyQt5.QtCore import QVariant | |
project = QgsProject.instance() | |
projectLayoutManager = project.layoutManager() | |
layout = projectLayoutManager.layoutByName('KIERUNKI_A0+') | |
treeRoot = project.layerTreeRoot() | |
temp = QgsVectorLayer("Polygon?crs=epsg:2180", "map_extends", "memory") | |
temp_data = temp.dataProvider() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arcpy.env.workspace = "." | |
current_mxd = arcpy.mapping.MapDocument("CURRENT") | |
current_dfs = arcpy.mapping.ListDataFrames(current_mxd) | |
project_filename = current_mxd.filePath.split('\\')[-1] | |
project_name = project_filename[:-4].split('_')[0] | |
project_scale = project_filename[:-4].split('_')[-1] | |
plan_filename = "{}_RysunekPlanu_{}.mxd".format(project_name, project_scale) | |
plan_mxd = arcpy.mapping.MapDocument(plan_filename) | |
source_dfs = arcpy.mapping.ListDataFrames(plan_mxd) | |
for index in range(len(source_dfs)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def FindLabel ( [NAZWA_OBIEKTU] ): | |
label = [NAZWA_OBIEKTU] | |
if (label.count('-') != 0): | |
return '\n'.join([e.strip() for e in label.split('-')]) | |
lens=[n for n in range(len(label)) if label.find(' ', n) == n] | |
abss = [abs(round(len(label)/2)-e) for e in lens] | |
i=lens[abss.index(min(abss))] | |
return '\n'.join([label[:i].strip(),label[i:].strip()]) |
NewerOlder