Learn R Programming

spatstat.geom (version 3.7-0)

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

82,872

Version

3.7-0

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

January 20th, 2026

Functions in spatstat.geom (3.7-0)

Extract.im

Extract Subset of Image
Extract.ppx

Extract Subset of Multidimensional Point Pattern
Extract.anylist

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

Extract or Replace Subset of Point Pattern
Extract.hyperframe

Extract or Replace Subset of Hyperframe
Extract.owin

Extract Subset of Window
Extract.listof

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

Extract Subset of Line Segment Pattern
Extract.quad

Subset of Quadrature Scheme
Extract.layered

Extract or Replace Subset of a Layered Object
Window

Extract or Change the Window of a Spatial Object
Frame

Extract or Change the Containing Rectangle of a Spatial Object
Extract.solist

Extract or Replace Subset of a List of Spatial Objects
Extract.splitppp

Extract or Replace Sub-Patterns
Replace.im

Reset Values in Subset of Image
Math.im

S3 Group Generic methods for images
NAobject

Make an NA Object
Extract.tess

Extract or Replace Subset of Tessellation
MinkowskiSum

Minkowski Sum of Windows
Math.imlist

S3 Group Generic methods for List of Images
affine.owin

Apply Affine Transformation To Window
add.texture

Fill Plot With Texture
affine.ppp

Apply Affine Transformation To Point Pattern
anyNA.im

Check Whether Image Contains NA Values
affine.tess

Apply Geometrical Transformation To Tessellation
Window.tess

Extract Window of Spatial Object
affine.psp

Apply Affine Transformation To Line Segment Pattern
angles.psp

Orientation Angles of Line Segments
affine

Apply Affine Transformation
affine.im

Apply Affine Transformation To Pixel Image
areaLoss

Difference of Disc Areas
areaGain

Difference of Disc Areas
as.colourmap

Convert to Colour Map
as.boxx

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

Coerce Hyperframe to Data Frame
as.box3

Convert Data to Three-Dimensional Box
anylist

List of Objects
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
append.psp

Combine Two Line Segment Patterns
as.function.owin

Convert Window to Indicator Function
area.owin

Area of a Window
as.hyperframe

Convert Data to Hyperframe
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
as.data.frame.tess

Convert Tessellation to Data Frame
as.function.tess

Convert a Tessellation to a Function
as.function.im

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

Convert Window to Data Frame
as.data.frame.im

Convert Pixel Image to Data Frame
as.data.frame.psp

Coerce Line Segment Pattern to a Data Frame
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
as.matrix.owin

Convert Pixel Image to Matrix
as.rectangle

Window Frame
as.im

Convert to Pixel Image
as.matrix.im

Convert Pixel Image to Matrix or Array
as.mask

Pixel Image Approximation of a Window
as.polygonal

Convert a Window to a Polygonal Window
as.owin

Convert Data To Class owin
as.psp

Convert Data To Class psp
as.ppp

Convert Data To Class ppp
as.layered

Convert Data To Layered Object
bdist.pixels

Distance to Boundary of Window
bdist.points

Distance to Boundary of Window
bounding.box.xy

Convex Hull of Points
beachcolours

Create Colour Scheme for a Range of Numbers
boundingcircle

Smallest Enclosing Circle
border

Border Region of a Window
as.tess

Convert Data To Tessellation
bdist.tiles

Distance to Boundary of Window
boundingbox

Bounding Box of a Window, Image, or Point Pattern
as.solist

Convert List of Two-Dimensional Spatial Objects
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
box3

Three-Dimensional Box
clickdist

Interactively Measure Distance
by.im

Apply Function to Image Broken Down by Factor
clickbox

Interactively Define a Rectangle
boxx

Multi-Dimensional Box
centroid.owin

Centroid of a window
by.ppp

Apply a Function to a Point Pattern Broken Down by Factor
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
bufftess

Buffer Distance Tessellation
closing

Morphological Closing
closepairs.pp3

Close Pairs of Points in 3 Dimensions
colourtools

Convert and Compare Colours in Different Formats
closepairs

Close Pairs of Points
colourmap

Colour Lookup Tables
clickpoly

Interactively Define a Polygon
clickppp

Interactively Add Points
clip.infline

Intersect Infinite Straight Lines with a Window
colouroutputs

