[postgis-users] st_union(rast) returning null because of non alignment,

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Wed Nov 7 15:01:19 PST 2012


By "on the same grid" I mean " at least one of any of the four corners of any pixel of one raster falls on any corner of the grid of the other raster" as stated in the ST_SameAlignment() doc.

What is (are) the pixel size?

> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> bounces at lists.osgeo.org] On Behalf Of Rhys A.D. Stewart
> Sent: Wednesday, November 07, 2012 5:51 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] st_union(rast) returning null because of non
> alignment,
> 
> Pierre,
> 
> If by on the same grid you mean equal, then no hey are not. Here they are.
> 
> 
> 1: POLYGON((766242.610093044 641994.463110607,779742.610093044
> 641994.463110607,779742.610093044 648494.463110607,766242.610093044
> 648494.463110607,766242.610093044 641994.463110607))
> 2:POLYGON((698486.043582936 617384.893096908,736736.043582936
> 617384.893096908,736736.043582936 674634.893096908,698486.043582936
> 674634.893096908,698486.043582936 617384.893096908))
> 
> Thanks,
> 
> Rhys
> 
> 
> On Wed, Nov 7, 2012 at 5:40 PM, Pierre Racine <Pierre.Racine at sbf.ulaval.ca>
> wrote:
> 
> 
> 	Hi Rhys,
> 
> 	Both rasters must also have their upperlefx and upperlefty on the same
> grid.
> 
> 	Could you do:
> 
> 	SELECT ST_AsText(ST_ConvexHull(rast))
> 
> 	on both rasters and post the result here?
> 
> 	Thanks,
> 
> 	Pierre
> 
> 
> 	> -----Original Message-----
> 	> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> 	> bounces at lists.osgeo.org] On Behalf Of Rhys A.D. Stewart
> 	> Sent: Wednesday, November 07, 2012 5:33 PM
> 	> To: PostGIS Users Discussion
> 	> Subject: [postgis-users] st_union(rast) returning null because of non
> alignment,
> 	>
> 	> Greetings,
> 	>
> 	> according to the trusty docs online two rasters are aligned when they
> share the
> 	> same skew, scale and srid. Created a raster using st_asraster  and
> according to
> 	> st_metadata scale, skew and srid are all equal. Howvere st_unon
> complains
> 	> saying that 'The two rasters provided do not have the same alignment.
> 	> Returning NULL'
> 	>
> 	> I noticed that  ticket #1336 as possibly relating to my issue, but I'm not
> entirely
> 	> sure. My posgis version is:
> 	> POSTGIS="2.0.0 r9605" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6
> March
> 	> 2012" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8"
> 	> LIBJSON="UNKNOWN" TOPOLOGY RASTER
> 	>
> 	>
> 	> What am I missing or doing incorrectly?
> 	>
> 	> Regards,
> 	>
> 	> Rhys
> 
> 	_______________________________________________
> 	postgis-users mailing list
> 	postgis-users at lists.osgeo.org
> 	http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> 
> 



More information about the postgis-users mailing list