Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GeoServer Tutorial #996

Open
sdc50 opened this issue Nov 16, 2023 · 3 comments
Open

Update GeoServer Tutorial #996

sdc50 opened this issue Nov 16, 2023 · 3 comments

Comments

@sdc50
Copy link
Member

sdc50 commented Nov 16, 2023

The GeoServer tutorial has some hard coded paths to GeoServer that make it hard to follow if you are using a different Geoserver configuration than that prescribed by the tutorial. It would be easy to make it more generic and just get the paths from the geoserver_engine.

@sdc50
Copy link
Member Author

sdc50 commented Nov 16, 2023

in the map controller, rather than hard coding the wms url:

geoserver_layer = MVLayer(
            source='ImageWMS',
            options={
                'url': geoserver_engine.get_wms_endpoint(),
                'params': {'LAYERS': selected_layer},
                'serverType': 'geoserver'
            },
            legend_title=legend_title,
            legend_extent=[-114, 36.5, -109, 42.5],
            legend_classes=[
                MVLegendClass('polygon', 'County', fill='#999999'),
            ]
        )

@sdc50
Copy link
Member Author

sdc50 commented Nov 16, 2023

In the home controller, rather than having a constant GEOSERVER_URI:

        if WORKSPACE not in workspaces:
            from urllib.parse import urlparse
            parsed = urlparse(geoserver_engine.public_endpoint)
            uri = f'{parsed.scheme}://{parsed.netloc}/{WORKSPACE}'
            geoserver_engine.create_workspace(workspace_id=WORKSPACE, uri=uri)

I would prefer for this to be:

        if WORKSPACE not in workspaces:
            uri = f'{geoserver_engine.base_url}/{WORKSPACE}'
            geoserver_engine.create_workspace(workspace_id=WORKSPACE, uri=uri)

But we'd first have to add a base_url attribute to the geoserver engine.

@swainn swainn added the docs label Nov 20, 2023
@swainn swainn added this to the Version 4.3 milestone Nov 20, 2023
@swainn
Copy link
Member

swainn commented Nov 20, 2023

In the home controller, rather than having a constant GEOSERVER_URI:

        if WORKSPACE not in workspaces:
            from urllib.parse import urlparse
            parsed = urlparse(geoserver_engine.public_endpoint)
            uri = f'{parsed.scheme}://{parsed.netloc}/{WORKSPACE}'
            geoserver_engine.create_workspace(workspace_id=WORKSPACE, uri=uri)

I would prefer for this to be:

        if WORKSPACE not in workspaces:
            uri = f'{geoserver_engine.base_url}/{WORKSPACE}'
            geoserver_engine.create_workspace(workspace_id=WORKSPACE, uri=uri)

But we'd first have to add a base_url attribute to the geoserver engine.

The only concern I have with this approach is that it implies that the URI needs to match the engine URL, which it does not. It just has to be a unique ID in URL form. This isn't a bad approach though and the nuance could be explained in a note box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants