Skip to content

Instantly share code, notes, and snippets.

@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: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()
# -*- 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')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@drnextgis
drnextgis / gfi.md
Last active November 17, 2015 11:42
NGW GetFeatureInfo

GetFeatureInfo

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

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

  • SERVICE
@drnextgis
drnextgis / glg.md
Last active November 17, 2015 11:37
GetLegendGraphic

GetLegendGraphic

Для слоёв WMS-сервиса, созданных на базе ресурса "Стиль MapServer" доступны запросы получения легенды GetLegendGraphic.

Пример запроса:

http://demo.nextgis.ru/ngw/api/resource/83/wms?SERVICE=WMS&REQUEST=GetLegendGraphic&LAYER=boundary-polygon
@drnextgis
drnextgis / admin.md
Last active December 10, 2022 03:22
Extract administrative boundaries from citypopulation.de as GeoJSON

Open page, for example, and type the following commands into web browser's console and copy output to file:

script = document.createElement('script');
document.head.appendChild(script);

script.onload = function () {
    polygons = [];
    adminLayer.forEach(function (polygon) {
        linearRing = [];
@drnextgis
drnextgis / telluric-reproject.ipynb
Created July 9, 2018 04:20
Reproject raster with telluric
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@drnextgis
drnextgis / dissolve.ipynb
Created July 10, 2018 04:50
telluric-dissolve
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.