polygon_sub

ReQL command: polygon_sub

Command syntax

polygon1.polygon_sub(polygon2) → polygon

Description

Use polygon2 to “punch out” a hole in polygon1. polygon2 must be completely contained within polygon1 and must have no holes itself (it must not be the output of polygon_sub itself).

Example: Define a polygon with a hole punched in it.

outer_polygon = r.polygon(
    [-122.4, 37.7],
    [-122.4, 37.3],
    [-121.8, 37.3],
    [-121.8, 37.7]
)
inner_polygon = r.polygon(
    [-122.3, 37.4],
    [-122.3, 37.6],
    [-122.0, 37.6],
    [-122.0, 37.4]
)
outer_polygon.polygon_sub(inner_polygon).run(conn)

Related commands

Get more help

Couldn't find what you were looking for?

© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/python/polygon_sub/

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部