- Python3: to ensure you can execute problems scripts.
Some steps to reproduce the errors with GeoServer Cloud.
-
Clone the GeoServer Cloud repository:
git clone --recurse-submodules https://github.com/geoserver/geoserver-cloud.git git checkout v2.26.2.0
-
run the
pgconfigfile:cd ./geoserver-cloud/compose/ ./pgconfig up -d -
Now clone this repo:
git clone https://github.com/romer8/gs-cloud-example.git
-
Run the
generate_data.shfile. This will create a table on thepostgisdatabase calledcities, and it will insert two records. It will use thegscloud_dev_pgconfig-postgis-1running image:cd ./gs-cloud-example/ ./generate_data.sh -
Get the IP of the postgis container. We will be using the postgis container that was spin by the
pgconfig.shscript :docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' gscloud_dev_pgconfig-postgis-1 -
Run the
first_problem.pypython file. This will create a workspace and a datastore:python3 first_problem.py --host <your_ip> # Replace with your desired IP
-
Access the webui (http://localhost:9090/geoserver/cloud/web/ user:admin, pass:geoserver). Then create a layer based on the created datastore (test_view_datastore1), based on the table cities. You need to create the
SQLview manually with the following:-
sql statement:
SELECT id, name, geom FROM cities WHERE id = %id%
-
Click on Guess parameters from SQL and complete the SQL view parameters as follows:
- name: id
- Default value : 1
- Validation regular expression : ^[0-9]+$
-
Click on Guess geometry type and srid for the Attributes, and click on Refresh (you will see the list of attributes listed)
-
-
Once you save the layer, go to layer preview. You should be able to see the error about the special character: "%"
-
if you come back to the layer and edit the
sql viewand save it, the error will return after you do a new request.
-
Get the IP of the postgis container. We will be using the postgis container that was spin by the
pgconfigscript :docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' gscloud_dev_pgconfig-postgis-1 -
Run the
second_problem.pypython file. This will create a workspace,a datastore, and asqlview:python3 second_problem.py --host <your_ip> # Replace with your desired IP
-
Once saved, go to layer preview. Choose
GeoJSONfor theWFSservice, You should be able to see that the layer has 0 feature. If you try aWMSservice it will show an empty white square.
-
Clone the GeoServer Cloud repository:
git clone --recurse-submodules https://github.com/geoserver/geoserver-cloud.git git checkout v2.26.2.0
-
run the
datadirfile:cd ./geoserver-cloud/compose/ ./datadir up -d -
Now clone this repo:
git clone https://github.com/romer8/gs-cloud-example.git
-
Run the
generate_data.shfile. This will create a table on thepostgisdatabase calledcities, and it will insert two records:cd ./gs-cloud-example/ ./generate_data.sh -c gscloud_dev_datadir-postgis-1 -
Get the IP of the postgis container. We will be using the postgis container that was spin by the
datadir.shscript :docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' gscloud_dev_datadir-postgis-1 -
Run the
first_problem.pypython file. This will create a workspace and a datastore:python3 first_problem.py --host <your_ip> # Replace with your desired IP
-
Access the webui (http://localhost:9090/geoserver/cloud/web/ user:admin, pass:geoserver). Then create a layer based on the created datastore (test_view_datastore1), based on the table cities. You need to create the
SQLview manually with the following:-
sql statement:
SELECT id, name, geom FROM cities WHERE id = %id%
-
Click on Guess parameters from SQL and complete the SQL view parameters as follows:
- name: id
- Default value : 1
- Validation regular expression : ^[0-9]+$
-
Click on Guess geometry type and srid for the Attributes, and click on Refresh (you will see the list of attributes listed)
-
-
If you are not able to see the layer on layer preview, go to the
restservice and login, then come back to the layer preview and you should be able to see it.
-
Get the IP of the postgis container:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' gscloud_dev_datadir-postgis-1 -
Run the
second_problem.pypython file. This will create a workspace,a datastore, and asqlview:python3 second_problem.py --host <your_ip> # Replace with your desired IP
-
Once saved, go to layer preview. Choose
GeoJSONfor theWFSservice, You should be able to see that the layer has 0 feature. If you try aWMSservice it will show an empty white square, or it will give an error, but once you compute the bounds, then you can go back to layer preview and chooseWMSservice, and it will show an empty white square
Some steps to reproduce the errors with Vanilla GeoServer.
-
Start GeoServer using Docker :
docker run --name vanila-gs -d -p 80:8080 docker.osgeo.org/geoserver:2.26.2
-
Start a Postgis container"
docker run --name postgis-vanilla-gs -d -p 5435:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgis -e POSTGRES_DB=postgis -e POSTGRES_PASSWORD=postgis -e POSTGIS_GDAL_ENABLED_DRIVERS=ENABLE_ALL imresamu/postgis:15-3.4 GEOSERVER_URL = "http://localhost:9090/geoserver/cloud" -
Now clone this repo:
git clone https://github.com/romer8/gs-cloud-example.git
-
Run the
generate_data.shfile. This will create a table on thepostgisdatabase calledcities, and it will insert two records. It will use thegscloud_dev_pgconfig-postgis-1running image:cd ./gs-cloud-example/ ./generate_data.sh -c postgis-vanilla-gs -
Get the IP of the postgis container:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' postgis-vanilla-gs -
Run the
first_problem.pypython file. This will create a workspace and a datastore:python3 first_problem.py --geoserver-url "http://localhost/geoserver" --host <your_ip> # Replace with your desired IP
-
Access the webui (http://localhost/geoserver user:admin, pass:geoserver). Then create a layer based on the created datastore (test_view_datastore1), based on the table cities. You need to create the
SQLview manually with the following:-
sql statement:
SELECT id, name, geom FROM cities WHERE id = %id%
-
Click on Guess parameters from SQL and complete the SQL view parameters as follows:
- name: id
- Default value : 1
- Validation regular expression : ^[0-9]+$
-
Click on Guess geometry type and srid for the Attributes, and click on Refresh (you will see the list of attributes listed)
-
-
Click Compute from data and Compute from native bounds for the Bounding Boxes.
-
Once you save the layer, go to layer preview. You should be able to see the layer succesfully.
-
Get the IP of the postgis container:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' postgis-vanilla-gs -
Run the
second_problem.pypython file. This will create a workspace,a datastore, and asqlview:python3 second_problem.py --geoserver-url "http://localhost/geoserver" --host <your_ip> # Replace with your desired IP
-
Once saved, go to layer preview. Choose
GeoJSONfor theWFSservice, You should be able to see that the layer has 0 feature. If you try aWMSservice it will show an empty white square, or it will give an error, but once you compute the bounds, then you can go back to layer preview and chooseWMSservice, and it will show an empty white square