Gruppen und Themen für ALKIS

Aus kvwmap
Version vom 31. Mai 2021, 10:57 Uhr von Rahn (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

Wichtige Hinweise

Die ALKIS-Komponenten von kvwmap basieren ab Version 2.8 auf dem vollständigen ALKIS-Datenbank-Schema. kvwmap unterstützt die Vollhistorisierung der NAS-Daten, weshalb alle Abfragen mit einem zeitlichen Filter versehen werden müssen. In den SQL-Abfragen "data" und "query" der Layerdefinitionen kann das Schlüsselwort $hist_timestamp verwendet werden. $hist_timestamp wird von kvwmap zur Laufzeit durch den vom Nutzer frei einstellbaren Zeitpunkt ersetzt. Für einen simplen Flurstückslayer sehen "query" und "data" folgendermaßen aus:

query:

SELECT * FROM ax_flurstueck WHERE tsrange(beginnt, endet) @> COALESCE(NULLIF('$hist_timestamp', '')::timestamp, localtimestamp)

data:

wkb_geometry from (select wkb_geometry, ogc_fid from alkis.ax_flurstueck where tsrange(beginnt, endet) @> COALESCE(NULLIF('$hist_timestamp', '')::timestamp, localtimestamp)) as foo using unique ogc_fid using srid=25833

ALKIS-Basisthemen

#Angaben zum Flurstück

#Flurstück

SET @group_id = 1;
SET @connection = 'user=xxxx password=xxxx dbname=kvwmapsp';

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Flurstuecke','','2',@group_id,'SELECT wkb_geometry, f.flurstueckskennzeichen as flurstkennz, \'\' as flurnr, \'\' AS entsteh, \'\' AS letzff, \'\' AS status, \'\' AS flaeche, \'\' AS karte, \'\' AS kreisid, \'\' AS kreisname, \'\' as gemkgschl, \'\' AS gemkgname, \'\' AS gemeinde, \'\' AS gemeindename,\'\' AS finanzamt,\'\' AS finanzamtname, \'\' AS forstschluessel, \'\' AS forstname, \'\' AS lagebezeichnung, \'\' AS nutzung, \'\' AS ausfstelle,\'\' AS verfahren, \'\' AS vorgaenger, \'\' AS nachfolger, \'\' AS bestandsnr,\'\' AS eigentuemer, \'\' AS freitext, \'\' AS hinweis,\'\' AS baulasten, \'\' AS amtsgerichtname, \'\' AS amtsgerichtnr,\'\' AS grundbuchbezirkname, \'\' AS grundbuchbezirkschl, \'\' AS klassifizierung, \'\' as festlegungen FROM ax_flurstueck AS f WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','ax_flurstueck','wkb_geometry from (select wkb_geometry, ogc_fid from alkis.ax_flurstueck WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique ogc_fid using srid=25833','alkis','','','','','',NULL,NULL,'',@connection,'','6','ogc_fid','ogc_fid','3','pixels','25833','Flurstuecke_customALKIS.php','1',NULL,'1000',NULL,NULL,'','EPSG:25833','ALK-Flurstücke','1.1.0','image/png','60','','','','','1','0','','','','','0');

SET @last_layer_id582=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('alle',@last_layer_id582,'','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','  ','0 0 0',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,'');
SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);

#Flurstücksnummer


