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

Add dimensions in WFS GetFeature requests #2496

Merged

Conversation

arnaud-morvan
Copy link
Member

No description provided.

@arnaud-morvan
Copy link
Member Author

@fredj : Could you take a look here ?

Note that I do not understand why to not dispatch all global dimensions to each node. In my project I will have to add FLOOR dimension on approximately all layers.

@arnaud-morvan
Copy link
Member Author

Note that when I put one dimension on one layer (gmf admin), it is applied on layer parent group (ol.Layer object), can't-we get this applied on all layer tree nodes, regardless of the dimensions set in admin interface ?
For me it does not make sense to put different dimensions on layers, the dimensions values should be only set on the main controller.
For WMS layers, it is passed as a GET parameter, server will use or ignore it.
For WMTS layers, if is is present in url template, server whould use it, if not it will be ignored.

@@ -290,6 +290,7 @@ gmf.LayertreeController.prototype.updateLayerDimensions_ = function(layer, node)
var value = this.dimensions[key];
if (value !== undefined) {
dimensions[key] = value;
node.dimensions[key] = value;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if looks strange for me, for me it should be like this:

       var value = this.dimensions[key];
       dimensions[key] = value !== undefined ? value : node.dimensions[key];

@fredj what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node.dimensions are the default dimension values for a node; it should not be modified

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this I cannot apply current dimensions on WFS GetFeature requests

value = dimensions[key];
}
if (value !== undefined) {
url = goog.uri.utils.setParam(url, key, value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use goog!!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, can you explain, why do not use goog, what should I use instead ? Note that this comes from doGetFeatureInfoRequests_ existing code.
I see goog everywhere in this file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try to don't use goog anymore to be able to build the project without google library.
In the master branch almost all the goog (Except goog.[asserts, requires, provide, module]) will be removes, in this case there a method in openlayers that can be used.

if (value === undefined) {
// get the value from the layer default value
value = dimensions[key];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks duplicate code from layer tree...

@arnaud-morvan
Copy link
Member Author

I've changed my desktop.js file with this :
this.dimensions['FLOOR'] = '+0';
instead of :
this.dimensions = {'FLOOR': '+0'};
so I get the same global dimensions object in main controller and query service (no need to overwrite the node dimensions anymore).

I've passed the parameters directly to $http, so I do not use goog anymore.

What do you think about this updated version, is this good for merging.

@arnaud-morvan
Copy link
Member Author

Note that I still have an issue on the server side, where I find really boring to add same dimensions on all layers.

Copy link
Member

@sbrunner sbrunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me @fredj can you also have a look?

@sbrunner
Copy link
Member

For the server part you can write a script like this one: https://github.com/camptocamp/epfl_authgeoportail/blob/master/epfl_authgeoportail/scripts/manage_layers.py

@arnaud-morvan
Copy link
Member Author

@fredj : Are you OK for merging this PR ?

@arnaud-morvan arnaud-morvan merged commit c821c33 into camptocamp:2.1 Apr 27, 2017
@arnaud-morvan arnaud-morvan deleted the wfs_getfeatures_dimensions branch April 27, 2017 14:56
@sbrunner sbrunner added this to the Older milestone Aug 23, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants