2025-03-04     2025-03-05     2025-03-06

timezone shapes complete with level 1 shapes in geoname_shapes

number of errors=0
number of warnings=0
Group=chkGrpTimezone

select geoshapeid,countrycode from geoname_shape where countrycode in (select countrycode from (select distinct countrycode,timezoneid from geoname_timezone) t group by countrycode having count(*)=1) and level=1 and geoshapeid not in (select sourcegeoshapeid from geoname_timezone where sourcegeoshapeid >0)

null
insert into geoname_timezone(timezoneshapeid,wkb_geometry,timezoneid,countrycode,layer,source,sourcegeoshapeid,geography) select nextval('timezoneshapeid'),wkb_geometry,'America/St_Thomas',countrycode,1,source,geoshapeid,ST_GeographyFromText(st_astext(st_multi(wkb_geometry))) from geoname_shape where countrycode in (select countrycode from (select distinct countrycode,timezoneid from geoname_timezone) t group by countrycode having count(*)=1) and level=1 and geoshapeid not in (select sourcegeoshapeid from geoname_timezone where sourcegeoshapeid >0) and geoname_shape.countrycode='VI';

geoshapeid	countrycode