Opened 9 years ago

Closed 9 years ago

#1238 closed defect (fixed)

[raster] Resample and upperleftx , upperlefty

Reported by: standa Owned by: pracine
Priority: medium Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: ST_Resample Cc:

Description

Hi I load in the raster having SRID = 4326 I like to reproject this raster to the 3844 when I test

SELECT rid, (foo.md).* FROM (SELECT rid,ST_MetaData(ST_Resample(rast,3844,0.002,0.002)) As md FROM dem_table1 WHERE rid=1) as foo;

and obtain the same upperleftx , upperlefty as for the original raster. I tested also ST_Transform - the same result -> is it OK? Thank you

Change History (9)

comment:1 Changed 9 years ago by Bborie Park

Summary: Resample and upperleftx , upperlefty[raster] Resample and upperleftx , upperlefty

No. That is incorrect. What versions (and revisions) of GDAL and PostGIS are you using? I created a test transforming from 4326 to 3844

SELECT rid, (ST_Metadata(rast)).* FROM (
(
SELECT
	1 AS rid,
	ST_AddBand(
		ST_MakeEmptyRaster(1, 1, 24.818115, 45.822675, 0.01, 0.01, 0, 0, 4326),
		1, '8BUI', 1
	) AS rast
) UNION ALL (
SELECT
	2 AS rid,
	ST_Transform(
		ST_AddBand(
			ST_MakeEmptyRaster(1, 1, 24.818115, 45.822675, 0.01, 0.01, 0, 0, 4326),
			1, '8BUI', 1
		),
		3844
	) AS rast
)
) AS foo;

If you run the SQL above, the results should be similar to:

rid;upperleftx;upperlefty;width;height;scalex;scaley;skewx;skewy;srid;numbands
1;24.818115;45.822675;1;1;0.01;0.01;0;0;4326;1
2;485990.139598202;481453.235469657;1;1;958.718116254953;-958.718116254953;0;0;3844;1

The results above are from a machine running GDAL svn-trunk r23215 and PostGIS svn-trunk r7964.

comment:2 Changed 9 years ago by Bborie Park

A thought occurred to me. Are you running Windows?

comment:3 Changed 9 years ago by standa

Windows

comment:4 Changed 9 years ago by standa

I obtain wrong result = I have wrong version

I am using version downloaded from

http://www.postgis.org/download/windows/experimental.php#wktraster

For PostgreSQL 9.0(compiled .....)

Where I can download proper one? I am new in this area.

comment:5 Changed 9 years ago by Bborie Park

I'm pretty sure that you have the correct version. But, I can't tell which Windows package you are using. You should be using http://www.postgis.org/download/windows/pg90/experimental/postgis/postgis-pg90-binaries-2.0.0svn.zip

My guess is that GDAL isn't able to find the PROJ library since the upper-left corner isn't changing. You may want to try setting the environmental variable PROJSO and see if that helps.

http://trac.osgeo.org/gdal/wiki/ConfigOptions#PROJSO

Can you post your results from the SQL query I posted?

As I don't use Windows, I'm hoping Regina can chime in and offer some wisdom.

comment:6 Changed 9 years ago by standa

rid;upperleftx;upperlefty;width;height;scalex;scaley;skewx;skewy;srid;numbands 1;24.818115;45.822675;1;1;0.01;0.01;0;0;4326;1 2;24.818115;45.832675;1;1;0.00999999999999979;-0.00999999999999979;0;0;3844;1

comment:7 Changed 9 years ago by standa

I am going home - I will connect in 1 hour. I use Transform for shape - and it look OK

comment:8 Changed 9 years ago by Bborie Park

Can you set the environmental variable PROJSO to the path and filename of the PROJ library and try again?

comment:9 Changed 9 years ago by standa

Resolution: fixed
Status: newclosed

Thank you very much - it work. :)

Note: See TracTickets for help on using tickets.