Extract or Assign Colour Values in a Colour Map
closetriples

Close Triples of Points
connected.ppp

Connected Components of a Point Pattern
compatible

Test Whether Objects Are Compatible
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
concatxy

Concatenate x,y Coordinate Vectors
contour.im

Contour plot of pixel image
contour.imlist

Array of Contour Plots
complement.owin

Take Complement of a Window
compatible.im

Test Whether Pixel Images Are Compatible
connected

Connected components
connected.tess

Connected Components of Tiles of a Tessellation
convexhull.xy

Convex Hull of Points
convexify

Weil's Convexifying Operation
crossdist

Pairwise distances
coords

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

Distance Metric Defined by Convex Set
crossdist.default

Pairwise distances between two different sets of points
convolve.im

Convolution of Pixel Images
corners

Corners of a rectangle
convexhull

Convex Hull
covering

Cover Region with Discs
cut.im

Convert Pixel Image from Numeric to Factor
default.dummy

Generate a Default Pattern of Dummy Points
crossing.psp

Crossing Points of Two Line Segment Patterns
default.image.colours

Default Colours for Images in Spatstat
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
cut.ppp

Classify Points in a Point Pattern
crossdist.psp

Pairwise distances between two different line segment patterns
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
default.colourmap

Default Colour Map for Plotting a Spatial Pattern
crossdist.ppp

Pairwise distances between two different point patterns
diameter

Diameter of an Object
delaunayDistance

Distance on Delaunay Triangulation
delaunay

Delaunay Triangulation of Point Pattern
default.symbolmap

Default Symbol Map for Plotting a Spatial Pattern
diameter.owin

Diameter of a Window
dilated.areas

Areas of Morphological Dilations
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
default.symbolmap.ppp

Default Symbol Map for Point Pattern
diameter.box3

Geometrical Calculations for Three-Dimensional Box
deltametric

Delta Metric
disc

Circular Window
discpartarea

Area of Part of Disc
discretise

Safely Convert Point Pattern Window to Binary Mask
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
dilation

Morphological Dilation
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
discs

Union of Discs
distfun

Distance Map as a Function
dirichlet

Dirichlet Tessellation of Point Pattern
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
distmap.ppp

Distance Map of Point Pattern
edges

Extract Boundary Edges of a Window.
distmap.psp

Distance Map of Line Segment Pattern
domain

Extract the Domain of any Spatial Object
distmap.owin

Distance Map of Window
edges2vees

List Dihedral Triples in a Graph
edges2triangles

List Triangles in a Graph
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
edit.hyperframe

Invoke Text Editor on Hyperframe
distmap

Distance Map
fardist

Farthest Distance to Boundary of Window
edit.ppp

Invoke Text Editor on Spatial Data
erosion

Morphological Erosion by a Disc
erosionAny

Morphological Erosion of Windows
eroded.areas

Areas of Morphological Erosions
fillholes.owin

Remove Small Holes in a Window
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
endpoints.psp

Endpoints of Line Segment Pattern
eval.im

Evaluate Expression Involving Pixel Images
ellipse

Elliptical Window.
gridcentres

Rectangular grid of points
fourierbasis

Fourier Basis Functions
gridweights

Compute Quadrature Weights Based on Grid Counts
harmonise

Make Objects Compatible
funxy

Spatial Function Class
framedist.pixels

Distance to Bounding Frame
grow.rectangle

Add margins to rectangle
harmonise.im

Make Pixel Images Compatible
flipxy

Exchange X and Y Coordinates
grow.boxx

Add margins to box in any dimension
hextess

Hexagonal Grid or Tessellation
harmoniseLevels

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

Check Whether Points Have Close Neighbours
identify.psp

Identify Segments in a Line Segment Pattern
hist.funxy

Histogram of Values of a Spatial Function
headtail

First or Last Part of a Spatial Pattern
identify.ppp

Identify Points in a Point Pattern
hist.im

Histogram of Pixel Values in an Image
harmonise.owin

Make Windows Compatible
hyperframe

Hyper Data Frame
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
inside.owin

Test Whether Points Are Inside A Window
integral.im

Integral of a Pixel Image
im

Create a Pixel Image Object
identify.tess

Interactively Identify Tiles of a Tessellation
infline

Infinite Straight Lines
imcov

