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

Problem with " character in WMS getMap request #198

Open
rmarzocchi84 opened this issue Aug 13, 2020 · 1 comment
Open

Problem with " character in WMS getMap request #198

rmarzocchi84 opened this issue Aug 13, 2020 · 1 comment

Comments

@rmarzocchi84
Copy link

I have a Rasdaman WMS GetMap request (e.g. http://rasdaman.org/browser/systemtest/testcases_services/test_wms/queries/31-get_map_on_4d_coverage_dim_pressure_and_time_irregular_specified.test)

The time parameter need to be written with the " character

This is the request using this leaflet plugin that doesn't work

http://localhost:8081/rasdaman/ows?&service=WMS
&request=GetMap
&layers=fwi_202006
&styles=
&format=image%2Fpng
&transparent=true
&version=1.3.0
&time=2020-0630T00%3A00%3A00.000Z
&width=256
&height=256
&crs=EPSG%3A3857
&bbox=860986.6866042254,5713820.738373496,939258.203568246,5792092.255337515

This is the correct request:

http://localhost:8081/rasdaman/ows?&service=WMS
&request=GetMap
&layers=fwi_202006
&styles=
&format=image%2Fpng
&transparent=true
&version=1.3.0
&time="2020-0630T00%3A00%3A00.000Z"
&width=256
&height=256
&crs=EPSG%3A3857
&bbox=860986.6866042254,5713820.738373496,939258.203568246,5792092.255337515

It is possible to change the request adding the " character

@bielfrontera
Copy link
Contributor

Hi @rmarzocchi84,
you could create a new TimeDimension.Layer class and change how the url for a given time is built.

This should work:

L.TimeDimension.Layer.WMS.Rasdaman = L.TimeDimension.Layer.WMS.extend({

    _createLayerForTime:function(time){
        var wmsParams = this._baseLayer.options;
        var date = new Date(time);
        wmsParams.time = '"' + date.toISOString() + '"';
        return new this._baseLayer.constructor(this._baseLayer.getURL(), wmsParams);
    }

});

L.timeDimension.layer.wms.rasdaman = function(layer, options) {
    return new L.TimeDimension.Layer.WMS.Rasdaman(layer, options);
};

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

No branches or pull requests

2 participants