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
ogr2ogr -f "PostgreSQL" PG:"host=localhost port=5432 user=user password=password dbname=mydb" -nlt GEOMETRY -sql "SELECT *, current_timestamp AS timestamp FROM input.shp" |
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
#!/bin/bash | |
# Rozkład pociągu zdawczego do składnicy drewna | |
# Gdzie jest książka pokładowa | |
for f in *.zip; do unzip "$f" -d "${f%.zip}"; done | |
#Karta próby | |
export PGHOST="127.0.0.1" | |
export PGPORT="5432" | |
export PGDATABASE="osm" | |
export PGUSER="baza" |
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
gdaltindex -tileindex godlo -t_srs EPSG:2180 index.gpkg *.asc | |
from PyQt5.QtCore import QFileInfo | |
vl = QgsProject.instance().mapLayersByName('nazwa_warstwy')[0] | |
qgis.utils.iface.setActiveLayer(vl) | |
root = QgsProject.instance().layerTreeRoot() | |
group_name = "Rastry DTM" | |
group = root.findGroup(group_name) | |
if group == None: |
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
-- DDL dla funkcji | |
CREATE TABLE public.g_compartment ( | |
ogc_fid int4 NOT NULL, | |
geom geometry NULL, | |
a_i_num float8 NULL, | |
adr_for varchar(25) NULL, | |
a_year float8 NULL, | |
oddzial varchar(5) NULL, | |
CONSTRAINT g_compartment_pkey PRIMARY KEY (ogc_fid) |
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
sudo apt-get update | |
sudo apt-get upgrade | |
cd /home | |
git clone https://github.com/OpenDroneMap/WebODM --config core.autocrlf=input --depth 1 | |
cd WebODM | |
./webodm.sh start --port 80 |
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
CASE | |
WHEN "fclass" IN ('primary','trunk','motorway') AND "maxspeed" >= '60' THEN '60' | |
WHEN "fclass" IN ('primary','trunk','motorway') AND "maxspeed" = '0' THEN '60' | |
WHEN "fclass" IN ('primary','trunk','motorway') AND "maxspeed" < '60' THEN "maxspeed" | |
WHEN "fclass" ='secondary' AND "maxspeed" >= '50' THEN '50' | |
WHEN "fclass" ='secondary' AND "maxspeed" = '0' THEN '50' | |
WHEN "fclass" ='secondary' AND "maxspeed" < '50' THEN "maxspeed" | |
WHEN "fclass" ='tertiary' AND "maxspeed" >= '40' THEN '40' | |
WHEN "fclass" ='tertiary' AND "maxspeed" = '0' THEN '40' | |
WHEN "fclass" ='tertiary' AND "maxspeed" < '40' THEN "maxspeed" |
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
FILES=$(find *.gml); | |
for FILE in $FILES | |
do | |
ogr2ogr -f GPKG -append -a_srs EPSG:2180 powiat.gpkg GMLAS:$FILE -oo REMOVE_UNUSED_LAYERS=YES | |
done |
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
CREATE TABLE bdl.naruszenia AS with | |
oddzialy as (select adr_for as adres_lesny, area_type, wkb_geometry AS geometry from bdl.g_subarea) | |
select o.adres_lesny, count(*) as zliczone, o.geometry, o.area_type | |
from oddzialy o | |
join waw.budowle b on ST_Intersects(b.geometry, o.geometry) | |
group by 1,3,4 | |
order by 2; | |
ALTER TABLE bdl.naruszenia OWNER TO osm; |
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 st_pointonsurface(z.geometry) AS geom, z.id, z.name, z.type, powiat.teryt | |
FROM topo.osm_zbiorniki z | |
JOIN topo.osm_admin powiat | |
ON st_intersects(powiat.geometry, st_pointonsurface(z.geometry)) WHERE powiat.admin_level='6'; |
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
WITH powiaty AS | |
(SELECT teryt, st_transform(geometry,2180) AS geometry, name | |
FROM topo.osm_admin | |
WHERE admin_level='6' OR admin_level='4') | |
SELECT row_number() OVER () AS _qgisid, | |
COUNT(1) AS ilosc, | |
AVG(ST_Area(st_transform(z.geometry,2180))) AS srednia, | |
MIN(ST_Area(st_transform(z.geometry,2180))) AS male, | |
powiaty.name, | |
powiaty.teryt, |
NewerOlder