Database Reference
In-Depth Information
gid | name | st_isvalidreason
----+--------+--------------------------------------------
24 | Canada | Ring
Self-intersection[-53.756367
48.5032620000001]
33 | Chile | Ring
Self-intersection[-70.917236 -54.708618]
155 | Norway | Ring
Self-intersection[5.33694400000002
61.592773]
175 | Russia | Ring
Self-intersection[143.661926 49.31221]
(4 rows)
2. Now, concentrate on just one of the invalid geometries, for example, in the
multipolygon geometry representing Russia. Create a table containing just
the ring generating the invalidity by selecting the table using the point co-
ordinates given in the ST_IsValidReason response in the previous step:
postgis_cookbook=# SELECT * INTO
chp03.invalid_geometriesFROM (
SELECT 'broken'::varchar(10) as
status,ST_GeometryN(the_geom,
generate_series(1,
ST_NRings(the_geom)))::geometry(Polygon,4326)
as the_geomFROM chp03.countries
WHERE name = 'Russia') AS foo
WHERE ST_Intersects(the_geom,
ST_SetSRID(ST_Point(143.661926,49.31221),
4326));
Search WWH ::




Custom Search