gicait / geoserver-rest

Python library for management of geospatial data in GeoServer.
https://geoserver-rest.readthedocs.io
MIT License
195 stars 77 forks source link

function get_style not work well #84

Closed HostenWang closed 2 years ago

HostenWang commented 2 years ago

My english suck

Environment

OS: Win10 Home 64bit Python: 3.10 64 geoserver-rest : 2.3.4 installed by pip

behave

get_style can not return style with workspace

code

i found some confused code

https://github.com/gicait/geoserver-rest/blob/master/geo/Geoserver.py start at line number 910

    def get_style(self, style_name, workspace: Optional[str] = None): // line 910
        """
        Returns the style by style name.
        """
        try:
            url = "{}/rest/styles/{}.json".format(self.service_url, style_name)
            if workspace is not None:
                url = "{}/workspaces/{}/styles/{}.json".format( // line 917
                    self.service_url, workspace, style_name
                )

line 917 is

                url = "{}/workspaces/{}/styles/{}.json".format(

is missing /rest/ ?

iamtekson commented 2 years ago

Thank you for addressing this issue. Yes, you are right, the /rest/ is missing from URL. I solved this issue and this issue will be solved on version v3.2.5 onward.