Learn R Programming

spatstat.geom (version 3.7-3)

Geometrical Functionality of the 'spatstat' Family

Description

Defines spatial data types and supports geometrical operations on them. Data types include point patterns, windows (domains), pixel images, line segment patterns, tessellations and hyperframes. Capabilities include creation and manipulation of data (using command line or graphical interaction), plotting, geometrical operations (rotation, shift, rescale, affine transformation), convex hull, discretisation and pixellation, Dirichlet tessellation, Delaunay triangulation, pairwise distances, nearest-neighbour distances, distance transform, morphological operations (erosion, dilation, closing, opening), quadrat counting, geometrical measurement, geometrical covariance, colour maps, calculus on spatial domains, Gaussian blur, level sets of images, transects of images, intersections between objects, minimum distance matching. (Excludes spatial data on a network, which are supported by the package 'spatstat.linnet'.)

Copy Link

Version

Install

install.packages('spatstat.geom')

Monthly Downloads

74,422

Version

3.7-3

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

March 23rd, 2026

Functions in spatstat.geom (3.7-3)

Extract.anylist

Extract or Replace Subset of a List of Things
Extract.solist

Extract or Replace Subset of a List of Spatial Objects
NAobject

Make an NA Object
FeretBox

Feret Box Enclosing a Domain
Extract.splitppp

Extract or Replace Sub-Patterns
FeretDiamFun

Feret Diameter as a Function of Direction
Extract.tess

Extract or Replace Subset of Tessellation
Math.imlist

S3 Group Generic methods for List of Images
MinkowskiSum

Minkowski Sum of Windows
Math.im

S3 Group Generic methods for images
Window

Extract or Change the Window of a Spatial Object
affine.psp

Apply Affine Transformation To Line Segment Pattern
SupportFun

Support Function
Replace.im

Reset Values in Subset of Image
Window.tess

Extract Window of Spatial Object
as.box3

Convert Data to Three-Dimensional Box
area.owin

Area of a Window
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
affine.tess

Apply Geometrical Transformation To Tessellation
areaLoss

Difference of Disc Areas
angles.psp

Orientation Angles of Line Segments
as.data.frame.owin

Convert Window to Data Frame
as.boxx

Convert Data to Multi-Dimensional Box
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
areaGain

Difference of Disc Areas
as.function.owin

Convert Window to Indicator Function
as.data.frame.tess

Convert Tessellation to Data Frame
as.data.frame.hyperframe

Coerce Hyperframe to Data Frame
as.colourmap

Convert to Colour Map
as.owin

Convert Data To Class owin
as.function.tess

Convert a Tessellation to a Function
as.mask

Pixel Image Approximation of a Window
as.im

Convert to Pixel Image
as.polygonal

Convert a Window to a Polygonal Window
bdist.points

Distance to Boundary of Window
beachcolours

Create Colour Scheme for a Range of Numbers
as.ppp

Convert Data To Class ppp
as.psp

Convert Data To Class psp
as.rectangle

Window Frame
boxx

Multi-Dimensional Box
boundingcircle

Smallest Enclosing Circle
bufftess

Buffer Distance Tessellation
by.im

Apply Function to Image Broken Down by Factor
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
by.ppp

Apply a Function to a Point Pattern Broken Down by Factor
centroid.owin

Centroid of a window
clickppp

Interactively Add Points
closing

Morphological Closing
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
clip.infline

Intersect Infinite Straight Lines with a Window
clickbox

Interactively Define a Rectangle
closepairs

Close Pairs of Points
clickdist

Interactively Measure Distance
closepairs.pp3

Close Pairs of Points in 3 Dimensions
closetriples

Close Triples of Points
concatxy

Concatenate x,y Coordinate Vectors
colourmap

Colour Lookup Tables
compatible

Test Whether Objects Are Compatible
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
compatible.im

Test Whether Pixel Images Are Compatible
connected

Connected components
connected.tess

Connected Components of Tiles of a Tessellation
contour.imlist

Array of Contour Plots
contour.im

Contour plot of pixel image
convexhull.xy

Convex Hull of Points
coords

Extract or Change Coordinates of a Spatial or Spatiotemporal Point Pattern
convexhull

Convex Hull
convolve.im

Convolution of Pixel Images
convexmetric

Distance Metric Defined by Convex Set
convexify

Weil's Convexifying Operation
cut.ppp

Classify Points in a Point Pattern
covering

Cover Region with Discs
cut.im

Convert Pixel Image from Numeric to Factor
crossdist.default

Pairwise distances between two different sets of points
crossdist

Pairwise distances
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
crossing.psp

