This file contains hidden or 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
{ | |
"features": [ | |
{ | |
"attrs": { | |
"address": "г. Москва, ул. Озерная, вл. 49, стр. 1", | |
"cn": "77:07:0014004:7068", | |
"id": "77:7:14004:7068" | |
}, | |
"center": { | |
"x": 4168166.7754504266, |
This file contains hidden or 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
Uncaught UnicodeEncodeError at http://0.0.0.0:8080/api/component/render/image?resource=5&extent=9400684.360680686,6659270.34123284,9626326.468178527,6800984.591673557&size=1476,927 | |
app_1 | Traceback (most recent call last): | |
app_1 | File "/opt/ngw/package/nextgisweb/nextgisweb/pyramid/exception.py", line 76, in unhandled_exception_tween | |
app_1 | return handler(request) | |
app_1 | File "/opt/ngw/package/nextgisweb/nextgisweb/pyramid/exception.py", line 66, in handled_exception_tween | |
app_1 | reraise(*exc_info) | |
app_1 | File "/opt/ngw/package/nextgisweb/nextgisweb/pyramid/exception.py", line 42, in handled_exception_tween | |
app_1 | response = handler(request) | |
app_1 | File "/usr/local/lib/python2.7/dist-packages/pyramid_tm/__init__.py", line 171, in tm_tween | |
app_1 | reraise(*exc_info) |
This file contains hidden or 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
import sys | |
import os | |
for path_item in sys.path: | |
try: | |
items = os.listdir(path_item) | |
for item in items: | |
if item == 'numpy': | |
print('numpy directory present in path: {}'.format(path_item)) | |
# cut some lines from __init__.py |
This file contains hidden or 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
from osgeo import gdal, osr | |
y = 7509137.5811 | |
x = 4187591.89173 | |
gsk2011 = '+proj=longlat +a=6378136.5 +rf=298.2564151 +towgs84=0.013,-0.092,-0.03,0.001738,0.003559,-0.004263,0.0074 +no_defs' | |
src = osr.SpatialReference() | |
dst = osr.SpatialReference() | |
src.ImportFromEPSG(3857) |
This file contains hidden or 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
from osgeo import osr | |
proj4 = '' | |
dst = osr.SpatialReference() | |
dst.ImportFromProj4(proj4) | |
dst.ExportToWkt() |
This file contains hidden or 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
from osgeo import gdal | |
from osgeo import ogr | |
from osgeo import osr | |
base_url = 'https://sandbox.nextgis.com' | |
service = 6038 | |
version = '1.0.0' | |
gdal.SetConfigOption("CPL_DEBUG", "ON") | |
gdal.SetConfigOption("CPL_CURL_VERBOSE", "YES") |
This file contains hidden or 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
bishop@Bishop-MacBookPro tmp % /usr/bin/env python /Users/Bishop/.vscode/extensions/ms-python.python-2020.9.114305/pythonFiles/lib/python/debugpy/launcher 58870 -- /Volumes/Data/tmp/test_wfs.py | |
WFS: https://sandbox.nextgis.com/api/resource/6038/wfs?VERSION=1.0.0&SERVICE=WFS&REQUEST=GetCapabilities | |
HTTP: Fetch(https://sandbox.nextgis.com/api/resource/6038/wfs?VERSION=1.0.0&SERVICE=WFS&REQUEST=GetCapabilities) | |
HTTP: libcurl/7.71.1 OpenSSL/1.1.1c zlib/1.2.11 | |
* Couldn't find host sandbox.nextgis.com in the .netrc file; using defaults | |
* Trying 5.9.138.126:443... | |
* Connected to sandbox.nextgis.com (5.9.138.126) port 443 (#0) | |
* ALPN, offering http/1.1 | |
* successfully set certificate verify locations: | |
* CAfile: /Users/Bishop/Applications/NextGIS/Library/Frameworks/openssl.framework/Resources/ssl/certs/cert.pem |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import math | |
dpi = 1000 / 39.37 / 0.28 | |
ipm = 39.37 | |
metersPerTile = 156543.04 | |
def getZoomFromScale(scale): | |
return math.log(scale) / math.log(2) |
This file contains hidden or 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
from osgeo import gdal | |
import os | |
ds = gdal.Warp('', 'small.tif', format='MEM', warpOptions=["INIT_DEST=NO_DATA", "UNIFIED_SRC_NODATA=YES"], srcNodata=0, dstAlpha=True) | |
try: | |
os.remove('nd5.tiff') | |
except OSError: | |
pass |
This file contains hidden or 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
from osgeo import ogr, osr | |
pt = ogr.CreateGeometryFromWkt('POINT(37.0 55.0)') | |
epsg7683 = osr.SpatialReference() | |
epsg7683.ImportFromEPSG(7683) | |
epsg7683.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER) | |
# epsg7683.SetTOWGS84(23.57,-140.95,-79.8,0,0.35,0.79,-0.22) | |
epsg4326 = osr.SpatialReference() | |
epsg4326.ImportFromEPSG(4326) |