Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WKT: how do you define Polygons with 3 rings (==2 holes)?

Tags:

polygon

wkt

I found in here this document. I read it but I keep wondering how to define a Polygon with 3 rings in WKT?

like image 776
Rella Avatar asked Nov 15 '11 16:11

Rella


People also ask

What format is a wkt in?

Well-Known Text (WKT) is an ASCII representation of a spatial object.

What is wkt in DBMS?

Well-known text (WKT) is a text markup language for representing vector geometry objects on a map, spatial reference systems of spatial objects and transformations between spatial reference systems.

What is wkt map?

Well Known Text (WKT) is an Open Geospatial Consortium (OGC) standard that is used to represent spatial data in a textual format. Most OGC-compliant systems support Well Known Text.

What are polygon rings?

A polygon consists of one or more rings. A ring is a connected sequence of four or more points that form a closed, non-self-intersecting loop. A polygon may contain multiple outer rings. The order of vertices or orientation for a ring indicates which side of the ring is the interior of the polygon.


1 Answers

You can use either the POLYGON or the MULTIPOLYGON type, but make sure the outer container ring is listed first followed by the inner hole rings. The orientations of the inner rings are not important since holes are explicit in the syntax.

X & Y are space separated, coordinates are comma separated, and ring extents are limited by parentheses and separated by commas. Polygons (outer ring plus any inner rings) are also limited by parentheses.

Finally, inner rings cannot cross each other, nor can they cross the outer ring.

Examples:
POLYGON ((10 10, 110 10, 110 110, 10 110), (20 20, 20 30, 30 30, 30 20), (40 20, 40 30, 50 30, 50 20))
MULTIPOLYGON (((10 10, 110 10, 110 110, 10 110), (20 20, 20 30, 30 30, 30 20), (40 20, 40 30, 50 30, 50 20)))

like image 153
Angus Johnson Avatar answered Sep 28 '22 21:09

Angus Johnson