[postgis-users] ST_AsRaster and pixeltype

Bborie Park bkpark at ucdavis.edu
Mon Nov 19 10:06:35 PST 2012


I'd rather keep the datatypes.  I've added a ticket to convert to the
requested datatype.

http://trac.osgeo.org/postgis/ticket/2100

-bborie

On Mon, Nov 19, 2012 at 8:53 AM, Pierre Racine
<Pierre.Racine at sbf.ulaval.ca> wrote:
> Or to remove support for 1BB and 8BSI?
>
>> -----Original Message-----
>> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
>> bounces at lists.osgeo.org] On Behalf Of Bborie Park
>> Sent: Monday, November 19, 2012 11:30 AM
>> To: PostGIS Users Discussion
>> Subject: Re: [postgis-users] ST_AsRaster and pixeltype
>>
>> This would be a limitation on the datatypes supported by GDAL vs
>> PostGIS Raster.  GDAL does not have any data types smaller than 8BUI,
>> so any datatype smaller is treated as 8BUI.  8BSI also does not have
>> an equivalent in GDAL so is treated as 16BSI.
>>
>> Feel free to file a ticket.  The only way to correct this is to add
>> another pass converting the output raster's pixel type from GDAL to
>> PostGIS Raster.
>>
>> -bborie
>>
>> On Mon, Nov 19, 2012 at 2:03 AM,  <Michael.Scholz at dlr.de> wrote:
>> > Moin!
>> > ST_AsRaster does not always create a raster with the specified pixel type.
>> Instead of a band with 1BB I get one with 8BUI, which is the default according to
>> the documentation. Example:
>> > ---------------------
>> > CREATE TEMP TABLE foo (rid serial PRIMARY KEY, rast raster);
>> >
>> > INSERT INTO foo (rast)
>> > SELECT ST_AsRaster (ST_MakePolygon (ST_GeomFromText
>> ('LINESTRING(604770 5793000, 604870 5793000, 604870 5792900, 604770
>> 5793000)',32632)), 0.1, -0.1, '1BB', 1.0, 0.0);
>> >
>> > SELECT AddRasterConstraints ('foo'::name,'rast'::name);
>> >
>> > SELECT srid,scale_x,scale_y,num_bands,pixel_types,nodata_values
>> > FROM raster_columns
>> > WHERE r_table_name = 'foo';
>> > ---------------------
>> > The result:
>> > 32632 | 0.10 | -0.1 | 1 | {8BUI} | {0}
>> > If I specify 16BUI, I indeed get a 16BUI-band. Is this a special feature of
>> ST_AsRaster or some limitation of GDAL?
>> >
>> > My version:
>> > "POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March
>> 2012" GDAL="GDAL 1.9.2, released 2012/10/08 GDAL_DATA not found"
>> LIBXML="2.7.8" RASTER"
>> >
>> > Ciaoi, Michi
>> > _______________________________________________
>> > postgis-users mailing list
>> > postgis-users at lists.osgeo.org
>> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>>
>>
>> --
>> Bborie Park
>> Programmer
>> Center for Vectorborne Diseases
>> UC Davis
>> 530-752-8380
>> bkpark at ucdavis.edu
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users



-- 
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkpark at ucdavis.edu


More information about the postgis-users mailing list