# 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

 `geotable2table` Convert geospatial table to table (Since R2021b) `table2geotable` Convert table to geospatial table (Since R2021b) `struct2geotable` Convert structure array to geospatial table (Since R2021b)

#### Line and Polygon Coordinate Arrays

 `poly2ccw` Convert polygon vertices to counterclockwise order `poly2cw` Convert polygon vertices to clockwise order `poly2fv` Convert polygon coordinates to patch faces and vertices `polyjoin` Convert line or polygon parts from cell arrays to vector form `polymerge` Merge line segments with matching endpoints `polysplit` Convert line or polygon parts from vector form to cell arrays `closePolygonParts` Close all rings in multipart polygon `removeExtraNanSeparators` Clean up `NaN` separators in polygons and lines
 `isinterior` Query geographic or planar points in polygon (Since R2022a) `ispolycw` Determine if polygon vertices are in clockwise order `ismultipoint` Determine which array elements are multipoint shapes (Since R2022b) `isgeotable` Determine if input is geospatial table (Since R2021b) `isShapeMultipart` True if polygon or line has multiple parts `extractfield` Field values from structure array

#### Interpolate Coordinates

 `interpm` Densify latitude-longitude sampling in lines or polygons `intrplat` Interpolate latitude at given longitude `intrplon` Interpolate longitude at given latitude

#### Clip Points, Lines, and Polygons

 `geoclip` Clip geographic shape to latitude-longitude limits (Since R2022a) `mapclip` Clip shape to xy-limits in planar coordinates (Since R2022a) `maptriml` Trim lines to latitude-longitude quadrangle `maptrimp` Trim polygons to latitude-longitude quadrangle `nanclip` Clip vector data with NaNs at specified pen-down locations `flatearthpoly` Clip polygon to world limits

#### Buffer or Reduce Density

 `bufferm` Buffer zones for latitude-longitude polygons `reducem` Reduce density of points in vector data
 `polyxpoly` Intersection points for lines or polygon edges `linecirc` Find intersection of line and circle in Cartesian coordinates `circcirc` Find intersection of circles in Cartesian coordinates

## Objects

expand all

 `geopointshape` Point shape in geographic coordinates (Since R2021b) `geolineshape` Line shape in geographic coordinates (Since R2021b) `geopolyshape` Polygon in geographic coordinates (Since R2021b) `mappointshape` Point shape in planar coordinates (Since R2021b) `maplineshape` Line shape in planar coordinates (Since R2021b) `mappolyshape` Polygon in planar coordinates (Since R2021b)
 `geopoint` Geographic point vector `geoshape` Geographic shape vector `mappoint` Planar point vector `mapshape` Planar 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.