line.fill() → polygon
Convert a Line object into a Polygon object. If the last point does not specify the same coordinates as the first point, polygon will close the polygon by connecting them.
Longitude (β180 to 180) and latitude (β90 to 90) of vertices are plotted on a perfect sphere. See Geospatial support for more information on ReQLβs coordinate system.
If the last point does not specify the same coordinates as the first point, polygon will close the polygon by connecting them. You cannot directly construct a polygon with holes in it using polygon, but you can use polygonSub to use a second polygon within the interior of the first to define a hole.
Example: Create a line object and then convert it to a polygon.
r.table("geo").insert(
r.hashMap("id", 201)
.with("rectangle", r.line(
r.array(-122.423246,37.779388),
r.array(-122.423246,37.329898),
r.array(-121.886420,37.329898),
r.array(-121.886420,37.779388)))
).run(conn);
r.table("geo").get(201).update(
r.hashMap("rectangle", row -> row.g("rectangle").fill())
).optArg("non_atomic", true).run(conn);
Couldn't find what you were looking for?
Contribute: edit this page or open an issue