Insercion de una geofence:
Parametros obtenidos de front:
-lower_limit
-vertical_reference
-upper_limit
-geom_buffer
-name
-message
-volume_limitation->vec
-code_restriction_type->vec
-code_zone_reason->vec
-condition_expression_type->vec
-code_uspace_class_type->vec
-permanent
-start_date
-end_date
-[time_start,time_end,day]->vec
-[operator_id,drone_id,time]->vec
#previous time vector with:
[start_date_drone,end_date_drone,[time_start_drone,time_end,day_drone]]->vec

#vendran de front pero no del formulario(almenos en estos momentos no estan plasmados)
-creation_date_time
-update_date_time
-author
-name_authority
-service_authority
-contact_name_authority
-site_url_authority
-email_authority
-phone_authority

Información que no cambia:
layer_id='19fe6347-1423-482c-8433-c885a6c9edb8'
code_zone_type_type_code=2
country_id=34
region=1
data_capture_prohibition=false

INSERT INTO airspace_volume(lower_limit,lower_vertical_reference,
upper_limit,upper_vertical_reference,geom_buffer,layers_layer_id) 
VALUES(lower_limit,vertical_reference,upper_limit,vertical_reference, geom_buffer, layer_id) RETURNING vol_id;

INSERT INTO time_period(permanent, start_date_time, end_date_time)
VALUES(permanent, start_date, end_date) RETURNING time_period_id;

#for each daily_period in vec [time_start,time_end,day]
INSERT INTO daily_period(start_time, end_time, code_week_day_day_number,time_period_time_period_id)
VALUES(time_start,time_end,day,time_period_id);

INSERT INTO metadata(creation_date_time,update_date_time,author)
VALUES(creation_date_time,update_date_time,author) RETURNING metadata_id;

INSERT INTO authority(name,service,contact_name,site_url,email,phone)
VALUES(name_authority,service_authority,contact_name_authority,site_url_authority,email_authority,phone_authority)
RETURNING authority_oid;

INSERT INTO uas_zone_version(country_id, name, airspace_volume_vol_id,code_zone_type_type_code,
region,data_capture_prohibition,message,metadata_metada_id,time_period_time_period_id,authority_authority_oid)
VALUES(country_id,name,vol_id,code_zone_type_type_code,region,data_capture_prohibition,message,metadata_id,time_period_id,authority_oid)
RETURNING uas_zone_id

#for each volume_limitation in the vector:
INSERT INTO volume_limitation(volume_limitation_definitions_limitation_definition_id, uas_zone_version_uas_zone_id)
VALUES(volume_limitation, uas_zone_id);

#for each value in the code_uspace_class_type:
INSERT INTO uas_uspace_class_type(code_uspace_class_type_u_space_code,uas_zone_version_uas_zone_id)
VALUES(code_uspace_class_type, uas_zone_id);

#for each value in the vector code_zone_reason:
INSERT INTO uas_code_zone_reason(code_zone_reason_code_zone_reason,uas_zone_version_uas_zone_id)
VALUE(code_zone_reason,uas_zone_id)

#for each value in the vector code_restriction_type:
INSERT INTO uas_code_restriction_type(code_restriction_type_restriction_code,uas_version_uas_zone_id)
VALUES(code_restriction_type,uas_zone_id) RETURNING uas_restriction_code;
#if uas_code_restriction_type==3:
#for each value in vector condition_expression_type
INSERT INTO uas_condition_expression_type(condition_expression_type_restriction_code, uas_code_restrcition_type_uas_retriction_code)
VALUES(condition_expression_type,uas_code_restriction_code) RETURNING uas_restriction_code;
#if condition_expression_type==5:
#for each value in vector [operator_id,drone_id,time_id]:
INSERT INTO time_period(permanent, start_date_time, end_date_time)
VALUES(permanent, start_date, end_date) RETURNING time_period_id;
#for each daily_period in vec [time_start_drone,time_end,day_drone]
INSERT INTO daily_period(start_time, end_time, code_week_day_day_number,time_period_time_period_id)
VALUES(time_start,time_end,day,time_period_id);

INSERT INTO list_allowed_operators_drones(operator_id,drone_id,time_id,uas_restriction_code,uas_zone_id)








#EJEMPLO SQL:
#datos elegidos:

Parametros obtenidos de front:
-lower_limit=0
-vertical_reference=1
-upper_limit=2000
-geom_buffer=' '
-name='prueba1'
-message='esta geofence es de prueba'
-volume_limitation->vec = [1,3,7]
-code_restriction_type->vec = [2,3]
-code_zone_reason->vec =[1]
-condition_expression_type->vec = [3,5]
-code_uspace_class_type->vec =[2,3]
-permanent=0
-start_date= '2021-01-01'
-end_date = '2022-02-02'
-[time_start,time_end,day]->vec = [[]]
-[operator_id,drone_id,time]->vec
#previous time vector with:
[start_date_drone,end_date_drone,[time_start_drone,time_end,day_drone]]->vec

#vendran de front pero no del formulario(al menos en estos momentos no estan plasmados)
-creation_date_time
-update_date_time
-author
-name_authority
-service_authority
-contact_name_authority
-site_url_authority
-email_authority
-phone_authority

Información que no cambia:
layer_id='19fe6347-1423-482c-8433-c885a6c9edb8'
code_zone_type_type_code=2
country_id=34
region=1
data_capture_prohibition=false