Skip to content

Instantly share code, notes, and snippets.

View trolleway's full-sized avatar
🎯
Python, PostGIS, PostgreSQL, GIS

Artem Svetlov trolleway

🎯
Python, PostGIS, PostgreSQL, GIS
View GitHub Profile
@trolleway
trolleway / address2iptc.py
Last active March 19, 2020 12:25
write address of place of GPS DEST point into IPTC tags in RU and EN
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import datetime
import pyexiv2
import re
from dateutil.tz import tzlocal
from PIL import Image
@trolleway
trolleway / wfs_download.py
Created November 10, 2015 13:30
mass download vector data from WFS service. Generates a sh script with ogr2ogr calls.
from owslib.fes import *
from owslib.etree import etree
from owslib.wfs import WebFeatureService
wfs11 = WebFeatureService(url='http://example.com:8080/geoserver/wfs/', version='1.1.0')
f = open('download.sh', 'wb')
f.write('#!/bin/bash'+'\n')
f.write(''+'\n')
@trolleway
trolleway / geojson2ngw.py
Created November 10, 2015 14:24
Загрузка всех файлов geojson из текущей директории в веб-гис NextGIS Web
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
URL = 'http://example.com/ngw'
AUTH = ('administrator', 'admin')
GRPNAME = "Загрузка из python"
import requests
from json import dumps
@trolleway
trolleway / wms_downloader.python
Created November 13, 2015 14:41
wms downloader with resume
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# anchor extraction from html document
from bs4 import BeautifulSoup
import urllib2
import urlparse
import re
import csv
import time
@trolleway
trolleway / ngw_service_create.py
Created November 17, 2015 13:47
Open a resourse group in NGW, add random mapstyle for each layer, if not exists, make WMS and WFS service for all layers in this group
# -*- coding: utf-8 -*-
#создаёт в группе ресурсов wfs-сервис со всеми слоями
from __future__ import unicode_literals
import os
import json
#для создания ключей транслитом
from transliterate import translit, get_available_language_codes
#!/usr/bin/python
import os
import datetime
import time
def get_args():
import argparse
p = argparse.ArgumentParser(description='Move images to folder with his date')
p.add_argument('path', help='Path to folder containing JPG files')
return p.parse_args()
@trolleway
trolleway / html_generator.py
Last active December 30, 2015 12:42
Постановление Правительства Москвы от 8 декабря 2015 г. N 829-ПП "О мерах по обеспечению сноса самовольных построек на отдельных территориях города Москвы"
#!/usr/bin/python
# -*- coding: utf-8 -*-
import ijson
from shapely.geometry import Polygon, MultiPolygon
import urllib
@trolleway
trolleway / photo2geojson.py
Created January 3, 2016 15:07
Generate a geojson file with coordinates of all photos in folder.
# -*- coding: UTF-8 -*-
'''
Generate a geojson file with coordinates of all photos in folder.
Using exiftool via exiftool module
Usage:
python geo3.py "E:\PHOTO\z_bat\geo\test1"
exiftool -a -G1 -s R0010031.JPG
[ExifTool] ExifToolVersion : 10.08
[System] FileName : R0010031.JPG
[System] Directory : .
[System] FileSize : 4.0 MB
[System] FileModifyDate : 2016:01:11 22:16:42+03:00
[System] FileAccessDate : 2016:01:11 23:27:07+03:00
[System] FileCreateDate : 2016:01:11 23:27:07+03:00
[System] FilePermissions : rw-rw-rw-
[File] FileType : JPEG
@trolleway
trolleway / ricohthetas_offshutter.txt
Last active June 26, 2016 17:57
Ricoh Theta S turn off shutter sound
POST /osc/commands/execute
{
"name": "camera.startSession",
"parameters": {}
}
#shoot
192.168.1.1/osc/commands/execute
{
"name": "camera.takePicture",