aoicircle
Syntax
Description
Numeric Data
defines an area of
interest (AOI) by creating circles with the specified radius that are
centered at the specified geographic coordinates. aoi = aoicircle(lat,lon,radius)
Examples
Read the geographic coordinates of European capitals into the workspace. Specify the geographic CRS as the World Geodetic System of 1984, which has the EPSG code 4326.
[lat,lon] = readvars("european_capitals.txt");
gcrs = geocrs(4326);Create an AOI of circles from the geographic coordinates. Specify the radius of each circle as 2 degrees. When you pass geographic coordinates to the aoicircle function, the function represents the AOI using a scalar polygon shape in geographic coordinates.
aoi = aoicircle(lat,lon,2,gcrs)
aoi =
geopolyshape with properties:
NumRegions: 6
NumHoles: 0
Geometry: "polygon"
CoordinateSystemType: "geographic"
GeographicCRS: [1×1 geocrs]
Display the AOI and the capitals on a map.
geobasemap topographic geoplot(aoi) hold on geoplot(lat,lon,"k.",MarkerSize=10)

Specify the projected coordinates for several places in Boston. Specify the projected CRS for the points as NAD83 / Massachusetts Mainland, which has the EPSG code 26986.
x = [236266 235743 234685 232989 236536 234591 235741 237114 235741 236548]; y = [900974 900355 901429 901884 901901 901892 900663 900670 900725 899587]; pcrs = projcrs(26986);
When you pass projected coordinates to the aoicircle function, you must specify the radius of each circle using the length unit of the projected CRS. Find the length unit. The result indicates that you must specify radius in meters.
pcrs.LengthUnit
ans = "meter"
Create an AOI of circles. Specify the circle centers using the projected coordinates, and specify the radius of each circle as 200 meters. When you pass projected coordinates to the aoicircle function, the function represents the AOI using a scalar polygon shape in projected coordinates.
aoi = aoicircle(x,y,200,pcrs)
aoi =
mappolyshape with properties:
NumRegions: 8
NumHoles: 0
Geometry: "polygon"
CoordinateSystemType: "planar"
ProjectedCRS: [1×1 projcrs]
Display the AOI on a map.
geobasemap streets
geoplot(aoi)
Create a geospatial table by geocoding several Australian cities. The table represents the cities using point shapes in geographic coordinates.
cities = ["Adelaide","Melbourne","Canberra","Sydney","Brisbane"]; GT = geocode(cities,"city"); GT.Shape
ans =
5×1 geopointshape array with properties:
NumPoints: [5×1 double]
Latitude: [5×1 double]
Longitude: [5×1 double]
Geometry: "point"
CoordinateSystemType: "geographic"
GeographicCRS: [1×1 geocrs]
Create an AOI of circles from the shapes in the geospatial table. Specify the radius of each circle as 3 degrees. When you pass data in geographic coordinates to the aoicircle function, the function represents the AOI using a scalar polygon shape in geographic coordinates.
aoi = aoicircle(GT,3)
aoi =
geopolyshape with properties:
NumRegions: 2
NumHoles: 0
Geometry: "polygon"
CoordinateSystemType: "geographic"
GeographicCRS: [1×1 geocrs]
Display the AOI and the cities on a map.
geoplot(aoi) hold on geoplot(GT,"k.",MarkerSize=20)

Specify the projected coordinates for several places in Boston. Specify the projected CRS for the points as NAD83 / Massachusetts Mainland, which has the EPSG code 26986.
x = [236266 235743 234685 232989 236536 234591 235741 237114 235741 236548]; y = [900974 900355 901429 901884 901901 901892 900663 900670 900725 899587]; pcrs = projcrs(26986);
Create a point shape object from the coordinates and projected CRS.
shape = mappointshape(x,y); shape.ProjectedCRS = pcrs;
When you pass projected coordinates to the aoicircle function, you must specify the radius of each circle using the length unit of the projected CRS. Find the length unit. The result indicates that you must specify the radius in meters.
pcrs.LengthUnit
ans = "meter"
Create an AOI of circles from the point shape. Specify the radius of each circle as 300 meters. When you pass data in projected coordinates to the aoicircle function, the function represents the AOI using a scalar polygon shape in projected coordinates.
aoi = aoicircle(shape,300)
aoi =
mappolyshape with properties:
NumRegions: 6
NumHoles: 0
Geometry: "polygon"
CoordinateSystemType: "planar"
ProjectedCRS: [1×1 projcrs]
Display the AOI and the places on a map.
geoplot(aoi) hold on geobasemap topographic geoplot(shape,".k",MarkerSize=10)

Create a point shape in geographic coordinates that represents Paris, France. Specify the geographic CRS as the World Geodetic System of 1984, which has the EPSG code 4326.
shape = geopointshape(48.86,2.35); shape.GeographicCRS = geocrs(4326);
Create an AOI from the point shape. Specify the radius as 0.5 degrees.
aoi = aoicircle(shape,0.5);
Create a geospatial table from the AOI. Then, export the geospatial table to a shapefile by using the shapewrite function.
aoiGT = table(aoi,VariableName="Shape"); filename = "parisAOI.shp"; shapewrite(aoiGT,filename)
Read the shapefile into the workspace, and view the AOI.
GT = readgeotable(filename);
geobasemap topographic
geoplot(GT)
Input Arguments
Latitudes of the center points in degrees, specified as a numeric array with
elements in the range [–90, 90]. The sizes of lat and
lon must match.
Longitudes of the center points in degrees, specified as a numeric array. The
sizes of lat and lon must match.
Radius of the circles, specified as a numeric scalar.
The units you use to specify radius and the way the
function interprets radius depends on the type of coordinates
you use to specify the center points of the circles.
| Type of Coordinates | Units | Interpretation |
|---|---|---|
| Geographic coordinates | Specify |
|
| Projected coordinates | Specify For
example, for a |
|
Geographic CRS of the coordinates, specified as a geocrs
object.
Projected CRS of the coordinates, specified as a projcrs
object.
Geospatial table. A geospatial table is a table or timetable object with a
Shape variable that contains point, line, or polygon shapes.
For more information about geospatial tables, see Create Geospatial Tables.
The aoicircle function requires the
Shape variable to contain only geopointshape or only mappointshape objects. The ProjectedCRS property
of mappointshape objects must not be empty.
Point shapes, specified as one of these options:
An array of
geopointshapeobjects — Point shapes in geographic coordinates.An array of
mappointshapeobjects — Point shapes in projected coordinates. TheProjectedCRSproperty of the objects must not be empty.
You can also specify this argument as a scalar point shape object.
Output Arguments
AOI composed of circles, returned as one of these options:
A scalar
geopolyshapeobject, when you specify the input using geographic coordinates.A scalar
mappolyshapeobject, when you specify the input using projected coordinates.
When you specify multiple center points, the AOI can contain multiple parts.
More About
An area of interest (AOI) defines a focus
area for geospatial analysis and visualization. Mapping Toolbox™ represents AOIs using polygon shape objects. A scalar geopolyshape
object represents an AOI in geographic coordinates, and a scalar mappolyshape
object represents an AOI in projected coordinates.
Version History
Introduced in R2024b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)