Crossing Points of Two Line Segment Patterns
diameter

Diameter of an Object
delaunay

Delaunay Triangulation of Point Pattern
default.symbolmap

Default Symbol Map for Plotting a Spatial Pattern
delaunayDistance

Distance on Delaunay Triangulation
default.image.colours

Default Colours for Images in Spatstat
default.dummy

Generate a Default Pattern of Dummy Points
deltametric

Delta Metric
dilation

Morphological Dilation
dilated.areas

Areas of Morphological Dilations
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
disc

Circular Window
discpartarea

Area of Part of Disc
distmap

Distance Map
distmap.owin

Distance Map of Window
domain

Extract the Domain of any Spatial Object
distfun

Distance Map as a Function
discretise

Safely Convert Point Pattern Window to Binary Mask
edges2triangles

List Triangles in a Graph
eroded.areas

Areas of Morphological Erosions
erosionAny

Morphological Erosion of Windows
endpoints.psp

Endpoints of Line Segment Pattern
ellipse

Elliptical Window.
erosion

Morphological Erosion by a Disc
edit.ppp

Invoke Text Editor on Spatial Data
fillholes.owin

Remove Small Holes in a Window
fourierbasis

Fourier Basis Functions
funxy

Spatial Function Class
fardist

Farthest Distance to Boundary of Window
flipxy

Exchange X and Y Coordinates
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
harmonise.owin

Make Windows Compatible
harmoniseLevels

Harmonise the levels of several factors, or factor-valued pixel images.
headtail

First or Last Part of a Spatial Pattern
hist.funxy

Histogram of Values of a Spatial Function
hist.im

Histogram of Pixel Values in an Image
has.close

Check Whether Points Have Close Neighbours
hextess

Hexagonal Grid or Tessellation
harmonise

Make Objects Compatible
identify.ppp

Identify Points in a Point Pattern
imcov

Spatial Covariance of a Pixel Image
hyperframe

Hyper Data Frame
incircle

Find Largest Circle Inside Window
interp.colourmap

Interpolate smoothly between specified colours
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
integral.tessfun

Integrate a Function Which is Constant on Each Tile of a Tessellation
intensity.ppp

Empirical Intensity of Point Pattern
integral.im

Integral of a Pixel Image
invoke.symbolmap

Plot Data Using Graphics Symbol Map
is.connected.ppp

Determine Whether a Point Pattern is Connected
interp.im

Interpolate a Pixel Image
is.boxx

Recognise a Multi-Dimensional Box
is.connected

Determine Whether an Object is Connected
is.im

Test Whether An Object Is A Pixel Image
is.lpp

Test Whether An Object Is A Point Pattern on a Linear Network
is.linim

Test Whether an Object is a Pixel Image on a Linear Network
is.marked

Test Whether Marks Are Present
is.multitype.ppp

Test Whether A Point Pattern is Multitype
is.multitype

Test whether Object is Multitype
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
is.ppp

Test Whether An Object Is A Point Pattern
is.owin

Test Whether An Object Is A Window
layered

Create List of Plotting Layers
is.subset.owin

Determine Whether One Window is Contained In Another
lengths_psp

Lengths of Line Segments
is.rectangle

Determine Type of Window
mean.im

Mean and Median of Pixel Values in an Image
levelset

Level Set of a Pixel Image
marks.psp

Marks of a Line Segment Pattern
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
levelset.distfun

Level Set of a Distance Function
matchingdist

Distance for a Point Pattern Matching
mergeTiles

Merge Groups of Tiles in a Tessellation
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
methods.unitname

Methods for Units
methods.distfun

Geometrical Operations for Distance Functions
methods.layered

Methods for Layered Objects
mergeLevels

Merge Levels of a Factor
nearestsegment

Find Line Segment Nearest to Each Point
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
nearest.raster.point

Find Pixel Nearest to a Given Point
nestsplit

Nested Split
nncross

Nearest Neighbours Between Two Patterns
nnwhich.ppx

Nearest Neighbours in Any Dimensions
nnmark

Mark of Nearest Neighbour
nnwhich

Nearest neighbour
nnfun

Nearest Neighbour Index Map as a Function
nndist

Nearest neighbour distances
owin2mask

Convert Window to Binary Mask under Constraints
overlap.owin

Compute Area of Overlap
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
nsegments

Number of Line Segments in a Line Segment Pattern
pairdist.ppp

Pairwise distances
padimage

Pad the Border of a Pixel Image
pairdist.psp

Pairwise distances between line segments
periodify

Make Periodic Copies of a Spatial Pattern
pairdist.pp3

