-
Notifications
You must be signed in to change notification settings - Fork 1
System
karlbrink edited this page Mar 6, 2024
·
8 revisions
In the mapbender.conf file there is an optional constant "RAMDISK". It defines the path to a fast storage which can be configured easy in debian. Under productive environments it make sense to have 6G available, cause the storage is used by the wfs-proxy to cache wfs features.
# as root
mkdir /mnt/ramdisk
mount -t tmpfs -o size=512m tmpfs /mnt/ramdisk
mkdir /mnt/ramdisk/www-data
chown -R www-data:www-data www-data/
cd {mapbender_path}/http/tmp/
ln -s /mnt/ramdisk/www-data/ ramdisk
chown -R www-data ramdisk
#mapbender.conf
define("RAMDISK", "../tmp/ramdisk");
#to make it persistent between reboots
#/etc/fstab
#tmpfs /mnt/ramdisk tmpfs defaults,size=512M 0 0
# as root
#things for using python scripts under www-data - apache user
sudo mkdir /var/www/.local
sudo mkdir /var/www/.cache
sudo chown www-data.www-data /var/www/.local
sudo chown www-data.www-data /var/www/.cache
sudo -H -u www-data pip3 install --proxy http://{proxyhost}:{proxyport} python-slugify==8.0.1
sudo -H -u www-data pip3 install --proxy http://{proxyhost}:{proxyport} shapely==2.0.1
sudo -H -u www-data pip3 install --proxy http://{proxyhost}:{proxyport} requests==2.31.0
sudo -H -u www-data pip3 install --proxy http://{proxyhost}:{proxyport} owslib==0.25.0
# --------------------------------------------
# Absolute path for downloading and processing gpkg files via python lib
# --------------------------------------------
define("GPKG_ABSOLUTE_DOWNLOAD_PATH", "/home/armin/GDI-RP/devel/Geoportal/Mapbender2.8/http/tmp/");
# --------------------------------------------
# Absolute uri for accessing processed gpkg files
# --------------------------------------------
define("GPKG_ABSOLUTE_DOWNLOAD_URI", "https://www.geoportal.rlp.de/inspiredownloads/");
# --------------------------------------------
# Max area for download of gpkg in squarekilometer
# --------------------------------------------
define("GPKG_AREA_LIMIT", "100");
# configure proxy in extensions/inspire-gpkg-cache/cli_invoke.py
#os.environ["HTTP_PROXY"] = "http://{proxyhost}:{proxyport}"
#os.environ["HTTPS_PROXY"] = "http://{proxyhost}:{proxyport}"
# example / test
sudo -H -u www-data python cli_invoke.py '{"area_of_interest":{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[7.27777894715114,50.4178656944585],[7.30656635759122,50.4277321965851],[7.3279761736337,50.4194974924674],[7.33189163928394,50.408221114172],[7.32264355862721,50.3990939695761],[7.30016592681787,50.4020055238014],[7.28626892485032,50.4049495485476],[7.27777894715114,50.4178656944585]]]},"properties":{"title":"Area of interest","area":"8103101.8952","boundary-length":"10821.7505"}},"dataset_configuration":{"datasets":[{"resourceidentifier":"https:\/\/registry.gdi-de.org\/id\/de.rp.vermkv\/2b009ae4-aa3e-ff21-870b-49846d9561b2","type":"raster"},{"resourceidentifier":"https:\/\/registry.gdi-de.org\/id\/de.rp.vermkv\/79d8b001-972f-dc45-33ea-7d50113d4377","type":"vector"}]}}' 'checkOptions'
INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) VALUES('Geoportal-RLP','sdi_download_widget',2,1,'Measure','Geopackage Export','img','../img/geopackage-2.png','',85,155,24,24,200,'','','','../plugins/mb_download_widget.php','../widgets/w_digitize.js,../extensions/RaphaelJS/raphael-1.4.7.min.js','mapframe1','jq_ui_dialog,jq_ui_widget','http://www.mapbender.org/index.php/Measure');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'dialogHeight', '250', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'dialogWidth', '300', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'lineStrokeDefault', '#C9F', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'lineStrokeSnapped', '#F30', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'lineStrokeWidthDefault', '3', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'lineStrokeWidthSnapped', '5', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'measurePointDiameter', '7', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'opacity', '0.4', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'pointFillDefault', '#CCF', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'pointFillSnapped', '#F90', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'pointStrokeDefault', '#FF0000', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'pointStrokeSnapped', '#FF0000', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'pointStrokeWidthDefault', '2', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'polygonFillDefault', '#FFF', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'polygonFillSnapped', '#FC3', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'polygonStrokeWidthDefault', '1', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-RLP', 'sdi_download_widget', 'polygonStrokeWidthSnapped', '5', '' ,'var');
INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) VALUES('Geoportal-Hessen-2019','sdi_download_widget',2,1,'geopackage export function including activate button','Geopackage Export','a','','',NULL ,NULL ,NULL ,NULL ,NULL ,'','<svg version="1.1" id="geopackage_mod" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="24px" height="24px" viewBox="0 0 50 50" overflow="visible" xml:space="preserve">
<path d="M41.55,20.07L26.8,24.95l3.33,5.29c0.16,0.26,0.48,0.37,0.77,0.28l13.44-4.46c0.41-0.14,0.59-0.62,0.35-0.99L41.55,20.07z
M23.82,28.4l-2.74,4.36c-0.28,0.45-0.83,0.64-1.33,0.48L9.13,29.71v7.02c0,0.51,0.33,0.97,0.81,1.13l12.32,4.08
c0.77,0.25,1.56-0.32,1.56-1.13V28.4z M28.98,32.85l-2.8-4.45v12.57c0,0.73,0.72,1.25,1.41,1.02l12.54-4.16
c0.44-0.15,0.74-0.56,0.74-1.02v-7.1l-10.73,3.56C29.71,33.41,29.23,33.24,28.98,32.85z M5.29,25.08l3.16-5.02l14.75,4.89
l-3.33,5.29c-0.16,0.26-0.48,0.37-0.77,0.28L5.65,26.07C5.24,25.93,5.06,25.45,5.29,25.08z M36.42,15.82l-0.77,0.23
c-0.08-0.68-0.27-1.85-0.75-2.83C36.44,14.85,36.42,15.79,36.42,15.82z M35.67,18.45l-10.59,4.08l-0.49-0.15
c-0.13-0.14-0.26-0.28-0.38-0.45c-0.72-0.98-1.89-1.25-3.1-0.66l-0.14-0.05c-0.27-0.43-0.53-0.83-0.81-1.27
c-0.19,0.05-0.43,0.12-0.96,0.27l-5.1-1.18c0.07-1.83,0.54-3.55,1.36-5.06c0.12,0.1,0.24,0.2,0.35,0.35
c0.55,0.76,0.88,1.6,1.07,2.59c0.22,1.14,0.9,2.05,1.67,2.93c0.23,0.26,0.44,0.22,0.5-0.07c0.21-0.52,0.44-0.61,0.61-0.64
c0.47-0.08,0.97,0.06,1.51,0.11c0.26-1.59,1.89-1.94,3.17-2.61c-0.02-0.14-0.03-0.19-0.04-0.25c-0.2-1.03-1.01-1.66-1.61-2.43
c-0.24-0.3-0.78-0.15-0.87,0.25c-0.1,0.44-0.15,0.89-0.25,1.53c-0.41-0.39-0.74-0.63-0.97-0.94c-0.19-0.25-0.43-0.65-0.35-0.87
c0.08-0.24,0.51-0.43,0.81-0.49c0.48-0.09,0.66-0.29,0.61-0.77c-0.03-0.32-0.01-0.64-0.01-1.02c-1.55,0.11-3.08,0.63-4.36-0.19
c2.09-2.16,5.02-3.5,8.26-3.5c3.21,0,6.11,1.31,8.2,3.43c-0.36-0.04-0.73-0.09-1.1-0.19c-1.19-0.31-0.8,2.16-0.72,1.83
c0.08-0.35,0.17-0.7,0.25-1.05c0.08,0.02,0.17,0.04,0.25,0.05c-0.27,0.55,0.88,0.55,1.85,0.59c-0.76,0.4-2.2,2.34-3.3,1.47
c-0.52,0.43-1,0.84-1.49,1.25c0.07,0.18,0.16,0.4,0.27,0.66c-0.28,0.02-0.52,0.04-0.78,0.07c-0.03,0.55-0.14,1.09,0.69,0.86
c-0.09,0.08-0.17,0.18-0.27,0.24c-1.1,0.66-1.83,2.33-0.61,3.01C29.21,20.41,34.22,18.79,35.67,18.45z M27.18,10.08
c-0.28-0.38-0.53-0.9-1.06-0.58c-0.44,0.26-0.86,0.66-0.48,1.34c0.28,0.49,0.41,1.07,0.64,1.59c0.09,0.21,0.3,0.37,0.46,0.56
c0.21-0.47,0.34-0.84,0.53-1.18C27.59,11.21,27.61,10.66,27.18,10.08z"/>
</svg>Geopackage Export<span style=''border:1px solid;padding: 1px 4px;margin-left:15px;font-style: italic;font-weight:bold;''>beta</span>','a','../plugins/mb_download_widget.php','../widgets/w_digitize.js,../extensions/RaphaelJS/raphael-1.4.7.min.js','mapframe1','jq_ui','http://www.mapbender.org/index.php/Measure');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'css', '/* INSERT sdi_download_widget -> elementVar -> css (text/css) */ #toolsContainer #sdi_download_widget svg {margin-left: 14px;margin-right: 5px;} /* END INSERT sdi_download_widget -> elementVar -> css (text/css) */', '' ,'text/css');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'dialogHeight', '250', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'dialogWidth', '300', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'lineStrokeDefault', '#C9F', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'lineStrokeSnapped', '#F30', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'lineStrokeWidthDefault', '3', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'lineStrokeWidthSnapped', '5', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'measurePointDiameter', '7', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'opacity', '0.4', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'pointFillDefault', '#CCF', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'pointFillSnapped', '#F90', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'pointStrokeDefault', '#FF0000', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'pointStrokeSnapped', '#FF0000', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'pointStrokeWidthDefault', '2', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'polygonFillDefault', '#FFF', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'polygonFillSnapped', '#FC3', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'polygonStrokeWidthDefault', '1', '' ,'var');
INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('Geoportal-Hessen-2019', 'sdi_download_widget', 'polygonStrokeWidthSnapped', '5', '' ,'var');
update mb_metadata set fkey_mb_user_id = foo3.wms_owner
from (select foo2.*, wms_owner
from (select foo.*, fkey_wms_id
from (select fkey_metadata_id, fkey_layer_id ,fkey_mb_user_id
from ows_relation_metadata
inner join mb_metadata on fkey_metadata_id = metadata_id
where fkey_mb_user_id = 2 and fkey_layer_id is not null) as foo
inner join layer on fkey_layer_id = layer_id) as foo2
inner join wms on fkey_wms_id = wms_id) as foo3
WHERE mb_metadata.metadata_id = foo3.fkey_metadata_id;