[Qgis-user] Convrting vector to raster: rasterize (vecor to raster ) in QGIS

Santiago Banchero santiagobanchero at gmail.com
Mon Mar 25 06:36:12 PDT 2013


Hi,


Have you reloaded the minimum and maximum values in the Style options?

I'm running a test with a point shapefile with values between 0 and 609
with this sentenses (in QGIS):


gdal_rasterize -init 0 -ot Int16 -of GTiff -co COMPRESS=DEFLATE -co
ZLEVEL=9 -a prueba -l puntos -ts 500 500 -l puntos puntos.shp raster.tif


And check Information to raster (gdalinfo in QGIS)


Band 1 Block=500x8 Type=Int16, ColorInterp=Gray
  Min=0.000 Max=609.000
  Minimum=0.000, Maximum=609.000, Mean=0.020, StdDev=1.618
  Metadata:
    STATISTICS_MAXIMUM=609
    STATISTICS_MEAN=0.019832
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=1.6183419576146


My GDAL version's 1.9.2






2013/3/23 Manuel Spínola <mspinola10 at gmail.com>

> Thank you very much Santiago.
>
> I still have unreasonables min and max numbers (-32768 - 32767)
>
> I cannot reproduce the raster that I got with R.
>
> Best,
>
> Manuel
>
>
> 2013/3/22 Santiago Banchero <santiagobanchero at gmail.com>
>
>> I attach a picture so you can understand better and the parameters that
>> you would see.
>> Best
>> Santiago
>>
>> Usage: gdal_rasterize [-b band]* [-i] [-at]
>>        [-burn value]* | [-a attribute_name] [-3d]
>>        [-l layername]* [-where expression] [-sql select_statement]
>>        [-of format] [-a_srs srs_def] [-co "NAME=VALUE"]*
>>        [-a_nodata value] [-init value]*
>>        [-te xmin ymin xmax ymax] [-tr xres yres] [-tap] [-ts width height]
>>       * [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/*
>> *             CInt16/CInt32/CFloat32/CFloat64}]* [-q]
>>        <src_datasource> <dst_filename>
>>
>>
>> 2013/3/22 Manuel Spínola <mspinola10 at gmail.com>
>>
>>> Thank you very much Santiago,
>>>
>>> I don´t understand your suggestion. Could you be more specific.
>>>
>>> Best,
>>>
>>> Manuel
>>>
>>>
>>> 2013/3/22 Santiago Banchero <santiagobanchero at gmail.com>
>>>
>>>> Hi,
>>>>    you need fix the *-ot* parameter manually and set a Data Type
>>>> according to your trouble.
>>>>
>>>> Regards
>>>> Santiago
>>>>
>>>>
>>>> 2013/3/22 Manuel Spínola <mspinola10 at gmail.com>
>>>>
>>>>>  Dear list members,
>>>>>
>>>>> I am trying to convert a vector (shapefile) to a raster using the
>>>>> option Conversion -> rasterize under the raster menu, however I don´t
>>>>> understand the result that I am getting. The values of the raster does not
>>>>> make any sense the min: -1.79769e+308 and max: 1.79769e+308
>>>>>
>>>>>
>>>>> I am also doing the same thing in R and I got reasonable results, the
>>>>> values of the raster goes from 1 to 10, the ones that I expected.
>>>>>
>>>>> > raster_agri
>>>>> class       : RasterLayer
>>>>> dimensions  : 300, 300, 90000  (nrow, ncol, ncell)
>>>>> resolution  : 207.5064, 133.2117  (x, y)
>>>>> extent      : 440239.3, 502491.2, 1032331, 1072294  (xmin, xmax, ymin,
>>>>> ymax)
>>>>> coord. ref. : +proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=500000
>>>>> +y_0=0 +ellps=WGS84 +units=m +no_defs
>>>>> data source : in memory
>>>>> names       : layer
>>>>> values      : 1, 10  (min, max)
>>>>>
>>>>>
>>>>>
>>>>> And even when I import this to QGIS the values of the raster does not
>>>>> make any sense either min: -2.14748e+09 and max: 2.14748e+09
>>>>>
>>>>> Any clue on this.
>>>>>
>>>>> Best,
>>>>>
>>>>> Manuel
>>>>>
>>>>> --
>>>>> *Manuel Spínola, Ph.D.*
>>>>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>>>>> Universidad Nacional
>>>>> Apartado 1350-3000
>>>>> Heredia
>>>>> COSTA RICA
>>>>> mspinola at una.ac.cr
>>>>> mspinola10 at gmail.com
>>>>> Teléfono: (506) 2277-3598
>>>>> Fax: (506) 2237-7036
>>>>> Personal website: Lobito de río<https://sites.google.com/site/lobitoderio/>
>>>>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>>>>
>>>>> _______________________________________________
>>>>> Qgis-user mailing list
>>>>> Qgis-user at lists.osgeo.org
>>>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Santiago Banchero
>>>>
>>>>
>>>
>>>
>>> --
>>> *Manuel Spínola, Ph.D.*
>>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>>> Universidad Nacional
>>> Apartado 1350-3000
>>> Heredia
>>> COSTA RICA
>>> mspinola at una.ac.cr
>>> mspinola10 at gmail.com
>>> Teléfono: (506) 2277-3598
>>> Fax: (506) 2237-7036
>>> Personal website: Lobito de río<https://sites.google.com/site/lobitoderio/>
>>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>>
>>
>>
>>
>> --
>> Santiago Banchero
>>
>>
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspinola at una.ac.cr
> mspinola10 at gmail.com
> Teléfono: (506) 2277-3598
> Fax: (506) 2237-7036
> Personal website: Lobito de río<https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>



-- 
Santiago Banchero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20130325/9ca4288e/attachment.html>


More information about the Qgis-user mailing list