Spatial Covariance of a Pixel Image
im.object

Class of Images
im.apply

Apply Function Pixelwise to List of Images
incircle

Find Largest Circle Inside Window
interp.im

Interpolate a Pixel Image
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
intensity.ppp

Empirical Intensity of Point Pattern
interp.colourmap

Interpolate smoothly between specified colours
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
intersect.owin

Intersection, Union or Set Subtraction of Windows
intensity.psp

Empirical Intensity of Line Segment Pattern
integral.tessfun

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

Intensity of a Dataset or a Model
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
is.empty

Test Whether An Object Is Empty
is.NAobject

Recognise NA Objects
invoke.symbolmap

Plot Data Using Graphics Symbol Map
intersect.tess

Intersection of Two Tessellations
invoke.metric

Perform Geometric Task using a Specified Metric
is.connected

Determine Whether an Object is Connected
is.convex

Test Whether a Window is Convex
is.boxx

Recognise a Multi-Dimensional Box
is.connected.ppp

Determine Whether a Point Pattern is Connected
is.im

Test Whether An Object Is A Pixel Image
is.na.solist

Identify Missing Entries in a List of Spatial Objects
is.owin

Test Whether An Object Is A Window
is.multitype

Test whether Object is Multitype
is.multitype.ppp

Test Whether A Point Pattern is Multitype
is.linnet

Test Whether An Object Is A Linear Network
is.marked.ppp

Test Whether A Point Pattern is Marked
is.linim

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

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

Test Whether Marks Are Present
is.na.hyperframe

Identify Missing Entries in a Hyperframe
lengths_psp

Lengths of Line Segments
levelset

Level Set of a Pixel Image
is.ppp

Test Whether An Object Is A Point Pattern
is.rectangle

Determine Type of Window
layered

Create List of Plotting Layers
layout.boxes

Generate a Row or Column Arrangement of Rectangles.
lut

Lookup Tables
is.subset.owin

Determine Whether One Window is Contained In Another
levelset.distfun

Level Set of a Distance Function
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
marks.psp

Marks of a Line Segment Pattern
mergeLevels

Merge Levels of a Factor
mean.im

Mean and Median of Pixel Values in an Image
methods.boxx

Methods for Multi-Dimensional Box
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
methods.box3

Methods for Three-Dimensional Box
matchingdist

Distance for a Point Pattern Matching
marks

Marks of a Point Pattern
marks.tess

Marks of a Tessellation
methods.distfun

Geometrical Operations for Distance Functions
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
methods.layered

Methods for Layered Objects
methods.unitname

Methods for Units
nearest.raster.point

Find Pixel Nearest to a Given Point
multiplicity.ppp

Count Multiplicity of Duplicate Points
metric.object

Distance Metric
methods.funxy

Methods for Spatial Functions
methods.pp3

Methods for three-dimensional point patterns
midpoints.psp

Midpoints of Line Segment Pattern
nndist.pp3

Nearest neighbour distances in three dimensions
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
nndist

Nearest neighbour distances
nncross

Nearest Neighbours Between Two Patterns
nearestValue

Image of Nearest Defined Pixel Value
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
nearestsegment

Find Line Segment Nearest to Each Point
nestsplit

Nested Split
nndist.psp

Nearest neighbour distances between line segments
nnfun

Nearest Neighbour Index Map as a Function
npoints

Number of Points in a Point Pattern
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
nnwhich.pp3

Nearest neighbours in three dimensions
nnwhich

Nearest neighbour
nvertices

Count Number of Vertices
nnwhich.ppx

Nearest Neighbours in Any Dimensions
nsegments

Number of Line Segments in a Line Segment Pattern
nnmark

Mark of Nearest Neighbour
nnmap

K-th Nearest Point Map
pairdist.pp3

Pairwise distances in Three Dimensions
padimage

Pad the Border of a Pixel Image
owin2mask

Convert Window to Binary Mask under Constraints
owin

Create a Window
overlap.owin

Compute Area of Overlap
opening

Morphological Opening
pairdist

Pairwise distances
pairdist.default

Pairwise distances
owin.object

Class owin
pHcolourmap

Colour Map for pH Values
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
pixellate.owin

Convert Window to Pixel Image
pixelquad

Quadrature Scheme Based on Pixel Grid
perimeter

