Ticket #410: ST_SetPoint_AND_BB.txt

File ST_SetPoint_AND_BB.txt, 1.8 KB (added by sdikiy, 2 years ago)
Line 
1GIS_TEST=# SELECT PostGIS_Full_Version();
2                                postgis_full_version
3-------------------------------------------------------------------------------------
4 POSTGIS="1.4.0" GEOS="3.1.1-CAPI-1.6.0" PROJ="Rel. 4.6.1, 21 August 2008" USE_STATS
5(1 row)
6
7
8GIS_TEST=# SELECT DropGeometryColumn( 'foo', 'the_geom');
9            dropgeometrycolumn
10------------------------------------------
11 public.foo.the_geom effectively removed.
12(1 row)
13
14
15GIS_TEST=# DROP TABLE foo;
16DROP TABLE
17GIS_TEST=# CREATE TABLE foo ()WITH (OIDS = TRUE);
18CREATE TABLE
19GIS_TEST=# SELECT AddGeometryColumn( 'foo', 'the_geom', -1, 'LINESTRING', 2);
20                  addgeometrycolumn
21-----------------------------------------------------
22 public.foo.the_geom SRID:-1 TYPE:LINESTRING DIMS:2
23(1 row)
24
25
26GIS_TEST=# INSERT INTO foo(the_geom) VALUES (ST_GeomFromText('LINESTRING(0 0, 1 3)'));
27INSERT 1206561 1
28GIS_TEST=#
29GIS_TEST=# select the_geom=ST_SetPoint(the_geom, 0, 'POINT(100000 200000)') from foo;
30 ?column?
31----------
32 t
33(1 row)
34
35
36GIS_TEST=# select the_geom=ST_Translate(ST_SetPoint(the_geom, 0, 'POINT(100000 200000)'), 0, 0) from foo;
37 ?column?
38----------
39 f
40(1 row)
41
42
43GIS_TEST=#
44GIS_TEST=# select st_astext(the_geom), st_astext(ST_Envelope(ST_SetPoint(the_geom, 0, 'POINT(100000 200000)'))) from foo;
45      st_astext      |           st_astext
46---------------------+--------------------------------
47 LINESTRING(0 0,1 3) | POLYGON((0 0,0 3,1 3,1 0,0 0))
48(1 row)
49
50
51GIS_TEST=# select st_astext(the_geom), st_astext(ST_Envelope(ST_Translate(ST_SetPoint(the_geom, 0, 'POINT(100000 200000)'), 0, 0))) from foo;
52      st_astext      |                     st_astext
53---------------------+----------------------------------------------------
54 LINESTRING(0 0,1 3) | POLYGON((1 3,1 200000,100000 200000,100000 3,1 3))
55(1 row)
56
57
58GIS_TEST=#