#Wird in Verbindung mit dem Flurstückslayer benutzt und über "Requires" eingebunden.

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Flurstücksnummern','','0',@group_id,'','pp_flurstueck_nr','the_geom from (SELECT * FROM alkis.pp_flurstueck_nr WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique gid using SRID=25833','alkis','','','','','fsnum','10000','1','',@connection,'','6','','','3','pixels','25833','','0',NULL,'30000994','1','10000','','EPSG:25833','','1.1.1','image/png','60','','','','','0','0','','ALKIS Flurstücksnummer für Layer Flurstücke zur Beschriftung','Landkreis Ludwigslust-Parchim / Landeshauptstadt Schwerin, FD Vermessung und Geoinformation','','0');
SET @last_layer_id11546=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('',@last_layer_id11546,'(1=1)','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial','0','100 100 100','254 254 254','',NULL,NULL,'','',NULL,NULL,'9','7','14',NULL,'0','-4',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);


#Grenzpunkte vermarkt und unvermarkt


#Wird in Verbindung mit dem Flurstückslayer benutzt und über "Requires" eingebunden.

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Flst_Grenzpunkt','','0',@group_id,'','lk_grenzpunkte','wkb_geometry from (select * from alkis.lk_grenzpunkte WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN o_endet IS NULL and p_endet IS NULL ELSE o_beginnt::text <= \'$hist_timestamp\' and p_beginnt::text <= \'$hist_timestamp\' AND ((\'$hist_timestamp\' < o_endet::text and \'$hist_timestamp\' < p_endet::text) or (o_endet IS NULL and p_endet IS NULL)) END) as foo using unique oid using srid=25833','alkis','','','','','','1000','50','',@connection,'','6','','','3','pixels','25833','','0',NULL,'30000995','1','5005','255 255 255','EPSG:2398','','1.1.0','image/png','60','','','','','0','0','','ALKIS Grenzpunkte zur Darstellung im  Flurstückslayer','Landkreis Ludwigslust-Parchim / Landeshauptstadt Schwerin, FD Vermessung und Geoinformation','','0');
SET @last_layer_id11596=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('',@last_layer_id11596,'(\'[abmarkung_marke]\'<\'9000\')','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','6','255 255 255','','100 100 100','4','8','','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'8 16 0','255 255 255','',NULL,NULL,'255 255 255','',NULL,NULL,'7','7','12','6',NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('',@last_layer_id11596,'(\'[abmarkung_marke]\'>\'9000\')','2','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES('26','punkt','6','255 255 255','255 255 255','255 255 255','4','8','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES('26','punkt','1.25','100 100 100','255 255 255','','1','3','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);


#Zuordnungspfeil


#Wird in Verbindung mit dem Flurstückslayer benutzt und über "Requires" eingebunden.

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Zuordnungspfeil','','1',@group_id,'','s_zuordungspfeil_flurstueck','wkb_geometry from (SELECT ogc_fid,wkb_geometry FROM alkis.s_zuordungspfeil_flurstueck WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique ogc_fid using SRID=25833','alkis','','','','','','10000','1','',@connection,'','6','','','3','pixels','25833','','0',NULL,'30001179','1','5000','','EPSG:25833','','1.1.1','image/png','60','','','','','0','0','','Zuordnungspfeil für Flurstücksnummern als Zusatz für Layer Flurstücke in ALKIS','Landkreis Ludwigslust-Parchim / Landeshauptstadt Schwerin, FD Vermessung und Geoinformation','','0');
SET @last_layer_id1260=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('',@last_layer_id1260,'','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'linie','1','100 100 100','','','1','2','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);


#Zuordnungspfeilspitze


#Wird in Verbindung mit dem Flurstückslayer benutzt und über "Requires" eingebunden. Benötigt das fontset "alkis_textsymbols" in den fonts von kvwmap. 

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Zuordungspfeilspitze','','0',@group_id,'','pp_zuordungspfeilspitze_flurstueck','geom from (SELECT *, \'E\' as text FROM alkis.pp_zuordungspfeilspitze_flurstueck WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique ogc_fid using SRID=25833','alkis','','','','winkel','text','5000','1','',@connection,'','6','','','3','pixels','25833','','0',NULL,'30000765','1','5000','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Zuordungspfeilspitze für Layer Flurstuecke in ALKIS','Landkreis Ludwigslust-Parchim / Landeshauptstadt Schwerin, FD Vermessung und Geoinformation','','0');
SET @last_layer_id11567=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('',@last_layer_id11567,'','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','','0 0 0','  ','',NULL,NULL,'','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('alkis_text',NULL,'100 100 100','100 100 100','',NULL,NULL,'','',NULL,NULL,'3','2','6',NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,'1');
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);


#Zugehoerigkeitshaken


#Wird in Verbindung mit dem Flurstückslayer benutzt und über "Requires" eingebunden. Benötigt das fontset "alkis_textsymbols" in den fonts von kvwmap.

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Zugehoerigkeitshaken','','0',@group_id,'','s_zugehoerigkeitshaken_flurstueck','wkb_geometry from (SELECT ogc_fid, wkb_geometry, drehwinkel, \'0\' as text FROM alkis.s_zugehoerigkeitshaken_flurstueck WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique ogc_fid using SRID=25833','alkis','','','','drehwinkel','text','5000','1','',@connection,'','6','','','3','pixels','25833','','0',NULL,'30000765','1','5000','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Zugehoerigkeitshaken für Layer Flurstuecke in ALKIS','Landkreis Ludwigslust-Parchim / Landeshauptstadt Schwerin, FD Vermessung und Geoinformation','','0');
SET @last_layer_id11431=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('',@last_layer_id11431,'','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','0','0 0 0','  ','',NULL,NULL,'','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('alkis_text','0','100 100 100','100 100 100','','0','0','','','0','0','14','7','24',NULL,'1','-8',NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);


#Grenzpunkt


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Grenzpunkte','','0',@group_id,'select gml_id, punktkennung,nbz, pnr, cast(o_beginnt as date) as o_beginnt, cast(o_endet as date) as o_endet, festgestelltergrenzpunkt, zustaendigestelle_stelle, zustaendige_stelle, zeitpunktderentstehung, abmarkung_marke, verm_bedeutung, bemerkungzurabmarkung, bemerkung_zurabmarkung, relativehoehe, besonderepunktnummer, sonstigeeigenschaft, zeigtauf, ax_punktortta_gml_id, cast(p_beginnt as date) as p_beginnt, cast(p_endet as date) as p_endet, position, koordinatenstatus, genauigkeitsstufe, punktgenauigkeit, vertrauenswuerdigkeit, punktvertrauenswuerdigkeit, source_description, datenerhebung, kartendarstellung, hinweise, wkb_geometry from lk_grenzpunkte WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN o_endet IS NULL and p_endet IS NULL ELSE o_beginnt::text <= \'$hist_timestamp\' and p_beginnt::text <= \'$hist_timestamp\' AND ((\'$hist_timestamp\' < o_endet::text and \'$hist_timestamp\' < p_endet::text) or (o_endet IS NULL and p_endet IS NULL)) END','lk_grenzpunkte','wkb_geometry from (select * from alkis.lk_grenzpunkte WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN o_endet IS NULL and p_endet IS NULL ELSE o_beginnt::text <= \'$hist_timestamp\' and p_beginnt::text <= \'$hist_timestamp\' AND ((\'$hist_timestamp\' < o_endet::text and \'$hist_timestamp\' < p_endet::text) or (o_endet IS NULL and p_endet IS NULL)) END) as foo using unique gml_id using srid=25833','alkis','','','','','','1000','50','',@connection,'','6','','','3','pixels','25833','','1',NULL,'30000790','1','2000','','EPSG:25833','','1.1.0','image/png','60','','','','','0','0','','Grenzpunkt mit zugehörigem Punktort','Vermessungs- und Geoinformationsbehörde VR','','0');
SET @last_layer_id952=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'abmarkung_marke','abmarkung_marke','lk_grenzpunkte','lk_grenzpunkte','int4','','','1','32','0','','Text','','Abmarkung','','','','','','Grenzpunkt',NULL,'0','10',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'ax_punktortta_gml_id','ax_punktortta_gml_id','lk_grenzpunkte','lk_grenzpunkte','varchar','','','1','16',NULL,'','Text','','GML-ID','','','','','','Punktort',NULL,'0','18','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'bemerkungzurabmarkung','bemerkungzurabmarkung','lk_grenzpunkte','lk_grenzpunkte','int4','','','1','32','0','','Text','','Bemerkung zur Abmarkung','','','','','','Grenzpunkt',NULL,'0','12',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'bemerkung_zurabmarkung','bemerkung_zurabmarkung','lk_grenzpunkte','lk_grenzpunkte','varchar','','','1',NULL,NULL,'','Text','','Bemerkung zur Abmarkung','','','','','','Grenzpunkt',NULL,'0','13','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'besonderepunktnummer','besonderepunktnummer','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','besondere Punktnummer','','','','','','Grenzpunkt',NULL,'0','15','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'datenerhebung','datenerhebung','lk_grenzpunkte','lk_grenzpunkte','varchar','','','1',NULL,NULL,'','Text','','Datenerhebung','','','','','','Punktort',NULL,'0','28','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'festgestelltergrenzpunkt','festgestelltergrenzpunkt','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','festgestellter Grenzpunkt','','','','','','Grenzpunkt',NULL,'0','6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'genauigkeitsstufe','genauigkeitsstufe','lk_grenzpunkte','lk_grenzpunkte','int4','','','1','32','0','','Text','','Genauigkeitsstufe','','','','','','Punktort',NULL,'0','23',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'gml_id','gml_id','lk_grenzpunkte','lk_grenzpunkte','varchar','','','1','16',NULL,'','Text','','GML-ID','','','','','','Grenzpunkt',NULL,'0','0',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'hinweise','hinweise','lk_grenzpunkte','lk_grenzpunkte','varchar','','','1',NULL,NULL,'','Text','','Hinweise','','','','','','Punktort',NULL,'0','30','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'kartendarstellung','kartendarstellung','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','Kartendarstellung','','','','','','Punktort',NULL,'0','29','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'koordinatenstatus','koordinatenstatus','lk_grenzpunkte','lk_grenzpunkte','int4','','','1','32','0','','Text','','Koordinatenstatus','','','','','','Punktort',NULL,'0','22','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'nbz','nbz','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','Nummerierungsbezirk','','','','','','Grenzpunkt',NULL,'0','2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'o_beginnt','o_beginnt','lk_grenzpunkte','lk_grenzpunkte','not_saveable','','','1',NULL,NULL,'','Text','','Lebenszeitintervall beginnt','','','','','','Grenzpunkt',NULL,'0','4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'o_endet','o_endet','lk_grenzpunkte','lk_grenzpunkte','not_saveable','','','1',NULL,NULL,'','Text','','Lebenszeitintervall endet','','','','','','Grenzpunkt',NULL,'0','5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'pnr','pnr','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','Punktnummer','','','','','','Grenzpunkt',NULL,'0','3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'position','position','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','Position','','','','','','Punktort',NULL,'0','21','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'punktgenauigkeit','punktgenauigkeit','lk_grenzpunkte','lk_grenzpunkte','varchar','','','1',NULL,NULL,'','Text','','Punktgenauigkeit','','','','','','Punktort',NULL,'0','24',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'punktkennung','punktkennung','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','Punktkennung','','','','','','Grenzpunkt',NULL,'0','1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'punktvertrauenswuerdigkeit','punktvertrauenswuerdigkeit','lk_grenzpunkte','lk_grenzpunkte','varchar','','','1',NULL,NULL,'','Text','','Punktzuverlässigkeit','','','','','','Punktort',NULL,'0','26',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'p_beginnt','p_beginnt','lk_grenzpunkte','lk_grenzpunkte','not_saveable','','','1',NULL,NULL,'','Text','','Lebenszeitintervall beginnt','','','','','','Punktort',NULL,'0','19','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'p_endet','p_endet','lk_grenzpunkte','lk_grenzpunkte','not_saveable','','','1',NULL,NULL,'','Text','','Lebenszeitintervall endet','','','','','','Punktort',NULL,'0','20','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'relativehoehe','relativehoehe','lk_grenzpunkte','lk_grenzpunkte','float8','','','1','53',NULL,'','Text','','Relative Höhe','','','','','','Grenzpunkt',NULL,'0','14','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'sonstigeeigenschaft','sonstigeeigenschaft','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','sonstige Eigenschaft','','','','','','Grenzpunkt',NULL,'0','16',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'source_description','source_description','lk_grenzpunkte','lk_grenzpunkte','int4','','','1','32','0','','Text','','Datenerhebung Schlüssel','','','','','','Punktort',NULL,'0','27','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'verm_bedeutung','verm_bedeutung','lk_grenzpunkte','lk_grenzpunkte','varchar','','','1',NULL,NULL,'','Text','','Vermarkung','','','','','','Grenzpunkt',NULL,'0','11',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'vertrauenswuerdigkeit','vertrauenswuerdigkeit','lk_grenzpunkte','lk_grenzpunkte','int4','','','1','32','0','','Text','','Vertrauenswürdigkeit','','','','','','Punktort',NULL,'0','25',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'wkb_geometry','wkb_geometry','lk_grenzpunkte','lk_grenzpunkte','geometry','POINT','','1',NULL,NULL,'','Text','','','','','','','','Punktort',NULL,'0','31','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'zeigtauf','zeigtauf','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','zeigt auf','','','','','','Grenzpunkt',NULL,'0','17','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'zeitpunktderentstehung','zeitpunktderentstehung','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','Zeitpunkt der Entstehung','','','','','','Grenzpunkt',NULL,'0','9','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'zustaendigestelle_stelle','zustaendigestelle_stelle','lk_grenzpunkte','lk_grenzpunkte','text','','','1',NULL,NULL,'','Text','','zuständige Stelle Schlüssel','','','','','','Grenzpunkt',NULL,'0','7','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id952,'zustaendige_stelle','zustaendige_stelle','lk_grenzpunkte','lk_grenzpunkte','varchar','','','1',NULL,NULL,'','Text','','zuständige Stelle','','','','','','Grenzpunkt',NULL,'0','8','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('nicht abg. vermessen',@last_layer_id952,'([source_description] < 1801 AND [abmarkung_marke] = 9500)','20','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','6','255 255 255','','255 255 255','5','6','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','3','0 0 0','','-1 -1 -1','2','3','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('abgemarkt digitalisiert',@last_layer_id952,'([source_description] > 1899  AND [abmarkung_marke] != 9500)','30','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','6','0 102 202','','0 102 202','5','7','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','5','255 255 255','','-1 -1 -1','4','6','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('nicht abg. digitalisiert',@last_layer_id952,'([source_description] > 1899  AND [abmarkung_marke] = 9500)','40','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','6','255 255 255','','255 255 255','5','6','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','3','0 102 202','','-1 -1 -1','2','3','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('abgemarkt vermessen',@last_layer_id952,'([source_description] < 1801 AND [abmarkung_marke] != 9500)','10','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','6','0 0 0','','-1 -1 -1','5','7','','','1',NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','5','255 255 255','','-1 -1 -1','4','6','','','1',NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);



#Grenzpunktkennung


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Grenzpunktkennung','','4',@group_id,'','lk_grenzpunkte','wkb_geometry from (select oid, gml_id, source_description, substring(punktkennung from 10) as punktnummer, wkb_geometry from alkis.lk_grenzpunkte WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN o_endet IS NULL and p_endet IS NULL ELSE o_beginnt::text <= \'$hist_timestamp\' and p_beginnt::text <= \'$hist_timestamp\' AND ((\'$hist_timestamp\' < o_endet::text and \'$hist_timestamp\' < p_endet::text) or (o_endet IS NULL and p_endet IS NULL)) END) as foo using unique gml_id using srid=25833','alkis','','','','','punktnummer','1000','50','',@connection,'','6','','','3','pixels','25833','','0',NULL,'30000790','1','1000','','EPSG:25833','','1.1.0','image/png','60','','','','','0','0','','','Vermessungs- und Geoinformationsbehörde VR','','0');
SET @last_layer_id50303579=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('vermessener Punkt',@last_layer_id50303579,'([ax_datenerhebung_punktort] < 1801)','10','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial_bold',NULL,'255 255 255','80 80 80','',NULL,NULL,'','',NULL,NULL,'6','5','6',NULL,'20','-5',NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,'1');
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);


#besondere Flurstücksgrenze


#Strittige Grenze

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Alkis strittige Grenze','','1',@group_id,'','ax_besondereflurstuecksgrenze','the_geom from  (SELECT ogc_fid as oid, gml_id, identifier, beginnt, endet, advstandardmodell, anlass, artderflurstuecksgrenze, wkb_geometry as the_geom FROM alkis.ax_besondereflurstuecksgrenze fg WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END and (1000 = ANY (fg.artderflurstuecksgrenze)) ) as foo using unique oid using srid=25833','alkis','','','','','','2000','1','',@connection,'','6','','','3','pixels','25833','','0','100','20250994','1','200010','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Strittige Grenzen im Landkreis Ludwigslust-Parchim','Vermessungs- und Geoinformationsbehörde LWL-PCH','','0');
SET @last_layer_id11424=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('strittige Grenze',@last_layer_id11424,'','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'circle','3','64 0 181','','0 51 0','7','15','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'0 0 0','255 204 51','',NULL,NULL,'255 204 51','',NULL,NULL,'11','11','24',NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1','35',NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);


#Angaben zum Netzpunkt

#Aufnahmepunkt


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Alkis AP','','0',@group_id,'select * from lk_ap WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','lk_ap','the_geom from (select oid, punktkennung, wkb_geometry as the_geom from alkis.lk_ap WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','punktkennung','1000','50','',@connection,'','6','','','3','pixels','25833','','1',NULL,'30000786','0','25001','255 255 255','EPSG:2398','','1.1.0','image/png','60','','','','','0','0','','Qualität der Grenz- und Gebäudepunkte. Ableitung aus der ALK.','Vermessungs- und Geoinformationsbehörde LWL-PCH','','0');
SET @last_layer_id955=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'bedeutung','bedeutung','lk_ap','lk_ap','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','11','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'beginnt','beginnt','lk_ap','lk_ap','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'endet','endet','lk_ap','lk_ap','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'genauigkeitsstufe','genauigkeitsstufe','lk_ap','lk_ap','int4','','','1','32','0','','Text','','','','','','','','',NULL,'0','8','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'gml_id','gml_id','lk_ap','lk_ap','varchar','','','1','16',NULL,'','Text','','','','','','','','',NULL,'0','1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'koord','koord','lk_ap','lk_ap','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','12','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'oid','oid','lk_ap','lk_ap','oid','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'punktgenauigkeit','punktgenauigkeit','lk_ap','lk_ap','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','9','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'punktkennung','punktkennung','lk_ap','lk_ap','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'sonstigeeigenschaft','sonstigeeigenschaft','lk_ap','lk_ap','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'vermarkung_marke','vermarkung_marke','lk_ap','lk_ap','int4','','','1','32','0','','Text','','','','','','','','',NULL,'0','6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'verm_bedeutung','verm_bedeutung','lk_ap','lk_ap','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','7','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'vertrauenswuerdigkeit','vertrauenswuerdigkeit','lk_ap','lk_ap','int4','','','1','32','0','','Text','','','','','','','','',NULL,'0','10','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id955,'wkb_geometry','wkb_geometry','lk_ap','lk_ap','geometry','POINT','','1',NULL,NULL,'','Geometrie','','','','','','','','',NULL,'0','13','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('AP',@last_layer_id955,'','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'circle','30','93 0 149','','0 255 0','7','8','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'8 16 0','255 255 255','',NULL,NULL,'255 255 255','',NULL,NULL,'7','7','12','6',NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);


 

# Sicherungspunkt


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Alkis SP','','0',@group_id,'select * from lk_sp WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','lk_sp','the_geom from (select oid, punktkennung, wkb_geometry as the_geom from alkis.lk_sp WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','punktkennung','1000','50','',@connection,'','6','','','3','pixels','25833','','1',NULL,'30000784','1','25001','255 255 255','EPSG:2398','','1.1.0','image/png','60','','','','','0','0','','Qualität der Grenz- und Gebäudepunkte. Ableitung aus der ALK.','Vermessungs- und Geoinformationsbehörde LWL-PCH','','0');
SET @last_layer_id956=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'bedeutung','bedeutung','lk_sp','lk_sp','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'10','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'beginnt','beginnt','lk_sp','lk_sp','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'endet','endet','lk_sp','lk_sp','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'genauigkeitsstufe','genauigkeitsstufe','lk_sp','lk_sp','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'7','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'koord','koord','lk_sp','lk_sp','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'11','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'oid','oid','lk_sp','lk_sp','oid','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'punktgenauigkeit','punktgenauigkeit','lk_sp','lk_sp','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'8','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'punktkennung','punktkennung','lk_sp','lk_sp','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'sonstigeeigenschaft','sonstigeeigenschaft','lk_sp','lk_sp','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'vermarkung_marke','vermarkung_marke','lk_sp','lk_sp','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'verm_bedeutung','verm_bedeutung','lk_sp','lk_sp','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'vertrauenswuerdigkeit','vertrauenswuerdigkeit','lk_sp','lk_sp','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'9','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id956,'wkb_geometry','wkb_geometry','lk_sp','lk_sp','geometry','POINT','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'12','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('SP',@last_layer_id956,'','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES('0','circle','30','164 152 255','','0 255 0','7','8','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'8 16 0','255 255 255','',NULL,NULL,'255 255 255','',NULL,NULL,'7','7','12','6',NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);


 

#sonst. Vermessungspunkt


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Alkis sonstiger Verm_PKT','0',@group_id,'select * from lk_so_punkte WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','the_geom from (select oid, punktkennung, wkb_geometry as the_geom from alkis.lk_so_punkte WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','punktkennung','1000','50','',@connection,'','6','','','3','pixels','25833','','1',NULL,'30000782','1','25001','255 255 255','EPSG:2398','','1.1.0','image/png','60','','','','','0','0','','Qualität der Grenz- und Gebäudepunkte. Ableitung aus der ALK.','Vermessungs- und Geoinformationsbehörde LWL-PCH','','0');
SET @last_layer_id1149=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'bedeutung','bedeutung','lk_so_punkte','lk_so_punkte','varchar','','','1','200','Text','','','','8','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'genauigkeitsstufe','genauigkeitsstufe','lk_so_punkte','lk_so_punkte','int4','','','1','32','Text','','','','5','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'koord','koord','lk_so_punkte','lk_so_punkte','text','','','1',NULL,'Text','','','','11','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'oid','oid','lk_so_punkte','lk_so_punkte','oid','','','1',NULL,'Text','','','','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'punktgenauigkeit','punktgenauigkeit','lk_so_punkte','lk_so_punkte','varchar','','','1','50','Text','','','','6','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'punktkennung','punktkennung','lk_so_punkte','lk_so_punkte','varchar','','','1',NULL,'Text','','','','1','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'sonstigeeigenschaft','sonstigeeigenschaft','lk_so_punkte','lk_so_punkte','_varchar','','','1',NULL,'Text','','','','2','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'vermarkung_marke','vermarkung_marke','lk_so_punkte','lk_so_punkte','int4','','','1','32','Text','','','','3','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'verm_bedeutung','verm_bedeutung','lk_so_punkte','lk_so_punkte','varchar','','','1','100','Text','','','','4','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'vertrauenswuerdigkeit','vertrauenswuerdigkeit','lk_so_punkte','lk_so_punkte','int4','','','1','32','Text','','','','7','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id1149,'wkb_geometry','wkb_geometry','lk_so_punkte','lk_so_punkte','geometry','POINT','','1',NULL,'Text','','','','10','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('sonst.PKT',@last_layer_id1149,'','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES('','circle','30','255 0 0','','0 255 0','7','8',NULL,'',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'8 16 0','255 255 255','',NULL,NULL,'255 255 255','',NULL,NULL,'7','7','12','6',NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);

 

#Gebäude

#Gebäude

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Alkis Gebäude','','2',@group_id,'SELECT * FROM lk_gebaeude WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','lk_gebaeude','the_geom from (select ogc_fid as oid, wkb_geometry as the_geom from alkis.lk_gebaeude WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','',NULL,NULL,'',@connection,'','6','','','3','pixels','25833','','1',NULL,'30000765','1','100000','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Gebäude in ALKIS','Vermessungs- und Geoinformationsbehörde LWL-PCH','','0');
SET @last_layer_id958=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'ax_datenerhebung','ax_datenerhebung','lk_gebaeude','lk_gebaeude','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'16','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'beginnt','beginnt','lk_gebaeude','lk_gebaeude','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'bezeichner','bezeichner','lk_gebaeude','lk_gebaeude','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'dachform','dachform','lk_gebaeude','lk_gebaeude','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'13','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'dach_bezeichner','dach_bezeichner','lk_gebaeude','lk_gebaeude','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'14','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'endet','endet','lk_gebaeude','lk_gebaeude','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'gebaeudefunktion','gebaeudefunktion','lk_gebaeude','lk_gebaeude','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'gebaeudezustand','gebaeudezustand','lk_gebaeude','lk_gebaeude','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'10','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'gml_id','gml_id','lk_gebaeude','lk_gebaeude','varchar','','','1','16',NULL,'','Text','','','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'herkunft','herkunft','lk_gebaeude','lk_gebaeude','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'17','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'hochhaus','hochhaus','lk_gebaeude','lk_gebaeude','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'15','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'lagezurerdoberflaeche','lagezurerdoberflaeche','lk_gebaeude','lk_gebaeude','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'12','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'name','name','lk_gebaeude','lk_gebaeude','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'8','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'objekthoehe','objekthoehe','lk_gebaeude','lk_gebaeude','float8','','','1','53',NULL,'','Text','','','','','','','','',NULL,NULL,'11','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'ogc_fid','ogc_fid','lk_gebaeude','lk_gebaeude','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'oid','oid','lk_gebaeude','lk_gebaeude','oid','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'weiterefunktion','weiterefunktion','lk_gebaeude','lk_gebaeude','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'7','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'wkb_geometry','wkb_geometry','lk_gebaeude','lk_gebaeude','geometry','GEOMETRY','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'18','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id958,'zustand','zustand','lk_gebaeude','lk_gebaeude','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'9','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('alle',@last_layer_id958,'','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','  ','0 0 0',NULL,NULL,'','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'240 0 19','255 255 255','',NULL,NULL,'255 255 255','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);

 

#weitere Varianten

#gebäudebez. Bauwerke


SET @group_id = @group_id;
SET @connection = @connection;
INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Alkis gebäudebez. Bauwerke','','2',@group_id,'SELECT * FROM lk_bes_gebaeude WHERE bauwerksfunktion < 1700 AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','lk_bes_gebaeude','the_geom from (select ogc_fid as oid, beschreibung, bauwerksfunktion, wkb_geometry, wkb_geometry as the_geom from alkis.lk_bes_gebaeude WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','beschreibung','505','1','',@connection,'','6','','','3','pixels','25833','','1',NULL,'30000765','1','100000','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Gebäude in ALKIS','Vermessungs- und Geoinformationsbehörde LWL-PCH','','0');
SET @last_layer_id959=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id959,'bauwerksfunktion','bauwerksfunktion','lk_bes_gebaeude','lk_bes_gebaeude','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id959,'beginnt','beginnt','lk_bes_gebaeude','lk_bes_gebaeude','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id959,'beschreibung','beschreibung','lk_bes_gebaeude','lk_bes_gebaeude','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id959,'endet','endet','lk_bes_gebaeude','lk_bes_gebaeude','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id959,'gml_id','gml_id','lk_bes_gebaeude','lk_bes_gebaeude','varchar','','','1','16',NULL,'','Text','','','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id959,'ogc_fid','ogc_fid','lk_bes_gebaeude','lk_bes_gebaeude','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id959,'oid','oid','lk_bes_gebaeude','lk_bes_gebaeude','oid','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id959,'wkb_geometry','wkb_geometry','lk_bes_gebaeude','lk_bes_gebaeude','geometry','GEOMETRY','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'7','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('alle',@last_layer_id959,'(\'[bauwerksfunktion]\'<\'1700\')','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','2','-1 -1 -1','  ','23 0 108','2','2','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'240 0 19','255 255 255','',NULL,NULL,'255 255 255','',NULL,NULL,'4','4','6',NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);


#Bauwerke

#zusammengefasste Bauwerkstabelle

SET @group_id = @group_id; 
SET @connection = @connection; 

# Bauwerk oder Anlage für Industrie und Gewerbe
 
INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_BauwerkAnlageIndustrie','','2',@group_id,'SELECT * FROM ax_bauwerkoderanlagefuerindustrieundgewerbe WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND (geometrytype(wkb_geometry) in (\'POLYGON\', \'MULTIPOLYGON\'))','ax_bauwerkoderanlagefuerindustrieundgewerbe','wkb_geometry from (select oid, ogc_fid, endet, bauwerksfunktion, wkb_geometry from alkis.ax_bauwerkoderanlagefuerindustrieundgewerbe WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND geometrytype(wkb_geometry) in (\'POLYGON\', \'MULTIPOLYGON\')) as foo using unique ogc_fid using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','bauwerksfunktion','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','ALKIS_BauwerkAnlageIndustrieGewerbe','1.1.0','image/png','60','','','','','1','0','','','','','0');
SET @last_layer_id960=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'advstandardmodell','advstandardmodell','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'anlass','anlass','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'art','art','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','8','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'bauwerksfunktion','bauwerksfunktion','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','int4','','','0','32','0','','Auswahlfeld','select wert as value, beschreibung as output from alkis.ax_bauwerksfunktion_bauwerkoderanlagefuerindustrieundgewer','','','','','','','',NULL,'0','12','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'beginnt','beginnt','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','timestamp','','UNIQUE','0',NULL,NULL,'','Text','','','','','','','','',NULL,'0','4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'bezeichnung','bezeichnung','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','13','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'endet','endet','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'fachdatenobjekt_name','fachdatenobjekt_name','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','9','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'gml_id','gml_id','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','varchar','','UNIQUE','1','16',NULL,'','Text','','','','','','','','',NULL,'0','2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'hatdirektunten','hatdirektunten','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','20','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'herkunft','herkunft','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','16','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'identifier','identifier','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'istabgeleitetaus','istabgeleitetaus','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','18','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'istteilvon','istteilvon','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','21','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'name','name','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','14','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'objekthoehe','objekthoehe','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','float8','','','1','53',NULL,'','Text','','','','','','','','',NULL,'0','15','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'ogc_fid','ogc_fid','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','int4','','PRIMARY KEY','1','32','0','','Text','','','','','','','','',NULL,'0','0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'sonstigesmodell','sonstigesmodell','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','7','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'traegtbeizu','traegtbeizu','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','19','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'uri','uri','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','_varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,'0','10','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'wkb_geometry','wkb_geometry','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','geometry','GEOMETRY','','1',NULL,NULL,'','Geometrie','','','','','','','','',NULL,'0','11','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id960,'zustand','zustand','ax_bauwerkoderanlagefuerindustrieundgewerbe','ax_bauwerkoderanlagefuerindustrieundgewerbe','int4','','','1','32','0','','Text','','','','','','','','',NULL,'0','17','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Bauwerke oder Analgen Industrie/Gewerbe',@last_layer_id960,'([bauwerksfunktion] != 1210)','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','204 204 204','','0 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Klärbecken',@last_layer_id960,'([bauwerksfunktion] = 1210)','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','242 235 232','','0 204 204',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);

# Bauwerk oder Anlage für Sport, Freizeit und Erholung
 
INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_BauwerkSportFreizeitEr','2',@group_id,'SELECT * FROM ax_bauwerkoderanlagefuersportfreizeitunderholung WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND (GeometryType(wkb_geometry) IN (\'POLYGON\',\'MULTIPOLYGON\'))','wkb_geometry from (select oid, ogc_fid, bauwerksfunktion, endet, wkb_geometry from alkis.ax_bauwerkoderanlagefuersportfreizeitunderholung WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND GeometryType(wkb_geometry) IN (\'POLYGON\',\'MULTIPOLYGON\')) as foo using unique ogc_fid using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','bauwerksfunktion','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','ALKIS_BauwerkSportFreizeitErholung','1.1.0','image/png','60','','','','','1','0','','','','','0'); 
SET @last_layer_id9620532=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'advstandardmodell','advstandardmodell','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'anlass','anlass','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'bauwerksfunktion','bauwerksfunktion','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'beginnt','beginnt','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'endet','endet','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','bpchar','','','1','20','Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'gml_id','gml_id','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','varchar','','','0',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'identifier','identifier','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','varchar','','','1',NULL,'Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'name','name','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','varchar','','','1',NULL,'Text','','','','11','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'ogc_fid','ogc_fid','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','int4','','PRIMARY KEY','1','32','Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'sonstigesmodell','sonstigesmodell','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','_varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'sportart','sportart','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','int4','','','1','32','Text','','','','10','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620532,'wkb_geometry','wkb_geometry','ax_bauwerkoderanlagefuersportfreizeitunderholung','ax_bauwerkoderanlagefuersportfreizeitunderholung','geometry','POLYGON','','1',NULL,'Text','','','','12','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Spielfeld, Hart- /Rasenplatz',@last_layer_id9620532,'{1410,1411,1412}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','217 255 217','','82 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Rennbahn, Laufbahn',@last_layer_id9620532,'1420','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 235 245','','82 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Tribühne, Liegewiese, Schießanlage, sonst.',@last_layer_id9620532,'{1430,1432,1460,1470,1480,1490,1510,9999}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','82 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Tribühne überdacht',@last_layer_id9620532,'1431','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 128 128','','-1 -1 -1',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','82 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Stadion',@last_layer_id9620532,'1440','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'circle','2','-1 -1 -1','','82 0 0',NULL,'2','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','-1 -1 -1',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Schwimmbecken',@last_layer_id9620532,'1450','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','227 255 255','','0 204 204',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 

# Besonderer Bauwerkspunkt

INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_BesondBauwerksPkt','0',@group_id,'SELECT b.*, p.wkb_geometry FROM ax_besondererbauwerkspunkt b, ax_punktortag p WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN b.endet IS NULL AND p.endet IS NULL ELSE b.beginnt::text <= \'$hist_timestamp\' and p.beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < b.endet::text or b.endet IS NULL) AND (\'$hist_timestamp\' < p.endet::text or p.endet IS NULL) END AND (b.gml_id = ANY(p.istteilvon) AND geometrytype(p.wkb_geometry) = \'POINT\')','wkb_geometry from (SELECT b.oid, b.gml_id, b.endet, p.wkb_geometry FROM alkis.ax_besondererbauwerkspunkt b, alkis.ax_punktortag p WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN b.endet IS NULL AND p.endet IS NULL ELSE b.beginnt::text <= \'$hist_timestamp\' and p.beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < b.endet::text or b.endet IS NULL) AND (\'$hist_timestamp\' < p.endet::text or p.endet IS NULL) END AND (b.gml_id = ANY(p.istteilvon) AND geometrytype(p.wkb_geometry) = \'POINT\')) as foo using unique gml_id using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','AX_BesondererBauwerkspunkt','1.1.0','image/png','60','','','','','0','0','','','','','0'); 
SET @last_layer_id9620537=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'advstandardmodell','advstandardmodell','ax_besondererbauwerkspunkt','b','_varchar','','','1',NULL,'Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'anlass','anlass','ax_besondererbauwerkspunkt','b','varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'beginnt','beginnt','ax_besondererbauwerkspunkt','b','bpchar','','','1','20','Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'dummy','dummy','ax_besondererbauwerkspunkt','b','geometry','POINT','','1',NULL,'Text','','','','12','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'endet','endet','ax_besondererbauwerkspunkt','b','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'gml_id','gml_id','ax_besondererbauwerkspunkt','b','varchar','','','0',NULL,'Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'identifier','identifier','ax_besondererbauwerkspunkt','b','varchar','','','1',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'land','land','ax_besondererbauwerkspunkt','b','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'ogc_fid','ogc_fid','ax_besondererbauwerkspunkt','b','int4','','PRIMARY KEY','1','32','Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'punktkennung','punktkennung','ax_besondererbauwerkspunkt','b','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'sonstigeeigenschaft','sonstigeeigenschaft','ax_besondererbauwerkspunkt','b','_varchar','','','1',NULL,'Text','','','','11','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'sonstigesmodell','sonstigesmodell','ax_besondererbauwerkspunkt','b','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'stelle','stelle','ax_besondererbauwerkspunkt','b','int4','','','1','32','Text','','','','10','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620537,'wkb_geometry','wkb_geometry','ax_punktortag','p','geometry','POINT','','1',NULL,'Text','','','','13','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('PunktortAG',@last_layer_id9620537,'','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'circle','1','0 0 0','','',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 

# Einrichtung in öffentlichen Bereichen
 
INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_EinrichtungInOeffentli','2',@group_id,'SELECT * FROM ax_einrichtunginoeffentlichenbereichen WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND (geometrytype(wkb_geometry) IN (\'POLYGON\',\'MULTIPOLYGON\'))','wkb_geometry from (SELECT oid, wkb_geometry, gml_id, endet, art FROM alkis.ax_einrichtunginoeffentlichenbereichen WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND geometrytype(wkb_geometry) IN (\'POLYGON\',\'MULTIPOLYGON\')) as foo using unique gml_id using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','art','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','AX_EinrichtungInOeffentlichenBereichen','1.1.0','image/png','60','','','','','1','0','','','','','0'); 
SET @last_layer_id9620536=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'advstandardmodell','advstandardmodell','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'anlass','anlass','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'art','art','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'beginnt','beginnt','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'endet','endet','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','bpchar','','','1','20','Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'gml_id','gml_id','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','varchar','','','0',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'identifier','identifier','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','varchar','','','1',NULL,'Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'kilometerangabe','kilometerangabe','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','varchar','','','1',NULL,'Text','','','','10','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'ogc_fid','ogc_fid','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','int4','','PRIMARY KEY','1','32','Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'sonstigesmodell','sonstigesmodell','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','_varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620536,'wkb_geometry','wkb_geometry','ax_einrichtunginoeffentlichenbereichen','ax_einrichtunginoeffentlichenbereichen','geometry','POINT','','1',NULL,'Text','','','','11','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Freisprechhäuschen, Müllbox, Sonstiges',@last_layer_id9620536,'{1110,2200,9999}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','153 153 153',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
 
# Heilquelle, Gasquelle
 
INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_HeilquelleGasquelle','0',@group_id,'SELECT * FROM ax_heilquellegasquelle WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND (geometrytype(wkb_geometry) = \'POINT\')','wkb_geometry from (select oid, wkb_geometry, gml_id, endet, art from alkis.ax_heilquellegasquelle WHERE endet IS NULL AND geometrytype(wkb_geometry) = \'POINT\') as foo using unique gml_id using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','art','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','AX_HeilquelleGasquelle','1.1.0','image/png','60','','','','','1','0','','','','','0'); 
SET @last_layer_id9620534=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'advstandardmodell','advstandardmodell','ax_heilquellegasquelle','ax_heilquellegasquelle','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'anlass','anlass','ax_heilquellegasquelle','ax_heilquellegasquelle','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'art','art','ax_heilquellegasquelle','ax_heilquellegasquelle','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'beginnt','beginnt','ax_heilquellegasquelle','ax_heilquellegasquelle','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'endet','endet','ax_heilquellegasquelle','ax_heilquellegasquelle','bpchar','','','1','20','Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'gml_id','gml_id','ax_heilquellegasquelle','ax_heilquellegasquelle','varchar','','','0',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'identifier','identifier','ax_heilquellegasquelle','ax_heilquellegasquelle','varchar','','','1',NULL,'Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'name','name','ax_heilquellegasquelle','ax_heilquellegasquelle','varchar','','','1',NULL,'Text','','','','10','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'ogc_fid','ogc_fid','ax_heilquellegasquelle','ax_heilquellegasquelle','int4','','PRIMARY KEY','1','32','Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'sonstigesmodell','sonstigesmodell','ax_heilquellegasquelle','ax_heilquellegasquelle','_varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620534,'wkb_geometry','wkb_geometry','ax_heilquellegasquelle','ax_heilquellegasquelle','geometry','POINT','','1',NULL,'Text','','','','11','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Heilquelle, Gasquelle, Mofette',@last_layer_id9620534,'{4010,4020}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'circle','7','227 255 255','','0 204 204',NULL,'7','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
 
# Historisches Bauwerk oder historische Einrichtung

INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_HistorischesBauwerk','2',@group_id,'SELECT * FROM ax_historischesbauwerkoderhistorischeeinrichtung WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND (geometrytype(wkb_geometry) IN (\'POLYGON\',\'MULTIPOLYGON\'))','wkb_geometry from (SELECT oid, wkb_geometry, gml_id, endet, archaeologischertyp FROM alkis.ax_historischesbauwerkoderhistorischeeinrichtung WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND geometrytype(wkb_geometry) IN (\'POLYGON\',\'MULTIPOLYGON\')) as foo using unique gml_id using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','archaeologischertyp','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','AX_HistorischesBauwerkOderHistorischeEinrichtung','1.1.0','image/png','60','','','','','1','0','','','','','0'); 
SET @last_layer_id9620533=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'advstandardmodell','advstandardmodell','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'anlass','anlass','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'archaeologischertyp','archaeologischertyp','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'beginnt','beginnt','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'endet','endet','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','bpchar','','','1','20','Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'gml_id','gml_id','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','varchar','','','0',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'identifier','identifier','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','varchar','','','1',NULL,'Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'name','name','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','varchar','','','1',NULL,'Text','','','','10','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'ogc_fid','ogc_fid','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','int4','','','1','32','Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'sonstigesmodell','sonstigesmodell','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','_varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620533,'wkb_geometry','wkb_geometry','ax_historischesbauwerkoderhistorischeeinrichtung','ax_historischesbauwerkoderhistorischeeinrichtung','geometry','POLYGON','','1',NULL,'Text','','','','11','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Hügelgrab, Dolmen, Aquädukt, Wall',@last_layer_id9620533,'{1000,1010,1020,1100,1110,1200,1210,9999}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','153 153 153',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Burg, Burgruine, Schanze, Lager',@last_layer_id9620533,'{1400,1410,1420,1430}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','153 153 153',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('hist. Mauer, Stadtmauer',@last_layer_id9620533,'{1500,1510,1520}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','204 204 204','','0 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
 
# Leitung
 
INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_Leitung','1',@group_id,'SELECT * FROM ax_leitung WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','wkb_geometry from (select oid, wkb_geometry, ogc_fid, endet, bauwerksfunktion, spannungsebene from alkis.ax_leitung WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique ogc_fid using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','bauwerksfunktion','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','AX_Leitung','1.1.0','image/png','60','','','','','1','0','','','','','0'); 
SET @last_layer_id9620531=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'advstandardmodell','advstandardmodell','ax_leitung','ax_leitung','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'anlass','anlass','ax_leitung','ax_leitung','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'bauwerksfunktion','bauwerksfunktion','ax_leitung','ax_leitung','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'beginnt','beginnt','ax_leitung','ax_leitung','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'endet','endet','ax_leitung','ax_leitung','bpchar','','','1','20','Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'gml_id','gml_id','ax_leitung','ax_leitung','varchar','','','0',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'identifier','identifier','ax_leitung','ax_leitung','varchar','','','1',NULL,'Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'ogc_fid','ogc_fid','ax_leitung','ax_leitung','int4','','PRIMARY KEY','1','32','Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'sonstigesmodell','sonstigesmodell','ax_leitung','ax_leitung','_varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'spannungsebene','spannungsebene','ax_leitung','ax_leitung','int4','','','1','32','Text','','','','10','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620531,'wkb_geometry','wkb_geometry','ax_leitung','ax_leitung','geometry','LINESTRING','','1',NULL,'Text','','','','11','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Freileitung',@last_layer_id9620531,'1110','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','0 0 0','','',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Erdkabel, Spannungsebene',@last_layer_id9620531,'1111','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','0 0 0','','',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
 
# Sonstiges Bauwerk oder sonstige Einrichtung

INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_SonstigesBauwerk','2',@group_id,'SELECT * FROM ax_sonstigesbauwerkodersonstigeeinrichtung WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND (geometrytype(wkb_geometry) IN (\'POLYGON\',\'MULTIPOLYGON\'))','wkb_geometry from (SELECT wkb_geometry, gml_id, endet, bauwerksfunktion FROM alkis.ax_sonstigesbauwerkodersonstigeeinrichtung WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND geometrytype(wkb_geometry) IN (\'POLYGON\',\'MULTIPOLYGON\')) as foo using unique gml_id using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','bauwerksfunktion','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','AX_SonstigesBauwerkOderSonstigeEinrichtung','1.1.0','image/png','60','','','','','1','0','','','','','0'); 
SET @last_layer_id9620535=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'advstandardmodell','advstandardmodell','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'anlass','anlass','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'bauwerksfunktion','bauwerksfunktion','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','int4','','','1','32','Text','','','','11','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'beginnt','beginnt','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'description','description','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'endet','endet','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','bpchar','','','1','20','Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'funktion','funktion','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','int4','','','1','32','Text','','','','12','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'gehoertzu','gehoertzu','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','varchar','','','1',NULL,'Text','','','','14','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'gehoertzubauwerk','gehoertzubauwerk','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','varchar','','','1',NULL,'Text','','','','13','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'gml_id','gml_id','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','varchar','','','0',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'identifier','identifier','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','varchar','','','1',NULL,'Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'name','name','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','varchar','','','1',NULL,'Text','','','','10','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'ogc_fid','ogc_fid','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','int4','','PRIMARY KEY','1','32','Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'sonstigesmodell','sonstigesmodell','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','_varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620535,'wkb_geometry','wkb_geometry','ax_sonstigesbauwerkodersonstigeeinrichtung','ax_sonstigesbauwerkodersonstigeeinrichtung','geometry','POLYGON','','1',NULL,'Text','','','','15','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Rampe, Treppe, Terasse, Mauer',@last_layer_id9620535,'{1620,1621,1622,1650,1670,1700,1720}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','204 204 204','','0 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Überdachung, Carport',@last_layer_id9620535,'{1610,1611}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','204 204 204','','-1 -1 -1',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','0 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Denkmal, Denkstein, Standbild, Sonstiges',@last_layer_id9620535,'{1750,9999}','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','153 153 153',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
 
# Transportanlage
 
INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_Transportanlage','1',@group_id,'SELECT * FROM ax_transportanlage WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND (geometrytype(wkb_geometry) in (\'LINESTRING\', \'MULTILINESTRING\')) ','wkb_geometry from (select oid, wkb_geometry, ogc_fid, endet, bauwerksfunktion, lagezurerdoberflaeche from alkis.ax_transportanlage WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND geometrytype(wkb_geometry) in (\'LINESTRING\', \'MULTILINESTRING\')) as foo using unique ogc_fid using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','bauwerksfunktion','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','AX_Transportanlage','1.1.0','image/png','60','','','','','1','0','','','','','0'); 
SET @last_layer_id9620530=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'advstandardmodell','advstandardmodell','ax_transportanlage','ax_transportanlage','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'anlass','anlass','ax_transportanlage','ax_transportanlage','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'art','art','ax_transportanlage','ax_transportanlage','varchar','','','1',NULL,'Text','','','','11','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'bauwerksfunktion','bauwerksfunktion','ax_transportanlage','ax_transportanlage','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'beginnt','beginnt','ax_transportanlage','ax_transportanlage','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'endet','endet','ax_transportanlage','ax_transportanlage','bpchar','','','1','20','Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'gml_id','gml_id','ax_transportanlage','ax_transportanlage','varchar','','','0',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'identifier','identifier','ax_transportanlage','ax_transportanlage','varchar','','','1',NULL,'Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'lagezurerdoberflaeche','lagezurerdoberflaeche','ax_transportanlage','ax_transportanlage','int4','','','1','32','Text','','','','10','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'name','name','ax_transportanlage','ax_transportanlage','varchar','','','1',NULL,'Text','','','','12','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'ogc_fid','ogc_fid','ax_transportanlage','ax_transportanlage','int4','','PRIMARY KEY','1','32','Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'produkt','produkt','ax_transportanlage','ax_transportanlage','int4','','','1','32','Text','','','','13','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'sonstigesmodell','sonstigesmodell','ax_transportanlage','ax_transportanlage','_varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620530,'wkb_geometry','wkb_geometry','ax_transportanlage','ax_transportanlage','geometry','GEOMETRY','','1',NULL,'Text','','','','14','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Förderband/Bandstraße unterirdisch/unterwasser',@last_layer_id9620530,'([bauwerksfunktion] = 1102 AND [lagezurerdoberflaeche] in (1200,1700))','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','0 0 0','','',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','0 0 0','','',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'circle','2','0 0 0','','',NULL,'2','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 2); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Rohrleitung/Pipeline',@last_layer_id9620530,'([bauwerksfunktion] = 1101 AND [lagezurerdoberflaeche] = 1400)','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'circle','2','0 0 0','','',NULL,'2','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','0 0 0','','',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Rohrleitung/Pipeline unterirdisch/unterwasser',@last_layer_id9620530,'([bauwerksfunktion] = 1101 AND [lagezurerdoberflaeche] in (1200,1700))','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'circle','2','0 0 0','','',NULL,'2','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','0 0 0','','',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Förderband/Bandstraße',@last_layer_id9620530,'([bauwerksfunktion] = 1102 AND [lagezurerdoberflaeche] = 1400)','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','0 0 0','','',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','0 0 0','','',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'circle','2','0 0 0','','',NULL,'2','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 2); 
 
# Turm
 
INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_Turm','2',@group_id,'SELECT * FROM ax_turm WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','wkb_geometry from (select oid, ogc_fid, endet, bauwerksfunktion, zustand, wkb_geometry from alkis.ax_turm WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique ogc_fid using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','zustand','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','AX_Turm','1.1.0','image/png','60','','','','','1','0','','','','','0'); 
SET @last_layer_id9620527=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'advstandardmodell','advstandardmodell','ax_turm','ax_turm','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'anlass','anlass','ax_turm','ax_turm','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'bauwerksfunktion','bauwerksfunktion','ax_turm','ax_turm','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'beginnt','beginnt','ax_turm','ax_turm','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'endet','endet','ax_turm','ax_turm','bpchar','','','1','20','Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'gml_id','gml_id','ax_turm','ax_turm','varchar','','','0',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'identifier','identifier','ax_turm','ax_turm','varchar','','','1',NULL,'Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'name','name','ax_turm','ax_turm','varchar','','','1',NULL,'Text','','','','11','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'ogc_fid','ogc_fid','ax_turm','ax_turm','int4','','PRIMARY KEY','1','32','Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'sonstigesmodell','sonstigesmodell','ax_turm','ax_turm','_varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'wkb_geometry','wkb_geometry','ax_turm','ax_turm','geometry','POLYGON','','1',NULL,'Text','','','','13','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'zeigtauf','zeigtauf','ax_turm','ax_turm','varchar','','','1',NULL,'Text','','','','12','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620527,'zustand','zustand','ax_turm','ax_turm','int4','','','1','32','Text','','','','10','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('in Betrieb',@last_layer_id9620527,'/^$/','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','204 204 204','','0 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('außer Betrieb, stillgelegt, verlassen',@last_layer_id9620527,'2100','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','204 204 204','','0 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('zerstört',@last_layer_id9620527,'2200','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','3.5','-1 -1 -1','','0 0 0',NULL,'4','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
 
# Vorratsbehaelter, Speicherbauwerk
 
INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('AX_VorratsbehaelterSpeich','2',@group_id,'SELECT * FROM ax_vorratsbehaelterspeicherbauwerk WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND (geometrytype(wkb_geometry) in (\'POLYGON\', \'MULTIPOLYGON\'))','wkb_geometry from (select oid, wkb_geometry, ogc_fid, endet, lagezurerdoberflaeche from alkis.ax_vorratsbehaelterspeicherbauwerk WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND geometrytype(wkb_geometry) in (\'POLYGON\', \'MULTIPOLYGON\')) as foo using unique ogc_fid using srid=25833','alkis','','','','','','10001','0','',@connection,'','6','lagezurerdoberflaeche','','5','pixels','25833','','1',NULL,'1000',NULL,NULL,'','EPSG:25833','AX_VorratsbehaelterSpeicherbauwerk','1.1.0','image/png','60','','','','','1','0','','','','','0'); 
SET @last_layer_id9620529=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'advstandardmodell','advstandardmodell','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','_varchar','','','1',NULL,'Text','','','','6','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'anlass','anlass','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','varchar','','','1',NULL,'Text','','','','8','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'bauwerksfunktion','bauwerksfunktion','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','int4','','','1','32','Text','','','','10','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'beginnt','beginnt','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','bpchar','','','1','20','Text','','','','4','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'endet','endet','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','bpchar','','','1','20','Text','','','','5','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'gml_id','gml_id','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','varchar','','','0',NULL,'Text','','','','2','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'identifier','identifier','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','varchar','','','1',NULL,'Text','','','','3','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'lagezurerdoberflaeche','lagezurerdoberflaeche','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','int4','','','1','32','Text','','','','11','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'name','name','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','varchar','','','1',NULL,'Text','','','','12','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'ogc_fid','ogc_fid','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','int4','','','1','32','Text','','','','1','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'sonstigesmodell','sonstigesmodell','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','_varchar','','','1',NULL,'Text','','','','7','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'speicherinhalt','speicherinhalt','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','int4','','','1','32','Text','','','','9','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id9620529,'wkb_geometry','wkb_geometry','ax_vorratsbehaelterspeicherbauwerk','ax_vorratsbehaelterspeicherbauwerk','geometry','POLYGON','','1',NULL,'Text','','','','13','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('ebenerdig',@last_layer_id9620529,'([lagezurerdoberflaeche] != 1200 AND [lagezurerdoberflaeche] != 1400)','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','204 204 204','','0 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('unterirdisch',@last_layer_id9620529,'1200','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','0 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('aufgeständert',@last_layer_id9620529,'1400','1',''); 
SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','0 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 


#Tatsächliche Nutzung

#Nutzung gesamt


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Nutzungen ALKIS','','2',@group_id,'select *  from lk_nutzungen WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','lk_nutzungen','the_geom FROM (SELECT *  FROM alkis.lk_nutzungen WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','','1000','50','',@connection,'','6','nutzungsartengruppeschl','oid','3','pixels','25833','','1',NULL,'18990','1','25001','255 255 255','EPSG:25833','','1.1.0','image/png','60','','','','','0','0','','Nutzungen in ALKIS','Vermessungs- und Geoinformationsbehörde LK-MSE','','0');
SET @last_layer_id971=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'beginnt','beginnt','lk_nutzungen','lk_nutzungen','bpchar','','','1',NULL,NULL,'','Text','','Beginn','','','','','','Lebenszeitintervall;collapsed',NULL,'0','2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'bereich','bereich','lk_nutzungen','lk_nutzungen','varchar','','','1','100',NULL,'','Text','','Bereich','','','','','','Nutzungsart',NULL,'0','11','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'bezeichnung','bezeichnung','lk_nutzungen','lk_nutzungen','varchar','','','1',NULL,NULL,'','Text','','Bezeichnung','','','','','','Weitere Info zur Nutzungsart;collapsed',NULL,'0','9','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'endet','endet','lk_nutzungen','lk_nutzungen','bpchar','','','1',NULL,NULL,'','Text','','Ende','','','','','','Lebenszeitintervall;collapsed',NULL,'0','3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'gml_id','gml_id','lk_nutzungen','lk_nutzungen','varchar','','','1',NULL,NULL,'','Text','','','','','','','','Lebenszeitintervall;collapsed',NULL,'0','1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'info','info','lk_nutzungen','lk_nutzungen','int4','','','1','32','0','','Text','','Information','','','','','','Weitere Info zur Nutzungsart;collapsed',NULL,'0','6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'name','name','lk_nutzungen','lk_nutzungen','varchar','','','1',NULL,NULL,'','Text','','Name','','','','','','Weitere Info zur Nutzungsart;collapsed',NULL,'0','8','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'nutzungsart','nutzungsart','lk_nutzungen','lk_nutzungen','varchar','','','1','100',NULL,'','Text','','Nutzungsart','','','','','','Nutzungsart',NULL,'0','13','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'nutzungsartengruppe','nutzungsartengruppe','lk_nutzungen','lk_nutzungen','varchar','','','1','100',NULL,'','Text','','Gruppe','','','','','','Nutzungsart',NULL,'0','12','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'nutzungsartengruppeschl','nutzungsartengruppeschl','lk_nutzungen','lk_nutzungen','int4','','','1','32','0','','Text','','','','','','','','Nutzungsart',NULL,'0','16','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'nutzungsartschl','nutzungsartschl','lk_nutzungen','lk_nutzungen','int4','','','1','32','0','','Text','','','','','','','','Nutzungsart',NULL,'0','17','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'nutzungsartschluessel','nutzungsartschluessel','lk_nutzungen','lk_nutzungen','text','','','1',NULL,NULL,'','Text','','Nutzungsartenschlüssel','','','','','','Nutzungsart',NULL,'0','10','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'oid','oid','lk_nutzungen','lk_nutzungen','oid','','','1',NULL,NULL,'','Text','','','','','','','','Lebenszeitintervall;collapsed',NULL,'0','0',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'the_geom','the_geom','lk_nutzungen','lk_nutzungen','geometry','POLYGON','','1',NULL,NULL,'','Geometrie','','','','','','','','Nutzungsart',NULL,'0','20','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'untergliederung1','untergliederung1','lk_nutzungen','lk_nutzungen','varchar','','','1','100',NULL,'','Text','','Untergliederung 1.Stufe','','','','','','Nutzungsart',NULL,'0','14','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'untergliederung1schl','untergliederung1schl','lk_nutzungen','lk_nutzungen','int4','','','1','32','0','','Text','','','','','','','','Nutzungsart',NULL,'0','18','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'untergliederung2','untergliederung2','lk_nutzungen','lk_nutzungen','varchar','','','1','100',NULL,'','Text','','Untergliederung 2.Stufe','','','','','','Nutzungsart',NULL,'0','15','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'untergliederung2schl','untergliederung2schl','lk_nutzungen','lk_nutzungen','int4','','','1','32','0','','Text','','','','','','','','Nutzungsart',NULL,'0','19','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'werteart1','werteart1','lk_nutzungen','lk_nutzungen','int4','','','1','32','0','','Text','','','','','','','','Weitere Info zur Nutzungsart;collapsed',NULL,'0','4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'werteart2','werteart2','lk_nutzungen','lk_nutzungen','int4','','','1','32','0','','Text','','','','','','','','Weitere Info zur Nutzungsart;collapsed',NULL,'0','5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id971,'zustand','zustand','lk_nutzungen','lk_nutzungen','int4','','','1','32','0','','Text','','Zustand der Fläche','','','','','','Weitere Info zur Nutzungsart;collapsed',NULL,'0','7','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Schiffsverkehr',@last_layer_id971,'26','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Acker',@last_layer_id971,'([nutzungsartengruppeschl] = 31 AND [nutzungsartschl] = 1)','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 247 191','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('stehendes Gewässer',@last_layer_id971,'43','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','190 233 250','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Obstplantage',@last_layer_id971,'([nutzungsartengruppeschl] = 31 AND [nutzungsartschl] = 5)','2','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','241 255 142','','153 153 153',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Wohnbaufläche',@last_layer_id971,'11','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 235 245','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Bergbaubetrieb',@last_layer_id971,'14','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Tagebau Grube Steinbruch',@last_layer_id971,'15','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','227 227 227','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('gemischte Nutzung',@last_layer_id971,'16','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 235 245','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('besondere funktionale N.',@last_layer_id971,'17','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 235 245','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Sport Freizeit Erholung',@last_layer_id971,'18','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','224 255 217','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Friedhof',@last_layer_id971,'19','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','201 228 201','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Straßenverkehr',@last_layer_id971,'21','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Weg',@last_layer_id971,'22','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','250 250 250','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Platz',@last_layer_id971,'23','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Bahnverkehr',@last_layer_id971,'24','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','250 250 250','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Flugverkehr',@last_layer_id971,'25','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','221 236 197','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Halde',@last_layer_id971,'13','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','237 237 237','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Industrie- und Gewerbe',@last_layer_id971,'12','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','237 237 237','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Gartenland',@last_layer_id971,'([nutzungsartengruppeschl] = 31 AND [nutzungsartschl] = 3)','2','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','241 255 142','','153 153 153',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Hafenbecken',@last_layer_id971,'42','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','230 255 255','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Fließgewässer',@last_layer_id971,'41','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','190 233 250','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Unland',@last_layer_id971,'37','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Sumpf',@last_layer_id971,'36','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','230 215 207','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Moor',@last_layer_id971,'35','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','242 235 232','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Heide',@last_layer_id971,'34','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','230 215 207','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Gehölz',@last_layer_id971,'33','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','187 222 201','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Wald',@last_layer_id971,'32','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','251 255 251','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Weingarten',@last_layer_id971,'([nutzungsartengruppeschl] = 31 AND [nutzungsartschl] = 4)','2','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','241 255 142','','153 153 153',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Brachland',@last_layer_id971,'([nutzungsartengruppeschl] = 31 AND [nutzungsartschl] = 6)','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','242 235 232','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Grünland',@last_layer_id971,'([nutzungsartengruppeschl] = 31 AND [nutzungsartschl] = 2)','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','235 255 212','','153 153 153',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);

#Relief

#flächenförmige Reliefformen

#Böschungen

SET @group_id = @group_id; 
SET @connection = @connection; 

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Böschung_ALKIS','','2',@group_id,'SELECT * FROM ax_boeschungsflaeche WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','ax_boeschungsflaeche','the_geom from (select ogc_fid as oid, wkb_geometry as the_geom from alkis.ax_boeschungsflaeche WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','',NULL,NULL,'',@connection,'','6','','','3','pixels','25833','','1','80','19000','1','100000','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Böschungen in ALKIS','Vermessungs- und Geoinformationsbehörde im LK MSE','','0');
SET @last_layer_id29100=LAST_INSERT_ID();
 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Böschung',@last_layer_id29100,'','0',''); 
SET @last_class_id=LAST_INSERT_ID(); 

INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','0 255 10',NULL,NULL,'0','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 

INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
 

#Damm Wall Deich

#Wenn die Spalten art und Name in der Tabelle ax_dammwalldeich mit Werten gefüllt sind, kann die Darstellung noch klassifiziert bzw. gelabelt werden.

SET @group_id = @group_id; 
SET @connection = @connection; 

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('DammWallDeich_ALKIS','','2',@group_id,'SELECT * FROM ax_dammwalldeich WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','ax_dammwalldeich','the_geom from (select ogc_fid as oid, wkb_geometry as the_geom from alkis.ax_dammwalldeich WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','',NULL,NULL,'',@connection,'','6','','','3','pixels','25833','','1','80','19000','1','100000','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Damm, Wall oder Deich in ALKIS','Vermessungs- und Geoinformationsbehörde im LK MSE','','0'); 
SET @last_layer_id29110=LAST_INSERT_ID(); 

INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('DammWallDeich',@last_layer_id29110,'','0',''); 
SET @last_class_id=LAST_INSERT_ID(); 

INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','15','-1 -1 -1','','255 103 124','1',NULL,'','',NULL,NULL,NULL,NULL,''); 
SET @last_style_id=LAST_INSERT_ID(); 

INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); UPDATE layer_attributes SET options = REPLACE(options, '29110', @last_layer_id29110) WHERE layer_id IN(@last_layer_id29110) AND form_element_type IN ('SubFormPK', 'SubFormFK', 'SubFormEmbeddedPK'); 

 

#linienförmige Reliefformen

#punktförmige Reliefformen

#Festlegungen

#Strassenrecht

SET @group_id = @group_id; 
SET @connection = @connection; 

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Strassenrecht_ALKIS','','2',@group_id,'SELECT a.ogc_fid as oid,a.gml_id,b.wert,b.beschreibung,a.wkb_geometry as the_geom FROM ax_klassifizierungnachstrassenrecht a,ax_artderfestlegung_klassifizierungnachstrassenrecht b WHERE a.artderfestlegung=b.wert AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','ax_klassifizierung nachstrassenrecht','the_geom from (SELECT a.ogc_fid as oid,a.gml_id,b.wert,b.beschreibung,a.wkb_geometry as the_geom FROM alkis.ax_klassifizierungnachstrassenrecht a,alkis.ax_artderfestlegung_klassifizierungnachstrassenrecht b WHERE a.artderfestlegung=b.wert AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','',NULL,NULL,'',@connection,'','6','','','3','pixels','25833','','1','80','19000','1','100000','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','','Vermessungs- und Geoinformationsbehörde im LK MSE','','0');
SET @last_layer_id974=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id974,'beschreibung','beschreibung','ax_artderfestlegung_klassifizierungnachstrassenrecht','b','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id974,'gml_id','gml_id','ax_klassifizierungnachstrassenrecht','a','varchar','','UNIQUE','1','16',NULL,'','Text','','','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id974,'oid','ogc_fid','ax_klassifizierungnachstrassenrecht','a','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id974,'the_geom','wkb_geometry','ax_klassifizierungnachstrassenrecht','a','geometry','GEOMETRY','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id974,'wert','wert','ax_artderfestlegung_klassifizierungnachstrassenrecht','b','int4','','','0','32','0','','Text','','','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Bundes- oder Landesstraßengesetz',@last_layer_id974,'([wert] = 1100)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','230 50 50','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Bundesautobahn',@last_layer_id974,'([wert] = 1110)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','170 0 84','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Bundesstraße',@last_layer_id974,'([wert] = 1120)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 0 0','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Landes- oder Staatsstraße',@last_layer_id974,'([wert] = 1130)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','65 199 0','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Kreisstraße',@last_layer_id974,'([wert] = 1140)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','209 0 82','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Gemeindestraße',@last_layer_id974,'([wert] = 1150)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','108 0 65','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Ortsstraße',@last_layer_id974,'([wert] = 1160)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','127 0 239','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Gemeindeverbindungsstraße',@last_layer_id974,'([wert] = 1170)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','108 0 65','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('sonst. öff. Straße',@last_layer_id974,'([wert] = 1180)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','230 50 50','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Privatstraße',@last_layer_id974,'([wert] = 1190)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 196 49','','',NULL,NULL,'0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
 

#Wasserrecht

#Natur-Umwelt-Bodenschutzrecht

#Bodenordnungsrecht

#Denkmalschutzrecht

#Forstrecht

#sonstiges Recht

#Schutzzone

#Bodenschätzung

#Bodenschätzung


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('ALKIS_Bodenschätzung','','2',@group_id,'select * from ax_bodenschaetzung where CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','ax_bodenschaetzung','the_geom from (select a.oid, c.beschreibung||d.beschreibung as label, b.beschreibung,
bodenzahlodergruenlandgrundzahl,ackerzahlodergruenlandzahl, a.wkb_geometry as the_geom 
FROM alkis.ax_bodenschaetzung as a, alkis.ax_kulturart_bodenschaetzung as b, 
alkis.ax_bodenart_bodenschaetzung as c, alkis.ax_zustandsstufeoderbodenstufe_bodenschaetzung as d
WHERE CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END AND a.kulturart=b.wert 
AND a.bodenart=c.wert
AND a.zustandsstufeoderbodenstufe = d.wert) as foo using unique oid using srid=25833','alkis','','','','','label','5001','49','',@connection,'','6','','oid','3','pixels','25833','','1','50','94010','49','5001','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Reichsbodenschätzung aus ALKIS','Fachdienst Kataster und Vermessung','','0');
SET @last_layer_id975=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'ackerzahlodergruenlandzahl','ackerzahlodergruenlandzahl','ax_bodenschaetzung','ax_bodenschaetzung','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'12','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'advstandardmodell','advstandardmodell','ax_bodenschaetzung','ax_bodenschaetzung','_varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'anlass','anlass','ax_bodenschaetzung','ax_bodenschaetzung','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'art','art','ax_bodenschaetzung','ax_bodenschaetzung','_varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'8','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'beginnt','beginnt','ax_bodenschaetzung','ax_bodenschaetzung','timestamp','','UNIQUE','0',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'bodenart','bodenart','ax_bodenschaetzung','ax_bodenschaetzung','int4','','','0','32','0','','Text','','','','','','','','',NULL,NULL,'13','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'bodenzahlodergruenlandgrundzahl','bodenzahlodergruenlandgrundzahl','ax_bodenschaetzung','ax_bodenschaetzung','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'14','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'endet','endet','ax_bodenschaetzung','ax_bodenschaetzung','timestamp','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'entstehungsartoderklimastufewasserverhaeltnisse','entstehungsartoderklimastufewasserverhaeltnisse','ax_bodenschaetzung','ax_bodenschaetzung','_int4','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'15','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'gml_id','gml_id','ax_bodenschaetzung','ax_bodenschaetzung','varchar','','UNIQUE','1','16',NULL,'','Text','','','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'hatdirektunten','hatdirektunten','ax_bodenschaetzung','ax_bodenschaetzung','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'23','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'herkunft','herkunft','ax_bodenschaetzung','ax_bodenschaetzung','text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'18','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'identifier','identifier','ax_bodenschaetzung','ax_bodenschaetzung','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'istabgeleitetaus','istabgeleitetaus','ax_bodenschaetzung','ax_bodenschaetzung','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'21','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'istteilvon','istteilvon','ax_bodenschaetzung','ax_bodenschaetzung','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'24','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'jahreszahl','jahreszahl','ax_bodenschaetzung','ax_bodenschaetzung','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'16','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'kulturart','kulturart','ax_bodenschaetzung','ax_bodenschaetzung','int4','','','0','32','0','','Text','','','','','','','','',NULL,NULL,'17','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'name','name','ax_bodenschaetzung','ax_bodenschaetzung','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'9','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'ogc_fid','ogc_fid','ax_bodenschaetzung','ax_bodenschaetzung','int4','','PRIMARY KEY','1','32','0','','Text','','','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'sonstigeangaben','sonstigeangaben','ax_bodenschaetzung','ax_bodenschaetzung','_int4','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'19','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'sonstigesmodell','sonstigesmodell','ax_bodenschaetzung','ax_bodenschaetzung','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'7','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'traegtbeizu','traegtbeizu','ax_bodenschaetzung','ax_bodenschaetzung','_text','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'22','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'uri','uri','ax_bodenschaetzung','ax_bodenschaetzung','_varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'10','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'wkb_geometry','wkb_geometry','ax_bodenschaetzung','ax_bodenschaetzung','geometry','GEOMETRY','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'11','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id975,'zustandsstufeoderbodenstufe','zustandsstufeoderbodenstufe','ax_bodenschaetzung','ax_bodenschaetzung','int4','','','1','32','0','','Text','','','','','','','','',NULL,NULL,'20','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Grünland-Acker',@last_layer_id975,'(\'[beschreibung]\' = \'Grünland-Acker (GrA)\')','4','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','3','22 154 0','','-1 -1 -1',NULL,NULL,'','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','4','-1 -1 -1','','0 98 3','4','6','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('verdana',NULL,'0 59 31','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1','126','1');
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Ackerland',@last_layer_id975,'(\'[beschreibung]\' = \'Ackerland (A)\')','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','3','205 116 40','','-1 -1 -1',NULL,NULL,'','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','4','-1 -1 -1','','0 98 3','4','6','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('verdana',NULL,'89 39 0','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1','126','1');
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Grünland',@last_layer_id975,'(\'[beschreibung]\' = \'Grünland (Gr)\')','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','3','143 249 44','','-1 -1 -1',NULL,NULL,'','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','4','-1 -1 -1','','0 98 3','4','6','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('verdana',NULL,'0 59 31','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1','126','1');
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Acker-Grünland',@last_layer_id975,'(\'[beschreibung]\' = \'Acker-Grünland (AGr)\')','2','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','3','231 168 0','','-1 -1 -1',NULL,NULL,'','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','4','-1 -1 -1','','0 98 3','4','6','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('verdana',NULL,'89 39 0','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1','126','1');
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);

 

#Musterstück


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('ALKIS_Musterstücke','','0',@group_id,'select ogc_fid,  gruppe||\' Nr. \'||nummer as bezeichnung, kultur, beschreibung, zustand_bodenstufe, entstehung, bodenzahlodergruenlandgrundzahl, ackerzahlodergruenlandzahl, the_geom from lk_muster_vergleichsstueck where merkmal < 3000 and CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','lk_muster_vergleichsstueck','the_geom FROM (SELECT oid, gruppe||\' Nr. \'||nummer as bezeichnung, merkmal, the_geom FROM alkis.lk_muster_vergleichsstueck where merkmal < 3000 and CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','bezeichnung','10001','49','',@connection,'','6','','','3','pixels','25833','','1',NULL,'100000','49','50001','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Musterstücke und Landesmusterstücke der Reichsbodenschätzung aus ALKIS','Fachdienst Kataster und Vermessung','','0');
SET @last_layer_id976=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id976,'ackerzahlodergruenlandzahl','ackerzahlodergruenlandzahl','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','text','','','1',NULL,NULL,'','Text','','Acker-/ Grünlandzahl','','','','','','',NULL,NULL,'7','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id976,'beschreibung','beschreibung','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id976,'bezeichnung','gruppe','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','not_saveable','','','1',NULL,NULL,'','Text','','Bezeichnung','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id976,'bodenzahlodergruenlandgrundzahl','bodenzahlodergruenlandgrundzahl','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','text','','','1',NULL,NULL,'','Text','','Bodenzahl / Grünlandgrundzahl','','','','','','',NULL,NULL,'6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id976,'entstehung','entstehung','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','varchar','','','1',NULL,NULL,'','Text','','Entstehung','','','','','','',NULL,NULL,'5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id976,'kultur','kultur','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','varchar','','','1',NULL,NULL,'','Text','','Kulturart','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id976,'ogc_fid','ogc_fid','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','int4','','','1','32','0','','Text','','Datenbank-ID','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id976,'the_geom','the_geom','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','geometry','GEOMETRY','','1',NULL,NULL,'','Geometrie','','Geometrie','','','','','','',NULL,NULL,'8','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id976,'zustand_bodenstufe','zustand_bodenstufe','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','varchar','','','1',NULL,NULL,'','Text','','Zustand Bodenstufe','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Musterstück',@last_layer_id976,'([merkmal] = 1000)','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','4','171 4 0','','','3','4','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'0 20 8','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10','6',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Landesmusterstück',@last_layer_id976,'([merkmal] = 2000)','2','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','4','230 0 160','','','3','4','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);

 

#Vergleichsstück


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('ALKIS_Vergleichsstücke','','0',@group_id,'select ogc_fid,  gruppe||\' Nr. \'||nummer as bezeichnung, kultur, beschreibung, zustand_bodenstufe, entstehung, bodenzahlodergruenlandgrundzahl, ackerzahlodergruenlandzahl, the_geom from lk_muster_vergleichsstueck where merkmal = 3000 and CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','lk_muster_vergleichsstueck','the_geom FROM (SELECT oid, gruppe||\' Nr. \'||nummer as bezeichnung, merkmal, the_geom FROM alkis.lk_muster_vergleichsstueck where merkmal = 3000 and CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','bezeichnung','10001','49','',@connection,'','6','','','3','pixels','25833','','1',NULL,'100000','49','50001','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Vergleichsstücke der Reichsbodenschätzung aus ALKIS','Fachdienst Kataster und Vermessung','','0');
SET @last_layer_id977=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id977,'ackerzahlodergruenlandzahl','ackerzahlodergruenlandzahl','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','text','','','1',NULL,NULL,'','Text','','Acker-/ Grünlandzahl','','','','','','',NULL,NULL,'7','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id977,'beschreibung','beschreibung','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id977,'bezeichnung','gruppe','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','not_saveable','','','1',NULL,NULL,'','Text','','Name','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id977,'bodenzahlodergruenlandgrundzahl','bodenzahlodergruenlandgrundzahl','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','text','','','1',NULL,NULL,'','Text','','Bodenzahl / Grünlandgrundzahl','','','','','','',NULL,NULL,'6','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id977,'entstehung','entstehung','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','varchar','','','1',NULL,NULL,'','Text','','Entstehung','','','','','','',NULL,NULL,'5','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id977,'kultur','kultur','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','varchar','','','1',NULL,NULL,'','Text','','Kulturart','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id977,'ogc_fid','ogc_fid','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','int4','','','1','32','0','','Text','','Datenbank-ID','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id977,'the_geom','the_geom','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','geometry','GEOMETRY','','1',NULL,NULL,'','Geometrie','','Geometrie','','','','','','',NULL,NULL,'8','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id977,'zustand_bodenstufe','zustand_bodenstufe','lk_muster_vergleichsstueck','lk_muster_vergleichsstueck','varchar','','','1',NULL,NULL,'','Text','','Zustand Bodenstufe','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Vergleichsstück',@last_layer_id977,'([merkmal] = 3000)','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES('25','','12','171 4 0','','255 255 255','7','8','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'0 20 8','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10','6',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);

 

#Grabloch


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('ALKIS_Grablöcher','','0',@group_id,'select beschreibung, nummerdesgrablochs, the_geom from lk_grabloch where CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','lk_grabloch','the_geom from (select oid, bedeutung, nummerdesgrablochs, the_geom from alkis.lk_grabloch where CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','nummerdesgrablochs','5001','49','',@connection,'','6','','','3','pixels','25833','','1',NULL,'30000730','1','5001','255 255 255','EPSG:2398','','1.1.0','image/png','60','','','','','0','0','','Grablöcher der Reichsbodenschätzung aus ALKIS.','Fachdienst Kataster und Vermessung','','0');
SET @last_layer_id978=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id978,'beschreibung','beschreibung','lk_grabloch','lk_grabloch','varchar','','','1',NULL,NULL,'','Text','','Bedeutung','','','','','','',NULL,'0','0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id978,'nummerdesgrablochs','nummerdesgrablochs','lk_grabloch','lk_grabloch','text','','','1',NULL,NULL,'','Text','','Nummer','','','','','','',NULL,'0','1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id978,'the_geom','the_geom','lk_grabloch','lk_grabloch','geometry','POINT','','1',NULL,NULL,'','Geometrie','','Geometrie','','','','','','',NULL,'0','2','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('nicht bestimmendes Grabloch',@last_layer_id978,'(\'[bedeutung]\' = \'{3000}\')','2','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'cross','6','255 0 255','','0 0 0','7','9','0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial_underline_1',NULL,'255 0 255','-1 -1 -1','',NULL,NULL,'','',NULL,NULL,'8','8','10','8','13','-5',NULL,NULL,NULL,'1',NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('bestimmendes Grabloch',@last_layer_id978,'(\'[bedeutung]\' = \'{1100}\')','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'cross','6','255 0 0','','0 0 0','7','9','0','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial_underline_1',NULL,'255 0 0','-1 -1 -1','',NULL,NULL,'','',NULL,NULL,'8','8','10','8','13','-5',NULL,NULL,NULL,'1',NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
 

#Bewertung


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Bewertung_ALKIS','','2',@group_id,'select a.oid, a.beginnt,a.endet,b.beschreibung as bewertung, a.wkb_geometry  FROM ax_bewertung as a, ax_klassifizierung_bewertung as b WHERE a.klassifizierung=b.wert AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','ax_bewertung','wkb_geometry from (select a.oid, a.beginnt,a.endet,a.wkb_geometry  FROM alkis.ax_bewertung as a, alkis.ax_klassifizierung_bewertung as b WHERE a.klassifizierung=b.wert AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','','10001','49','',@connection,'','6','','oid','3','pixels','25833','','1','50','94010','49','10001','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Reichsbodenschätzung aus ALKIS','LK Mecklenburgische Seenplatte','','0');
SET @last_layer_id29360=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id29360,'beginnt','beginnt','ax_bewertung','a','bpchar','','UNIQUE','1','20',NULL,'','Text','','','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id29360,'bewertung','bezeichner','ax_bewertung_klassifizierung','b','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id29360,'endet','endet','ax_bewertung','a','bpchar','','','1','20',NULL,'','Text','','','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id29360,'oid','oid','ax_bewertung','a','oid','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id29360,'wkb_geometry','wkb_geometry','ax_bewertung','a','geometry','POLYGON','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Bewertung',@last_layer_id29360,'','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','98 255 219','','0 0 0',NULL,NULL,'0','',NULL,'1','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);

#Tagesabschnitt


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('ALKIS_Tagesabschnitte','2',@group_id,'','the_geom from (select ogc_fid as oid, tagesabschnittsnummer, wkb_geometry as the_geom from alkis.ax_tagesabschnitt where CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','tagesabschnittsnummer','50000','50','',@connection,'','6','','','3','pixels','25833','','0',NULL,'350000','1','25001','','EPSG:2398','','1.1.0','image/png','60','','','','','0','0','','Tagesabschnitte der Reichsbodenschätzung aus ALKIS.','Fachdienst Kataster und Vermessung','','0');
SET @last_layer_id50303315=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Tagesabschnitt',@last_layer_id50303315,'','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'punkt','4','-1 -1 -1','','0 204 204','3','4','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'0 204 204','255 255 255','',NULL,NULL,'255 255 255','',NULL,NULL,'12','12','18',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
 

#Verwaltungseinheiten

Kreis


SET @group_id = @group_id; 
SET @connection = @connection; 

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('ALKIS_Kreisgrenze','Kreisgrenze','2',@group_id,'SELECT oid, gid, land||\'\'||regierungsbezirk||\'\'|| kreis as kreis_schluessel, kreisname, anz_aemter,simple_geom FROM pp_kreis WHERE 1=1','pp_kreis','simple_geom from (select oid , gid, simple_geom from alkis.pp_kreis) as foo using unique oid using srid=25833 ','alkis','','','','','',NULL,NULL,'',@connection,'','6','gid','gid','3','pixels','25833','','1',NULL,'105000','99','1000001','','EPSG:2398','','1.1.0','image/png','60','','','','','1','0','','Darstellung der Landkreisgrenze','','','0'); SET @last_layer_id50303450=LAST_INSERT_ID(); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303450,'anz_aemter','anz_aemter','pp_kreis','pp_kreis','int4','','','1','32',NULL,'','Text','','Anzahl kreisbildender Ämter','','','','','','',NULL,NULL,'4','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303450,'gid','gid','pp_kreis','pp_kreis','int4','','','1','32',NULL,'','Text','','','','','','','','',NULL,NULL,'1',NULL,'0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303450,'kreisname','kreisname','pp_kreis','pp_kreis','varchar','','','1','80',NULL,'','Text','','Kreisname','','','','','','',NULL,NULL,'3','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303450,'kreis_schluessel','land','pp_kreis','pp_kreis','not_saveable','','PRIMARY KEY','0','32',NULL,'','Text','','Kreisschlüssel','','','','','','',NULL,NULL,'2','0','0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303450,'oid','oid','','','oid','','',NULL,NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'0',NULL,'0'); 
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303450,'simple_geom','simple_geom','pp_kreis','pp_kreis','geometry','MULTIPOLYGON','','1',NULL,NULL,'','Geometrie','','Geometrie','','','','','','',NULL,NULL,'5','0','0'); 
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES(' ',@last_layer_id50303450,'','0',''); SET @last_class_id=LAST_INSERT_ID(); 
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','100 100 100',NULL,NULL,'','',NULL,'2','2','5',''); SET @last_style_id=LAST_INSERT_ID(); 
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0); 

 

#Amtsverwaltungen


SET @group_id = @group_id; 
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('ALKIS_Ämter','Ämter','2',@group_id,'SELECT gid, amtsname, lpad(cast(amt as text), 4,\'0\') as amt, anz_gemeinden, the_geom FROM pp_amt WHERE 1=1','pp_amt','the_geom from (select oid, gid, the_geom from alkis.pp_amt) as foo using unique oid using srid=25833','alkis','','','','','',NULL,NULL,'',@connection,'','6','gid','gid','1','pixels','25833','','1',NULL,'104000','499','1000001','','EPSG:25833','Aemter','1.1.1','image/png','20','','','','','1','0','','Dient der Darstellung der Amtsgrenzen','Reissland','','0');
SET @last_layer_id50303448=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303448,'amt','amt','pp_amt','pp_amt','text','','PRIMARY KEY','0','32',NULL,'','Text','','Schlüssel des Amtes','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303448,'amtsname','amtsname','pp_amt','pp_amt','varchar','','','1','80',NULL,'','Text','','Name des Amtes','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303448,'anz_gemeinden','anz_gemeinden','pp_amt','pp_amt','int4','','','1','32',NULL,'','Text','','Anzahl amtsbildender Gemeinden','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303448,'gid','gid','pp_amt','pp_amt','int4','','','1','32',NULL,'','Text','','','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303448,'oid','oid','','','oid','','',NULL,NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303448,'the_geom','the_geom','pp_amt','pp_amt','geometry','MULTIPOLYGON','','1',NULL,NULL,'','Geometrie','','Geometrie','','','','','','',NULL,NULL,'5','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Ämtergrenzen',@last_layer_id50303448,'','470','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','0 0 255',NULL,NULL,'360','',NULL,'5','3','5','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);

#Gemeinden


SET @group_id = @group_id; 
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Gemeinden','','2',@group_id,'SELECT gid, gemeindename, gemeinde, the_geom FROM pp_gemeinde WHERE 1=1','pp_gemeinde','the_geom from (SELECT oid, gid, gemeindename, gemeinde, the_geom FROM alkis.pp_gemeinde) as foo using unique oid using srid=25833
','alkis','','','','','',NULL,NULL,'',@connection,'','6','gid','gid','1','pixels','25833','','1',NULL,'103000','49','1000001','','EPSG:25833','Gemeinden','1.1.1','image/png','60','','','','','1','0','','Dient der Darstellung der Gemeindegrenzen','','','0');
SET @last_layer_id50303337=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303337,'gemeinde','gemeinde','pp_gemeinde','pp_gemeinde','int4','','PRIMARY KEY','0','32',NULL,'','Text','','Gemeindeschlüssel','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303337,'gemeindename','gemeindename','pp_gemeinde','pp_gemeinde','varchar','','','1','80',NULL,'','Text','','Gemeinde','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303337,'gid','gid','pp_gemeinde','pp_gemeinde','int4','','','1','32',NULL,'','Text','','Datenbank-ID','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303337,'oid','oid','','','oid','','',NULL,NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'0',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303337,'the_geom','the_geom','pp_gemeinde','pp_gemeinde','geometry','MULTIPOLYGON','','1',NULL,NULL,'','Geometrie','','Geometrie','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Gemeindegrenzen',@last_layer_id50303337,'','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','255 0 0',NULL,NULL,'','',NULL,'3','2','4','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);

 

#Gemeindeteil

#Gemeindeteile-WMS

#Gemarkungen


SET @group_id = @group_id; 
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Gemarkungen','','2',@group_id,'SELECT a.gid, a.gemarkungsname,(a.land ||\'\'|| a.gemarkung) as gemarkung, a.anz_flur, b.gemeindename, a.the_geom FROM pp_gemarkung as a, pp_gemeinde as b WHERE a.gemeinde = b.gemeinde','pp_gemarkung','the_geom from (select oid, gid, the_geom from alkis.pp_gemarkung) as foo using unique oid using srid=25833','alkis','','','','','',NULL,NULL,'',@connection,'','6','gid','gid','1','pixels','25833','','1',NULL,'102000','49','100001','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Dient der Darstellung der Gemarkungsgrenzen.','','','0');
SET @last_layer_id50303327=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303327,'anz_flur','anz_flur','pp_gemarkung','a','int4','','','1','32',NULL,'','Text','','Anzahl Fluren','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303327,'gemarkung','gemarkung','pp_gemarkung','a','text','','PRIMARY KEY','0','32',NULL,'','Text','','Gemarkungsschlüssel','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303327,'gemarkungsname','gemarkungsname','pp_gemarkung','a','varchar','','','1','80',NULL,'','Text','','Gemarkungsname','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303327,'gemeindename','gemeindename','pp_gemeinde','b','varchar','','','1','80',NULL,'','Text','','gehört zu Gemeinde','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303327,'gid','gid','pp_gemarkung','a','int4','','','1','32',NULL,'','Text','','Datenbank-ID','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303327,'the_geom','the_geom','pp_gemarkung','a','geometry','MULTIPOLYGON','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'5','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Gemarkungsgrenze',@last_layer_id50303327,'','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','90 90 170',NULL,NULL,'360','',NULL,'5','3','5','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);

 

#Fluren


SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Fluren','','2',@group_id,'SELECT a.gid, a.flurnummer, b.gemarkungsname, \'13\'||a.gemarkung as gemarkung, c.gemeindename, a.the_geom FROM pp_flur as a, pp_gemarkung as b, pp_gemeinde as c WHERE a.gemarkung = b.gemarkung AND b.gemeinde = c.gemeinde','pp_flur','the_geom from (select oid, gid, the_geom from alkis.pp_flur) as foo using unique oid using srid=25833','alkis','','','','','',NULL,NULL,'',@connection,'','6','gid','gid','1','pixels','25833','','1',NULL,'100000','49','50001','','EPSG:25833','','1.1.0','image/png','60','','','','','1','0','','Dient der Darstellung der Flurgrenzen.','','','0');
SET @last_layer_id50303336=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303336,'flurnummer','flurnummer','pp_flur','a','int4','','PRIMARY KEY','0','32',NULL,'','Text','','Flurnummer','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303336,'gemarkung','gemarkung as gemarkung','','','not_saveable','','',NULL,NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'3','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303336,'gemarkungsname','gemarkungsname','pp_gemarkung','b','varchar','','','1','80',NULL,'','Text','','gehört zu Gemarkung','','','','','','',NULL,NULL,'2','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303336,'gemeindename','gemeindename','pp_gemeinde','c','varchar','','','1','80',NULL,'','Text','','gehört zu Gemeinde','','','','','','',NULL,NULL,'4','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303336,'gid','gid','pp_flur','a','int4','','','1','32',NULL,'','Text','','Datenbank-ID','','','','','','',NULL,NULL,'0','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id50303336,'the_geom','the_geom','pp_flur','a','geometry','MULTIPOLYGON','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'5','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Flurgrenzen',@last_layer_id50303336,'','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','240 210 100',NULL,NULL,'360','',NULL,'5','3','5','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);

 

#sonstige Angaben

#Vegetationsmerkmale


#Die nachfolgenden Layerdefinitionen beziehen sich nur auf Geometrien vom Typ ‚Polygon‘.

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Vegetationsmerkmal','2',@group_id,'SELECT bewuchs, name, zustand, wkb_geometry FROM ax_vegetationsmerkmal WHERE ST_GeometryType(wkb_geometry) = \'ST_Polygon\' AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','wkb_geometry from (SELECT oid, bewuchs, name, zustand, wkb_geometry FROM alkis.ax_vegetationsmerkmal WHERE ST_GeometryType(wkb_geometry) = \'ST_Polygon\' AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','',NULL,NULL,'',@connection,'','6','bewuchs','bewuchs','5','pixels','25833','','0',NULL,'85960','99','10010','','EPSG:25833','ax_vegetationsmerkmal','1.3.0','image/png','60','','','','','1','0','','','','','0');
SET @last_layer_id207501=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207501,'bewuchs','bewuchs','ax_vegetationsmerkmal','ax_vegetationsmerkmal','int4','','','1','32','Text','','','','1','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207501,'name','name','ax_vegetationsmerkmal','ax_vegetationsmerkmal','varchar','','','1',NULL,'Text','','','','2','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207501,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207501,'wkb_geometry','wkb_geometry','ax_vegetationsmerkmal','ax_vegetationsmerkmal','geometry','POLYGON','','1',NULL,'Text','','','','4','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207501,'zustand','zustand','ax_vegetationsmerkmal','ax_vegetationsmerkmal','int4','','','1','32','Text','','','','3','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Baumbestand, Laubholz',@last_layer_id207501,'/1021/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'baumbestand_laubholz-fla','48','0 0 0','','','36','60','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Baumbestand, Nadelholz',@last_layer_id207501,'/1022/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','0 129 49',NULL,'1','360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'baumbestand_nadelholz-fla','48','0 0 0','','','36','60','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Bestand, Laub-/Nadelholz',@last_layer_id207501,'/1023/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'baumbestand_laub_nadelholz-fla','48','0 0 0','','','36','60','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Gehölz',@last_layer_id207501,'/1250/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'gehoelz-fla','20','0 0 0','','','14','30','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Gebüsch',@last_layer_id207501,'/1260/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'gebuesch-fla','12','0 0 0','','','8','16','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Schneise',@last_layer_id207501,'/1300/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','242 246 203','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Röhricht, Schilf',@last_layer_id207501,'/1400/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','0 129 49',NULL,'1','360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'schilf-fla','12','0 0 0','','','8','16','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Gras',@last_layer_id207501,'/1500/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'grass-fla','9','0 0 0','','','6','12','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Rain',@last_layer_id207501,'/1510/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','242 246 203','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'grass-fla','9','0 0 0','','','6','12','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Zierfläche',@last_layer_id207501,'/1600/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'zierflaeche-fla','33','0 0 0','','','22','44','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Korbweide',@last_layer_id207501,'/1700/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'korbweide-fla','48','0 0 0','','','36','60','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Reet',@last_layer_id207501,'/1800/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','','-1 -1 -1','','0 129 49',NULL,NULL,'360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'reet-fla','48','0 0 0','','','36','60','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);

#Gewässermerkmale

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Gewässermerkmal','2',@group_id,'','the_geom from (SELECT oid, art, name, wkb_geometry AS the_geom FROM alkis.ax_gewaessermerkmal WHERE st_geometrytype(wkb_geometry) = \'ST_Polygon\' AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833','alkis','','','','','name','10010','99','',@connection,'','6','art','art','5','pixels','25833','','0',NULL,'85940','99','10010','','EPSG:25833','gewaessermerkmal','1.1.1','image/png','60','','','','','0','0','','','','','0');
SET @last_layer_id207502=LAST_INSERT_ID();
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Quelle',@last_layer_id207502,'/1610/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','0 204 204',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 204 204','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Wasserfall',@last_layer_id207502,'/1620/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','0 204 204',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 204 204','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Stromschnelle',@last_layer_id207502,'/1630/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','0 204 204',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 204 204','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Sandbank',@last_layer_id207502,'/1640/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 247 191','','82 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 0 0','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Watt',@last_layer_id207502,'/1650/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','235 240 240','','-1 -1 -1',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 0 0','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Priel',@last_layer_id207502,'/1660/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','227 255 255','','0 204 204',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 204 204','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('sonstiges Merkmal',@last_layer_id207502,'/9999/','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','82 0 0',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 0 0','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);

#untergeordnetes Gewässer

SET @group_id = @group_id;
SET @connection = @connection;

INSERT INTO layer (`Name`,`Datentyp`,`Gruppe`,`pfad`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('untergeord.Gewässer','2',@group_id,'SELECT funktion, (CASE WHEN funktion = 1010 THEN \'Graben\' WHEN funktion = 1020 THEN \'Fleet\' WHEN funktion = 1030 THEN \'Bach\'::text WHEN funktion = 1040 THEN \'Teich\' ELSE NULL END) AS fldfunktion, lagezurerdoberflaeche, (CASE WHEN lagezurerdoberflaeche = 1800 THEN \'Verrohrt, unterirdisch, bedeckt\' WHEN lagezurerdoberflaeche = 1810 THEN \'Verdolt\' ELSE NULL END) AS fldlage, hydrologischesmerkmal, (CASE WHEN hydrologischesmerkmal = 2000 THEN \'Nicht ständig Wasser führend\' WHEN hydrologischesmerkmal = 3000 THEN \'Trocken, versiegt\' ELSE NULL END) AS fldmerkmal, name, wkb_geometry AS the_geom FROM ax_untergeordnetesgewaesser WHERE ST_GeometryType(wkb_geometry) = \'ST_Polygon\' AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END','the_geom from (SELECT oid, funktion, lagezurerdoberflaeche, hydrologischesmerkmal, name, wkb_geometry AS the_geom FROM alkis.ax_untergeordnetesgewaesser WHERE st_geometrytype(wkb_geometry) = \'ST_Polygon\' AND CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt::text <= \'$hist_timestamp\' and (\'$hist_timestamp\' < endet::text or endet IS NULL) END) as foo using unique oid using srid=25833 ','alkis','','','','','name','25010','99','',@connection,'','6','funktion','funktion','5','pixels','25833','','1',NULL,'85920','99','25010','','EPSG:25833','untergeordnetesgewaesser_poly','1.1.1','image/png','60','','','','','0','0','','','','','0');
SET @last_layer_id207503=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207503,'fldfunktion','fldfunktion','','','text','','',NULL,NULL,'Text','','Art (Beschreibung)','','2','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207503,'fldlage','fldlage','','','text','','',NULL,NULL,'Text','','Lage (Beschreibung)','','4','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207503,'fldmerkmal','fldmerkmal','','','text','','',NULL,NULL,'Text','','Merkmal (Beschreibung)','','6','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207503,'funktion','funktion','ax_untergeordnetesgewaesser','ax_untergeordnetesgewaesser','int4','','','1','32','Text','','erkennbare Art','','1','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207503,'hydrologischesmerkmal','hydrologischesmerkmal','ax_untergeordnetesgewaesser','ax_untergeordnetesgewaesser','int4','','','1','32','Text','','hydr. Merkmal','','5','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207503,'lagezurerdoberflaeche','lagezurerdoberflaeche','ax_untergeordnetesgewaesser','ax_untergeordnetesgewaesser','int4','','','1','32','Text','','Lage zur Erdoberfläche','','3','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207503,'name','name','ax_untergeordnetesgewaesser','ax_untergeordnetesgewaesser','varchar','','','1',NULL,'Text','','Name','','7','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207503,'oid','oid','','','oid','','',NULL,NULL,'Text','','','','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`form_element_type`,`options`,`alias`,`tooltip`,`order`,`privileg`) VALUES(@last_layer_id207503,'the_geom','wkb_geometry','ax_untergeordnetesgewaesser','ax_untergeordnetesgewaesser','geometry','GEOMETRY','','1',NULL,'Geometrie','','','','8','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('stehend, fließend',@last_layer_id207503,'','4','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','227 255 255','','0 204 204',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 204 204','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('verrohrt, unterirdisch, verdolt',@last_layer_id207503,'([lagezurerdoberflaeche] = 1800 OR [lagezurerdoberflaeche] = 1810)','1','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','0 204 204',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 204 204','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('nicht std.wasserführend',@last_layer_id207503,'([hydrologischesmerkmal] = 2000)','2','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','-1 -1 -1',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','0 204 204',NULL,'1','360','',NULL,'1','1','1','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 204 204','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('trocken, versiegt',@last_layer_id207503,'([hydrologischesmerkmal] = 3000)','3','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','255 255 255','','-1 -1 -1',NULL,'1','360','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','-1 -1 -1','','0 204 204',NULL,'1','360','',NULL,'2','1','2','');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 1);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('ArialItalic',NULL,'0 204 204','255 255 255','',NULL,NULL,'','',NULL,NULL,'8','6','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);


andere Themen mit ALKIS-Bezug

alle

Buchdatenauskunft

Baulasten


SET @group_id = 1;
SET @connection = 'user=xxxx password=xxxx dbname=kvwmapsp';

INSERT INTO layer (`Name`,`alias`,`Datentyp`,`Gruppe`,`pfad`,`maintable`,`Data`,`schema`,`document_path`,`tileindex`,`tileitem`,`labelangleitem`,`labelitem`,`labelmaxscale`,`labelminscale`,`labelrequires`,`connection`,`printconnection`,`connectiontype`,`classitem`,`filteritem`,`tolerance`,`toleranceunits`,`epsg_code`,`template`,`queryable`,`transparency`,`drawingorder`,`minscale`,`maxscale`,`offsite`,`ows_srs`,`wms_name`,`wms_server_version`,`wms_format`,`wms_connectiontimeout`,`wms_auth_username`,`wms_auth_password`,`wfs_geom`,`selectiontype`,`querymap`,`logconsume`,`processing`,`kurzbeschreibung`,`datenherr`,`metalink`,`privileg`) VALUES('Baulasten','','2',@group_id,'SELECT ogc_fid, gml_id, identifier, beginnt, endet, advstandardmodell, sonstigesmodell, anlass, art, name, artderfestlegung, land, stelle, bezeichnung, datumanordnung, wkb_geometry FROM ax_bauraumoderbodenordnungsrecht where CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt <= \'$hist_timestamp\' and (\'$hist_timestamp\' <= endet or endet IS NULL) END and artderfestlegung = 2610','ax_bauraumoderbodenordnungsrecht','wkb_geometry from (SELECT oid, ogc_fid, gml_id, identifier, beginnt, endet, advstandardmodell, sonstigesmodell, anlass, art, name, artderfestlegung, land, stelle, bezeichnung, datumanordnung, wkb_geometry
  FROM alkis.ax_bauraumoderbodenordnungsrecht where CASE WHEN \'$hist_timestamp\' = \'\' THEN endet IS NULL ELSE beginnt <= \'$hist_timestamp\' and (\'$hist_timestamp\' <= endet or endet IS NULL) END and artderfestlegung = 2610) as foo using unique oid using srid=25833','alkis','','','','','bezeichnung','10000','1','',@connection,'','6','','','3','pixels','25833','','1','70','31000990','1','25000','','EPSG:25833','','1.1.1','image/png','60','','','','','0','0','','Baulasten aus ALKIS, soweit im Datenbestand vorhanden, keine vollständige Darstellung der Baulasten!','Vermessungs- und Geoinformationsbehörde','','0');
SET @last_layer_id11664=LAST_INSERT_ID();
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'advstandardmodell','advstandardmodell','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','_varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'5',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'anlass','anlass','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'7',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'art','art','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'8',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'artderfestlegung','artderfestlegung','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','int4','','','1','32',NULL,'','Text','','','','','','','','',NULL,NULL,'10',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'beginnt','beginnt','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','bpchar','','UNIQUE','1','20',NULL,'','Text','','','','','','','','',NULL,NULL,'3',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'bezeichnung','bezeichnung','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','varchar','','','1',NULL,NULL,'','Text','','Bezeichnung','','','','','','',NULL,NULL,'13','0','1');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'datumanordnung','datumanordnung','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'14',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'endet','endet','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','bpchar','','','1','20',NULL,'','Text','','','','','','','','',NULL,NULL,'4',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'gml_id','gml_id','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','varchar','','UNIQUE','0','16',NULL,'','Text','','GML ID','','','','','','',NULL,NULL,'1','0','0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'identifier','identifier','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'2',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'land','land','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','int4','','','1','32',NULL,'','Text','','','','','','','','',NULL,NULL,'11',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'name','name','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'9',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'ogc_fid','ogc_fid','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','int4','','PRIMARY KEY','1','32',NULL,'','Text','','','','','','','','',NULL,NULL,'0',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'sonstigesmodell','sonstigesmodell','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','_varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'6',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'stelle','stelle','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','varchar','','','1',NULL,NULL,'','Text','','','','','','','','',NULL,NULL,'12',NULL,'0');
INSERT INTO layer_attributes (`layer_id`,`name`,`real_name`,`tablename`,`table_alias_name`,`type`,`geometrytype`,`constraints`,`nullable`,`length`,`decimal_length`,`default`,`form_element_type`,`options`,`alias`,`alias_low-german`,`alias_english`,`alias_polish`,`alias_vietnamese`,`tooltip`,`group`,`raster_visibility`,`mandatory`,`order`,`privileg`,`query_tooltip`) VALUES(@last_layer_id11664,'wkb_geometry','wkb_geometry','ax_bauraumoderbodenordnungsrecht','ax_bauraumoderbodenordnungsrecht','geometry','POLYGON','','1',NULL,NULL,'','Geometrie','','','','','','','','',NULL,NULL,'15','0','0');
INSERT INTO classes (`Name`,`Layer_ID`,`Expression`,`drawingorder`,`text`) VALUES('Flächen',@last_layer_id11664,'(1=1)','0','');
SET @last_class_id=LAST_INSERT_ID();
INSERT INTO styles (`symbol`,`symbolname`,`size`,`color`,`backgroundcolor`,`outlinecolor`,`minsize`,`maxsize`,`angle`,`angleitem`,`antialias`,`width`,`minwidth`,`maxwidth`,`sizeitem`) VALUES(NULL,'','1','19 255 2','','100 100 100','1','1','','',NULL,NULL,NULL,NULL,'');
 SET @last_style_id=LAST_INSERT_ID();
INSERT INTO u_styles2classes (style_id, class_id, drawingorder) VALUES (@last_style_id, @last_class_id, 0);
INSERT INTO labels (`font`,`type`,`color`,`outlinecolor`,`shadowcolor`,`shadowsizex`,`shadowsizey`,`backgroundcolor`,`backgroundshadowcolor`,`backgroundshadowsizex`,`backgroundshadowsizey`,`size`,`minsize`,`maxsize`,`position`,`offsetx`,`offsety`,`angle`,`autoangle`,`buffer`,`antialias`,`minfeaturesize`,`maxfeaturesize`,`partials`,`wrap`,`the_force`) VALUES('arial',NULL,'0 0 0','255 255 150','',NULL,NULL,'255 255 150','100 100 100','2','2','6','4','8','1','-5','-5',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 SET @last_label_id=LAST_INSERT_ID();
INSERT INTO u_labels2classes (label_id, class_id) VALUES (@last_label_id, @last_class_id);

UPDATE layer_attributes SET options = REPLACE(options, '11664', @last_layer_id11664) WHERE layer_id IN(@last_layer_id11664) AND form_element_type IN ('SubFormPK', 'SubFormFK', 'SubFormEmbeddedPK');
 

ProBauG

Eigentum von ...

vermessene Flurstücke

Grundstücke

WBV-Flächen

FLurstücksflächendifferenzen

Strassenverzeichnis aus ALKIS-Daten

Mit folgendem View lässt sich ein Straßenverzeichnis mit amtlichem Straßenschlüssel ausgeben:

CREATE OR REPLACE VIEW alkis.lk_strassenverzeichnis AS 
SELECT am.amt_name, gem.bezeichnung AS gemeindename, 
   gmk.bezeichnung AS gemarkungsname, o.gemarkungsnummer, gem.schluesselgesamt, 
   p.lage, s.bezeichnung, 
   am.regionalschluessel::text || p.lage::text AS strassenschluessel
  FROM alkis.ax_lagebezeichnungmithausnummer p
  JOIN alkis.ax_flurstueck o ON p.gml_id::text = ANY (o.weistauf::text[])
  LEFT JOIN alkis.ax_lagebezeichnungkatalogeintrag s ON p.kreis = s.kreis AND p.gemeinde = s.gemeinde AND p.lage::text = s.lage::text
  LEFT JOIN alkis.ax_gemeinde gem ON s.gemeinde = gem.gemeinde
  LEFT JOIN alkis.ax_gemarkung gmk ON o.gemarkungsnummer = gmk.gemarkungsnummer
  LEFT JOIN alkis.lk_aemtergemeinden am ON gem.schluesselgesamt::text = am.gemeinde_schluessel::text
  WHERE o.endet IS NULL AND p.endet IS NULL AND s.endet IS NULL AND gem.endet IS NULL AND gmk.endet IS NULL AND o.weistauf IS NOT NULL
  GROUP BY am.amt_name, gem.bezeichnung, gmk.bezeichnung, o.gemarkungsnummer, gem.schluesselgesamt, p.lage, s.bezeichnung, am.regionalschluessel, am.amt_schluessel
  ORDER BY gem.schluesselgesamt, p.lage, am.amt_schluessel;
 ALTER TABLE alkis.lk_strassenverzeichnis
  OWNER TO kvwmap;

Voraussetzung ist die Tabelle lk_aemtergemeinden mit dem 12-stelligen Regionalschlüssel.
Hiermit kann man abgewandelt auch neue Straßen in ALKIS finden.

Anbindung Kaufpreissammlung AKuK

Für die Kaufpreissammlung AKuK der Fa. Sprengnetter besteht eine Anbindung an eine ALB-Datenbank zur Übernahme von Werten aus dem Liegenschaftsbuch in die Kaufpreissammlung. Gegenwärtig ist eine Umstellung der Kaufpreissammlung auf ALKIS®, insbesondere die Anpassung an das Flurstückskennzeichen nicht geplant.

Um die Datenübernahme aus dem Liegenschaftskataster unter ALKIS® zu realisieren wurden neue Abfragen erstellt, die aus den ALKIS®-Daten der Kaufpreissammlung ein ALB vortäuschen. Die Felder und die Eigenschaften der Felder sind nahezu identisch mit den vorherigen Abfragen. Aus Performancegründen werden die Abfragen unter ALKIS® genutzt, um Tabellen im Postprocessing zu füllen. Diese Tabellen werden im entsprechenden ODBC-Aufruf in AKuK angesprochen.

Tabellendefinitionen

Tabelle Flurstücke

CREATE TABLE ak_flurstuecke
(
  gml_id character varying(16),
  gemkgname character varying(80),
  gemkgschl integer,
  flurstkennz text,
  flur integer,
  zaehler integer,
  nenner integer,
  flurstueck text,
  flaeche double precision,
  rw double precision,
  hw double precision
)
WITH (
  OIDS=FALSE
);

CREATE INDEX ak_flurstuecke_flurstkennz
  ON ak_flurstuecke
  USING btree
  (flurstkennz COLLATE pg_catalog."default");
COMMENT ON INDEX ak_flurstuecke_flurstkennz
  IS 'Suche nach Flurstückskennzeichen';


Tabelle tatsächliche Nutzung

CREATE TABLE ak_nutzung
(
  flurstkennz text,
  nutzungsart integer,
  bezeichnung text,
  flaeche_ab integer
)
WITH (
  OIDS=FALSE
);

CREATE INDEX ak_nutzung_flurstkennz
  ON ak_nutzung
  USING btree
  (flurstkennz COLLATE pg_catalog."default");
COMMENT ON INDEX ak_nutzung_flurstkennz
  IS 'Suche nach Flurstückskennzeichen';


Tabelle Lage

CREATE TABLE ak_lage
(
  flurstkennz text,
  lage character varying
)
WITH (
  OIDS=FALSE
);

CREATE INDEX ak_lage_flurstkennz
  ON ak_lage
  USING btree
  (flurstkennz COLLATE pg_catalog."default");
COMMENT ON INDEX ak_lage_flurstkennz
  IS 'Suche nach Flurstückskennzeichen';


Tabelle Straße

CREATE TABLE ak_strasse
(
  flurstkennz text,
  plz character varying(8),
  gemeindename character varying(32),
  gemkgname character varying(80),
  strassenname character varying,
  hausnr character varying
)
WITH (
  OIDS=FALSE
);

CREATE INDEX ak_strasse_flurstkennz
  ON ak_strasse
  USING btree
  (flurstkennz COLLATE pg_catalog."default");
COMMENT ON INDEX ak_strasse_flurstkennz
  IS 'Suche nach Flurstückskennzeichen';


Tabelle Grundbuch

CREATE TABLE ak_grundbuch
(
  flurstkennz text,
  grundbuchbezschl integer,
  bezirk character varying,
  blatt text,
  bvnr text
)
WITH (
  OIDS=FALSE
);

CREATE INDEX ak_grundbuch_flurstkennz
  ON ak_grundbuch
  USING btree
  (flurstkennz COLLATE pg_catalog."default");
COMMENT ON INDEX ak_grundbuch_flurstkennz
  IS 'Suche nach Flurstückskennzeichen';


Tabelle Boden

CREATE TABLE ak_boden
(
  flurstkennz text,
  nutzung character varying,
  flaeche_ab integer,
  bodenklasse text,
  az integer,
  gz integer
)
WITH (
  OIDS=FALSE
);

CREATE INDEX ak_boden_flurstkennz
  ON ak_boden
  USING btree
  (flurstkennz COLLATE pg_catalog."default");
COMMENT ON INDEX ak_boden_flurstkennz
  IS 'Suche nach Flurstückskennzeichen';

Diese Tabellen werden im Postprocessing der Aktualisierung von ALKIS® mit nachfolgenden Abfragen gefüllt.

Definition der Abfragen

View Flurstuecke

CREATE OR REPLACE VIEW ak_flurstuecke_alkis AS 
 SELECT a.gml_id, b.gemarkungsname AS gemkgname, 130000 + a.gemarkungsnummer AS gemkgschl, (((((('13'::text || a.gemarkungsnummer) || '-'::text) || lpad(a.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(a.zaehler::text, 5, '0'::text)) || '/'::text) || 
        CASE
            WHEN a.nenner IS NULL THEN '000.00'::text
            ELSE lpad(a.nenner::text, 3, '0'::text) || '.00'::text
        END AS flurstkennz, a.flurnummer AS flur, a.zaehler, 
        CASE
            WHEN a.nenner IS NULL THEN 0
            ELSE a.nenner
        END AS nenner, 
        CASE
            WHEN a.nenner IS NULL THEN a.zaehler::text
            ELSE (a.zaehler || '/'::text) || a.nenner
        END AS flurstueck, a.amtlicheflaeche AS flaeche, round(st_x(st_centroid(a.wkb_geometry))) AS rw, round(st_y(st_centroid(a.wkb_geometry))) AS hw
   FROM alkis.ax_flurstueck a, alkis.pp_gemarkung b
  WHERE a.endet IS NULL AND b.gemarkung = a.gemarkungsnummer;


View tatsächliche Nutzung

CREATE OR REPLACE VIEW ak_nutzung_alkis AS 
 SELECT (((((('13'::text || b.gemarkungsnummer) || '-'::text) || lpad(b.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(b.zaehler::text, 5, '0'::text)) || '/'::text) || 
        CASE
            WHEN b.nenner IS NULL THEN '000.00'::text
            ELSE lpad(b.nenner::text, 3, '0'::text) || '.00'::text
        END AS flurstkennz, n.class AS nutzungsart, 
        CASE
            WHEN n.class = 0 THEN m.title::text
            ELSE (m.title::text || ' - '::text) || x.label::text
        END AS bezeichnung, round(st_area(st_intersection(b.wkb_geometry, n.wkb_geometry)) * b.amtlicheflaeche / st_area(b.wkb_geometry))::integer AS flaeche
   FROM alkis.ax_flurstueck b, alkis.nutzung n, alkis.nutzung_class x, alkis.nutzung_meta m
  WHERE n.nutz_id = m.nutz_id AND n.endet IS NULL AND n.class = x.class AND n.nutz_id = x.nutz_id AND st_intersects(b.wkb_geometry, n.wkb_geometry) AND st_area(st_intersection(b.wkb_geometry, n.wkb_geometry)) > 0::double precision;


View Lage

CREATE OR REPLACE VIEW ak_lage_alkis AS 
         SELECT (((((('13'::text || a.gemarkungsnummer) || '-'::text) || lpad(a.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(a.zaehler::text, 5, '0'::text)) || '/'::text) || 
                CASE
                    WHEN a.nenner IS NULL THEN '000.00'::text
                    ELSE lpad(a.nenner::text, 3, '0'::text) || '.00'::text
                END AS flurstkennz, string_agg(
                CASE
                    WHEN b.unverschluesselt IS NULL THEN c.bezeichnung
                    ELSE b.unverschluesselt
                END::text, ', '::text)::character varying AS lage
           FROM alkis.ax_lagebezeichnungohnehausnummer b
      LEFT JOIN alkis.ax_lagebezeichnungkatalogeintrag c ON c.lage::text = b.lage::text AND b.gemeinde = c.gemeinde, alkis.ax_flurstueck a
     WHERE c.endet IS NULL AND (b.gml_id::text = ANY (a.zeigtauf::text[]))
     GROUP BY (((((('13'::text || a.gemarkungsnummer) || '-'::text) || lpad(a.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(a.zaehler::text, 5, '0'::text)) || '/'::text) || 
           CASE
               WHEN a.nenner IS NULL THEN '000.00'::text
               ELSE lpad(a.nenner::text, 3, '0'::text) || '.00'::text
           END
UNION 
         SELECT (((((('13'::text || a.gemarkungsnummer) || '-'::text) || lpad(a.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(a.zaehler::text, 5, '0'::text)) || '/'::text) || 
                CASE
                    WHEN a.nenner IS NULL THEN '000.00'::text
                    ELSE lpad(a.nenner::text, 3, '0'::text) || '.00'::text
                END AS flurstkennz, (c.bezeichnung::text || ' '::text) || b.hausnummer::text AS lage
           FROM alkis.ax_lagebezeichnungmithausnummer b, alkis.ax_flurstueck a, alkis.ax_lagebezeichnungkatalogeintrag c
          WHERE c.endet IS NULL AND (b.gml_id::text = ANY (a.weistauf::text[])) AND c.lage::text = b.lage::text AND b.gemeinde = c.gemeinde;


View Straße

Für die Ermittlung der Postleitzahlen nutzen wir in LRO eine erweiterte Gemeindetabelle sd_gemeinde, in der zu jeder Gemeinde u.a. die PLZ gespeichert ist.

CREATE OR REPLACE VIEW ak_strasse_alkis AS 
         SELECT (((((('13'::text || a.gemarkungsnummer) || '-'::text) || lpad(a.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(a.zaehler::text, 5, '0'::text)) || '/'::text) || 
                CASE
                    WHEN a.nenner IS NULL THEN '000.00'::text
                    ELSE lpad(a.nenner::text, 3, '0'::text) || '.00'::text
                END AS flurstkennz, c.plz, c.gemeinde AS gemeindename, b.gemarkungsname AS gemkgname, string_agg(
                CASE
                    WHEN d.unverschluesselt IS NULL THEN e.bezeichnung
                    ELSE d.unverschluesselt
                END::text, ', '::text)::character varying AS strassenname, ''::character varying AS hausnr
           FROM alkis.ax_flurstueck a, alkis.pp_gemarkung b, sd_gemeinde c, alkis.ax_lagebezeichnungohnehausnummer d
      LEFT JOIN alkis.ax_lagebezeichnungkatalogeintrag e ON d.lage::text = e.lage::text AND d.gemeinde = e.gemeinde
     WHERE a.endet IS NULL AND (d.gml_id::text = ANY (a.zeigtauf::text[])) AND c.endet IS NULL AND d.endet IS NULL AND e.endet IS NULL AND c.plz IS NOT NULL AND b.gemarkung = a.gemarkungsnummer AND lpad(b.gemeinde::text, 3, '0'::text) = c.gemdeschl_k::text AND a.gemeinde = b.gemeinde
     GROUP BY (((((('13'::text || a.gemarkungsnummer) || '-'::text) || lpad(a.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(a.zaehler::text, 5, '0'::text)) || '/'::text) || 
           CASE
               WHEN a.nenner IS NULL THEN '000.00'::text
               ELSE lpad(a.nenner::text, 3, '0'::text) || '.00'::text
           END, c.plz, c.gemeinde, b.gemarkungsname, ''::character varying
UNION 
         SELECT (((((('13'::text || a.gemarkungsnummer) || '-'::text) || lpad(a.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(a.zaehler::text, 5, '0'::text)) || '/'::text) || 
                CASE
                    WHEN a.nenner IS NULL THEN '000.00'::text
                    ELSE lpad(a.nenner::text, 3, '0'::text) || '.00'::text
                END AS flurstkennz, c.plz, c.gemeinde AS gemeindename, b.gemarkungsname AS gemkgname, e.bezeichnung AS strassenname, d.hausnummer AS hausnr
           FROM alkis.ax_flurstueck a, alkis.pp_gemarkung b, sd_gemeinde c, alkis.ax_lagebezeichnungmithausnummer d, alkis.ax_lagebezeichnungkatalogeintrag e
          WHERE a.endet IS NULL AND (d.gml_id::text = ANY (a.weistauf::text[])) AND c.endet IS NULL AND d.endet IS NULL AND e.endet IS NULL AND c.plz IS NOT NULL AND b.gemarkung = a.gemarkungsnummer AND lpad(b.gemeinde::text, 3, '0'::text) = c.gemdeschl_k::text AND d.lage::text = e.lage::text AND d.gemeinde = e.gemeinde AND d.gemeinde = b.gemeinde;


View Grundbuch

CREATE OR REPLACE VIEW ak_grundbuch_alkis AS 
         SELECT (((((('13'::text || d.gemarkungsnummer) || '-'::text) || lpad(d.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(d.zaehler::text, 5, '0'::text)) || '/'::text) || 
                CASE
                    WHEN d.nenner IS NULL THEN '000.00'::text
                    ELSE lpad(d.nenner::text, 3, '0'::text) || '.00'::text
                END AS flurstkennz, b.schluesselgesamt AS grundbuchbezschl, b.bezeichnung AS bezirk, substr(a.buchungsblattkennzeichen::text, 9, 13) AS blatt, lpad(c.laufendenummer::text, 4, '0'::text) AS bvnr
           FROM alkis.ax_buchungsblatt a, alkis.ax_buchungsblattbezirk b, alkis.ax_buchungsstelle c, alkis.ax_flurstueck d
          WHERE b.bezirk = a.bezirk AND (c.istbestandteilvon::text = a.gml_id::text OR (c.gml_id::text = ANY (a.bestehtaus::text[]))) AND (d.istgebucht::text = c.gml_id::text OR (d.gml_id::text = ANY (c.verweistauf::text[])))
UNION 
         SELECT (((((('13'::text || d.gemarkungsnummer) || '-'::text) || lpad(d.flurnummer::text, 3, '0'::text)) || '-'::text) || lpad(d.zaehler::text, 5, '0'::text)) || '/'::text) || 
                CASE
                    WHEN d.nenner IS NULL THEN '000.00'::text
                    ELSE lpad(d.nenner::text, 3, '0'::text) || '.00'::text
                END AS flurstkennz, b.schluesselgesamt AS grundbuchbezschl, b.bezeichnung AS bezirk, substr(a.buchungsblattkennzeichen::text, 9, 13) AS blatt, lpad(c.laufendenummer::text, 4, '0'::text) AS bvnr
           FROM alkis.ax_buchungsblatt a, alkis.ax_buchungsblattbezirk b, alkis.ax_buchungsstelle c, alkis.ax_buchungsstelle c2, alkis.ax_flurstueck d
          WHERE b.bezirk = a.bezirk AND (c2.istbestandteilvon::text = a.gml_id::text OR (c2.gml_id::text = ANY (a.bestehtaus::text[]))) AND (c.gml_id::text = ANY (c2.an::text[])) AND (d.istgebucht::text = c.gml_id::text OR (d.gml_id::text = ANY (c.verweistauf::text[])));


View Bodenschätzung

In der Geschäftsstelle des Gutachterausschusses in dem Landkreis Rostock bestand der Wunsch, für die Flächen, deren Bodenschätzung noch nicht in das Liegenschaftskataster übernommen ist, die tatsächliche Nutzung zu übernehmen.

Da dieses View auf die Tabellen ak_boden und ak_nutzung zurückgreift, kann diese Abfrage erst nach dem Füllen dieser beiden Tabellen ausgeführt werden und steht daher ganz am Ende.

CREATE OR REPLACE VIEW ak_boden_alkis AS 
         SELECT b.flurstkennz, b.nutzung, b.flaeche_ab, b.bodenklasse, b.az, b.gz
           FROM ak_boden b
UNION 
         SELECT n.flurstkennz, n.bezeichnung AS nutzung, n.flaeche_ab, NULL::bpchar AS bodenklasse, NULL::integer AS az, NULL::integer AS gz
           FROM ak_nutzung n
      LEFT JOIN ak_boden b ON n.flurstkennz = b.flurstkennz
     WHERE b.flurstkennz IS NULL;