Commit graph

109 commits

Author SHA1 Message Date
Bborie Park 6a8a4356c4 Updated regression tests to correctly support change of unknown SRID from -1 to 0.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7923 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-30 00:11:55 +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 224a487980 Removed ST_Intersects(raster, int, raster, int) version of two raster ST_Intersects.
Associated ticket is #1212


git-svn-id: http://svn.osgeo.org/postgis/trunk@7901 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-27 03:40:08 +00:00
Regina Obe 265c3a8605 add missing geos flag to let it make check under mingw
git-svn-id: http://svn.osgeo.org/postgis/trunk@7891 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-25 20:37:39 +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 6f0e380b17 Updated expected output due to change in message
git-svn-id: http://svn.osgeo.org/postgis/trunk@7817 b70326c6-7e19-0410-871a-916f4a2858ee
2011-09-07 13:58:19 +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 aba77a3674 Fixed the function rt_band_get_summary_stats rt_core/rt_api.c to correctly handle the situation where a band's values are all nodata
git-svn-id: http://svn.osgeo.org/postgis/trunk@7788 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-25 23:23:46 +00:00
Bborie Park 56791ce3b5 Fixed the problem where having configure detect that GDAL has the GDALFPolygonize function does not cause the code to use GDALFPolygonize. This is due to the macro GDALFPOLYGONIZE not being set anywhere. So, it is now being set in raster_config.h.in and included in rt_core/rt_api.h. Had to update testapi.c as the geometries generated differ depending on whether or not GDALFPolygonize is used.
Associated ticket is #650


git-svn-id: http://svn.osgeo.org/postgis/trunk@7785 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-25 14:44:55 +00:00
Bborie Park d432dc28e5 Inclusion of missing ST_PixelWidth and ST_PixelHeight functions and regression tests.
Associated ticket is #928


git-svn-id: http://svn.osgeo.org/postgis/trunk@7779 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-24 15:23:25 +00:00
Bborie Park 3ac670b992 Refactored ST_ValueCount and ST_ValuePercent to be a C function rather than a plpgsql function.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7778 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-23 22:41:22 +00:00
Regina Obe df057abedf #1158 add proj flags to fix mingw test issue
git-svn-id: http://svn.osgeo.org/postgis/trunk@7774 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-21 03:34:56 +00:00
Bborie Park 4c3dac62a8 More fixups for the quantile coverage function. Fixes segfault that seems to only occur on OSX.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7771 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-20 17:51:04 +00:00
Bborie Park 28797da0e1 Adds coverage table version of ST_Quantile and ST_ApproxQuantile. Function implemented using the algorithm discussed in
A One-Pass Space-Efficient Algorithm for Finding Quantiles (1995)
  by Rakesh Agrawal, Arun Swami
  in Proc. 7th Intl. Conf. Management of Data (COMAD-95)
  http://www.almaden.ibm.com/cs/projects/iis/hdb/Publications/papers/comad95.pdf

Also refactored the regression test for rt_histogram due to unnecessary columns in output


git-svn-id: http://svn.osgeo.org/postgis/trunk@7765 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-19 19:08:36 +00:00
Bborie Park cd974c4adc Commit of patch provided by David Zwarg in #482 adding the functions ST_SetRotation, ST_Rotation, ST_PixelHeight and ST_PixelWidth.
Associated tickets are #482, #928, #929 and #936


git-svn-id: http://svn.osgeo.org/postgis/trunk@7763 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-19 14:04:50 +00:00
Bborie Park 33352aacb5 Consolidated various struct declarations from rt_api.c into rt_api.h as these structs are duplicatively redeclared in rt_pg.c and testapi.c
git-svn-id: http://svn.osgeo.org/postgis/trunk@7745 b70326c6-7e19-0410-871a-916f4a2858ee
2011-08-13 18:10:44 +00:00
Bborie Park ed8d71db19 Addition of ST_AsRaster function to provide the ability to convert geometries into rasters.
Associated ticket is #1141.


git-svn-id: http://svn.osgeo.org/postgis/trunk@7675 b70326c6-7e19-0410-871a-916f4a2858ee
2011-07-25 15:52:36 +00:00
Bborie Park 29686bbbfa Fixed floating point issue with the remainder returned from the function modf in rt_api.c. Updated messages in rt_pg.c. Corrected expected regression results in rt_resample_expected.
Associated ticket is #1114


git-svn-id: http://svn.osgeo.org/postgis/trunk@7657 b70326c6-7e19-0410-871a-916f4a2858ee
2011-07-21 16:20:36 +00:00
Bborie Park f22b886f23 Fixed width and height values expected.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7653 b70326c6-7e19-0410-871a-916f4a2858ee
2011-07-18 23:39:05 +00:00
Bborie Park fa708f255c - tweaked the rt_resample regression test to use SRIDs under 1000000
- changed the computation of width and height when aligning to a grid


