Re: [Geoserver-users] Quick installation script for GeoServer

2020-07-20 Thread Russ Hore
Thanks Jody.

Can you clarify the first bit about geoserver.xml

I am not well versed in Tomcat

> On 20 Jul 2020, at 19:05, Jody Garnett  wrote:
> 
> Small feedback for this step:
> 
> #
> ## Make Geoserver point to /data/
> #
> # Uncomment DATA_DIR and point it to /data/
> #
> vi /var/lib/tomcat9/webapps/geoserver/WEB-INF/web.xml
> 
> Provide a conf/catalina/localhost/geoserver.xml file to control context 
> variables (rather than adjust web.xml defaults):
> 
> 
>   
>override="false"/>
>override="false"/>
> 
> 
> I usually separate out the tilecache (no need to backup), but you can do what 
> you like :)
> --
> Jody Garnett
> 
> 
> On Mon, 20 Jul 2020 at 01:28, Russ Hore  > wrote:
> Whilst investigating performance improvements to my GeoServer installation I 
> have been installing it quite a few times. To make things faster, I developed 
> a script to automate most of the basic stuff I needed from a clean install of 
> Ubuntu 20
> Just in case it is of any use to others I post it here.
> It might not be the tidies scripting and I run it as root (I know thats not 
> ideal and feel free to change it, but it is a local test server)
> 
> I always create a folder /data/ and usually run Apache as the front end to 
> terminate SSL and provide authentication.
> 
> Russ
> 
> #!/bin/bash
> #
> #build_geoserver - Automates most of the tasks of installing Geoserver 
> and PostgreSQL
> #
> #Copyright Russ Hore, 2010, All Rights Reserved
> #
> #This script is free for use: you can redistribute it and/or modify
> #it under the terms of the GNU General Public License as published by
> #the Free Software Foundation, either version 3 of the License, or
> #(at your option) any later version.
> #
> #This program is distributed in the hope that it will be useful,
> #but WITHOUT ANY WARRANTY; without even the implied warranty of
> #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> #GNU General Public License for more details.
> #
> #
> #
> # Do an update and clean up before continuing
> apt-get update --assume-yes
> apt-get upgrade --assume-yes
> apt-get dist-upgrade --assume-yes
> apt autoremove --assume-yes
> 
> 
> #
> # Install Tomcat 9
> apt-get install tomcat9 --assume-yes
> apt-get install tomcat9-admin --assume-yes
> apt-get install tomcat9-common --assume-yes
> apt-get install tomcat9-user --assume-yes
> 
> #
> # Install GDAL utilities
> apt-get install gdal-bin --assume-yes
> apt-get install gdal-data --assume-yes
> apt-get install python-gdal --assume-yes
> 
> #
> # Install Apache2
> apt-get install apache2 --assume-yes
> 
> #
> # Install PHP
> apt-get install php7.4 --assume-yes
> apt-get install php7.4-common --assume-yes
> apt-get install php7.4-curl --assume-yes
> apt-get install php7.4-gd --assume-yes
> apt-get install php7.4-json --assume-yes
> apt-get install php7.4-pgsql --assume-yes
> apt-get install php7.4-xml --assume-yes
> 
> #
> # Install CertBot to use LetsEncrypt certificates for SSL
> apt-get install certbot --assume-yes
> 
> #
> # Unzip is always useful
> apt-get install unzip --assume-yes
> 
> #
> # Install Geoserver
> # NB Need to check for the latest version
> #
> ## Now install Geoserver 2.17.1
> #
> # 1) Get the WAR file
> wget 
> "http://sourceforge.net/projects/geoserver/files/GeoServer/2.17.1/geoserver-2.17.1-war.zip
>  
> "
> # 2) Create a directory to hold the zip file
> mkdir GS2.17.1
> # 3) Cop yhte zip file to the directory
> mv geoserver-2.17.1-war.zip GS2.17.1
> # 4) Change into the directory and unzxip the file
> cd GS2.17.1
> unzip geoserver-2.17.1-war.zip
> # 5) Stop tomcat whilst we copy the war file in (I know you don't need to but 
> why not?)
> service tomcat9 stop
> # 6) Copy the war file to the Tomcat web apps directory
> cp geoserver.war /var/lib/tomcat9/webapps/
> # 7) Re-start Tomcat
> service tomcat9 start
> 
> #
> ## Now configure Geoserver 2.17.1
> #
> # I always create a data folder at / to hold all the GeoServer stuff
> mkdir /data/
> chown tomcat:tomcat /data/
> 
> #
> ## Need to make 

