Skip to content

Instantly share code, notes, and snippets.

@drnextgis
drnextgis / gfi.md
Last active November 17, 2015 11:42
NGW GetFeatureInfo

GetFeatureInfo

NextGIS Web для ресурсов типа "Сервис WMS" поддерживает запрос GetFeatureInfo. В настоящее время единственный поддерживаемый формат ответа - HTML.

Обязательные параметры запроса ссылка:

  • SERVICE
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# -*- coding: utf-8 -*-
import os
import sys
import win32com.client as win32
from regions import regions
def build_registry(root_dir, build_header=True):
registry_path = os.path.join(root_dir, 'registry.xls')
@drnextgis
drnextgis / gist:4382927
Created December 26, 2012 20:34
mapnik.MemoryDatasource
import mapnik
# Массив векторных данных
geometries = [
(0, "POLYGON ((0 0, 5 0, 5 5, 0 5, 0 0))"),
(1, "POLYGON((1 5, 4 5, 4 6, 1 6, 1 5))")
]
# Создаём хранилище
ds = mapnik.MemoryDatasource()
@drnextgis
drnextgis / github
Created February 19, 2012 10:27
Команды для работы с github-репозиториями
Создание локального репозитория
$git clone [email protected]:drnextgis/openlayers.git
$cd openlayers
$git remote add upstream git://github.com/openlayers/openlayers.git
Обновление локального репозитория
$git pull upstream master
Создаем ветку
git checkout -b feature #Создаёт новую ветвь, названную "feature" и делает её активной
@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"
@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 / 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 / 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 / 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 ([email protected])
# Date created: 22:56 22.05.2011
# Last updated: 13:15 04.06.2011
# ---------------------------------------------------------------------------