git-svn-id: http://svn.osgeo.org/postgis/trunk@7652 b70326c6-7e19-0410-871a-916f4a2858ee
2011-07-18 23:29:54 +00:00
Bborie Park 65caa54e1f Refactored functions returning sets to use Datums instead of C strings, which were causing rounding issues particularly for ST_Metadata. This refactoring affected RASTER_metadata, RASTER_bandmetadata, RASTER_summarystats, RASTER_histogram, RASTER_quantile, RASTER_valuecount and RASTER_gdaldrivers.
Also refactored the ST_Raster2World* and ST_World2Raster* functions to get the raster's metadata in one call using ST_Metadata rather than individual calls for the georeference components


git-svn-id: http://svn.osgeo.org/postgis/trunk@7638 b70326c6-7e19-0410-871a-916f4a2858ee
2011-07-14 14:54:49 +00:00
Bborie Park 2ad776d498 Complete refactoring of code from ST_Transform to ST_Resample. There are four new functions as of this revision: ST_Resample, ST_Rescale, ST_Reskew and ST_SnapToGrid. ST_Transform is still present but points to ST_Resample.
Associated ticket #1114


git-svn-id: http://svn.osgeo.org/postgis/trunk@7633 b70326c6-7e19-0410-871a-916f4a2858ee
2011-07-13 19:33:12 +00:00
Bborie Park c2bd42d810 fixed logic issues in ST_AsJPEG
git-svn-id: http://svn.osgeo.org/postgis/trunk@7527 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-30 13:28:47 +00:00
Bborie Park d6dd575dac modified expected results for rt_pixelvalue.
Associated ticket is #1055


git-svn-id: http://svn.osgeo.org/postgis/trunk@7503 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-27 19:02:04 +00:00
Bborie Park 48ff0b2940 Modified ST_Transform to permit specification of projected raster's scale. This is due to the scale change that occurs when a raster is being reprojected.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7482 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-25 19:20:23 +00:00
Bborie Park 67ce832591 Added sanitization of the algorithm parameter of ST_Transform. Refactored the regression test for ST_Transform.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7471 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-24 21:20:04 +00:00
Bborie Park 04bbd059b2 Removed rt_raster_transform from rt_api.c and any calls to it since rt_raster_gdal_warp has same results for reprojections.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7455 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-23 20:46:32 +00:00
Bborie Park 6ebb8e7534 Addition of rt_raster_gdal_warp function in rt_api.c. This was written based upon GDAL's gdalwarp utility to provide a flexible means to reproject, change the scale of, adjust the skew (deskew) of and shift the origin of a raster. RASTER_transform in rt_pg.c has been adjusted to make use of rt_raster_gdal_warp instead of rt_raster_transform. Regression te
sts confirm that resulting rasters from rt_raster_gdal_warp are identical to that of rt_raster_transform.

The abilities to change a raster's scale, skew and origin have yet to be tested and have no user-accessible SQL functions as of this revision.  This will occur in future revisions.

The function rt_raster_transform will be removed in a future revision.


git-svn-id: http://svn.osgeo.org/postgis/trunk@7454 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-23 20:29:51 +00:00
Bborie Park b633449bc0 Refactored code and removed the use of SET_VARSIZE for RASTER_band to fix segfault.
Associated ticket is #1044.


git-svn-id: http://svn.osgeo.org/postgis/trunk@7440 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-21 05:05:16 +00:00
Bborie Park 41b6e3dc15 Changed the regression tests for ST_Transform in preparation for testing replacement ST_Transform function with different underlying code.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7432 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-20 14:55:22 +00:00
Bborie Park 8429d06e82 Changed band pixel types to 64BF instead of 32BF so that the warning messages for data getting converted are mitigated.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7400 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-15 15:43:51 +00:00
Bborie Park 4e0a89adc4 Changed SRID to something within the range permitted by GSERIALIZED. As of this revision, all raster regression tests pass successfully.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7396 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-14 19:32:18 +00:00
Bborie Park cfdb07ccca Fixed memory leak in RASTER_asGDALRaster of rt_pg.c and left note in comments of rt_raster_to_gdal
git-svn-id: http://svn.osgeo.org/postgis/trunk@7390 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-13 21:47:27 +00:00
Bborie Park b2ca472ea1 Added function parameter "header_only" to rt_raster_deserialize. This instructs the function to only extract the raster header.
All functions calls to rt_raster_deserialize in rt_pg.c and testwkb.c have been modified to account for the "header_only" parameter.  In addition, functions that can use PG_DETOAST_DATUM_SLICE have been modified to use it.

Associated tickets are #867 and #985.

Now to work on valgrinding rt_pg.c


git-svn-id: http://svn.osgeo.org/postgis/trunk@7376 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-11 19:26:44 +00:00
Bborie Park 19c5577f52 Removed the ST_SummaryStats wrappers: ST_Sum, ST_Mean, ST_Stddev, ST_MinMax. Only ST_Count is preserved as it has a shortcut for when "exclude_nodata_value" is FALSE.
Refactored regression test for rt_transform due to removal of some ST_SummaryStats wrappers and make the tests no longer about being exact to specific values but more about being in the appropriate contexts.

Associated ticket is #1005 and to some degree, #985.


