Main Content

rmprop

Remove property from geographic or planar vector

Description

example

vout = rmprop(vin,name) removes the property specified by name from the geographic or planar vector vin.

example

vout = rmprop(vin,names) removes all properties specified by names from vin.

Note

rmprop cannot remove Metadata, and Geometry properties from any geographic or planar vector. Further, it cannot remove Latitude and Longitude properties from geopoint and geoshape objects, nor X and Y properties from mappoint and mapshape objects.

Examples

collapse all

Create a geoshape vector with dynamic properties.

gs = geoshape(shaperead('worldcities.shp', 'UseGeoCoords', true))
gs = 
 318x1 geoshape vector with properties:

 Collection properties:
     Geometry: 'point'
     Metadata: [1x1 struct]
 Vertex properties:
  (318 features concatenated with 317 delimiters)
     Latitude: [5.2985 NaN 24.6525 NaN 5.6106 NaN 37.0613 NaN 9.0235 NaN ... ]
    Longitude: [-3.9509 NaN 54.7589 NaN -0.2121 NaN 35.3894 NaN 38.7575 ... ]
 Feature properties:
         Name: {1x318 cell}

Remove only the Name property from the geoshape vector.

gs2 = rmprop(gs,'Name')
gs2 = 
 318x1 geoshape vector with properties:

 Collection properties:
     Geometry: 'point'
     Metadata: [1x1 struct]
 Vertex properties:
  (318 features concatenated with 317 delimiters)
     Latitude: [5.2985 NaN 24.6525 NaN 5.6106 NaN 37.0613 NaN 9.0235 NaN ... ]
    Longitude: [-3.9509 NaN 54.7589 NaN -0.2121 NaN 35.3894 NaN 38.7575 ... ]

Create a mappoint vector.

mp = mappoint(-33.961,18.484,'Name','Cape Town','Temperature',64)
mp = 
 1x1 mappoint vector with properties:

 Collection properties:
       Geometry: 'point'
       Metadata: [1x1 struct]
 Feature properties:
              X: -33.9610
              Y: 18.4840
           Name: 'Cape Town'
    Temperature: 64

Attempt to remove multiple properties from the mappoint vector.

s2 = rmfield(mp,{'X','Name','temperature'})
s2 = 
 1x1 mappoint vector with properties:

 Collection properties:
       Geometry: 'point'
       Metadata: [1x1 struct]
 Feature properties:
              X: -33.9610
              Y: 18.4840
    Temperature: 64

The Name property has been removed successfully. Note that the X property still exists because it cannot be removed. Also, the Temperature property still exists because property names are case-sensitive.

Input Arguments

collapse all

Input geographic or planar vector, specified as a geopoint, geoshape, mappoint, or mapshape object.

Name of a single property to remove, specified as a character vector. The character vector is case sensitive.

Name of multiple properties to remove, specified as a cell array of character vectors. The character vectors are case-sensitive.

Output Arguments

collapse all

Output geographic or planar vector, returned as a geopoint, geoshape, mappoint, or mapshape object. The object type of vout matches the object type of vin.

See Also

| |

Introduced in R2012a