Re: [Geoserver-users] Quick installation script for GeoServer

2020-07-20 Thread Jody Garnett
Small feedback for this step:

#
## Make Geoserver point to /data/
#
# Uncomment DATA_DIR and point it to /data/
#
vi /var/lib/tomcat9/webapps/geoserver/WEB-INF/web.xml


Provide a conf/catalina/localhost/geoserver.xml file to control context
variables (rather than adjust web.xml defaults):


  
  
  



I usually separate out the tilecache (no need to backup), but you can do
what you like :)
--
Jody Garnett


On Mon, 20 Jul 2020 at 01:28, Russ Hore  wrote:

> Whilst investigating performance improvements to my GeoServer installation
> I have been installing it quite a few times. To make things faster, I
> developed a script to automate most of the basic stuff I needed from a
> clean install of Ubuntu 20
> Just in case it is of any use to others I post it here.
> It might not be the tidies scripting and I run it as root (I know thats
> not ideal and feel free to change it, but it is a local test server)
>
> I always create a folder /data/ and usually run Apache as the front end to
> terminate SSL and provide authentication.
>
> Russ
>
> #!/bin/bash
> #
> #build_geoserver - Automates most of the tasks of installing Geoserver
> and PostgreSQL
> #
> #Copyright Russ Hore, 2010, All Rights Reserved
> #
> #This script is free for use: you can redistribute it and/or modify
> #it under the terms of the GNU General Public License as published by
> #the Free Software Foundation, either version 3 of the License, or
> #(at your option) any later version.
> #
> #This program is distributed in the hope that it will be useful,
> #but WITHOUT ANY WARRANTY; without even the implied warranty of
> #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> #GNU General Public License for more details.
> #
> #
> #
> # Do an update and clean up before continuing
> apt-get update --assume-yes
> apt-get upgrade --assume-yes
> apt-get dist-upgrade --assume-yes
> apt autoremove --assume-yes
>
>
> #
> # Install Tomcat 9
> apt-get install tomcat9 --assume-yes
> apt-get install tomcat9-admin --assume-yes
> apt-get install tomcat9-common --assume-yes
> apt-get install tomcat9-user --assume-yes
>
> #
> # Install GDAL utilities
> apt-get install gdal-bin --assume-yes
> apt-get install gdal-data --assume-yes
> apt-get install python-gdal --assume-yes
>
> #
> # Install Apache2
> apt-get install apache2 --assume-yes
>
> #
> # Install PHP
> apt-get install php7.4 --assume-yes
> apt-get install php7.4-common --assume-yes
> apt-get install php7.4-curl --assume-yes
> apt-get install php7.4-gd --assume-yes
> apt-get install php7.4-json --assume-yes
> apt-get install php7.4-pgsql --assume-yes
> apt-get install php7.4-xml --assume-yes
>
> #
> # Install CertBot to use LetsEncrypt certificates for SSL
> apt-get install certbot --assume-yes
>
> #
> # Unzip is always useful
> apt-get install unzip --assume-yes
>
> #
> # Install Geoserver
> # NB Need to check for the latest version
> #
> ## Now install Geoserver 2.17.1
> #
> # 1) Get the WAR file
> wget "
> http://sourceforge.net/projects/geoserver/files/GeoServer/2.17.1/geoserver-2.17.1-war.zip
> "
> # 2) Create a directory to hold the zip file
> mkdir GS2.17.1
> # 3) Cop yhte zip file to the directory
> mv geoserver-2.17.1-war.zip GS2.17.1
> # 4) Change into the directory and unzxip the file
> cd GS2.17.1
> unzip geoserver-2.17.1-war.zip
> # 5) Stop tomcat whilst we copy the war file in (I know you don't need to
> but why not?)
> service tomcat9 stop
> # 6) Copy the war file to the Tomcat web apps directory
> cp geoserver.war /var/lib/tomcat9/webapps/
> # 7) Re-start Tomcat
> service tomcat9 start
>
> #
> ## Now configure Geoserver 2.17.1
> #
> # I always create a data folder at / to hold all the GeoServer stuff
> mkdir /data/
> chown tomcat:tomcat /data/
>
> #
> ## Need to make /data/ readable by Tomcat9
> #
> # Edit the following file and add  the follwoing line unere the #
> Secunrity section
> # ReadWritePaths=/data/
> #
> #
> vi /lib/systemd/system/tomcat9.service
>
> #
> ## Make Geoserver point to /data/
> #
> # Uncomment DATA_DIR and point it to /data/

