Skip to content

Instantly share code, notes, and snippets.

View drnextgis's full-sized avatar

Denis Rykov drnextgis

View GitHub Profile
@drnextgis
drnextgis / temp.txt
Created June 22, 2011 16:40
Tilestache install
sudo apt-get install python-setuptools
sudo apt-get install python2.7-dev
sudo apt-get install libmapnik0.7 mapnik-utils python-mapnik
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
sudo pip install -U PIL
sudo pip install -U modestmaps
sudo pip install -U werkzeug
@drnextgis
drnextgis / check-modis.py
Created June 23, 2011 07:25
check-modis.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os,fnmatch
def main():
rootPath = './PullDir'
for root, dirs, files in os.walk(rootPath):
files.sort()
hdffiles = fnmatch.filter(files, '*.hdf')
@drnextgis
drnextgis / response.xml
Created June 24, 2011 12:08
GetCapabilities response
<?xml version='1.0' encoding='UTF-8'?>
<WFS_Capabilities version='1.1.0' updateSequence='0'
xmlns='http://www.opengis.net/wfs'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:ogc='http://www.opengis.net/ogc'
xmlns:gml='http://www.opengis.net/gml'
xmlns:ows='http://www.opengis.net/ows'
xmlns:xlink='http://www.w3.org/1999/xlink'
xsi:schemaLocation='http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd' >
Sub reports()
Const DBfile = "c:\personal\sib\operative.xls"
Dim notFillRows(59)
Set fso = CreateObject("Scripting.FileSystemObject")
Set a = CreateObject("excel.application")
Set b = a.Workbooks.Open(DBfile)
Set s = b.Sheets(1)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os,fnmatch
def main():
rootPath = 'c:/personal/gpx'
for root, dirs, files in os.walk(rootPath):
gpxfiles = fnmatch.filter(files, '*.gpx')
if (len(gpxfiles) != 0):
@drnextgis
drnextgis / mod14-process.py
Created July 10, 2011 12:29
mod14-process
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# mod14-process
# Äàìïû è îáðàáîòêà CSV ôàéëîâ ïîñëå ïðîãîíà àëãîðèòìà MOD14
# Author: Maxim Dubinin (sim@gis-lab.info)
# Date created: 22:56 22.05.2011
# Last updated: 13:15 04.06.2011
# ---------------------------------------------------------------------------
@drnextgis
drnextgis / mod14-process.py
Created July 13, 2011 10:12
Convert MOD14 hdf into csv
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
from optparse import OptionParser
import os, sys, fnmatch, shutil, datetime
def echo_err(parser,msg):
parser.print_help()
print "*** " + msg
@drnextgis
drnextgis / csv2shp.py
Created July 13, 2011 12:00
Convert MOD14 csv into ESRI Shapefile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import OptionParser
import os, sys, fnmatch
def echo_err(parser,msg):
parser.print_help()
print "*** " + msg
sys.exit(1)
@drnextgis
drnextgis / mod14meta.py
Created August 4, 2011 07:26
Check extent from mod14 XML metadata
import sys
from lxml import etree
from optparse import OptionParser
from shapely.geometry import Polygon
def echo_err(parser,msg):
parser.print_help()
print "*** " + msg
sys.exit(1)
@drnextgis
drnextgis / gist:1326800
Created October 31, 2011 02:52
Update geometry column for iFort
UPDATE g_lgeom SET geom = ST_GeomFromText(_.wkt) FROM (SELECT * FROM g_lgeom) AS _ WHERE _."LGID" = g_lgeom."LGID"