import rsgislib
from rsgislib import imageutils
from rsgislib import vectorutils
from rsgislib.classification import classimgutils
from sklearn.ensemble import ExtraTreesClassifier
import os
#Change Path to Input
pathInput = "/home/rsgis/Datasets/Landsat/L8/"
os.chdir(pathInput)
#Load Raster
landsatImg = "L8_stack_mask.kea"
#Input Training SHP
waterVEC = "Training/Water.shp"
#Temp Training Raster
waterImg = "waterImg.kea"
#Temp Training Raster with Samples
waterImgSmp = "waterImgSmp.kea"
#Training Pixel Values
waterPxlTrainVal = "waterPxlTrainVal.h5"
# Rasterise the training samples (shapefiles)
vectorutils.rasterise2Image(waterVEC,landsatImg,waterImg,'KEA',shpAtt='TYPE')On 6 Feb 2017, at 08:38, Benjamin Mewes <bennam...@gmail.com> wrote:
It is really frustrating, as I can't see an error neither in my data nor in my script. I tried to force to add a FID column, but it didn't help either.
--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To post to this group, send email to rsgislib...@googlegroups.com.
Visit this group at https://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.
On 6 Feb 2017, at 15:00, Benjamin Mewes <bennam...@gmail.com> wrote:
I loaded the kea file into QGIS assigned the projection and the coordinates were set by QGIS. I think these are just pixels from some origin within the file. Very strange...
On Mon, Feb 6, 2017 at 3:47 PM, Pete Bunting [pfb] <p...@aber.ac.uk> wrote:
Hi Benjamin,
But when I looked at the coordinates of your polygons the values were (1000, -2000) which aren’t in degrees or UTM. Have you changed the coordinates which make up the polygons?
Best wishes,
Pete
****************************************************
* Dr Pete Bunting
* Reader in Remote Sensing
* Earth Observation and Ecosystem Dynamics Group
* Department of Geography and Earth Sciences
* Aberystwyth University
* Aberystwyth
* Ceredigion
* SY23 3DB
* UK
*
* Ph: +44 (0) 1970 622615
* Mob: +44 (0) 7917 842743
* Email: p...@aber.ac.uk
* ORCID: http://orcid.org/0000-0002-7435-0148
****************************************************"Please consider the environment before printing this email or any documents attached”
On 6 Feb 2017, at 13:27, Benjamin Mewes <bennam...@gmail.com> wrote:
Still the results are nan and 0 in the rasterised version.Hi Pete,thanks for looking at it. Yes, oddly gdalsrsinfo shows degree as unit. I changed the projection to UTM Zone 12 (as stated in the meta information by Landsat 8) but the error remains the same although gdalsrsinfo now returns correct information:
OGC WKT :
PROJCS["WGS_1984_UTM_Zone_12N",
GEOGCS["GCS_WGS_1984",
DATUM["WGS_1984",
SPHEROID["WGS_84",6378137,298.257223563]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-111],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-support+unsubscribe@googlegroups.com.
To post to this group, send email to rsgislib-support@googlegroups.com.
Visit this group at https://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.
--------------------------------------------------------------------
Un o’r 4 prifysgol uchaf yn y DU a’r orau yng Nghymru am fodlonrwydd myfyrwyr.
(Arolwg Cenedlaethol y Myfyrwyr 2016)
www.aber.ac.uk
Top 4 UK university and best in Wales for student satisfaction
(National Student Survey 2016)
www.aber.ac.uk
--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-support+unsubscribe@googlegroups.com.
To post to this group, send email to rsgislib-support@googlegroups.com.
Visit this group at https://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.
--------------------------------------------------------------------
Un o’r 4 prifysgol uchaf yn y DU a’r orau yng Nghymru am fodlonrwydd myfyrwyr.
(Arolwg Cenedlaethol y Myfyrwyr 2016)
www.aber.ac.uk
Top 4 UK university and best in Wales for student satisfaction
(National Student Survey 2016)
www.aber.ac.uk
--------------------------------------------------------------------
Un o’r 4 prifysgol uchaf yn y DU a’r orau yng Nghymru am fodlonrwydd myfyrwyr.
(Arolwg Cenedlaethol y Myfyrwyr 2016)
www.aber.ac.uk
Top 4 UK university and best in Wales for student satisfaction
(National Student Survey 2016)
www.aber.ac.uk