Re: [Geoserver-users] Pregeneralized DataStore and Vector-tyle

2020-07-20 Thread carlo cancellieri
Dear Andrea and all,
 I'm trying to conclude that pull request but I'm stuck on tests and I can
work over it only on sparetime so I'm wondering if someone can give some
hint (links or examples) on how to test it.

I've planned to create a test simulating a datastore which has support for
pregeneralization and finally check that the hint has been appended to the
query.

The problem is that I'm not able to create that datastore, I've tried to:

- Moke the datastore
- Moke the featuresource
- Implement a new dummy featuresource
- look to other implementations related to pregeneralized data

with no success:
when I try to verify and call  Set hints =
pregeneralizedLayer.getSimpleFeatureSource().getSupportedHints();
hints only contains the MamoryStore hints only...

Here is one of the snippet I've produced with no success:

private final static class PregenDataStore extends MemoryDataStore {
+
+
+private final static class _FeatureSource extends
MemoryFeatureSource {
+
+// MemoryFeatureSource delegate;
+
+ public _FeatureSource(ContentEntry entry) {
+ super(entry);
+
+Set supportedHints = new HashSet();
+supportedHints.addAll(hints);
+supportedHints.add(Hints.GEOMETRY_DISTANCE);
+ hints=Collections.unmodifiableSet(supportedHints);
+ }
+
+}
+
+ _FeatureSource fs;
+
+/**
+ * Creates the new feature store.
+ *
+ */
+@SuppressWarnings("unchecked")
+public PregenDataStore() throws IOException {
+super();
+}
+
+@Override
+public ContentFeatureSource getFeatureSource(String name) throws
IOException {
+
+ if (fs!=null)
+ return fs;
+ fs = spy(new _FeatureSource(name));
+
+return fs;
+}
+}

I'll appreciate if any of you (List) can share a better Idea to test it or
a way to moke the supported hints.

Regards,
C.



Il giorno mer 27 mag 2020 alle ore 12:14 carlo cancellieri <
geo.ccancelli...@gmail.com> ha scritto:

> Dear Andrea and ML,
>
> The vector tiles plugin should probably be modified, although I'm
>> wondering why this was not done when it was written.
>>
>
> I've just completed a first patch having a great speedup improvement of
> performances and now GADM do not require anymore 5gb of ram to be rendered
> (at level 0) and geoserver do not hangs anymore, I really like it.
>
> I will followup with some more details and measurements later but as you
> may immagine the speedup is obvious and the improve of performance depends
> mainly on the level of the simplification and the way we pregeneralize the
> store.
>
> The speedup in generating tiles is just a direct consequence of that.
>
>
>> Could be an oversight, but could have also been a conscious decision?
>> Maybe something related to producing
>> topologically valid geometries in output? And yet, the GEOMETRY_DISTANCE
>> hint is specifically designed to return
>>
>
> Well, good question, I'm looking for the author of that extension with no
> luck, who's the maintainer?
>
> Looking at this part of the presentation
> https://youtu.be/xdc67aZVO7E?t=530 it seems that those feature should be
> implemented into that extension, not sure why they are not there.
>
> Anyhow looking at the examples on how to build the pregeneralized
> geometries they are always generated using
> ST_SimplifyPreserveTopology(geom,...) which helps keeping the topology,
> even if onthefly simplification is not enabled.
>
> I'm blocked also by Atlassian Issue tracking login issue (PTDF-3856) so, I
> can wait for a clarifications by the author/maintainer, then I will share
> the implementation for your suggestions/comments and start adding tests for
> the PR.
>
> Thank you all and regards,
> Carlo
>
>
>
>> topologically valid geometries:
>>
>> /**
>>  * Asks a datastore having a vector pyramid (pre-generalized
>> geometries) to return the geometry
>>  * version whose points have been generalized less than the specified
>> distance (further
>>  * generalization might be performed by the client in memory).
>>  *
>>  * The geometries returned are supposed to be topologically valid.
>>  */
>> public static final Key GEOMETRY_DISTANCE = new Key(Double.class);
>>
>> Well, you know where to look and have familiarity with the source code...
>> PRs welcomed :-D
>>
>> Cheers
>> Andrea
>>
>> On Thu, May 14, 2020 at 6:45 PM carlo cancellieri <
>> geo.ccancelli...@gmail.com> wrote:
>>
>>> Dear list,
>>>  we're trying to configure a pregeneralized datastore to speedup the
>>> vector tyles cache generation with no luck.
>>>
>>> Actually asking in layerpreview for a simple application/openlayer
>>> everything works very well.
>>> ---
>>> 14 May 20:45:36 DEBUG [renderer.lite] - Computed scale denominator:
>>> 2.7922819993363017E8
>>> 14 May 20:45:36 DEBUG [renderer.lite] - creating rules for scale
>>> denominator - 279,228,199.934
>>> 14 May 20:45:36 