Perimeter Length of Window
persp.im

Perspective Plot of Pixel Image
pairdist.ppx

Pairwise Distances in Any Dimensions
plot.layered

Layered Plot
pairdist.psp

Pairwise distances between line segments
pairdist.ppp

Pairwise distances
periodify

Make Periodic Copies of a Spatial Pattern
pixelcentres

Extract Pixel Centres as Point Pattern
plot.anylist

Plot a List of Things
pixellate.psp

Convert Line Segment Pattern to Pixel Image
pixellate.ppp

Convert Point Pattern to Pixel Image
plot.imlist

Plot a List of Images
plot.im

Plot a Pixel Image
plot.colourmap

Plot a Colour Map
pixellate

Convert Spatial Object to Pixel Image
persp.ppp

Perspective Plot of Marked Point Pattern
plot.hyperframe

Plot Entries in a Hyperframe
plot.quadratcount

Plot Quadrat Counts
plot.pppmatching

Plot a Point Matching
plot.quad

Plot a Spatial Quadrature Scheme
plot.pp3

Plot a Three-Dimensional Point Pattern
plot.ppp

plot a Spatial Point Pattern
plot.psp

plot a Spatial Line Segment Pattern
plot.solist

Plot a List of Spatial Objects
plot.owin

Plot a Spatial Window
plot.listof

Plot a List of Things
plot.onearrow

Plot an Arrow
plot.tess

Plot a Tessellation
plot.yardstick

Plot a Yardstick or Scale Bar
plot.symbolmap

Plot a Graphics Symbol Map
ppp

Create a Point Pattern
polartess

Tessellation Using Polar Coordinates
pointsOnLines

Place Points Evenly Along Specified Lines
pp3

Three Dimensional Point Pattern
plot.textstring

Plot a Text String
plot.splitppp

Plot a List of Point Patterns
plot.texturemap

Plot a Texture Map
print.owin

Print Brief Details of a Spatial Window
print.ppp

Print Brief Details of a Point Pattern Dataset
print.psp

Print Brief Details of a Line Segment Pattern Dataset
ppx

Multidimensional Space-Time Point Pattern
print.quad

Print a Quadrature Scheme
print.im

Print Brief Details of an Image
pppmatching.object

Class of Point Matchings
ppp.object

Class of Point Patterns
pppmatching

Create a Point Matching
pppdist

Distance Between Two Point Patterns
quad.object

Class of Quadrature Schemes
psp.object

Class of Line Segment Patterns
project2set

Find Nearest Point in a Region
project2segment

Move Point To Nearest Line
quadscheme

Generate a Quadrature Scheme from a Point Pattern
psp2mask

Convert Line Segment Pattern to Binary Pixel Mask
quadratcount

Quadrat counting for a point pattern
progressreport

Print Progress Reports
psp

Create a Line Segment Pattern
quadrats

Divide Region into Quadrats
quasirandom

Quasirandom Patterns
quantile.im

Sample Quantiles of Pixel Image
rQuasi

Generate Quasirandom Point Pattern in Given Window
raster.x

Cartesian Coordinates for a Pixel Raster
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
reflect

Reflect In Origin
rectdistmap

Distance Map Using Rectangular Distance Metric
quantilefun.im

Quantile Function for Images
quantess

Quantile Tessellation
regularpolygon

Create A Regular Polygon
rescale.psp

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

Restrict a Colour Map to a Subset of Values
rescale.ppp

Convert Point Pattern to Another Unit of Length
requireversion

Require a Specific Version of a Package
relevel.im

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

Convert Window to Another Unit of Length
rescale.im

Convert Pixel Image to Another Unit of Length
rev.colourmap

Reverse the Colours in a Colour Map
rescale

Convert dataset to another unit of length
rescue.rectangle

Convert Window Back To Rectangle
ripras

Estimate window from points alone
rotate.owin

Rotate a Window
rjitter

Random Perturbation of a Point Pattern
rotate

Rotate
rlinegrid

Generate grid of parallel lines with random displacement
rotate.infline

Rotate or Shift Infinite Lines
rgbim

Create Colour-Valued Pixel Image
rotate.ppp

Rotate a Point Pattern
rexplode

Explode a Point Pattern by Displacing Duplicated Points
rotate.im

Rotate a Pixel Image
runifrect

