Show
Ignore:
Timestamp:
06/04/07 16:06:28 (5 years ago)
Author:
mleslie
Message:

Added versions of functions with standard ST (Spatial Type) prefixes to any functions that were lacking them. Updated the regression tests to include the new functions.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/regress/measures.sql

    r2367 r2616  
    1  
    21select '113', area2d('MULTIPOLYGON( ((0 0, 10 0, 10 10, 0 10, 0 0)),( (0 0, 10 0, 10 10, 0 10, 0 0),(5 5, 7 5, 7 7 , 5 7, 5 5) ) ,( (0 0, 10 0, 10 10, 0 10, 0 0),(5 5, 7 5, 7 7, 5 7, 5 5),(1 1,2 1, 2 2, 1 2, 1 1) ) )'::GEOMETRY) as value; 
    32 
     
    1615select '136', distance('POINT(0 0)', translate('POINT(0 0)', 5, 12, 0)); 
    1716 
    18  
    1917-- postgis-users/2006-May/012174.html 
    20 select 'dist', distance(a,b), distance(b,a) from ( 
     18select 'dist', distance(a,b), ST_distance(b,a) from ( 
    2119        select 'POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))'::geometry as a, 
    2220                'POLYGON((11 0, 11 10, 20 10, 20 0, 11 0), 
     
    2422        ) as foo; 
    2523 
     24-- Apply the same tests using the new function names. 
     25select '113', ST_area2d('MULTIPOLYGON( ((0 0, 10 0, 10 10, 0 10, 0 0)),( (0 0, 10 0, 10 10, 0 10, 0 0),(5 5, 7 5, 7 7 , 5 7, 5 5) ) ,( (0 0, 10 0, 10 10, 0 10, 0 0),(5 5, 7 5, 7 7, 5 7, 5 5),(1 1,2 1, 2 2, 1 2, 1 1) ) )'::GEOMETRY) as value; 
     26 
     27select '114', ST_perimeter2d('MULTIPOLYGON( ((0 0, 10 0, 10 10, 0 10, 0 0)),( (0 0, 10 0, 10 10, 0 10, 0 0),(5 5, 7 5, 7 7 , 5 7, 5 5) ) ,( (0 0, 10 0, 10 10, 0 10, 0 0),(5 5, 7 5, 7 7, 5 7, 5 5),(1 1,2 1, 2 2, 1 2, 1 1) ) )'::GEOMETRY) as value; 
     28 
     29select '115', ST_perimeter3d('MULTIPOLYGON( ((0 0 0, 10 0 0, 10 10 0, 0 10 0, 0 0 0)),( (0 0 0, 10 0 0, 10 10 0, 0 10 0, 0 0 0),(5 5 0, 7 5 0, 7 7  0, 5 7 0, 5 5 0) ) ,( (0 0 1, 10 0 1, 10 10 1, 0 10 1, 0 0 1),(5 5 1, 7 5 1, 7 7 1, 5 7 1, 5 5 1),(1 1 1,2 1 1, 2 2 1, 1 2 1, 1 1 1) ) )'::GEOMETRY) as value; 
     30 
     31 
     32select '116', ST_length2d('MULTILINESTRING((0 0, 1 1),(0 0, 1 1, 2 2) )'::GEOMETRY) as value; 
     33select '117', ST_length3d('MULTILINESTRING((0 0, 1 1),(0 0, 1 1, 2 2) )'::GEOMETRY) as value; 
     34select '118', ST_length3d('MULTILINESTRING((0 0 0, 1 1 1),(0 0 0, 1 1 1, 2 2 2) )'::GEOMETRY) as value; 
     35 
     36select '134', ST_distance('POINT(1 2)', 'POINT(1 2)'); 
     37select '135', ST_distance('POINT(5 0)', 'POINT(10 12)'); 
     38 
     39select '136', ST_distance('POINT(0 0)', ST_translate('POINT(0 0)', 5, 12, 0)); 
     40 
     41 
     42-- postgis-users/2006-May/012174.html 
     43select 'dist', ST_distance(a,b), ST_distance(b,a) from ( 
     44        select 'POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))'::geometry as a, 
     45                'POLYGON((11 0, 11 10, 20 10, 20 0, 11 0), 
     46                        (15 5, 15 8, 17 8, 17 5, 15 5))'::geometry as b 
     47        ) as foo; 
     48