#1531 closed defect (wontfix)
[raster] raster2pgsql loader aborts
Reported by: | andreasft | Owned by: | Bborie Park |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.0 |
Component: | raster | Version: | master |
Keywords: | raster2pgsql loader | Cc: |
Description
raster2pgsql loader aborts processing for some rasters returning error: raster2pgsql: rt_api.c:4281: rt_raster_set_srid: Assertion `((void *)0) != raster' failed.
No pattern in which type of raster formats that crashes the loader.
Tried two different ArcInfo Binary Grid Format. One works fine, the other crashes the import.
Crashes http://bioval.jrc.ec.europa.eu/products/gam/download/access_50k.zip (200mb)
Works fine http://sedac.ciesin.columbia.edu/gpw/global.jsp?file=gpwv3&data=pcount&type=wrk&resolut=half&year=90&version=gpw-v3 (461 kb)
Loader syntax crashing raster: raster2pgsql -s 4326 -I w001001.adf access > home/andreas/access.sql Processing 1/1: /mnt/pc258/prio_grid/source/access/access_50k/acc_50k/w001001.adf Warning 6: A dataset opened by GDALOpenShared should have the same filename (/mnt/pc258/prio_grid/source/access/access_50k/acc_50k/w001001.adf) and description (/mnt/pc258/prio_grid/source/access/access_50k/acc_50k) raster2pgsql: rt_api.c:4281: rt_raster_set_srid: Assertion `((void *)0) != raster' failed. Aborted
Loader syntax working raster: raster2pgsql -s 4326 -I /w001001.adf poptest > /home/andreas/poptest1.sql Processing 1/1: /mnt/pc258/prio_grid/source/gpw/lrc30p90/glp90ag30/w001001.adf Warning 6: A dataset opened by GDALOpenShared should have the same filename (/mnt/pc258/prio_grid/source/gpw/lrc30p90/glp90ag30/w001001.adf) and description (/mnt/pc258/prio_grid/source/gpw/lrc30p90/glp90ag30)
Change History (6)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Summary: | raster2pgsql loader aborts → [raster] raster2pgsql loader aborts |
comment:3 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
I just tested the access_50k.zip and when run using the following command causes an abort:
raster2pgsql -s 4326 -I acc_50k access > access.sql
The following command does work due to the addition of the tiling flag:
raster2pgsql -t 50x50 -s 4326 -I acc_50k access > access.sql
From the looks of the raster, it has 43200x21600 pixels of datatype Int32. The loader attempts to allocate ~3732480000 bytes for the band and fails.
The loader uses PostGIS raster's C API for handling the conversion from GDAL to raster hex. I could replace the use of the API with a stream processor but I don't know if it is worth the effort. Everything in PostGIS raster is performed in memory with no disk access (for temp files) but it may need to be considered if users are trying to load large rasters without tiling.
It is strongly encouraged to tile your rasters as it does increase the performance of any queries run against the rasters.
comment:4 by , 13 years ago
Would still be nice to get an "Out of memory" message rather than aborting. Would reduce user frustration.
comment:5 by , 13 years ago
Hooked the loader into rterror, rtwarn and rtinfo functions so that messages from the C API are emitted properly in r9012
comment:6 by , 9 years ago
It seems that the original dataset ( http://bioval.jrc.ec.europa.eu/products/gam/download/access_50k.zip ) has all but disappeared from the net.
Information about each file from gdal_info:
Driver: AIG/Arc/Info Binary Grid Files: c:\prio_grid\source\gpw\lrc30p90\glp90ag30
Size is 720, 286 Coordinate System is: GEOGCS["WGS 84",
Origin = (-180.000000000000000,85.000000000114397) Pixel Size = (0.500000000000400,-0.500000000000400) Corner Coordinates: Upper Left (-180.0000000, 85.0000000) Lower Left (-180.0000000, -58.0000000) Upper Right ( 180.0000000, 85.0000000) Lower Right ( 180.0000000, -58.0000000) Center ( 0.0000000, 13.5000000) Band 1 Block=360x4 Type=Float32, ColorInterp=Undefined
Driver: AIG/Arc/Info Binary Grid Files: c:\prio_grid\source\Access\access_50k\acc_50k
Size is 43200, 21600 Coordinate System is: GEOGCS["WGS 84",
Origin = (-180.000000000000000,89.999999999280021) Pixel Size = (0.008333333333300,-0.008333333333300) Corner Coordinates: Upper Left (-180.0000000, 90.0000000) Lower Left (-180.0000000, -90.0000000) Upper Right ( 180.0000000, 90.0000000) Lower Right ( 180.0000000, -90.0000000) Center ( -0.0000000, -0.0000000) Band 1 Block=256x4 Type=Int32, ColorInterp=Undefined
5, 85x43