Bborie Park
bd703fcc7f
Fixed incorrect call to rt_raster_geopoint_to_cell in rt_band_load_offline_data and added additional debug messages
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8752 b70326c6-7e19-0410-871a-916f4a2858ee
2012-01-10 19:36:52 +00:00
Bborie Park
c4305740bc
Fixed incorrect use of rt_band_destroy when loading offline band data. ALso added rules to raster_columns and raster_overviews to gracefully handle insert/update/delete.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8751 b70326c6-7e19-0410-871a-916f4a2858ee
2012-01-10 18:45:19 +00:00
Bborie Park
35b0ff01ae
Make the data of externally-loaded band internally owned so a call to rt_band_destroy() properly frees the memory.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8731 b70326c6-7e19-0410-871a-916f4a2858ee
2012-01-09 20:08:15 +00:00
Bborie Park
370bae1ed5
Add read-only support for band data located outside the database in raster files. All "get" and analysis functions should work for out of database bands. Related ticket is #1440 . Also added a test raster file for use by an out of db band and future use for raster2pgsql loader regression tests.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8730 b70326c6-7e19-0410-871a-916f4a2858ee
2012-01-09 19:48:21 +00:00
Bborie Park
4f81e7e099
Code cleanup related to registering and deregistering GDAL drivers
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8704 b70326c6-7e19-0410-871a-916f4a2858ee
2012-01-08 16:28:12 +00:00
Bborie Park
ff4cdc048c
Have rt_raster_from_gdal_dataset attempt to determine the SRID of the raster using OSR.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8695 b70326c6-7e19-0410-871a-916f4a2858ee
2012-01-07 15:24:08 +00:00
Bborie Park
2e75260f57
Added shortcut mechanism for copying data in rt_raster_from_gdal_dataset() when the natural block width is the raster width. Enhanced testing in testapi.c.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8684 b70326c6-7e19-0410-871a-916f4a2858ee
2012-01-05 21:18:56 +00:00
Bborie Park
6e559453f1
Force initialization of output GDAL raster from rt_raster_gdal_warp to band's NODATA value. Also, spelling correction.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8602 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-28 15:45:19 +00:00
Bborie Park
63e7bbcd67
Instead of using spatial reference text in WKT format, use PROJ.4 format when possible. This does mean that in situations that require WKT format, rt_raster_gdal_sr must be called to convert from one format to the other.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8537 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-24 01:14:16 +00:00
Bborie Park
fce6e3a842
Added option -G to get listing of supported raster types instead of calling ST_GDALDrivers in SQL. Had to tweak rt_raster_gdal_drivers in rt_api.c to not limit drivers based upon creation capabilities. Associated ticket is #1374 .
...
Added ability to specify band indices with ranges for option -b. Example: -b 1-5,7,9-15. Associated ticket is #1375 .
Added warning messages when loader is processing more than one raster and rasters may have different number of bands, pixel types, hasnodata flags, NODATA values, geotransforms andtile sizes. Associated ticket is #153 .
git-svn-id: http://svn.osgeo.org/postgis/trunk@8418 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-14 22:23:42 +00:00
Bborie Park
aaf3ac45ef
Fixed handling of output ranges going from high to low rather than the default of values going from low to high. Based upon message on postgis-users: http://postgis.refractions.net/pipermail/postgis-users/2011-December/031763.html
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8393 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-13 21:19:54 +00:00
Bborie Park
d68c6424ea
Code refactoring in rtpg_ utility functions for better memory usage and syntax cleanup in rt_api.*
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8341 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-10 01:01:37 +00:00
Bborie Park
ed7fff55e8
Return use of GDAL "natural" blocking removed in r8313 and refactor pointer handling.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8325 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-08 20:05:49 +00:00
Bborie Park
dc6178d3af
Added rt_raster_set_pixel_line for use when setting values for sequential pixels. Should be faster than repeated calls to rt_raster_set_pixel.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8314 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-07 20:46:47 +00:00
Bborie Park
13ac027977
Refactored the GDALRasterIO part of rt_raster_from_gdal_dataset to use scanlines instead of "natural" blocks, which dramatically simplifies the code and makes it easier to maintain.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8313 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-07 15:29:46 +00:00
Bborie Park
4644f0d561
Fixed regression issue with rt_raster_from_gdal_dataset by explicitly setting the valid block sizes passed into GDALRasterIO. Probably related to the changes made in r8309
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8310 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-07 01:15:46 +00:00
Bborie Park
0e17e93920
Removed attempt to duplicate entire band in rt_raster_from_gdal_dataset
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8309 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-06 16:48:12 +00:00
Bborie Park
47faf3b72f
Removed division by bin-width for when bin-widths are specified in ST_Histogram
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8304 b70326c6-7e19-0410-871a-916f4a2858ee
2011-12-05 18:36:56 +00:00
Bborie Park
1897194dd0
Fixed ST_AsRaster to duplicate exactly the attributes of a reference raster.
...
Associated ticket is #1336 .
git-svn-id: http://svn.osgeo.org/postgis/trunk@8263 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-30 20:35:57 +00:00
Bborie Park
e7ba644265
Fixed extent bug for UNION in rt_raster_from_two_rasters
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8215 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-21 19:18:37 +00:00
Bborie Park
ab61f4c1b9
Addition of function rt_util_gdal_datatype_to_pixtype to complement rt_util_pixtype_to_gdal_datatype.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8188 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-18 23:47:35 +00:00
David Zwarg
d7c4d5437d
Non-functional change. Updated author email address for dzwarg.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8184 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-18 20:56:57 +00:00
Bborie Park
028ea10f03
Added a flag --with-raster-dblwarning so as to provide the software builder the option of enabling all the value truncation/clamping/conversion warnings, which can be many. The new default is to suppress those warnings. All appropriate regression tests have been updated.
...
Associated ticket is #1307
git-svn-id: http://svn.osgeo.org/postgis/trunk@8181 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-18 18:30:00 +00:00
David Zwarg
9ba7a6f7e4
Fixed debug problem in #1308
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8179 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-18 14:53:36 +00:00
Bborie Park
5bd86f0e99
Added ability to specify raster width and height to ST_Resample.
...
Associated ticket is #1267
git-svn-id: http://svn.osgeo.org/postgis/trunk@8153 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-14 21:40:25 +00:00
Bborie Park
41d2a118dc
Separated the output raster's extent calculation from RASTER_mapAlgebra2Expr() in rt_pg.c to rt_raster_from_two_rasters() in rt_api.c. Added test of rt_raster_from_two_rasters() in testapi.c
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8128 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-09 23:00:53 +00:00
Bborie Park
c01f9c6f32
Fix floating point issues in rt_raster_geopoint_to_cell in addition to other minor changes.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8120 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-08 23:18:37 +00:00
Bborie Park
4f6f5e2b41
Bug fix for evaluating remainder when remainder is infinitely close to 1. Basically, the check wasn't added to a block of code those similar blocks of code had the check.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8119 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-08 21:34:12 +00:00
Bborie Park
c450d6d83a
Fixed the bug described in #1263 . Also fixed additional code that has the same problem. Additional syntax cleaning and comments updated. Fixed the problem with "make check" running test/core twice.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8102 b70326c6-7e19-0410-871a-916f4a2858ee
2011-11-06 04:56:30 +00:00
Bborie Park
e20f3d0a60
Refactored rt_band_get_min_value() to call new function rt_pixtype_get_min_value(). Addition of function rt_util_extent_type().
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8011 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-27 14:08:24 +00:00
Bborie Park
709dc2d8a9
Added rt_raster_set_geotransform_matrix() to provide quick setting of a raster's geotransform based upon the matrix
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@8000 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-21 21:42:12 +00:00
Bborie Park
4c7dbc99ce
Corrected rt_raster_same_alignment() and RASTER_sameAlignment() to behave as an end-user would expect it to. So intead of errors when parameters don't match, return false.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7999 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-21 19:10:53 +00:00
Bborie Park
8864196bef
Changed rt_raster_has_no_band to use 0-based band index instead of 1-based. Removed function prototype ST_HasNoData(raster) as the other prototype ST_HasNoData(raster, nband) now uses the default value of 1 for nband.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7998 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-21 18:11:46 +00:00
Bborie Park
b9ab21eabb
Changed those functions that is 1-based for band index to 0-based in rt_core. This leaves only rt_raster_has_no_band, which may have other issues as well.
...
Associated ticket is #754
git-svn-id: http://svn.osgeo.org/postgis/trunk@7997 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-21 14:53:29 +00:00
David Zwarg
41b8676733
Implemented raster map algebra with user functions/callbacks. ( #860 )
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7980 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-14 18:11:27 +00:00
Bborie Park
49ca7588dd
Added additional error checking and error messages to ST_SameAlignment function
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7959 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-07 00:29:40 +00:00
Bborie Park
d911b1ee21
Implements ST_SameAlignment.
...
Associated ticket is #589 .
git-svn-id: http://svn.osgeo.org/postgis/trunk@7951 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-05 23:03:19 +00:00
Bborie Park
a3abb76533
As per Bryce's comments in ticket #1174 , reduce the number of calculations when doing rt_raster_geopoint_to_cell by using an inverse geotransform matrix. Unlike the patch attached to the ticket, this commit does not change the structure of the rt_raster struct. It may be worth changing the rt_raster struct eventually, but will cost us the single memcpy when serializing rt_raster. Also, changes for testing SRID as "unknown" if value is lte SRID_UNKNOWN (presently 0).
...
Associated ticket is #1174 .
git-svn-id: http://svn.osgeo.org/postgis/trunk@7949 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-05 18:49:11 +00:00
Bborie Park
b5c044ab3d
Removed hackish use of POSTGIS_GDAL_VERSION in postgis/sqldefines.h.in and postgis/postgis.sql.in.c. Added conditional compilation of extent resizing based upon GDAL version in rt_api.c
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7948 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-05 04:54:00 +00:00
Bborie Park
54d6bc0265
Adds postgis_gdal_version() function as per ticket #1225 .
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7945 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-04 22:38:46 +00:00
Bborie Park
295c02be84
Changed adjustment of extent by half-pixel to full-pixel for points and linestrings to ensure compatibility with GDAL 1.6, 1.7 and 1.8. GDAL 1.9 (current trunk) appears to work fine with half-pixel adjustments.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7944 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-04 20:51:10 +00:00
Bborie Park
2bbfeb294e
For linestrings, use same logic for points where extent is increased by half a pixel to catch geometries on the edges.
...
Associated ticket is #1213
git-svn-id: http://svn.osgeo.org/postgis/trunk@7941 b70326c6-7e19-0410-871a-916f4a2858ee
2011-10-04 19:50:54 +00:00
Bborie Park
167c3b8c9d
Changed function ST_Intersects(raster, raster, int, int) to ST_Intersects(raster, raster). Added additional comments to rt_raster_geopoint_to_cell().
...
Associated ticket is #1212
git-svn-id: http://svn.osgeo.org/postgis/trunk@7919 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-29 18:33:27 +00:00
Bborie Park
9b3d2c21a7
Removed unnecessary typedef for fmin and fmax on windows. Possible fix to #1207 .
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7890 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-25 14:48:57 +00:00
Bborie Park
b443689cf4
Tweaks to makefiles due to linker symbol errors in OSX. Hopefully this can also resolve the issue with #1207 .
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7889 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-24 19:05:10 +00:00
Bborie Park
c5d7903487
Further tweaks to rt_raster_gdal_rasterize to correctly handle auto-computed extents of multipoints. Addition of ST_Intersects for two rasters. Refactored the one raster and one geometry version of ST_Intersects.
...
Associated ticket is #1176
git-svn-id: http://svn.osgeo.org/postgis/trunk@7884 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-22 15:07:25 +00:00
Bborie Park
008e749e4d
additional code cleanup of rt_raster_gdal_rasterize
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7870 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-19 21:28:40 +00:00
Bborie Park
a43ebe1780
fixups and code cleanups for the rt_raster_gdal_rasterize to better handle point and linestring geometries
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7857 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-16 13:32:22 +00:00
Bborie Park
152a2d6786
Added optimizations and shortcuts for rt_band_get_quantiles_stream
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@7802 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-02 01:54:43 +00:00
Bborie Park
f9bfa6f17e
Added solaris define for UNIX using patch provided by rroliver.
...
Associated ticket is #1171 .
git-svn-id: http://svn.osgeo.org/postgis/trunk@7790 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-26 14:47:07 +00:00