Commit graph

35 commits

Author SHA1 Message Date
Bborie Park bffadd2c76 Addition of ST_SummaryStats function.
- added function rt_band_get_summary_stats to rt_core/rt_api.c and rt_api.h
	- added test case to test/core/testapi.c
	- added function RASTER_summaryStats to rt_pg/rt_pg.c
	- added SQL functions for ST_SummaryStats to rt_pg/rtpostgis.sql.in.c
	- added regression tests in test/regress

Associated ticket is #930.


git-svn-id: http://svn.osgeo.org/postgis/trunk@7148 b70326c6-7e19-0410-871a-916f4a2858ee
2011-05-16 19:17:15 +00:00
Bborie Park 41ca87ef01 Addition of ST_Band functionality.
- added function rt_raster_from_band to rt_core/rt_api.c and rt_api.h
	- added test case to test/core/testapi.c
	- added function RASTER_band to rt_pg/rt_pg.c
	- added SQL functions for ST_Band to rt_pg/rtpostgis.sql.in.c
	- added regression tests in test/regress

Associated ticket is #339 and attached patch st_band.3.patch


git-svn-id: http://svn.osgeo.org/postgis/trunk@7147 b70326c6-7e19-0410-871a-916f4a2858ee
2011-05-16 19:11:21 +00:00
Jorge Arévalo f0ebd104a7 Trailing spaces removed from raster files.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7107 b70326c6-7e19-0410-871a-916f4a2858ee
2011-05-06 14:29:04 +00:00
Jorge Arévalo 6f16c2bfcb Changes in raster memory management:
- Only calling function memory context is used, except in SRF functions, where
multi_call_memory_ctx is used.
- rt_context internals hidden. The memory management and error reporting is
performed by rtalloc/rterror family functions. They simply call rt_context
struct fields as requested. Same philosophy here than in liblwgeom.
- Now rt_context memory is statically allocated. Before this, new memory for
rt_context was allocated in every function call. And the memory was allocated
outside the calling function (in fcinfo->flinfo->fn_mcxt postgres memory
        context).


git-svn-id: http://svn.osgeo.org/postgis/trunk@7106 b70326c6-7e19-0410-871a-916f4a2858ee
2011-05-06 12:06:29 +00:00
Jorge Arévalo 2f6f61231e palloc return value doesn't need to be checked, because if out of memory, function ends with elog(ERROR). It never returns NULL.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7032 b70326c6-7e19-0410-871a-916f4a2858ee
2011-04-14 16:29:21 +00:00
Jorge Arévalo 2abf24ed59 Context freed. It's not necessary.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7026 b70326c6-7e19-0410-871a-916f4a2858ee
2011-04-13 19:53:58 +00:00
Jorge Arévalo 731d665c71 Fixed bug from ticket #837. Some other improvements in RASTER_mapAlgebra. Minor bug fixed in rt_raster_serialized_size.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7025 b70326c6-7e19-0410-871a-916f4a2858ee
2011-04-13 19:44:48 +00:00
Jorge Arévalo 3955185051 Some memory freed. Related ticket #851.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7008 b70326c6-7e19-0410-871a-916f4a2858ee
2011-04-07 18:02:25 +00:00
Pierre Racine 390a83406c -Transformed many error into warning (or notice)
-Removed function name in message for warnings
-Added doc about rules when to return notice or error
-Removed commented out notices
-removed warning when passed raster is null. Just return null
-Get band number with PG_GETARG_INT32 instead of PG_GETARG_UINT16 which was converting values < 0 to something > 0

git-svn-id: http://svn.osgeo.org/postgis/trunk@6978 b70326c6-7e19-0410-871a-916f4a2858ee
2011-03-28 20:31:08 +00:00
Pierre Racine 15c1570955 -Fixxed a bug getting toindex band index
-Classified one function declaration

git-svn-id: http://svn.osgeo.org/postgis/trunk@6967 b70326c6-7e19-0410-871a-916f4a2858ee
2011-03-24 22:56:55 +00:00
Pierre Racine 685272bf03 -Return NULL if raster is NULL in RASTER_addband
-Warn if first raster is NULL in RASTER_copyband and return NULL

git-svn-id: http://svn.osgeo.org/postgis/trunk@6964 b70326c6-7e19-0410-871a-916f4a2858ee
2011-03-23 22:09:59 +00:00
Pierre Racine db4225f0b1 -Reordered/classified function declaration
-Renamed index and nband to bandindex in many functions
-Better handling for NULL in RASTER_setBandNoDataValue following ticket #883. Return original raster if can't set nodata value



git-svn-id: http://svn.osgeo.org/postgis/trunk@6963 b70326c6-7e19-0410-871a-916f4a2858ee
2011-03-23 22:01:10 +00:00
Pierre Racine cfbfb9c77a -Better handling of NULL for ST_SetValue. Return the original raster when band, X or Y are NULL instead of an error or NULL. See #883.
git-svn-id: http://svn.osgeo.org/postgis/trunk@6961 b70326c6-7e19-0410-871a-916f4a2858ee
2011-03-23 20:51:41 +00:00
Pierre Racine 08d41a641c -General review of ST_AddBand following ticket 871
-Moved some warning in the core
-Renamed the parameters to make more explicit which one is "to" and which one is "from"
-Fixed confusion in parameter order.
-Set many rtpostgis.sql.in.c functions to STRICT
-Removed check for null in RASTER_getPixelValue since st_value is now strict. More might follow.
-Removed (or moved) some documentation from rt_api.c already present in rt_api.h


git-svn-id: http://svn.osgeo.org/postgis/trunk@6960 b70326c6-7e19-0410-871a-916f4a2858ee
2011-03-23 19:52:34 +00:00
Jorge Arévalo a635b4ecaf Semicolon missed.
git-svn-id: http://svn.osgeo.org/postgis/trunk@6959 b70326c6-7e19-0410-871a-916f4a2858ee
2011-03-23 18:15:33 +00:00
Jorge Arévalo e444592ee6 Server crash reported in ticket #837 partially solved. SPI_finish causes server to crash. Commented in this commit, but it's not a good solution, I think.
This guy had the same problem 10 years ago. No responses: http://www.mail-archive.com/pgsql-general@postgresql.org/msg18558.html


git-svn-id: http://svn.osgeo.org/postgis/trunk@6958 b70326c6-7e19-0410-871a-916f4a2858ee
2011-03-23 02:57:33 +00:00
Pierre Racine 6b917c2436 -Fix for ticket 792: Clamp double to known values when pixeltype is other than double in rt_band_set_nodata, rt_band_set_pixel & rt_raster_generate_new_band
-Added function name to many error messages
-Standardized the way we write "nodata" from "NODATA" to "nodata"
-Moved some documentation to the header file
-My editor remove a lot of trailing space and convert tab to 4 spaces. Please make your editor do the same.
-Removed declarations of many unused variable


git-svn-id: http://svn.osgeo.org/postgis/trunk@6920 b70326c6-7e19-0410-871a-916f4a2858ee
2011-03-18 14:06:55 +00:00
Jorge Arévalo f529a4ef48 Added a new variant for ST_AddBand, taking 2 rasters as input. Needs doc.
git-svn-id: http://svn.osgeo.org/postgis/trunk@6833 b70326c6-7e19-0410-871a-916f4a2858ee
2011-02-16 19:12:25 +00:00
Jorge Arévalo 1fcfb1f7c0 - One raster core implementation of MapAlgebra (related ticket #588, needs
documentation).
- RASTER_addBand code moved to core level. The new RASTER_addBand function calls
the core one (rt_raster_generate_new_band).
- Added regression tests for MapAlgebra.
- Deleted lexer/parser at core level. Not used.
- Fixed small bug in documentation: ST_SetBandNoDataValue returns a raster, not
an integer.


git-svn-id: http://svn.osgeo.org/postgis/trunk@6832 b70326c6-7e19-0410-871a-916f4a2858ee
2011-02-16 18:19:57 +00:00
Jorge Arévalo d27525c417 Added header for RASTER_setBandIsNoData.Related ticket #593.
git-svn-id: http://svn.osgeo.org/postgis/trunk@6738 b70326c6-7e19-0410-871a-916f4a2858ee
2011-01-26 16:57:08 +00:00
Jorge Arévalo 7c5624530e Added function ST_SetBandIsNoData with tests and doc. Deleted isnodata checking
for loader. Related ticket #593.


git-svn-id: http://svn.osgeo.org/postgis/trunk@6736 b70326c6-7e19-0410-871a-916f4a2858ee
2011-01-26 16:08:02 +00:00
Pierre Racine b440f9cf66 -Fix for ticket 606: ST_Value now return NULL for nodata value and ST_SetValue accept NULL values (if there is a nodata value in the band).
ST_Value accept a boolean parameter which, when set to false, have the function to return nodata values as their true value instead of null. 

git-svn-id: http://svn.osgeo.org/postgis/trunk@6680 b70326c6-7e19-0410-871a-916f4a2858ee
2011-01-20 23:29:16 +00:00
Jorge Arévalo 141dd80f01 Added isnodata flag at core level and st_bandisnodata at postgresql level.
Related ticket #593. Fixed bug with debug functions at raster core level. Still
need to change the loader and the doc.


