  (abridged) NGC6530 is a young cluster with a complex morphology and
star-formation history. We present a statistical study of its global properties
using a new large list of candidate members down to masses of 0.2-0.4 Msun and
Gaia DR2 astrometry. We consider a wider sky region compared to previous
studies, to investigate the whole cluster and its neighborhood. We study the
distribution of extinction and age across the different regions, and obtain
constraints on the star-formation history. Cluster membership is determined on
the basis of X-ray data, H-alpha emission, near-IR and UV excesses from VPHAS+,
UKIDSS and other surveys, and Gaia DR2 astrometry; we also use a novel method
for photometric selection of M-type pre-main-sequence cluster members. The list
of candidates includes nearly 3700 stars, of which we estimate ~2700 genuine
NGC6530 members. Using Gaia parallaxes, the cluster distance is found to be
1325 pc, with errors of 0.5% (statistical) and 8.5% (systematic), in agreement
with previous determinations. The cluster morphology and boundaries are
established with great confidence, from members selected using different
criteria. There is no diffuse population of members around the cluster, but
there are minor member subgroups (associated with the stars 7 Sgr (F2II-III)
and HD 164536 (O7.5V)) in addition to the two main groups in the cluster core
and in the Hourglass nebula. We find a pattern of sequential star formation,
between ages of <0.5 Myr and ~5 Myr. Extinction is spatially non-uniform, with
part of the population still obscured by thick dust. The precise Gaia proper
motion data indicate that the NGC6530 parent cloud collided with the Galactic
plane ~4 Myr ago, and we suggest that event as the trigger of the bulk of star
formation in NGC6530. The internal cluster dynamics is also partially resolved
by the Gaia data, indicating expansion of the main cluster population.
