[gdal-dev] Problems with pct2rgb and gdal_translate

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Problems with pct2rgb and gdal_translate

Aklim
Hello.

I try to mosaic images using gdalwrap from following instructions here
https://download.osgeo.org/gdal/workshop/foss4ge2015/workshop_gdal.html#__RefHeading__5961_1333016408
<https://download.osgeo.org/gdal/workshop/foss4ge2015/workshop_gdal.html#__RefHeading__5961_1333016408>  

1. problem with pct2rgb
Traceback (most recent call last):
  File "C:\OSGEO4~1\bin\pct2rgb.py", line 121, in <module>
    ct_size = ct.GetCount()
AttributeError: 'NoneType' object has no attribute 'GetCount'

2. problem with gdal_translate (expand rgb)
Input file size is 6085, 7106
ERROR 1: Error : band 1 has no color table

when I check shapes of images I receive following results:

Dimension image 1:
(4, 7106, 6085)

Dimension image 2:
(4, 6928, 7180)







--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Problems with pct2rgb and gdal_translate

Even Rouault-2
On mardi 29 mai 2018 00:09:42 CEST Aklim wrote:

> Hello.
>
> I try to mosaic images using gdalwrap from following instructions here
> https://download.osgeo.org/gdal/workshop/foss4ge2015/workshop_gdal.html#__Re
> fHeading__5961_1333016408
> <https://download.osgeo.org/gdal/workshop/foss4ge2015/workshop_gdal.html#__
> RefHeading__5961_1333016408>
>
> 1. problem with pct2rgb
> Traceback (most recent call last):
>   File "C:\OSGEO4~1\bin\pct2rgb.py", line 121, in <module>
>     ct_size = ct.GetCount()
> AttributeError: 'NoneType' object has no attribute 'GetCount'

That means your input raster has no color table.  You don't need to do that
preliminary step.
The tutorial works out-of-the-box only with the input data it was written.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev