[postgis-users] Raster displaced when loading or make a new one

Jose Carlos Martinez jomarlla at cgf.upv.es
Mon Feb 20 10:46:58 PST 2012


On 20/02/2012 19:18, Pierre Racine wrote:
> Is this happening with any raster or just with a specific one (or a set of specific ones)?
It is happening with more rasters but I cant identify with which ones. 
Im going to share it [1]  so you can check if it is just problem or  
maybe it is a bug.
If you need the original format let me know.

[1] dem1.sql
http://intercambio.upv.es/download.php?id=4b911b33cf73403e8a62e0316167cbea



>
> Is this is only happening with a specific one, could we have it?
>
>> -----Original Message-----
>> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
>> bounces at postgis.refractions.net] On Behalf Of Jose Carlos Martinez
>> Sent: Monday, February 20, 2012 7:35 AM
>> To: PostGIS Users Discussion
>> Subject: [postgis-users] Raster displaced when loading or make a new one
>>
>> Hi,
>> Im getting a problem with raster in PostGIS 2.0, r9200.
>>    POSTGIS="2.0.0alpha6SVN" GEOS="3.3.2-CAPI-1.7.2" PROJ="Rel. 4.7.1, 23
>> September 2009" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8"
>> USE_STATS
>>
>> I have loaded a raster file successfully. The layer is dem1 and the raster column
>> is rast.
>> The  when I try to make any new raster from this one, even just a copy of it:
>>
>> alter table dem1 add column rast1 raster; update dem1 set rast1 = rast; --
>> UPDATE 132 select addrasterconstraints ('dem1','rast1');
>>
>> I got the new raster 'rast1' displaced.
>> Dont know what im doing wrong. QGIS and GDAL_translate to png show the
>> same problem (maybe its no a postgis problem but a gdal problem?):
>> I uploaded a pdf with the images [1].
>>
>> PD: Im having similar problems when I try to load a tif raster to PostGIS.
>>
>> [1]
>> http://intercambio.upv.es/download.php?id=35c292331b627e462c1d5d92187bf
>> 492
>>
>>
>> The constrains are the same in both:
>> ra1=# \d dem1
>>                             Table "public.dem1"
>>    Column |  Type   |                     Modifiers
>> --------+---------+----------------------------------------------------
>>    rid    | integer | not null default nextval('dem1_rid_seq'::regclass)
>>    rast   | raster  |
>>    rast1  | raster  |
>> Indexes:
>>       "dem1_pkey" PRIMARY KEY, btree (rid) Check constraints:
>>       "enforce_height_rast" CHECK (st_height(rast) = 100)
>>       "enforce_height_rast1" CHECK (st_height(rast1) = 100)
>>       "enforce_max_extent_rast" CHECK (st_coveredby(st_convexhull(rast),
>> '0103000020E76400000100000005000000C09AA2803CA41A4104D63FE70A7950
>> 41C09AA2803CA41A4104D63FE776E45041604D51409EFB204104D63FE776E450
>> 41604D51409EFB204104D63FE70A795041C09AA2803CA41A4104D63FE70A7950
>> 41'::geometry))
>>       "enforce_max_extent_rast1" CHECK
>> (st_coveredby(st_convexhull(rast1),
>> '0103000020E76400000100000005000000C09AA2803CA41A4104D63FE70A7950
>> 41C09AA2803CA41A4104D63FE776E45041604D51409EFB204104D63FE776E450
>> 41604D51409EFB204104D63FE70A795041C09AA2803CA41A4104D63FE70A7950
>> 41'::geometry))
>>       "enforce_nodata_values_rast" CHECK
>> (_raster_constraint_nodata_values(rast)::numeric(16,10)[] =
>> '{32767}'::numeric(16,10)[])
>>       "enforce_nodata_values_rast1" CHECK
>> (_raster_constraint_nodata_values(rast1)::numeric(16,10)[] =
>> '{32767}'::numeric(16,10)[])
>>       "enforce_num_bands_rast" CHECK (st_numbands(rast) = 1)
>>       "enforce_num_bands_rast1" CHECK (st_numbands(rast1) = 1)
>>       "enforce_out_db_rast" CHECK (_raster_constraint_out_db(rast) =
>> '{f}'::boolean[])
>>       "enforce_out_db_rast1" CHECK (_raster_constraint_out_db(rast1) =
>> '{f}'::boolean[])
>>       "enforce_pixel_types_rast" CHECK
>> (_raster_constraint_pixel_types(rast) = '{16BSI}'::text[])
>>       "enforce_pixel_types_rast1" CHECK
>> (_raster_constraint_pixel_types(rast1) = '{16BSI}'::text[])
>>       "enforce_same_alignment_rast" CHECK (st_samealignment(rast,
>> '0100000000000000000000594000000000000059C0C09AA2803CA41A4104D63F
>> E776E4504100000000000000000000000000000000E764000001000100'::raster)
>> )
>>       "enforce_same_alignment_rast1" CHECK (st_samealignment(rast1,
>> '0100000000000000000000594000000000000059C0C09AA280FC781C4104D63F
>> E7EED0504100000000000000000000000000000000E764000001000100'::raster)
>> )
>>       "enforce_scalex_rast" CHECK (st_scalex(rast)::numeric(16,10) =
>> 100::numeric(16,10))
>>       "enforce_scalex_rast1" CHECK (st_scalex(rast1)::numeric(16,10) =
>> 100::numeric(16,10))
>>       "enforce_scaley_rast" CHECK (st_scaley(rast)::numeric(16,10) =
>> (-100)::numeric(16,10))
>>       "enforce_scaley_rast1" CHECK (st_scaley(rast1)::numeric(16,10) =
>> (-100)::numeric(16,10))
>>       "enforce_srid_rast" CHECK (st_srid(rast) = 25831)
>>       "enforce_srid_rast1" CHECK (st_srid(rast1) = 25831)
>>       "enforce_width_rast" CHECK (st_width(rast) = 100)
>>       "enforce_width_rast1" CHECK (st_width(rast1) = 100)
>>
>> Best,
>> Jose
>>
>>
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list