struct

Class: geopoint

Convert geopoint vector to scalar structure

Syntax

S = struct(P)

Description

S = struct(P) converts the geopoint vector, P, to a scalar structure, S.

Input Arguments

P

geopoint vector

Output Arguments

S

Scalar structure of the geopoint vector P.

Examples

expand all

Converting a geopoint vector into struct

Create a geopoint vector and convert it into a structure.

S = shaperead('worldcities', 'UseGeo', true);
p = geopoint(S)
S2 = struct(p)
class(S2)
p = 

 318x1 geopoint vector with properties:

 Collection properties:
     Geometry: 'point'
     Metadata: [1x1 struct]
 Feature properties:
     Latitude: [1x318 double]
    Longitude: [1x318 double]
         Name: {1x318 cell}


S2 = 

     Geometry: 'point'
     Metadata: [1x1 struct]
     Latitude: [1x318 double]
    Longitude: [1x318 double]
         Name: {1x318 cell}


ans =

struct
Was this topic helpful?