File: bestsrid.sql

package info (click to toggle)
postgis 3.5.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 70,052 kB
  • sloc: ansic: 162,204; sql: 93,950; xml: 53,121; cpp: 12,646; perl: 5,658; sh: 5,369; makefile: 3,434; python: 1,205; yacc: 447; lex: 151; pascal: 58
file content (31 lines) | stat: -rw-r--r-- 1,128 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- South lambert
select x, y, _ST_BestSRID(ST_Point(x, y))
from ( select 0 as x, -70 as y ) as foo ;

-- North lambert
select x, y, _ST_BestSRID(ST_Point(x, y))
from ( select 0 as x, 70 as y ) as foo ;

-- UTM north
select x, 60, _ST_BestSRID(ST_Point(x, 60))
from generate_series(-177, 177, 6) as x ;
-- Corner cases
select -180, 60, _ST_BestSRID(ST_Point(-180, 60));
select 180, 60, _ST_BestSRID(ST_Point(180, 60));

-- UTM south
select x, -60, _ST_BestSRID(ST_Point(x, -60))
from generate_series(-177, 177, 6) as x;
-- Corner cases
select -180, -60, _ST_BestSRID(ST_Point(-180, -60));
select 180, -60, _ST_BestSRID(ST_Point(180, -60));

-- World mercator
select 'world', _ST_BestSRID(ST_Point(-160, -40), ST_Point(160, 40));

-- infinite coords
SELECT _ST_BestSRID(ST_Point('-infinity', 'infinity'));

SELECT '#5347', ST_Intersection('0102000020E610000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geography,
                       '0101000020E6100000000000000000F07F000000000000F07F'::geography);