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

Deactivate the "area cut service" for shop layers "aerial images" #3100

Open
pauloamado opened this issue Feb 6, 2019 · 8 comments
Open

Comments

@pauloamado
Copy link
Contributor

When selecting an image whose entire footprint is outside Switzerland, the order button is disabled in the tooltip. It concerns the following shop layers :
ch.swisstopo.lubis-luftbilder_farbe
ch.swisstopo.lubis-luftbilder_infrarot
ch.swisstopo.lubis-luftbilder_schwarzweiss

Try it : https://s.geo.admin.ch/7feefcba86

@procrastinatio
Copy link
Contributor

procrastinatio commented Mar 5, 2019

@ltkum
Looks like the shop service is doing a request like (Kibana): https://api3.geo.admin.ch/rest/services/luftbilder/MapServer/ch.swisstopo.lubis-luftbilder_farbe/19990910013128

and then decide it is outside Switzerland.

@ltkum
Copy link
Contributor

ltkum commented Mar 5, 2019

Hello @pauloamado (and thanks @procrastinatio )
After trying it, I saw that trying to obtain the price from a tile outside of switzerland returned a 400 error from the shop price-service.

https://shop.swisstopo.admin.ch/shop-server/resources/products/price?layer=ch.swisstopo.lubis-luftbilder_farbe&featureid=19990880013130 (way out of the swiss borders)

gives us

HTTP/1.1 400 Bad Request Access-Control-Allow-Headers: x-requested-with, Content-Type, origin, authorization, accept, client-security-token Access-Control-Allow-Methods: POST, GET, OPTIONS Access-Control-Allow-Origin: * Age: 0 Cache-Control: no-cache, no-store, must-revalidate Content-Length: 0 Date: Tue, 05 Mar 2019 17:00:53 GMT Expires: 0 Pragma: no-cache Server: WildFly/11 Vary: Accept-Encoding,Origin Via: 1.1 varnish-v4 X-Cache: MISS X-Powered-By: Undertow/1 X-Varnish: 311300322 Connection: keep-alive
with no answer.

while https://shop.swisstopo.admin.ch/shop-server/resources/products/price?layer=ch.swisstopo.lubis-luftbilder_farbe&featureid=20057111803247 (overlapping the swiss boundaries) give us

{"productPrice":9155}
as a payload.

How does the shop price service works exactly ? How does it "decides" on a price ?

@procrastinatio
Copy link
Contributor

@ltkum As far as I know, this how it is done

  • toolitp is doing and identify request to get a feature id
  • shop-service receive a product id (feature id)
  • This service make a request to chsidi (cut service or else), and get an geometry or a surface back
  • The price is calculated on the base of this surface (every single product has a different price and price progression)

@pauloamado
Copy link
Contributor Author

Exactly, but in the case of aerial images, the price is fixed to CHF 91.55 regardless the footprint surface.

@procrastinatio
Copy link
Contributor

Oui, mais en l'ocurrence, c'est le shop qui décide que les images en questions ne doivent pas être traitées sur la base du résultat de la requête à l'API sur la feature 20057111803247 et qui retourne une erreur.

@pauloamado
Copy link
Contributor Author

Indeed, the Shop must retrieve the attribute "Ort" which is null when the footprint is completely outside Switzerland. I will confirm this with Michael, if this is the case we can close this ticket and change the Shop code. Thank you both.

@procrastinatio
Copy link
Contributor

attribute "ort"

@procrastinatio
Copy link
Contributor

@pauloamado Do we do anything before we ditch the shop?

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

4 participants