Opened 14 years ago
Closed 13 years ago
#651 closed defect (fixed)
[raster] ST_makeemptyraster inconsistent with documentation
Reported by: | etiennebr | Owned by: | pracine |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.0 |
Component: | raster | Version: | master |
Keywords: | Cc: | etiennebr |
Description
To recreate this box BOX(0 0,100 100) one would expect to use the upper left corner (as documented[1])
select st_box2d(ST_MakeEmptyRaster(100, 100, 0, 100, 1)) as upperl, st_box2d(ST_MakeEmptyRaster(100, 100, 0, 0, 1)) as lowerl;
but it is in fact the lower left corner, wich I personnaly prefer.
On a personal touch, I must say I am new to PostGIS raster, but I'd like to add I couldn't understand from the documentation what ipx, ipy, scalex, scaley, skewx, skewy where standing for and what were their effects.
[1] http://postgis.refractions.net/documentation/manual-svn/RT_ST_MakeEmptyRaster.html
Change History (14)
comment:1 by , 14 years ago
Milestone: | PostGIS 1.5.3 → PostGIS 2.0.0 |
---|
follow-up: 3 comment:2 by , 14 years ago
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Okay closing this out. Regarding the upper left corner -- I think what you want to look at is the pixel y size. The pixel y size should be negative in general to go in the direction I think you are expecting. Take a look at the ST_PixelYSize and link at bottom -- as well as the world file description.
comment:5 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I reoppen the ticket as the documentation is still confusing.
1-The ipx and ipy where replaced in rtpostgis.sql to better express their meaning: "ipx" to "upperleftx" and "ipy" to "upperlefty"
2-The type of these parameter are float8
3-The description of these parameters is wrong in the documentation. It should read something like:
"Returns an empty raster (having no band) of given dimensions (width & height) and georeferenced in spatial (or world) coordinates with upper left x (upperleftx), upper left y (upperlefty), pixel size expressed as scalex, scaley, skewx, skewy and reference system (srid). The last version use a single parameter to specify the pixel size (pixelsize). In this case scalex and scaley are set to this parameter and skewx and skewy are set to 0. If an existing raster is passed in, it returns a new raster with the same meta data settings (without the bands). If no srid is specified it defaults to -1, though this may change to 0 in future. After you create an empty raster you probably want to add bands to it and maybe edit it. Refer to ST_AddBand to define bands and ST_SetValue to set pixel values."
This introduce two things to fix:
1-The last version in the doc name the last parameter "pixelsize" when rtpostgis.sql names it scale. It should probably better to modify rtpostgis.sql to match the doc.
2-This same last version is kind of useless right now as the scaley parameter should be negated in the function and is not. Rasters created using this function are upside down in most reference systems.
comment:6 by , 14 years ago
Also it would good, in every page documenting a function making reference to scalex, scaley, skewx and skewy, to include a link to
http://en.wikipedia.org/wiki/World_file
I worked a lot last year to make this article comprehensible.
comment:7 by , 14 years ago
Status: | reopened → new |
---|
comment:8 by , 14 years ago
Status: | new → assigned |
---|
comment:9 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
Robe I reassign this ticket to you untill you fix the doc part of it. Just reassign it to me after so I will take care of two thing I identified to change in the code. Thanks.
comment:11 by , 14 years ago
Milestone: | PostGIS 2.0.0 → PostGIS Raster Future |
---|
comment:12 by , 13 years ago
Milestone: | PostGIS Raster Future → PostGIS 2.0.0 |
---|
I set it to PostGIS 2.0.0 as it would be harder to fix it later. The idea is simply to negate the y component when using the third variant:
raster ST_MakeEmptyRaster(integer width, integer height, float8 upperleftx, float8 upperlefty, float8 pixelsize);
comment:13 by , 13 years ago
Status: | new → assigned |
---|
I made some changes to the documentation. Please check and see if things are a bit clearer.