wiki:PostGIS_Raster_SoC_Idea_2012/Distance_Analysis_Tools/test

Version 6 (modified by qliu, 12 years ago) ( diff )

--

Test 0:

CREATE TABLE test_source_raster_0 AS SELECT 1 AS rid,rast FROM (SELECT ST_MakeEmptyRaster(10,10,0,0,1,1,0,0,4326) AS rast)foo; CREATE TABLE test_source_geometry_0 AS SELECT generate_series(1,10) AS id,ST_RandomPoints(the_geom,10) AS the_geom FROM (SELECT ST_SetSRID(ST_Extent(rast::geometry),4326) AS the_geom FROM test_source_raster_0)foo; CREATE TABLE test_ref_raster_0 AS SELECT 1 AS rid,rast FROM (SELECT ST_MakeEmptyRaster(10,10,0,0,1,1,0,0,4326) AS rast)foo;

0-a: Test NULL Raster. Should be true. SELECT ST_EuclideanDistance(NULL,NULL,'public','test_source_geometry_0','the_geom',False) IS NULL FROM test_ref_raster_0;

0-b: Test Empty Raster. Should be true. SELECT ST_IsEmpty(ST_EuclideanDistance(0,10,0,0,1,1,0,0,4326,-999,'32BF','public','test_source_geometry_0','the_geom',False));

Test 1: Small number of sources vs low resolution raster: (Source: 10 points, Raster: 10x10)

1-a: Source geometry within the extent of the desired raster: CREATE TABLE test_source_raster_1 AS SELECT 1 AS rid,rast FROM (SELECT ST_MakeEmptyRaster(10,10,0,0,1,1,0,0,4326) AS rast)foo; CREATE TABLE test_source_geometry_1 AS SELECT generate_series(1,10) AS id,ST_RandomPoints(the_geom,10) AS the_geom FROM (SELECT ST_SetSRID(ST_Extent(rast::geometry),4326) AS the_geom FROM test_source_raster_1)foo; CREATE TABLE test_ref_raster_1 AS SELECT 1 AS rid,rast FROM (SELECT ST_MakeEmptyRaster(10,10,0,0,1,1,0,0,4326) AS rast)foo;

1-a-i: Generate Euclidean Distance from a one-band reference raster

1-a-i-1: Snap is True; Max distance NOT specified:

CREATE TABLE test_eudist_1_a_i_1 AS (SELECT 1 AS rid,ST_EuclideanDistance(rast,'32BF','public','test_source_geometry_1','the_geom',True) AS rast FROM test_ref_raster_1);
result:































-- Test 2: Small number of sources vs high resolution raster:(Source: 10 points, Raster: 300x300)


































-- Test 3: Large number of sources vs low resolution raster:(Source: 1000 points, Raster: 300x300)


































-- Test 4: Large number of sources vs high resolution raster:(Source: 1000 points, Raster: 1000x1000)


































-- Test 5: Scalability test:






-- Test 6: Performance test:




















Attachments (28)

Note: See TracWiki for help on using the wiki.