Gruppen und Themen für ALKIS: Amtsverwaltungen
Aus kvwmap
Version vom 17. April 2015, 12:11 Uhr von Markus Hentschel (Diskussion | Beiträge)
Ursprungsversion, LUP 01.01.2015
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('ALKIS_Ämter','Ämter','2',@group_id,'SELECT oid, gid, amtsname, lpad(amt::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); UPDATE layer_attributes SET options = REPLACE(options, '50303448', @last_layer_id50303448) WHERE layer_id IN(@last_layer_id50303448) AND form_element_type IN ('SubFormPK', 'SubFormFK', 'SubFormEmbeddedPK');
--Markus Hentschel (Diskussion) 13:10, 17. Apr. 2015 (CEST)
Version vom 17.04.15
Wesentliche Änderungen: Der Amtsname wird komischerweise teilweise mit dem Verwaltungssitz in Klammern geschrieben: unnötig
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('ALKIS_Ämter','Ämter','2',@group_id,'SELECT oid, gid, case when position(\'(\' in amtsname) = 0 then amtsname else substring(amtsname,1,position(\'(\' in amtsname)-2) end as 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); UPDATE layer_attributes SET options = REPLACE(options, '50303448', @last_layer_id50303448) WHERE layer_id IN(@last_layer_id50303448) AND form_element_type IN ('SubFormPK', 'SubFormFK', 'SubFormEmbeddedPK');