Issues

Select view

Select search mode

 
50 of

SQL Parametric View Creation – Layer Preview Shows No Features

Description

Description
When running the second_problem.py script, the workflow successfully creates a workspace, a datastore, but when creating the a SQL parametric view, the following happens:

  • WFS (GeoJSON): The layer shows 0 features.

  • WMS: The preview displays an empty white square

Steps to Reproduce:

  1. Start GeoServer using Docker :

    docker run --name vanila-gs -d -p 80:8080 docker.osgeo.org/geoserver:2.26.2
  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"
  3. Clone the following repo:

    git clone https://github.com/romer8/gs-cloud-example.git
  4. Run the generate_data.sh file. This will create a table on the postgis database called cities, and it will insert two records. It will use the gscloud_dev_pgconfig-postgis-1 running image:

    cd ./gs-cloud-example/ ./generate_data.sh -c postgis-vanilla-gs
  5. Get the IP Address of the PostGIS Container:
    Use the command below (adjust container name as necessary):

    docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' gscloud_dev_pgconfig-postgis-1
  6. Run the second_problem.py Script:
    Replace <your_ip> with the IP address obtained from step 1:

    python3 second_problem.py --host <your_ip>
  7. Check the GeoServer Layer Preview:

    • For the WFS service, choose GeoJSON and verify that the layer has 0 features.

    • For the WMS service, note that an empty white square is displayed.

Expected Behavior:

  • The layer preview should display the features from the SQL parametric view.

  • The WFS (GeoJSON) should list the correct number of features, and the WMS service should render the layer correctly.

Environment

None

Details

Assignee

Reporter

Triage

Affects versions

Components

Priority

Created 3 days ago
Updated 3 days ago

Activity

Show:
Elkin G Romero Bustamante
created the Issue3 days ago