SQL, 379 346 244 bytes
This uses Microsoft T-SQL in SQL Management Studio's (SSMS) to generate spatial data. This code should work with Oracle's PL-SQL with few changes. Not sure about how it would work with others.
Updated with changes to reduce byte count by t-clausen.dk and removed unnecessary spaces and line breaks, though it's not very readable anymore.
DECLARE @C INT=1,@ VARCHAR(MAX)='' WHILE @C<32 SELECT @+='|.0,0 .x'+iif(@C=14,'|26,0 x',''), @C+=1 SET @=REPLACE(REPLACE(REPLACE(@+'|-26,0 -26?', '|','SELECT CAST(''POLYGON((0 0,78 0,78 '),'x','26?UNION ALL '),'?',',0 0))''AS GEOMETRY)')EXEC(@)
Update using REPLACE to cut out redundant parts of the strings and removing some extra spaces after commas:
DECLARE @C INT = 1,@S VARCHAR(MAX) = '',@G VARCHAR(99)='|1 0,1 .1,0 .1,0 0))'' AS GEOMETRY) G UNION ALL '
WHILE @C<=31 --loop is just to cycle through the colors
BEGIN
SET @S+=@G --MERGE SELECT STATEMENTS OF UNVIEWABLE OBJECTS (TOO SMALL) FOR WRONG COLORS
IF @C=14 SET @S+='|78 0,78 26,0 26,0 0))'' AS GEOMETRY) UNION ALL ' --ADD TOP OF FLAG IN BLUE
SET @C+=1 --UPDATE COLOR COUNTER
END
SET @S+='|78 0,78 -26,0 -26,0 0))'' AS GEOMETRY)'
SELECT @S = REPLACE(@S,'|','SELECT CAST(''POLYGON ((0 0,')
EXEC (@S) --execute query
Original T_SQL:
DECLARE @C INT = 1,@S VARCHAR(MAX) = '',@G VARCHAR(99)='SELECT CAST(''POLYGON ((0 0, 1 0, 1 .1, 0 .1, 0 0))'' AS GEOMETRY) G UNION ALL '
WHILE @C<=31 --loop is just to cycle through the colors
BEGIN
SET @S+=@G --MERGE SELECT STATEMENTS OF UNVIEWABLE OBJECTS (TOO SMALL) FOR WRONG COLORS
IF @C=14 SET @S+='SELECT CAST(''POLYGON ((0 0, 78 0, 78 26, 0 26, 0 0))'' AS GEOMETRY) UNION ALL ' --ADD TOP OF FLAG IN BLUE
SET @C+=1 --UPDATE COLOR COUNTER
END
SET @S+='SELECT CAST(''POLYGON ((0 0, 78 0, 78 -26, 0 -26, 0 0))'' AS GEOMETRY)' --ADD BOTTOM OF FLAG IN YELLOW(ish)
EXEC (@S) --execute query
Unfortunately, the colors look a little faded. Apologies to Ukraine for the bad colors. There don't seem to be too many colors available and they are all faded tones.
SQL Fiddle doesn't handle the spatial data. If there's another fiddle site that does, let me know or add a link. Or if there's a way to set the colors.
#fbd02a
and the blue is#1a54b2
, as opposed to the#ffd700
and#0057b7
specified in the text. \$\endgroup\$