Main Content

rmprop

Remove property from geographic or planar vector

Description

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.

example

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 -34.6645 NaN 12.8767 NaN 22.7778 NaN 31.3044 NaN 36.7870 NaN 43.3620 NaN 31.7444 NaN 31.7744 NaN 52.3699 NaN 61.6040 NaN 39.7831 NaN 41.4673 NaN -18.9141 NaN ... ] (1x635 double)
    Longitude: [-3.9509 NaN 54.7589 NaN -0.2121 NaN 35.3894 NaN 38.7575 NaN 138.8528 NaN 44.5408 NaN 72.2474 NaN 30.4098 NaN 3.0397 NaN 77.0010 NaN 35.9214 NaN 75.0498 NaN 4.8892 NaN -149.1074 NaN 32.9496 NaN 122.8003 NaN 47.5258 NaN ... ] (1x635 double)
 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 -34.6645 NaN 12.8767 NaN 22.7778 NaN 31.3044 NaN 36.7870 NaN 43.3620 NaN 31.7444 NaN 31.7744 NaN 52.3699 NaN 61.6040 NaN 39.7831 NaN 41.4673 NaN -18.9141 NaN ... ] (1x635 double)
    Longitude: [-3.9509 NaN 54.7589 NaN -0.2121 NaN 35.3894 NaN 38.7575 NaN 138.8528 NaN 44.5408 NaN 72.2474 NaN 30.4098 NaN 3.0397 NaN 77.0010 NaN 35.9214 NaN 75.0498 NaN 4.8892 NaN -149.1074 NaN 32.9496 NaN 122.8003 NaN 47.5258 NaN ... ] (1x635 double)

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.

Version History

Introduced in R2012a

See Also

| |