%
% DESCRIPTION: Program to create the Mine Area GDF file in the Matlab format.
%
% [TimeZone] and [Description] have text format so the values give in ''


clear;clc;
[FormatName] = 'GDF';
[FormatVersion] = 2.1;
[CRS] = 'EPSG:4326';%['EPSG:' num2str(input('[CRS] EPSG code (just number) = '))];
[TimeZone] = 'UTC' %input('TimeZone (char) = ');
[Description] = 'Description of the dataset' %input('Description of data (char) = ');

[FieldDescription] = {
    'Name','Mine name'
    'Lat','Latitude of the mine boundary'
    'Long','Longitude of the mine boundary'
    };
[FieldType] = {
    'Name',3
    'Lat',124
    'Long',134
    };
[FieldUnit] = {
    'Name','char'
    'Lat','deg'
    'Long','deg'
    };
[d] = struct();



k=1
d(k).Name='Name1';
d(k).Lat=[52.7941,52.7920];
d(k).Long=[-0.9572,-0.9586];


k=2
d(k).Name='Name2';
d(k).Lat=[52.7920,52.7917];
d(k).Long=[-0.9586,-0.9574];

k=3
d(k).Name='Name3';
d(k).Lat=[52.7913,52.7909];
d(k).Long=[-0.9558,-0.9541];


k=4
d(k).Name='Name4';
d(k).Lat=[52.7917,52.7913];
d(k).Long=[-0.9574,-0.9558];

clear k 
save('GDF_EpisodeName_Mine_Area_example.mat')