git-svn-id: http://svn.osgeo.org/postgis/trunk@7375 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-11 19:06:15 +00:00
Bborie Park e5062e5dc9 Refactored rt_raster_replace_band in rt_api.c to return the replaced band.
Additional memory cleanups in testapi.c due to segfault and leaks.


git-svn-id: http://svn.osgeo.org/postgis/trunk@7372 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-11 04:59:19 +00:00
Bborie Park c093bd3940 Fixed bunch of memory leaks in rt_api.c and testapi.c. Will need to valgrind the regression tests to clean up the leaks in rt_pg.c
git-svn-id: http://svn.osgeo.org/postgis/trunk@7369 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-11 00:05:53 +00:00
Pierre Racine 34f97a500c Getting pixel value at out of range coordinate should only return a warning. Was broken at r7106. Added a check.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7366 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-10 19:49:29 +00:00
Bborie Park 1bb6dcb742 Rewrote ST_BandMetaData to use a C function instead of sequential calls for the metadata of a raster's band in plpgsql. Also added regression tests for ST_MetaData and ST_BandMetaData due to C functions.
Associated ticket #1012


git-svn-id: http://svn.osgeo.org/postgis/trunk@7357 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-10 15:19:03 +00:00
Bborie Park 3a24b02e1c - added additional tests that shouldn't require datum shift files for proj.4.
- refactored output that would be double precision to be rounded


git-svn-id: http://svn.osgeo.org/postgis/trunk@7343 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-08 22:47:14 +00:00
Bborie Park 7e143b23c8 Rewrote how the standard/sample deviation is computed in ST_SummaryStats for coverage tables. It now extends the existing use of a single-pass standard deviation calculation to be able to do the calculation for a coverage table.
Associated ticket #985.


git-svn-id: http://svn.osgeo.org/postgis/trunk@7342 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-08 21:10:11 +00:00
Bborie Park 0d83cc1894 fixed ST_SummaryStats for coverage tables where the sum of all tiles was not being computed.
Associated ticket #1005

Also added shortcuts to ST_Count for when parameter "exclude_nodata_value" is FALSE, just compute the count based upon the raster's dimensions.  Performance difference between the normal route and the shortcut is negligible for small rasters but noticable when run on large rasters and coverage tables


git-svn-id: http://svn.osgeo.org/postgis/trunk@7340 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-08 00:00:51 +00:00
Bborie Park 60c2a10862 Added support for coverage tables to ST_Histogram. This entailed adding the ability to explicitly specify the min and max values in the underlying C function rt_band_get_histogram. The min and max parameters should ONLY be used by the established coverage table handling ST_Histogram functions as the returned percent element of the histogram type is changed from returning the percentage to returning the sum of counts for that histogram.
Associated ticket is #934.


git-svn-id: http://svn.osgeo.org/postgis/trunk@7339 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-07 22:59:23 +00:00
Bborie Park 4752433c0d Add ST_Transform function that achieves the primary purpose of reprojecting a raster to a new projection system. This makes use of the GDAL Warp API function GDALAutoCreateWarpedVRT(). In the future, the underlying C function is expected to be refactored to support skewing and pixel scaling at the same time the raster is reprojected.
Really minor changes to rt_pg/rt_pg.c adding initilization values to variables for eliminating compile warnings in Windows (thanks Pierre).

Fixed variable "status" in rt_raster_from_gdal_dataset() of rt_core/rt_api.c

Associated ticket is #925


git-svn-id: http://svn.osgeo.org/postgis/trunk@7338 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-07 18:21:34 +00:00
Bborie Park 621954071c - added additional function parameters "bandNums" and "count" to rt_raster_to_gdal_mem so that the GDAL dataset created only contains those bands specified
- any calls to rt_raster_to_gdal_mem function was refactored for the new function parameters
- refactored rt_raster_dump_as_wktpolygons to make use of rt_raster_to_gdal_mem so as to reduce duplicate code and improve cleanliness


git-svn-id: http://svn.osgeo.org/postgis/trunk@7325 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-05 20:52:48 +00:00
Bborie Park 8e1a828f0f Added rt_raster_from_gdal_dataset function to rt_core/rt_api.c. This function provides the functionality needed to convert a GDAL dataset into a PostGIS Raster object.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7317 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-03 17:02:57 +00:00
Jorge Arévalo 6c38bd8437 Check for new GDALFPolygonize function. If it isn't present, the old GDALPolygonize is called. Related ticket #650.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7316 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-03 15:19:40 +00:00
Jorge Arévalo f007bac333 Fixed ticket #650. You need to update your GDAL copy to a release up to 22476 to make it work.
git-svn-id: http://svn.osgeo.org/postgis/trunk@7308 b70326c6-7e19-0410-871a-916f4a2858ee
2011-06-01 23:50:14 +00:00
Bborie Park ab6ad7fcaf - remove OUT parameters on those functions that only return a single value.
- updated regression tests that made use of those functions returning single values with OUT parameters


git-svn-id: http://svn.osgeo.org/postgis/trunk@7277 b70326c6-7e19-0410-871a-916f4a2858ee
2011-05-27 23:35:07 +00:00