Pairwise distances in Three Dimensions
pixellate.ppp

Convert Point Pattern to Pixel Image
pixellate.owin

Convert Window to Pixel Image
pixellate.psp

Convert Line Segment Pattern to Pixel Image
plot.colourmap

Plot a Colour Map
pixellate

Convert Spatial Object to Pixel Image
plot.anylist

Plot a List of Things
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
pixelquad

Quadrature Scheme Based on Pixel Grid
plot.pp3

Plot a Three-Dimensional Point Pattern
plot.ppp

plot a Spatial Point Pattern
plot.hyperframe

Plot Entries in a Hyperframe
plot.imlist

Plot a List of Images
plot.yardstick

Plot a Yardstick or Scale Bar
plot.quad

Plot a Spatial Quadrature Scheme
plot.splitppp

Plot a List of Point Patterns
plot.symbolmap

Plot a Graphics Symbol Map
plot.solist

Plot a List of Spatial Objects
pppmatching.object

Class of Point Matchings
ppp.object

Class of Point Patterns
polarbody

Polar Body and Voronoi Flower
pointsOnLines

Place Points Evenly Along Specified Lines
pppdist

Distance Between Two Point Patterns
pppmatching

Create a Point Matching
project2segment

Move Point To Nearest Line
print.quad

Print a Quadrature Scheme
print.ppp

Print Brief Details of a Point Pattern Dataset
progressreport

Print Progress Reports
psp.object

Class of Line Segment Patterns
psp

Create a Line Segment Pattern
project2set

Find Nearest Point in a Region
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
quadscheme

Generate a Quadrature Scheme from a Point Pattern
quad.object

Class of Quadrature Schemes
quadratcount

Quadrat counting for a point pattern
quadrats

Divide Region into Quadrats
rectdistmap

Distance Map Using Rectangular Distance Metric
requireversion

Require a Specific Version of a Package
regularpolygon

Create A Regular Polygon
relevel.im

Reorder Levels of a Factor-Valued Image or Pattern
rescale.im

Convert Pixel Image to Another Unit of Length
rescale

Convert dataset to another unit of length
raster.x

Cartesian Coordinates for a Pixel Raster
reflect

Reflect In Origin
rQuasi

Generate Quasirandom Point Pattern in Given Window
rjitter

Random Perturbation of a Point Pattern
rlinegrid

Generate grid of parallel lines with random displacement
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
rev.colourmap

Reverse the Colours in a Colour Map
rescale.ppp

Convert Point Pattern to Another Unit of Length
rexplode

Explode a Point Pattern by Displacing Duplicated Points
ripras

Estimate window from points alone
rotate

Rotate
rotate.owin

Rotate a Window
run.simplepanel

Run Point-and-Click Interface
rsyst

Simulate systematic random point pattern
rotate.psp

Rotate a Line Segment Pattern
rounding.ppp

Detect Numerical Rounding
scalardilate

Apply Scalar Dilation
shift.im

Apply Vector Translation To Pixel Image
selfcut.psp

Cut Line Segments Where They Intersect
shift

Apply Vector Translation
selfcrossing.psp

Crossing Points in a Line Segment Pattern
shift.ppp

Apply Vector Translation To Point Pattern
simplify.owin

Approximate a Window by a Simpler Polygon
solutionset

Evaluate Logical Expression Involving Pixel Images and Return Region Where Expression is True
shift.psp

Apply Vector Translation To Line Segment Pattern
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
shift.ppx

Apply Vector Translation To Box Or Point Pattern In Arbitrary Dimension
solist

List of Two-Dimensional Spatial Objects
shift.owin

Apply Vector Translation To Window
spatdim

Spatial Dimension of a Dataset
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
spatstat.geom-deprecated

Deprecated spatstat.geom functions
split.ppp

Divide Point Pattern into Sub-patterns
summary.owin

Summary of a Spatial Window
summary.distfun

Summarizing a Function of Spatial Location
stratrand

Stratified random point pattern
square

Square Window
summary.im

Summarizing a Pixel Image
summary.anylist

Summary of a List of Things
subset.ppp

Subset of Point Pattern Satisfying A Condition
tess

Create a Tessellation
summary.solist

Summary of a List of Spatial Objects
summary.quad

Summarizing a Quadrature Scheme
summary.psp

Summary of a Line Segment Pattern Dataset
summary.ppp

Summary of a Point Pattern Dataset
summary.splitppp

Summary of a Split Point Pattern
test.crossing.psp

Check Whether Segments Cross
text.ppp

Add Text Labels to Spatial Pattern
superimpose

Superimpose Several Geometric Patterns
timeTaken

