<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 02/13/2014 04:31 PM, Moritz Lennert
wrote:<br>
</div>
<blockquote cite="mid:52FCE537.4070603@club.worldonline.be"
type="cite">On 13/02/14 13:32, manuel.martin wrote:
<br>
<blockquote type="cite">I think geoTiffs do not handle categorical
variables (can anyone
<br>
confirm?), neither the writeRAST6() function from spgrass6
(tested
<br>
yesterday), and that's why I looked for a full GRASS option
(avoiding
<br>
using R to go from ArcGIS to GRASS). So it is true that I can
import
<br>
categorical ArcGIS binary rasters into R, but then I'm stuck
into R and
<br>
cannot move to GRASS...
<br>
</blockquote>
<br>
AFAIU, your "categorical" variables are just integers, or ? So no
problem to create a GeoTiff with them.
<br>
<br>
This said, what exactly is the format the data is in ? Is it
really a binary with several values per pixel, or do you have one
value per pixel and then a lookup table linking these values to
clc categories ? ESRI's binary ArcInfo Grid format has a specific
file (vat.adf for Value Attribute Table) which contains this
lookup table, with a value and count field.
<br>
</blockquote>
Hi Moritz and thank you for the valuable informations. <br>
<br>
So I looked closer at the data and it is ESRI's binary ArcInfo Grid
format with vat.adf files in the layer directory. These tables may
be accessed outside of ArcGIS using for instance gdalinfo, and the R
raster library seem to do it as well. However these tables seem to
contain some binary codes so they cannot easily be read from
automatic processing.<br>
<br>
Unfortunately, CLC is not the only categorical layer I need to
process, and manually linking the imported rasters values (within
GRASS) to manually extracted codes (which again may be also strings)
is not really an option. (or maybe is there a way to automate the
process?)<br>
<br>
So I am now thinking to convert these ArcGIS layers to another
format using the gdal library (function gdal_translate for instance)
for latter importing these converted layers to grass. I am thus
facing two new questions. <br>
1) which format is the best suited for carrying such categorical
data on larger rasters among supported gdal formats and <br>
2) will this format be supported by grass?<br>
<br>
It seems to me that this story with multiple fields and categorical
data might be related to the problem described here :
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="http://r-forge.r-project.org/forum/forum.php?thread_id=1689&forum_id=962">http://r-forge.r-project.org/forum/forum.php?thread_id=1689&forum_id=962</a>
<br>
<br>
Cheers, Manuel<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<blockquote cite="mid:52FCE537.4070603@club.worldonline.be"
type="cite">
<br>
In GRASS, the equivalent would be labels linked to category
values. But actually since the CLC categories are also integers,
you could use those as category values and put the text
descriptions into the labels.
<br>
<br>
The CLC data contains a legend which links values to categories:
<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.eea.europa.eu/data-and-maps/data/corine-land-cover-2006-raster#tab-additional-information">http://www.eea.europa.eu/data-and-maps/data/corine-land-cover-2006-raster#tab-additional-information</a>
<br>
<br>
see clc_legend.csv
<br>
<br>
Using that file and a bit of text handling magic you can easily
create an input file for r.reclass to create a map with clc
categories as values and the textual descriptions as labels.
<br>
<br>
Moritz
<br>
<br>
<br>
<br>
<blockquote type="cite">
<br>
Manuel
<br>
<br>
On 02/13/2014 11:58 AM, Nuno Sá wrote:
<br>
<blockquote type="cite">Out of the box:
<br>
<br>
Import it in R and save it as a Tiff - use GRASS to open this
tiff.
<br>
Maybe it works ;P
<br>
<br>
<br>
On 13 February 2014 10:50, Benjamin Ducke
<<a class="moz-txt-link-abbreviated" href="mailto:benducke@fastmail.fm">benducke@fastmail.fm</a>
<br>
<a class="moz-txt-link-rfc2396E" href="mailto:benducke@fastmail.fm"><mailto:benducke@fastmail.fm></a>> wrote:
<br>
<br>
Ouch. I am beginning to suspect that the ESRI "field"
<br>
concept for raster layers does not translate well
<br>
to GRASS/GDAL. Sorry for not being able to help.
<br>
Maybe someone else on this list has experience with
<br>
this type of data structure?
<br>
<br>
At least now we know that r.in.gdal starts counting
<br>
bands with "1"!
<br>
<br>
Ben
<br>
<br>
On 13/02/14 11:14, manuel.martin wrote:
<br>
> I had already tried this (with "2") ;-). No luck
either. Reading
<br>
your
<br>
> email I tried with "0" (maybe would gdal detect only
two bands over
<br>
> three). It comes out that only "band=1" works....
<br>
>
<br>
>
<br>
> GRASS 7.0.svn (lambert93):~ > r.in.gdal --o
<br>
>
<br>
input=/home/manuel/Desktop/sftp/Projets/Projets/Zones-humides/base_sig/dsm_data/clc/clc06_250m<br>
> band=0 output=testclc
<br>
> WARNING: Raster map <testclc> already exists
and will be overwritten
<br>
> WARNING: Datum
<Not_specified_based_on_GRS_1980_ellipsoid> not
<br>
recognised
<br>
> by GRASS and no parameters found
<br>
> Projection of input dataset and current location
appear to match
<br>
> ERROR 5:
<br>
>
<br>
/home/manuel/Desktop/sftp/Projets/Projets/Zones-humides/base_sig/dsm_data/clc/clc06_250m:<br>
> GDALDataset::GetRasterBand(0) - Illegal band #
<br>
>
<br>
> ERROR: Selected band (0) does not exist
<br>
>
<br>
>
<br>
>
<br>
>
<br>
> On 02/13/2014 10:59 AM, Benjamin Ducke wrote:
<br>
>> Hmm, the manual page does not say so explicitely,
<br>
>> but maybe band numbering starts with "0"?
<br>
>> In that case your band 3 would have index number
"2".
<br>
>>
<br>
>> Ben
<br>
>>
<br>
>> On 13/02/14 10:48, manuel.martin wrote:
<br>
>>> Hi Ben,
<br>
>>> Thanks for the reply. I tried with the band
option but it
<br>
looks like
<br>
>>> gdal does not detect the multiple fields as
multiple bands :
<br>
>>>
<br>
>>> GRASS 7.0.svn (lambert93):~ > r.in.gdal
--o \
<br>
>>>
<br>
input=/home/manuel/Desktop/sftp/Projets/Projets/Zones-humides/base_sig/dsm_data/clc/clc06_250m<br>
>>>
<br>
>>> \
<br>
>>>> band=3 output=testclc
<br>
>>> WARNING: Raster map <testclc> already
exists and will be
<br>
overwritten
<br>
>>> WARNING: Datum
<Not_specified_based_on_GRS_1980_ellipsoid> not
<br>
>>> recognised
<br>
>>> by GRASS and no parameters found
<br>
>>> Projection of input dataset and current
location appear to match
<br>
>>> ERROR 5:
<br>
>>>
<br>
/home/manuel/Desktop/sftp/Projets/Projets/Zones-humides/base_sig/dsm_data/clc/clc06_250m:<br>
>>>
<br>
>>> GDALDataset::GetRasterBand(3) - Illegal band
#
<br>
>>>
<br>
>>> ERROR: Selected band (3) does not exist
<br>
>>>
<br>
>>>
<br>
>>> Cheers, Manuel
<br>
>>>
<br>
>>> On 02/12/2014 08:25 PM, Benjamin Ducke wrote:
<br>
>>>> Hi Manuel,
<br>
>>>>
<br>
>>>> GRASS does not support multi-band
rasters, so you'll have
<br>
>>>> to import each band as a separate raster
map.
<br>
>>>>
<br>
>>>> r.in.gdal has the "band=" option to
specify a band number
<br>
>>>> to import.
<br>
>>>>
<br>
>>>> Best,
<br>
>>>>
<br>
>>>> Ben
<br>
>>>>
<br>
>>>> On 12/02/14 17:05, manuel.martin wrote:
<br>
>>>>> Hi all,
<br>
>>>>>
<br>
>>>>> I tried to import an ArcGIS binary
raster (corine land cover
<br>
for the
<br>
>>>>> French territory) with three fields
on each pixels (VALUE,
<br>
COUNT and
<br>
>>>>> CODE_06) using the *r.in.gdal*
command. The import works
<br>
just fine,
<br>
>>>>> except that in the resulting raster,
in GRASS, I only get
<br>
one field,
<br>
>>>>> which seems to be the VALUE field
(and not the CODE_06
<br>
field, which
<br>
>>>>> I am
<br>
>>>>> interested in, and which is a
categorical field, although
<br>
coded with
<br>
>>>>> integers).
<br>
>>>>>
<br>
>>>>> Is there a way to produce a resulting
raster with all the
<br>
fields of
<br>
>>>>> the
<br>
>>>>> initial ArcGIS layer, or
alternatively to choose one unique
<br>
field?
<br>
>>>>> Also,
<br>
>>>>> is there a limitation on categorical
fields. For instance,
<br>
what if
<br>
>>>>> instead of integer corine land cover
codes I have literal
<br>
labels, i.e.
<br>
>>>>> levels of my categorical field coded
with strings?
<br>
>>>>>
<br>
>>>>> Cheers, Manuel
<br>
>>>>>
<br>
>>>>> --
<br>
>>>>>
<br>
>>>>> ----------------0----0------
<br>
>>>>> INRA - InfoSol
<br>
>>>>> Centre de recherche d'Orléans
<br>
>>>>> 2163 Avenue de la Pomme de Pin
<br>
>>>>> CS 40001 ARDON
<br>
>>>>> 45075 ORLEANS Cedex 2
<br>
>>>>> tel : (33) (0)2 38 41 48 21
<br>
>>>>> fax : (33) (0)2 38 41 78 69
<br>
>>>>> <a class="moz-txt-link-freetext" href="http://www.gissol.fr">http://www.gissol.fr</a>
<br>
>>>>> ----0----0------------------
<br>
>>>>>
<br>
>>>>>
<br>
>>>>>
<br>
>>>>>
_______________________________________________
<br>
>>>>> grass-user mailing list
<br>
>>>>> <a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-rfc2396E" href="mailto:grass-user@lists.osgeo.org"><mailto:grass-user@lists.osgeo.org></a>
<br>
>>>>>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
<br>
>>>>>
<br>
>>>>
<br>
>>>
<br>
>>
<br>
>>
<br>
>
<br>
>
<br>
<br>
<br>
<br>
--
<br>
Dr. Benjamin Ducke, M.A.
<br>
{*} Geospatial Consultant
<br>
{*} GIS Developer
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:benducke@fastmail.fm">benducke@fastmail.fm</a> <a class="moz-txt-link-rfc2396E" href="mailto:benducke@fastmail.fm"><mailto:benducke@fastmail.fm></a>
<br>
_______________________________________________
<br>
grass-user mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-rfc2396E" href="mailto:grass-user@lists.osgeo.org"><mailto:grass-user@lists.osgeo.org></a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
<br>
<br>
<br>
<br>
<br>
--
<br>
<br>
Nuno César de Sá
<br>
+351 91 961 90 37
<br>
<br>
<br>
<br>
_______________________________________________
<br>
grass-user mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
<br>
</blockquote>
<br>
<br>
--
<br>
<br>
----------------0----0------
<br>
INRA - InfoSol
<br>
Centre de recherche d'Orléans
<br>
2163 Avenue de la Pomme de Pin
<br>
CS 40001 ARDON
<br>
45075 ORLEANS Cedex 2
<br>
tel : (33) (0)2 38 41 48 21
<br>
fax : (33) (0)2 38 41 78 69
<br>
<a class="moz-txt-link-freetext" href="http://www.gissol.fr">http://www.gissol.fr</a>
<br>
----0----0------------------
<br>
<br>
<br>
<br>
_______________________________________________
<br>
grass-user mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
<br>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
----------------0----0------
INRA - InfoSol
Centre de recherche d'Orléans
2163 Avenue de la Pomme de Pin
CS 40001 ARDON
45075 ORLEANS Cedex 2
tel : (33) (0)2 38 41 48 21
fax : (33) (0)2 38 41 78 69
<a class="moz-txt-link-freetext" href="http://www.gissol.fr">http://www.gissol.fr</a>
----0----0------------------
</pre>
</body>
</html>