Main Content

Vector Data

Analyze and transform point, line, and polygon data

Vector data uses points, lines, polygons, and their non-spatial attributes to describe real-world objects, locations, and events. For example, you can represent a city by using a point, a river by using a line, and a country by using a polygon. The vertices of points, lines, and polygons can be in geographic (latitude-longitude) or projected (x-y) coordinates.

Functions

expand all

Geospatial Tables, Tables, and Structures

geotable2tableConvert geospatial table to table (Since R2021b)
table2geotableConvert table to geospatial table (Since R2021b)
struct2geotableConvert structure array to geospatial table (Since R2021b)

Line and Polygon Coordinate Arrays

poly2ccwConvert polygon vertices to counterclockwise order
poly2cwConvert polygon vertices to clockwise order
poly2fvConvert polygon coordinates to patch faces and vertices
polyjoinConvert line or polygon parts from cell arrays to vector form
polymergeMerge line segments with matching endpoints
polysplitConvert line or polygon parts from vector form to cell arrays
closePolygonPartsClose all rings in multipart polygon
removeExtraNanSeparatorsClean up NaN separators in polygons and lines
isinteriorQuery geographic or planar points in polygon (Since R2022a)
ispolycwDetermine if polygon vertices are in clockwise order
ismultipointDetermine which array elements are multipoint shapes (Since R2022b)
isgeotableDetermine if input is geospatial table (Since R2021b)
isShapeMultipartTrue if polygon or line has multiple parts
extractfieldField values from structure array

Interpolate Coordinates

interpmDensify latitude-longitude sampling in lines or polygons
intrplatInterpolate latitude at given longitude
intrplonInterpolate longitude at given latitude

Clip Points, Lines, and Polygons

geoclipClip geographic shape to latitude-longitude limits (Since R2022a)
mapclipClip shape to xy-limits in planar coordinates (Since R2022a)
maptrimlTrim lines to latitude-longitude quadrangle
maptrimpTrim polygons to latitude-longitude quadrangle
nanclipClip vector data with NaNs at specified pen-down locations
flatearthpolyClip polygon to world limits

Buffer or Reduce Density

buffermBuffer zones for latitude-longitude polygons
reducemReduce density of points in vector data
polyxpolyIntersection points for lines or polygon edges
linecircFind intersection of line and circle in Cartesian coordinates
circcircFind intersection of circles in Cartesian coordinates

Objects

expand all

geopointshapePoint shape in geographic coordinates (Since R2021b)
geolineshapeLine shape in geographic coordinates (Since R2021b)
geopolyshapePolygon in geographic coordinates (Since R2021b)
mappointshapePoint shape in planar coordinates (Since R2021b)
maplineshapeLine shape in planar coordinates (Since R2021b)
mappolyshapePolygon in planar coordinates (Since R2021b)
geopointGeographic point vector
geoshapeGeographic shape vector
mappointPlanar point vector
mapshapePlanar shape vector

Topics

Vector Data Representations

  • Create Geospatial Tables
    Geospatial tables contain shapes and attributes for point, line, and polygon data. Import geospatial tables from vector data files, convert tables to geospatial tables, or create geospatial tables from arrays.
  • Geographic Data Structures
    A geographic data structure stores geographic features as elements in a structure array. The structure has fields such as the geometry of the feature and the coordinates of points in the vector.

Modify and Analyze Vector Data

Related Information