 UNION ALL
 
 -- query 2: select point transmitters
-SELECT
-point_location.locationid,
-point_georef.northing,
-point_georef.easting,
-multipoint_location.locationid 
-
+SELECT "tx" as txrx,
+txconfig.licenceid as licenceid,
+point_location.locationid as point_locationid,
+rxconfig.locationid as multipoint_locationid
 
 FROM location as point_location
 


JOIN location AS multipoint_location
ON multipoint_location.locationid = txconfig.locationid

JOIN geographicreference AS point_georef
ON point_georef.locationid = point_location.locationid

-- select only WGS84 datum LatLngs
WHERE point_georef.georeferencetypeid = 3

-- select points where one is a "POINT", and the other isn't
AND point_location.locationtypeid = 4 
AND multipoint_location.locationtypeid != 4

-- Objective: find all the point-to-multipoint links, so we can
-- plot them on a map as placemarks

SELECT
txrx,
point_location.locationname,
multipoint_location.locationname,
georef.easting,
georef.northing,
trim(clientname.name),
subquery.licenceid,
point_locationid,
multipoint_locationid

FROM (
-- query 1: select point receivers
SELECT "rx" as txrx,
rxconfig.licenceid as licenceid,
point_location.locationid as point_locationid,
txconfig.locationid as multipoint_locationid

FROM location as point_location

