<div dir="ltr"><div class="gmail_default" style="color:rgb(39,78,19)"><br></div><div class="gmail_default" style="color:rgb(39,78,19)"><br></div><div class="gmail_extra"><div class="gmail_quote">2013/11/27 Nikos Alexandris <span dir="ltr"><<a href="mailto:nik@nikosalexandris.net" target="_blank">nik@nikosalexandris.net</a>></span><br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>Cesar Augusto Ramírez Franco wrote:<br>
<br>
</div><div>> > > I've been trying to do a supervised classification from landsat8 imagery<br>
> > > using i.class and then i.maxlik, but I'm getting an error when running<br>
> > > i.maxlik saying it can't read the signature file.<br>
<br>
<br>
</div>Nikos Alexandris:<br>
<div><br>
> > Just to double-check: verify that your "classes" don't overlay any NULL<br>
> > cells. It might be completely irrelevant, I have, though, blurry memories<br>
> > of this being a blocker actually (with i.smap at least).<br>
<br>
> ​There are no NULL cells on my classes, neither on my Landsat 8 images or<br>
> the Landsat 7 in the North Carolina dataset<br>
<br>
</div>ok<br>
<div><br>
<br>
> > > I tested my procedure on the NC sample dataset and I'm getting the same<br>
> > > error, I'm using Grass 6.4.2 on Debian Wheezy, installed from the debian<br>
> > > repo. Here's the command set:<br>
<br>
> > > #Display RGB enhanced map<br>
> > > i.landsat.rgb blue=lsat7_2000_10 green=lsat7_2000_20 red=lsat7_2000_30<br>
> > > d.rgb blue=lsat7_2000_10 green=lsat7_2000_20 red=lsat7_2000_30<br>
> > ><br>
> > > #"Real color" map<br>
> > > r.composite red=lsat7_2000_30 green=lsat7_2000_20 blue=lsat7_2000_10<br>
> > > output=lsat7_2000_RGB<br>
> > ><br>
> > > #Group images to process<br>
> > > i.group group=lsat7_2000_RGB subgroup=lsat7_2000_RGB<br>
> > > input=lsat7_2000_10,lsat7_2000_20,lsat7_2000_30<br>
> > ><br>
> > > #Unsupervised classification<br>
> > > i.cluster group=lsat7_2000_RGB subgroup=lsat7_2000_RGB<br>
> > > sigfile=clustlsat7<br>
> > > classes=20 report=rep_clust_lsat7.txt<br>
> ><br>
> > (I have never tried to feed a group that uses a single composite. I'll try<br>
> > it out.)<br>
><br>
> The composite is for the supervised clasification, the group and subgroup<br>
> are made with the 3 RGB bands (1,2,3 in Landsat7 or 2,3,4 in Landsat8)​<br>
<br>
</div>Right, I didn't pay much attention. Apologies.<br>
<br>
<br>
<br>
> > i.maxlik group=lsat7_2000_RGB subgroup=lsat7_2000_RGB sigfile=clustlsat7<br>
> > class=lsat7_classes reject=lsat7_classes_rej<br>
<br>
> > Does the unsupervised classification work?  i.cluster requires at least<br>
> > two input raster maps. And, honestly, I have never tried it the way you<br>
> > did, i.e. by using a composite map.  Also, r.composite will use by default<br>
> > "32 levels" whicih means that you loose important info for the subsequent<br>
> > classification, if I am not wrong.<br>
<br>
Same error (of mine) as above, you correctly used a group with three bands.<br>
<br>
<br>
<br>
> ​The supervised classification does work, i.cluster generates a signature<br>
> file and i.maxlik success to create the classes raster map<br>
<br>
You mean the _un_supervised I guess.<br></blockquote><div><br></div><div class="gmail_default" style="color:rgb(39,78,19)">Yes, I meant the unsupervised, with i.cluster​​</div><div class="gmail_default" style="color:rgb(39,78,19)">