[Geoserver-users] Quick installation script for GeoServer

2020-07-20 Thread Russ Hore
Whilst investigating performance improvements to my GeoServer installation I 
have been installing it quite a few times. To make things faster, I developed a 
script to automate most of the basic stuff I needed from a clean install of 
Ubuntu 20
Just in case it is of any use to others I post it here.
It might not be the tidies scripting and I run it as root (I know thats not 
ideal and feel free to change it, but it is a local test server)

I always create a folder /data/ and usually run Apache as the front end to 
terminate SSL and provide authentication.

Russ

#!/bin/bash
#
#build_geoserver - Automates most of the tasks of installing Geoserver and 
PostgreSQL
#
#Copyright Russ Hore, 2010, All Rights Reserved
#
#This script is free for use: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#
#
# Do an update and clean up before continuing
apt-get update --assume-yes
apt-get upgrade --assume-yes
apt-get dist-upgrade --assume-yes
apt autoremove --assume-yes


#
# Install Tomcat 9
apt-get install tomcat9 --assume-yes
apt-get install tomcat9-admin --assume-yes
apt-get install tomcat9-common --assume-yes
apt-get install tomcat9-user --assume-yes

#
# Install GDAL utilities
apt-get install gdal-bin --assume-yes
apt-get install gdal-data --assume-yes
apt-get install python-gdal --assume-yes

#
# Install Apache2
apt-get install apache2 --assume-yes

#
# Install PHP
apt-get install php7.4 --assume-yes
apt-get install php7.4-common --assume-yes
apt-get install php7.4-curl --assume-yes
apt-get install php7.4-gd --assume-yes
apt-get install php7.4-json --assume-yes
apt-get install php7.4-pgsql --assume-yes
apt-get install php7.4-xml --assume-yes

#
# Install CertBot to use LetsEncrypt certificates for SSL
apt-get install certbot --assume-yes

#
# Unzip is always useful
apt-get install unzip --assume-yes

#
# Install Geoserver
# NB Need to check for the latest version
#
## Now install Geoserver 2.17.1
#
# 1) Get the WAR file
wget 
"http://sourceforge.net/projects/geoserver/files/GeoServer/2.17.1/geoserver-2.17.1-war.zip;
# 2) Create a directory to hold the zip file
mkdir GS2.17.1
# 3) Cop yhte zip file to the directory
mv geoserver-2.17.1-war.zip GS2.17.1
# 4) Change into the directory and unzxip the file
cd GS2.17.1
unzip geoserver-2.17.1-war.zip
# 5) Stop tomcat whilst we copy the war file in (I know you don't need to but 
why not?)
service tomcat9 stop
# 6) Copy the war file to the Tomcat web apps directory
cp geoserver.war /var/lib/tomcat9/webapps/
# 7) Re-start Tomcat
service tomcat9 start

#
## Now configure Geoserver 2.17.1
#
# I always create a data folder at / to hold all the GeoServer stuff
mkdir /data/
chown tomcat:tomcat /data/

#
## Need to make /data/ readable by Tomcat9
#
# Edit the following file and add  the follwoing line unere the # Secunrity 
section
# ReadWritePaths=/data/
#
#
vi /lib/systemd/system/tomcat9.service 

#
## Make Geoserver point to /data/
#
# Uncomment DATA_DIR and point it to /data/
#
vi /var/lib/tomcat9/webapps/geoserver/WEB-INF/web.xml

# Re-start Tomcat
systemctl restart tomcat9
systemctl daemon-reload

#
#
## Install PostgreSQL with PostGIS
# CHECK the latest version fo PostgreSQLL and PostGIS
#
apt-get install postgresql-12-pgrouting --assume-yes
apt-get install postgresql-12-postgis-3 --assume-yes
apt-get install postgresql-12-postgis-3-scripts --assume-yes

# Install the OpenStreetMap to PostgreSQL utilities
apt-get install osm2pgsql --assume-yes

#