# make sure the layer are in exactly the same projection
print('Reprojecting shapefile')
call (["ogr2ogr", "-t_srs", "EPSG:27700", "./data/GB_CCM21_elementary_OSGB36_proj.shp", "./data/GB_CCM21_elementary_OSGB36.shp"])
call (["gdalwarp", "-t_srs", "EPSG:27700", "./data/GB_covariables_stack.kea", "./data/GB_covariables_stack_proj.kea"])
# extract zonal stats for elementary catchments
imagestack = './data/GB_covariables_stack_proj.kea'
inputvector = './data/GB_CCM21_elementary_OSGB36_proj.shp'
outputtxt = './output/GB_CCM21_elementary_covars.txt'
zonalattributes = zonalstats.ZonalAttributes(minThreshold=0, maxThreshold=10000, calcCount=False, calcMin=True, calcMax=True, calcMean=True, calcStdDev=True, calcMode=False, calcSum=False)
rsgislib.zonalstats.pixelStats2TXT(imagestack, inputvector, outputtxt, zonalattributes, True, False, zonalstats.METHOD_POLYCONTAINSPIXELCENTER, True)
WARNING: Shapefile and image are not the same projection!
Image is: PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM["OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646,AUTHORITY["EPSG","7001"]],AUTHORITY["EPSG","6277"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]
Shapefile is: PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM["OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646,AUTHORITY["EPSG","7001"]],AUTHORITY["EPSG","6277"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4277"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]
...Continuing anyway
Started, 25762 features to process.
0% Done
Segmentation fault (core dumped)
To post to this group, send email to rsgisli...@googlegroups.com.
Visit this group at https://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.
To post to this group, send email to rsgislib...@googlegroups.com.
...Continuing anyway
Started, 25762 features to process.
0% Done
Segmentation fault (core dumped)