jxie@leeonsoft.com (12) [Avatar] Offline
#1
SQL in Listing 5.3 just creates a rectangle polygon that is not one depicted in Figure 5.4.

Listing 5.8 should use ST_Crosses.

Jim
regina.leo (265) [Avatar] Offline
#2
Re: Listing 5.3 doesn't create a house with a hole as depicted in Figure 5.4
Jim,

Thanks for the catch. We have corrected so should show in our next release.

The listing 5.3 should have looked more like the below. We had originally started of with a square and then decided it looked too boring. I guess we forgot to replace the code.

CREATE TABLE example_set(ex_name varchar(150) PRIMARY KEY,
the_geom geometry);
INSERT INTO example_set(ex_name, the_geom)
VALUES
('A polygon with hole', ST_GeomFromText('POLYGON ((110 180, 110 335, 184 316, 260 335, 260 180, 209 212.51, 110 180),
(160 280, 200 240, 220 280, 160 280))') ),
('A point',ST_GeomFromText('POINT(110 245)')) ,
('A linestring',ST_GeomFromText('LINESTRING(110 245,200 260, 227 309)')) ,
('A multipoint',ST_GeomFromText('MULTIPOINT(110 245,200 260)')) ;