Generate N Uniform Random Points in a Rectangle
rotate.psp

Rotate a Line Segment Pattern
scanpp

Read Point Pattern From Data File
scalardilate

Apply Scalar Dilation
rounding.ppp

Detect Numerical Rounding
run.simplepanel

Run Point-and-Click Interface
selfcrossing.psp

Crossing Points in a Line Segment Pattern
rsyst

Simulate systematic random point pattern
scaletointerval

Rescale Data to Lie Between Specified Limits
round.ppp

Apply Numerical Rounding to Spatial Coordinates
setcov

Set Covariance of a Window
selfcut.psp

Cut Line Segments Where They Intersect
sessionLibs

Print Names and Version Numbers of Libraries Loaded
shift.ppp

Apply Vector Translation To Point Pattern
shift

Apply Vector Translation
shift.owin

Apply Vector Translation To Window
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
shift.ppx

Apply Vector Translation To Box Or Point Pattern In Arbitrary Dimension
shift.im

Apply Vector Translation To Pixel Image
shift.psp

Apply Vector Translation To Line Segment Pattern
solapply

Apply a Function Over a List and Obtain a List of Objects
spatdim

Spatial Dimension of a Dataset
spatstat.geom-deprecated

Deprecated spatstat.geom functions
solutionset

Evaluate Logical Expression Involving Pixel Images and Return Region Where Expression is True
simplify.owin

Approximate a Window by a Simpler Polygon
spatstat.options

Internal Options in Spatstat Package
spatstat.geom-internal

Internal spatstat.geom functions
solist

List of Two-Dimensional Spatial Objects
spatstat.geom-package

The spatstat.geom Package
simplepanel

Simple Point-and-Click Interface Panels
split.ppp

Divide Point Pattern into Sub-patterns
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
subset.ppp

Subset of Point Pattern Satisfying A Condition
subset.psp

Subset of Line Segment Satisfying A Condition
square

Square Window
split.im

Divide Image Into Sub-images
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
stratrand

Stratified random point pattern
spokes

Spokes pattern of dummy points
summary.solist

Summary of a List of Spatial Objects
summary.splitppp

Summary of a Split Point Pattern
summary.psp

Summary of a Line Segment Pattern Dataset
summary.quad

Summarizing a Quadrature Scheme
summary.listof

Summary of a List of Things
summary.distfun

Summarizing a Function of Spatial Location
summary.ppp

Summary of a Point Pattern Dataset
summary.im

Summarizing a Pixel Image
summary.anylist

Summary of a List of Things
summary.owin

Summary of a Spatial Window
test.crossing.psp

Check Whether Segments Cross
tile.centroids

Compute Centroids of Tiles in a Tessellation
superimpose

Superimpose Several Geometric Patterns
text.ppp

Add Text Labels to Spatial Pattern
tileindex

Determine Which Tile Contains Each Given Point
textureplot

Plot Image or Tessellation Using Texture Fill
tess

Create a Tessellation
symbolmap

Graphics Symbol Map
tile.areas

Compute Areas of Tiles in a Tessellation
texturemap

Texture Map
union.quad

Union of Data and Dummy Points
transmat

Convert Pixel Array Between Different Conventions
timeTaken

Extract the Total Computation Time
triangulate.owin

Decompose Window into Triangles
tilenames

Names of Tiles in a Tessellation
timed

Record the Computation Time
tweak.colourmap

Change Colour Values in a Colour Map
tiles.empty

Check For Empty Tiles in a Tessellation
trim.rectangle

Cut margins from rectangle
tiles

Extract List of Tiles in a Tessellation
vertices

Vertices of a Window
unmark

Remove Marks
unstack.ppp

Separate Multiple Columns of Marks
update.symbolmap

Update a Graphics Symbol Map.
unitname

Name for Unit of Length
volume

Volume of an Object
uniquemap.ppp

Map Duplicate Entries to Unique Entries
venn.tess

Tessellation Delimited by Several Sets
unstack.solist

Unstack Each Spatial Object in a List of Objects
unique.ppp

Extract Unique Points from a Spatial Point Pattern
yardstick

Text, Arrow or Scale Bar in a Diagram
where.max

Find Location of Maximum in a Pixel Image
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
zapsmall.im

Rounding of Pixel Values