| Mapping Toolbox | ![]() |
Extract vector data from geographic data structures
Syntax
[lat,lon] = extractm(gstruct,object) [lat,lon] = extractm(gstruct,objects) [lat,lon] = extractm(gstruct,objects,'exact') [lat,lon,indx] = extractm(...) mat = extractm(...)
Description
[lat,lon] = extractm(gstruct,object) will extract vector data from those entries in the Mapping Toolbox geographic data structure that have tags beginning with the object string. The output vectors use NaNs to separate the entries in the map structure. Matches of the tag string must be vector data (lines and patches) to be included in the output.
[lat,lon] = extractm(gstruct,objects), where objects is a character array, allows more than one object to be the basis for the search.
[lat,lon] = extractm(gstruct,objects,'exact') requires an exact match to extract data.
[lat,lon,indx] = extractm(gstruct) extracts all vector data from the input map structure.
[lat,lon,indx] = extractm(...) also returns the vector indx identifying the entries in the structure which meet the selection criteria.
mat = extractm(...) returns the vector data in a single, two-column matrix, in which the first column contains latitudes and the second column, longitudes.
Examples
Extract the District of Columbia from the low resolution U.S. vector data:
load usalo extractm(state,'district of columb') ans = 38.9000 -77.0700 38.9000 -77.0500 38.9000 -77.0700 38.8700 -77.0200 38.8000 -77.0200 38.7800 -77.0300 38.9000 -76.9000 39.0000 -77.0300 38.9500 -77.1200 38.9000 -77.0700
Extract the states that meet at the Four Corners and plot them:
states4 = strvcat('colo','new mex','ariz','utah'); [lat,long,indx] = extractm(state,states4); axesm mercator patchm(lat,long,'g')
Remarks
A Mapping Toolbox geographic data structure is a MATLAB structure that may contain line, patch, text, regular matrix map, general matrix map, and light objects.
See Also
displaym |
Project data in a geographic data structure |
geographic data structure |
Specially formatted structure for map data |
mlayers |
GUI for manipulating layers of a map |
| eqa2grn | fill3m | ![]() |