[GRASS-user] r.in.gdal for importing categorical ArcGIS binary rasters

Markus Metz markus.metz.giswork at gmail.com
Tue Feb 18 03:47:19 PST 2014


On Tue, Feb 18, 2014 at 11:43 AM, manuel.martin
<manuel.martin at orleans.inra.fr> wrote:
> Hi, I just compiled grass r59073 and gave a try.
> I could not get the attributes imported along with the raster, but maybe am
> I missing something from the new revision of r.in.gdal (although from the
> code it looks that the import of values from the attribute table should be
> automatic?).

Yes, r.in.gdal automatically imports whatever it finds as color tables
or attribute labels.

> Markus, I just sent you the ESRI layer I am trying to import, in case you
> would like to try as well.

GDAL does not see an attribute table in the data you sent to me, thus
GRASS can not import any attributes. If there is really an attribute
table, it is not recognized by GDAL.

Markus M

>
> Thank you in advance
>
> Manuel
>
>
>
> On 02/17/2014 02:48 PM, Markus Metz wrote:
>>
>> On Fri, Feb 14, 2014 at 5:41 PM, manuel.martin
>> <manuel.martin at orleans.inra.fr> wrote:
>>>
>>> On 02/14/2014 05:08 PM, Markus Metz wrote:
>>>>
>>>> On Wed, Feb 12, 2014 at 5:05 PM, manuel.martin
>>>> <manuel.martin at orleans.inra.fr> wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I tried to import an ArcGIS binary raster (corine land cover for the
>>>>> French
>>>>> territory) with three fields on each pixels (VALUE, COUNT and CODE_06)
>>>>> using
>>>>> the r.in.gdal command. The import works just fine, except that in the
>>>>> resulting raster, in GRASS, I only get one field, which seems to be the
>>>>> VALUE field (and not the CODE_06 field, which I am interested in, and
>>>>> which
>>>>> is a categorical field, although coded with integers).
>>>>
>>>> r.in.gdal will soon support import of category labels such as those
>>>> stored in the CODE_06 field. You can then inspect the labels with
>>>> r.category. GDAL supports reading and writing of raster attribute
>>>> tables, so far only the color rules stored in a raster attribute table
>>>> are imported, but I plan to add import of labels to r.in.gdal. Note
>>>> that this applies only to GRASS 7.
>>>>
>>>> Markus M
>>>
>>>
>>> Good to hear that ;-). I will wait for the next release of r.in.gdal
>>
>> Done in r59073.
>>
>> Markus M
>>
>>
>>> (meanwhile I did import clc vector layers with v.in.ogr and later managed
>>> the category labels with v.to.rast).
>>>
>>> All the best,           Manuel
>>>
>>>>> Is there a way to produce a resulting raster with all the fields of the
>>>>> initial ArcGIS layer, or alternatively to choose one unique field?
>>>>> Also,
>>>>> is
>>>>> there a limitation on categorical fields. For instance, what if instead
>>>>> of
>>>>> integer corine land cover codes I have literal labels, i.e. levels of
>>>>> my
>>>>> categorical field coded with strings?
>>>>>
>>>>> Cheers, Manuel
>>>>>
>>>>> --
>>>>>
>>>>> ----------------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
>>>>> http://www.gissol.fr
>>>>> ----0----0------------------
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> grass-user mailing list
>>>>> grass-user at lists.osgeo.org
>>>>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>>
>>>
>>>
>>> --
>>>
>>> ----------------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
>>> http://www.gissol.fr
>>> ----0----0------------------
>>>
>
>
> --
>
> ----------------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
> http://www.gissol.fr
> ----0----0------------------
>


More information about the grass-user mailing list