-/*
+﻿/*
 generate ONT
 Runtime 08:30 min
 

INSERT INTO		model_draft."ego_grid_lv_griddistrictwithoutpop" (geom,load_area_id)

SELECT (ST_DUMP(ST_UNION(cut.geom))).geom::geometry(Polygon,3035), onts.load_area_id
FROM model_draft."ego_grid_lv_cut" AS cut
	INNER JOIN model_draft."ego_grid_mvlv_substation" AS onts
ON cut.ont_id = onts.id
WHERE ont_id >= 0

  ont_count integer,
  ont_id integer,
  merge_id integer,
  CONSTRAINT ego_grid_lv_griddistrict_pkey2 PRIMARY KEY (id)
);

 
TRUNCATE TABLE 	model_draft."ego_grid_lv_griddistrict";
INSERT INTO		model_draft.ego_grid_lv_griddistrict (geom,load_area_id)
	SELECT	(ST_DUMP(ST_INTERSECTION(mun.geom,voi.geom))).geom ::geometry(Polygon,3035) AS geom, mun.id AS load_area_id
	FROM	model_draft."ego_demand_loadarea" AS mun,
		model_draft."ego_grid_lv_griddistrictsvoronoi" AS voi
