Skip to main content

containsProperly

Returns true if geometry b lies in the interior of geometry a.

Geometry a contains geometry b properly if all points of b are in the interior of a.

info

This function needs the geometry a to be prepared.
If geometry a is not prepared this function will prepare it.

warning

Do not use this function with invalid geometries. You will get unexpected results.

Parameters

NameTypeDescription
aGeometry | Prepared<Geometry>First geometry
bGeometrySecond geometry

Returns

boolean

true if geometry a contains geometry b properly

Throws

  • GEOSError on unsupported geometry types (curved)

See also

  • contains more inclusive containsProperly
  • covers more inclusive contains
  • prepare improves performance of repeated calls against a single geometry

Examples

differences with 'contains'
above example, but adjusted to 'containsProperly'