Giter Club home page Giter Club logo

spring-cloud-gateway-wms-bbox's Introduction

Spring Cloud Gateway with WMS BBOX Dynamic Routing

Request parameter based dynamic routing with BBOX Coordinate on WMS Protocol.

Example Description

When xmin: 20000000.0 then, Route to http://localhost:8000.

 $ curl "http://localhost:8080/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=myLayer%3AMyGrid&TILED=true&viewparams=msrDate%3A20210401%3Bmsr%3AA%3Bmnc%3A1%3BkpiValue%3Apoor_sinr%3A%3Anumeric%3Bterm%3Amm%3BuseMsrDate%3A1%3BuseMsr%3A1%3BuseMnc%3A1%3BuseKpiValue%3A1%3BuseTerm%3A1%3BgpotSize%3A150%3BpartxMin%3A1414%3BpartxMax%3A1414%3Bminx%3A14146114.833080746%3Bminy%3A4489366.42764472%3Bmaxx%3A14147815.556960093%3Bmaxy%3A4491067.151524066%3B&env=c1%3A%23ff0000%3Bv1%3A1%3B&WIDTH=256&HEIGHT=256&CRS=EPSG%3A3857&STYLES=&BBOX=20000000.0%2C4489366.42764472%2C14147815.556960093%2C4491067.151524066"
 $ python3 -m http.server
Serving HTTP on :: port 8000 (http://[::]:8000/) ...
::ffff:127.0.0.1 - - [16/Sep/2021 10:08:22] "GET /geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%252Fpng&TRANSPARENT=true&LAYERS=myLayer%253AMyGrid&TILED=true&viewparams=msrDate%253A20210401%253Bmsr%253AA%253Bmnc%253A1%253BkpiValue%253Apoor_sinr%253A%253Anumeric%253Bterm%253Amm%253BuseMsrDate%253A1%253BuseMsr%253A1%253BuseMnc%253A1%253BuseKpiValue%253A1%253BuseTerm%253A1%253BgpotSize%253A150%253BpartxMin%253A1414%253BpartxMax%253A1414%253Bminx%253A14146114.833080746%253Bminy%253A4489366.42764472%253Bmaxx%253A14147815.556960093%253Bmaxy%253A4491067.151524066%253B&env=c1%253A%2523ff0000%253Bv1%253A1%253B&WIDTH=256&HEIGHT=256&CRS=EPSG%253A3857&STYLES=&BBOX=20000000.833080746%252C4489366.42764472%252C14147815.556960093%252C4491067.151524066 HTTP/1.1"

When xmin: 10000000.0 then, Route to http://localhost:8001.

 $ curl "http://localhost:8080/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=myLayer%3AMyGrid&TILED=true&viewparams=msrDate%3A20210401%3Bmsr%3AA%3Bmnc%3A1%3BkpiValue%3Apoor_sinr%3A%3Anumeric%3Bterm%3Amm%3BuseMsrDate%3A1%3BuseMsr%3A1%3BuseMnc%3A1%3BuseKpiValue%3A1%3BuseTerm%3A1%3BgpotSize%3A150%3BpartxMin%3A1414%3BpartxMax%3A1414%3Bminx%3A14146114.833080746%3Bminy%3A4489366.42764472%3Bmaxx%3A14147815.556960093%3Bmaxy%3A4491067.151524066%3B&env=c1%3A%23ff0000%3Bv1%3A1%3B&WIDTH=256&HEIGHT=256&CRS=EPSG%3A3857&STYLES=&BBOX=10000000.833080746%2C4489366.42764472%2C14147815.556960093%2C4491067.151524066"
 $ python3 -m http.server 8001
Serving HTTP on :: port 8001 (http://[::]:8001/) ...
::ffff:127.0.0.1 - - [16/Sep/2021 10:08:50] "GET /geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%252Fpng&TRANSPARENT=true&LAYERS=myLayer%253AMyGrid&TILED=true&viewparams=msrDate%253A20210401%253Bmsr%253AA%253Bmnc%253A1%253BkpiValue%253Apoor_sinr%253A%253Anumeric%253Bterm%253Amm%253BuseMsrDate%253A1%253BuseMsr%253A1%253BuseMnc%253A1%253BuseKpiValue%253A1%253BuseTerm%253A1%253BgpotSize%253A150%253BpartxMin%253A1414%253BpartxMax%253A1414%253Bminx%253A14146114.833080746%253Bminy%253A4489366.42764472%253Bmaxx%253A14147815.556960093%253Bmaxy%253A4491067.151524066%253B&env=c1%253A%2523ff0000%253Bv1%253A1%253B&WIDTH=256&HEIGHT=256&CRS=EPSG%253A3857&STYLES=&BBOX=10000000.833080746%252C4489366.42764472%252C14147815.556960093%252C4491067.151524066 HTTP/1.1"

At Window OS. then we can use Invoke-WebRequest on powershell.

Reference

A Web Map Service (WMS) is a standard protocol developed by the Open Geospatial Consortium

spring-cloud-gateway-wms-bbox's People

Contributors

paranlee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.