Created
November 30, 2015 21:52
-
-
Save v0lat1le/b839f24b21356e21dd82 to your computer and use it in GitHub Desktop.
GDAL ctypes shenanigans
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 rasterio | |
import ctypes | |
_gdal = ctypes.cdll.LoadLibrary('libgdal.so.1') | |
OSRNewSpatialReference = _gdal.OSRNewSpatialReference | |
OSRIsGeographic = _gdal.OSRIsGeographic | |
OSRIsGeographic.restype = ctypes.c_bool | |
OSRGetSemiMajor = _gdal.OSRGetSemiMajor | |
OSRGetSemiMajor.restype = ctypes.c_double | |
print OSRIsGeographic(crs) | |
print OSRGetSemiMajor(crs, None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment