[postgis-users] Make Empty Raster

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Fri Mar 23 08:20:10 PDT 2012


> create table vector_grid as
> SELECT (gvxy).geom geom, ((gvxy).x - 1) + (gvxy).y cellid FROM (SELECT
> ST_PixelAsPolygons(
>     ST_MakeEmptyRaster( 423152, 361936,
>                ST_X(ST_Transform(ST_SetSRID(ST_Point(8.07734039737749,
> 57.7505109647578),4326),32632)),
>                ST_Y(ST_Transform(ST_SetSRID(ST_Point(8.07734039737749,
> 57.7505109647578),4326),32632)),
>                16,16,0,0, 32632) ) gvxy) foo;
> 
> to get a "16 mt by 16 mt" grid. I calculated the height and width in meters. And I
> should approximately get 0.5 billion polygons!
> Y'day your calculation for 4x4 m^2 was saying 25 million polygons. Am not sure
> how you got that? Am I doing something wrong by projecting it to UTM
> coordinates first to compute euclidean height and width?

It should be ok now. I guess the other day 0.000036 was wrong.

> I also get error --> NOTICE:  Raster do not have band 1. Returning null values

It's true and ok.

Pierre



More information about the postgis-users mailing list