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 | |
pulkovo42v1 = osr.SpatialReference() | |
pulkovo42v1.ImportFromWkt("""GEOGCS["Pulkovo 1942 v2", | |
DATUM["Pulkovo_1942", | |
SPHEROID["Krassowsky 1940",6378245,298.3], | |
TOWGS84[23.57,-140.95,-79.8,0,-0.35,-0.79,-0.22]], | |
PRIMEM["Greenwich",0, | |
AUTHORITY["EPSG","8901"]], | |
UNIT["degree",0.0174532925199433, |
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 nomk import coord | |
from osgeo import ogr, osr | |
epsg7683 = osr.SpatialReference() | |
epsg7683.ImportFromEPSG(4284) | |
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() |
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) |
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
# -*- 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
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
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
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, 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
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 |
NewerOlder