[postgis-devel] pgraster: st_resample error

Bborie Park dustymugs at gmail.com
Thu Dec 29 08:20:56 PST 2011


Hey Tom,

What I'm saying is that the extent may be different (appearance of an
offset) due to the bounding box guaranteed to contain all pixels of
the input raster.

The quickest way to understand this for you to take one of your
rasters and transform it using GDAL's gdalwarp utility and then view
both the original raster and the transformed raster in qgis or another
raster viewer.  You'll see that those the transformed raster's extent
does not match that of the original raster, the significant pixels
(those with actual data) are aligned.

For your rasters, something like the following will do.

gdalwarp -s_srs EPSG:28992 -t_srs EPSG:3857 SOURCERASTERNAME DESTRASTERNAME

You'll notice I'm not using the SRID 900913 as per Even's suggestions
regarding the unusualness of the Google Mercator projection.

I'm of the opinion that the extent doesn't matter.  What matters is
where the data is located.

-bborie

On Thu, Dec 29, 2011 at 12:23 AM, Tom van Tilburg
<tom.van.tilburg at gmail.com> wrote:
> Hi Bborie,
>
> I noticed the issue has been closed in postgis.
> As far as I understand the warping itself was correct, whereas the returned
> metadata on the extent had an offset.
>
> Do you say now that:
> a) the extent doesn't matter, so there's no issue
> b) the extent issue (if it is an issue) is fixed
>
> if a: how do I make the extent match so it lines up properly in my GIS?
>
> Sorry if I'm asking obvious things, it's been a long time since I did
> something with rasters.
> Thanks for looking into this anyway.
>
>  Tom
>
>
> On 28-12-2011 16:25, Bborie Park wrote:
>>
>> Hey Tom,
>>
>> Regina asked me about a similar concern regarding tiles after they
>> were projected so I did some digging yesterday.  The reprojected
>> tile's extent doesn't matter as long as the tile data is spatially
>> correct.
>>
>> I've been double-checking the transformed rasters vs the reference
>> rasters using qgis.  Though the extent of the transformed tile doesn't
>> match that of the source tile, the pixel data lines up correctly when
>> looking for important features such as edges of the data and areas
>> where I know that the data should be different (mountain ranges vs
>> valleys).
>>
>> -bborie
>>
>>
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list