git-svn-id: http://svn.osgeo.org/postgis/trunk@6678 b70326c6-7e19-0410-871a-916f4a2858ee
2011-01-20 17:07:37 +00:00
Jorge Arévalo f31fd8b185 Functions ST_BandHasNodataValue and ST_SetBandHasNodataValue deleted. Related ticket #602.
git-svn-id: http://svn.osgeo.org/postgis/trunk@6621 b70326c6-7e19-0410-871a-916f4a2858ee
2011-01-13 21:36:43 +00:00
Mateusz Loskot 3c9511aea1 [raster] Cleaned and updated copyright notice.
git-svn-id: http://svn.osgeo.org/postgis/trunk@6608 b70326c6-7e19-0410-871a-916f4a2858ee
2011-01-12 22:02:35 +00:00
Jorge Arévalo c359a861cc Added code for ST_IsEmpty and ST_HasNoBand functions. And test code for the
first one. Related tickets #592, #593.


git-svn-id: http://svn.osgeo.org/postgis/trunk@6555 b70326c6-7e19-0410-871a-916f4a2858ee
2011-01-03 16:07:53 +00:00
Jorge Arévalo 713fb69eba Changed information return by postgis_raster_build_date and
postgis_raster_lib_version, to match the PostGIS build date and version. Related
ticket #653


git-svn-id: http://svn.osgeo.org/postgis/trunk@6554 b70326c6-7e19-0410-871a-916f4a2858ee
2011-01-03 11:53:42 +00:00
Jorge Arévalo 8f14e6c7ed Renamed accessors and editors of 'PixelSize' to 'Scale', including tests.
Related ticket #654.


git-svn-id: http://svn.osgeo.org/postgis/trunk@6552 b70326c6-7e19-0410-871a-916f4a2858ee
2011-01-03 10:46:41 +00:00
Paul Ramsey c8fb70b6d0 Fix conversion to geometry (#730)
git-svn-id: http://svn.osgeo.org/postgis/trunk@6494 b70326c6-7e19-0410-871a-916f4a2858ee
2010-12-23 22:06:52 +00:00
Paul Ramsey c5c1ffbe5f Fix up failure in distance calculation (#705) and replace some SRID -1 with SRID_UNKNOWN
git-svn-id: http://svn.osgeo.org/postgis/trunk@6349 b70326c6-7e19-0410-871a-916f4a2858ee
2010-12-13 19:25:15 +00:00
Sandro Santilli bd5c6118fb ISO C90 forbids mixed declarations and code
git-svn-id: http://svn.osgeo.org/postgis/trunk@6156 b70326c6-7e19-0410-871a-916f4a2858ee
2010-10-30 17:35:42 +00:00
Jorge Arévalo d2f82a6424 Fixes on PostGIS Raster debug system. The raster core uses
default_info_handler() call. Other minor bugs fixed. Created DEBUG file in
raster directory, similar to postgis/DEBUG file. Erased references to old raster debug variables in configure.ac. Deleted old readme file.


git-svn-id: http://svn.osgeo.org/postgis/trunk@6136 b70326c6-7e19-0410-871a-916f4a2858ee
2010-10-26 17:40:32 +00:00
Jorge Arévalo ea830ea686 New debug system, similar to the PostGIS debug system, with two sets of macros
that depend on the POSTGIS_DEBUG_LEVEL value. Related ticket #638.


git-svn-id: http://svn.osgeo.org/postgis/trunk@6134 b70326c6-7e19-0410-871a-916f4a2858ee
2010-10-26 16:40:49 +00:00
Jorge Arévalo 0ed01cc6eb Modified the prototype of dump core/server/sql functions, adding "wkt" to their names, because their returning elements are WKT geometries, not real PostGIS geometries.
git-svn-id: http://svn.osgeo.org/postgis/trunk@6061 b70326c6-7e19-0410-871a-916f4a2858ee
2010-10-10 11:16:16 +00:00
Jorge Arévalo dc8b342f29 - Added raster extension to new 'raster' directory.
- Modified PostGIS 'configure.ac' script to add support for new raster type (driven by '--with-raster' configure option.
- Added raster build options to 'GNUMakefile' script.
- PostGIS Python scripts moved to a 'python' subdirectory inside 'raster/scripts' directory.
- References to "WKT" deleted from source code.


git-svn-id: http://svn.osgeo.org/postgis/trunk@6019 b70326c6-7e19-0410-871a-916f4a2858ee
2010-09-26 21:21:03 +00:00