Extract the Total Computation Time
tile.centroids

Compute Centroids of Tiles in a Tessellation
tile.areas

Compute Areas of Tiles in a Tessellation
textureplot

Plot Image or Tessellation Using Texture Fill
texturemap

Texture Map
tileindex

Determine Which Tile Contains Each Given Point
tiles

Extract List of Tiles in a Tessellation
tweak.colourmap

Change Colour Values in a Colour Map
triangulate.owin

Decompose Window into Triangles
unique.ppp

Extract Unique Points from a Spatial Point Pattern
unitname

Name for Unit of Length
uniquemap.ppp

Map Duplicate Entries to Unique Entries
transmat

Convert Pixel Array Between Different Conventions
unstack.solist

Unstack Each Spatial Object in a List of Objects
venn.tess

Tessellation Delimited by Several Sets
zapsmall.im

Rounding of Pixel Values
vertices

Vertices of a Window
yardstick

Text, Arrow or Scale Bar in a Diagram
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
update.symbolmap

Update a Graphics Symbol Map.
Extract.ppx

Extract Subset of Multidimensional Point Pattern
Extract.listof

Extract or Replace Subset of a List of Things
Extract.owin

Extract Subset of Window
Extract.psp

Extract Subset of Line Segment Pattern
Extract.quad

Subset of Quadrature Scheme
Extract.ppp

Extract or Replace Subset of Point Pattern
Extract.im

Extract Subset of Image
Extract.layered

Extract or Replace Subset of a Layered Object
Extract.hyperframe

Extract or Replace Subset of Hyperframe
Frame

Extract or Change the Containing Rectangle of a Spatial Object
affine.im

Apply Affine Transformation To Pixel Image
affine.owin

Apply Affine Transformation To Window
add.texture

Fill Plot With Texture
affine

Apply Affine Transformation
affine.ppp

Apply Affine Transformation To Point Pattern
anyNA.im

Check Whether Image Contains NA Values
append.psp

Combine Two Line Segment Patterns
anylist

List of Objects
as.data.frame.psp

Coerce Line Segment Pattern to a Data Frame
as.function.im

Convert Pixel Image to Function of Coordinates
as.data.frame.im

Convert Pixel Image to Data Frame
as.matrix.owin

Convert Pixel Image to Matrix
as.hyperframe

Convert Data to Hyperframe
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
as.matrix.im

Convert Pixel Image to Matrix or Array
as.layered

Convert Data To Layered Object
as.tess

Convert Data To Tessellation
bdist.tiles

Distance to Boundary of Window
as.solist

Convert List of Two-Dimensional Spatial Objects
border

Border Region of a Window
bdist.pixels

Distance to Boundary of Window
bounding.box.xy

Convex Hull of Points
boundingbox

Bounding Box of a Window, Image, or Point Pattern
box3

Three-Dimensional Box
clickpoly

Interactively Define a Polygon
colourtools

Convert and Compare Colours in Different Formats
complement.owin

Take Complement of a Window
colouroutputs

Extract or Assign Colour Values in a Colour Map
connected.ppp

Connected Components of a Point Pattern
corners

Corners of a rectangle
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
crossdist.psp

Pairwise distances between two different line segment patterns
crossdist.ppp

Pairwise distances between two different point patterns
diameter.box3

Geometrical Calculations for Three-Dimensional Box
default.colourmap

Default Colour Map for Plotting a Spatial Pattern
default.symbolmap.ppp

Default Symbol Map for Point Pattern
diameter.owin

Diameter of a Window
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
dirichlet

Dirichlet Tessellation of Point Pattern
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
distmap.ppp

Distance Map of Point Pattern
discs

Union of Discs
edges

Extract Boundary Edges of a Window.
distmap.psp

Distance Map of Line Segment Pattern
edit.hyperframe

Invoke Text Editor on Hyperframe
eval.im

Evaluate Expression Involving Pixel Images
edges2vees

List Dihedral Triples in a Graph
grow.boxx

Add margins to box in any dimension
gridweights

Compute Quadrature Weights Based on Grid Counts
framedist.pixels

Distance to Bounding Frame
gridcentres

Rectangular grid of points
harmonise.im

Make Pixel Images Compatible
grow.rectangle

Add margins to rectangle
im

Create a Pixel Image Object
im.object

Class of Images
identify.psp

Identify Segments in a Line Segment Pattern
identify.tess

Interactively Identify Tiles of a Tessellation
infline

Infinite Straight Lines
im.apply

Apply Function Pixelwise to List of Images
intensity

Intensity of a Dataset or a Model
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
inside.owin

