[postgis-users] Make Empty Raster
Ed Linde
edolinde at gmail.com
Fri Mar 23 08:13:30 PDT 2012
I am running
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?
*I also get error --> NOTICE: Raster do not have band 1. Returning null
values
*
On Fri, Mar 23, 2012 at 2:05 PM, Pierre Racine
<Pierre.Racine at sbf.ulaval.ca>wrote:
> > I have a bounding box with the dimensions below.
> > "BOX(8.07734039737749 54.4984986588244,15.1919565742587
> > 57.7505109647578)"
> > I now want to make an empty raster using ST_MakeEmptyRaster, but I am not
> > sure about a few params. So maybe someone can help me?
> >
> > raster ST_MakeEmptyRaster(integer width, integer height,
> > float8 upperleftx, float8
> upperlefty,
> > float8 scalex, float8
> scaley, float8 skewx, float8
> > skewy,
> > integer
> srid=unknown);
> >
> > ST_MakeEmptyRaster( 15.1919565742587 - 8.07734039737749,
> > 57.7505109647578 - 54.4984986588244,
> > 8.07734039737749,
> 57.7505109647578,
> > ?,?,?,? (no idea what to put
> in skew and scale)
> > 4326);
> >
> > I am hoping that using the degrees in height, width calculations is ok?
>
> Maybe it's would time for you to read a bit of the documentation...
>
> http://postgis.org/documentation/manual-svn/RT_ST_MakeEmptyRaster.html
>
> scale is the pixel size. skew is the rotation (kind of).
>
> Read this as well:
>
> http://en.wikipedia.org/wiki/World_file
>
> Pierre
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120323/997fa324/attachment.html>
More information about the postgis-users
mailing list