<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
> > #Supervised classification<br>
> ><br>
> > > i.class map=lsat7_2000_RGB group=lsat7_2000_RGB subgroup=lsat7_2000_RGB<br>
> > > outsig=classlsat7<br>
> > > i.maxlik group=lsat7_2000_RGB subgroup=lsat7_2000_RGB sigfile=classlsat7<br>
> > > class=lsat7_class_sup<br>
> > ><br>
> > > Here I get the error in which i.maxlik can't read the signature file<br>
> > > created by i.class (classlsat7) but read the one created by i.cluster<br>
> > > flawlessly<br>
> > ><br>
> > > This is what I'm selecting on the i.class monitor, I named it<br>
> > > vegetation:<br>
> > > [image: Imagen integrada 1]<br>
> ><br>
> > Only on class?  Can you try with more please?<br>
><br>
> Yes, the error I'm getting is only with the i.class module<br>
<br>
Sorry for my typo -- I meant to write "only with 1 class?", "can you try with<br>
more than 1 class, i.e. 3 or 4 classes?".<br></blockquote><div><br></div><div class="gmail_default" style="color:rgb(39,78,19)">I was using two classes, vegetation and construction, I tried two more classes and got the same error</div>

<div class="gmail_default" style="color:rgb(39,78,19)">​​</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
> I'm doing some tests creating a test vector​​ with my classes as areas,<br>
<br>
how many classes? </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
> then converting it to raster with v.to.rast,<br>
<br>
can you post the exact command?  What values are you attributing to the<br>
rasterised classes?<br></blockquote><div><br></div><div class="gmail_default" style="color:rgb(39,78,19)">I used the grass gui to draw some polygons on a test vector with ​​cat(integer),class(integer),desc(varchar) and assigned 1 for vegetation or 2 for constructions</div>


<div class="gmail_default" style="color:rgb(39,78,19)"><br></div><div class="gmail_default" style="color:rgb(39,78,19)">Then issued</div><div class="gmail_default" style="color:rgb(39,78,19)">v.to.rast in=test out=test use=attr col=class labelcol=desc<br>


</div><div class="gmail_default" style="color:rgb(39,78,19)"><br></div><div class="gmail_default" style="color:rgb(39,78,19)">And got a raster with those areas, then created the signature with</div><div class="gmail_default" style="color:rgb(39,78,19)">


i.gensigset group=lsat7_2000_RGB subgroup=lsat7_2000_RGB sig=lsat7_testsig training=test</div><div class="gmail_default" style="color:rgb(39,78,19)">i.smap group=lsat7_2000_RGB subgroup=lsat7_2000_RGB sig=lsat7_testsig out=veg_const</div>


<div class="gmail_default" style="color:rgb(39,78,19)"><br></div><div class="gmail_default" style="color:rgb(39,78,19)"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



> and then using that raster to generate statistics for i.smap with<br>
> i.gensigset<br>
<br>
> I don't know if I'm not using the i.class module the right way or if it's<br>
> broken<br>
<br>
I don't think it is broken as it usually works/ed fine.  But we'll try to nail<br>
that down.<br>
<span><font color="#888888"><br>
Nikos<br>
</font></span></blockquote></div><br><div class="gmail_default" style="color:rgb(39,78,19)">​I just tested with Grass7.0svn and the GUI tool for supervised clasification (g.gui.iclass) generates a signature (with just one class) that is read just fine by i.maxlik​</div>

<div><br></div>-- <br><div dir="ltr"><div style="text-align:right"><b style="color:rgb(39,78,19)">César Augusto Ramírez Franco</b></div><font color="#274e13"><div style="text-align:right">
Laboratorio de Sistemas Complejos Naturales</div><span style="font-family:Arial;vertical-align:baseline;white-space:pre-wrap"><div style="text-align:right">Escuela de Geociencias</div></span></font><div><div style="text-align:right">


<span style="white-space:pre-wrap;font-family:Arial;color:rgb(39,78,19)">Facultad de Ciencias</span></div><font color="#274e13"><div style="text-align:right">Universidad Nacional de Colombia - Sede Medellín</div></font></div>


<font color="#274e13"><div style="text-align:right">Teléfono: (57-4) 430 9369 -<font face="arial, helvetica, sans-serif"> 301 389 5607</font></div></font></div>
</div></div>