Test Whether Points Are Inside A Window
intensity.psp

Empirical Intensity of Line Segment Pattern
is.NAobject

Recognise NA Objects
invoke.metric

Perform Geometric Task using a Specified Metric
intersect.tess

Intersection of Two Tessellations
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
intersect.owin

Intersection, Union or Set Subtraction of Windows
is.marked.ppp

Test Whether A Point Pattern is Marked
is.linnet

Test Whether An Object Is A Linear Network
is.empty

Test Whether An Object Is Empty
is.convex

Test Whether a Window is Convex
layout.boxes

Generate a Row or Column Arrangement of Rectangles.
is.na.hyperframe

Identify Missing Entries in a Hyperframe
is.na.solist

Identify Missing Entries in a List of Spatial Objects
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
lut

Lookup Tables
marks

Marks of a Point Pattern
marks.tess

Marks of a Tessellation
methods.boxx

Methods for Multi-Dimensional Box
methods.pp3

Methods for three-dimensional point patterns
methods.box3

Methods for Three-Dimensional Box
methods.funxy

Methods for Spatial Functions
nearestValue

Image of Nearest Defined Pixel Value
multiplicity.ppp

Count Multiplicity of Duplicate Points
midpoints.psp

Midpoints of Line Segment Pattern
metric.object

Distance Metric
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
nndist.psp

Nearest neighbour distances between line segments
nnwhich.pp3

Nearest neighbours in three dimensions
nndist.pp3

Nearest neighbour distances in three dimensions
nnmap

K-th Nearest Point Map
opening

Morphological Opening
owin

Create a Window
owin.object

Class owin
nvertices

Count Number of Vertices
pHcolourmap

Colour Map for pH Values
npoints

Number of Points in a Point Pattern
pairdist.default

Pairwise distances
persp.im

Perspective Plot of Pixel Image
pairdist

Pairwise distances
pairdist.ppx

Pairwise Distances in Any Dimensions
perimeter

Perimeter Length of Window
persp.ppp

Perspective Plot of Marked Point Pattern
pixelcentres

Extract Pixel Centres as Point Pattern
plot.listof

Plot a List of Things
plot.layered

Layered Plot
plot.owin

Plot a Spatial Window
plot.pppmatching

Plot a Point Matching
plot.im

Plot a Pixel Image
plot.onearrow

Plot an Arrow
plot.texturemap

Plot a Texture Map
plot.tess

Plot a Tessellation
plot.quadratcount

Plot Quadrat Counts
plot.psp

plot a Spatial Line Segment Pattern
plot.textstring

Plot a Text String
ppx

Multidimensional Space-Time Point Pattern
ppp

Create a Point Pattern
polartess

Tessellation Using Polar Coordinates
pp3

Three Dimensional Point Pattern
print.owin

Print Brief Details of a Spatial Window
print.psp

Print Brief Details of a Line Segment Pattern Dataset
print.im

Print Brief Details of an Image
quantilefun.im

Quantile Function for Images
psp2mask

Convert Line Segment Pattern to Binary Pixel Mask
quantile.im

Sample Quantiles of Pixel Image
quasirandom

Quasirandom Patterns
quantess

Quantile Tessellation
rescale.owin

Convert Window to Another Unit of Length
rescue.rectangle

Convert Window Back To Rectangle
restrict.colourmap

Restrict a Colour Map to a Subset of Values
rgbim

Create Colour-Valued Pixel Image
rotate.ppp

Rotate a Point Pattern
rotate.im

Rotate a Pixel Image
round.ppp

Apply Numerical Rounding to Spatial Coordinates
rotate.infline

Rotate or Shift Infinite Lines
runifrect

Generate N Uniform Random Points in a Rectangle
setcov

Set Covariance of a Window
sessionLibs

Print Names and Version Numbers of Libraries Loaded
scanpp

Read Point Pattern From Data File
scaletointerval

Rescale Data to Lie Between Specified Limits
simplepanel

Simple Point-and-Click Interface Panels
solapply

Apply a Function Over a List and Obtain a List of Objects
split.im

Divide Image Into Sub-images
spatstat.geom-internal

Internal spatstat.geom functions
spatstat.options

Internal Options in Spatstat Package
spokes

Spokes pattern of dummy points
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
summary.listof

Summary of a List of Things
symbolmap

Graphics Symbol Map
tilenames

Names of Tiles in a Tessellation
tiles.empty

Check For Empty Tiles in a Tessellation
trim.rectangle

Cut margins from rectangle
where.max

Find Location of Maximum in a Pixel Image
volume

Volume of an Object
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe