From 1709052b26cc5cc42a19b6041274b1893cd21fca Mon Sep 17 00:00:00 2001 From: Paul Dziemiela Date: Fri, 24 Jan 2025 11:32:02 -0500 Subject: [PATCH] getFeatureInfo under WMS 1.3.0 just no worky --- demo/nginx/html/upstreamdownstream.html | 69 ++++++++++--------- .../cipsrv/owld_wqp_src_a/featuretype.xml | 28 ++++++-- .../cipsrv/cipsrv/owld_wqp_src_a/layer.xml | 3 +- .../cipsrv/owld_wqp_src_l/featuretype.xml | 20 ++++++ .../cipsrv/cipsrv/owld_wqp_src_l/layer.xml | 3 +- .../cipsrv/cipsrv/owld_wqp_src_p/layer.xml | 4 +- 6 files changed, 87 insertions(+), 40 deletions(-) diff --git a/demo/nginx/html/upstreamdownstream.html b/demo/nginx/html/upstreamdownstream.html index e719322..b97dd1f 100644 --- a/demo/nginx/html/upstreamdownstream.html +++ b/demo/nginx/html/upstreamdownstream.html @@ -278,45 +278,50 @@

CIP Service Upstream/Downstream } } - - $.ajax({ - url: url, - success: function (data, status, xhr) { - var err = typeof data === 'string' ? null : data; - showResults(err, evt.latlng, data); - }, - error: function (xhr, status, error) { - showResults(error); - } - }); - - + }, getFeatureInfoUrl: function (latlng) { - var point = this._map.latLngToContainerPoint(latlng, this._map.getZoom()); - var size = this._map.getSize(); + var point = map.latLngToContainerPoint(latlng,map.getZoom()); + var size = map.getSize(); + var bounds = map.getBounds(); + var sw = bounds.getSouthWest(); + var ne = bounds.getNorthEast(); + var params = { - request: 'GetFeatureInfo', - service: 'WMS', - srs: 'EPSG:4326', - styles: this.wmsParams.styles, - transparent: this.wmsParams.transparent, - version: this.wmsParams.version, - format: this.wmsParams.format, - bbox: this._map.getBounds().toBBoxString(), - height: size.y, - width: size.x, - layers: this.wmsParams.layers, - query_layers: this.wmsParams.layers, - info_format: 'text/html' + request: 'GetFeatureInfo' + ,service: 'WMS' + ,srs: 'EPSG:4326' + ,styles: this.wmsParams.styles + ,version: "1.1.0" + ,bbox: map.getBounds().toBBoxString() + ,height: size.y + ,width: size.x + ,layers: this.wmsParams.layers + ,query_layers: this.wmsParams.layers + ,info_format: 'application/json' + ,x: point.x + ,y: point.y }; - params[params.version === '1.3.0' ? 'i' : 'x'] = point.x; - params[params.version === '1.3.0' ? 'j' : 'y'] = point.y; + //params[params.version === '1.3.0' ? 'i' : 'x'] = point.x; + //params[params.version === '1.3.0' ? 'j' : 'y'] = point.y; - var url = this._url + L.Util.getParamString(params, this._url, true); - + var url = this._url + L.Util.getParamString(params,this._url,true); + + // This replacement is unideal but such is geoserver + if ( url.includes("cipsrv%3Aowld_wqp_src") ) { + url = url.replace(/cipsrv\%3Aowld_wqp_src/g,"cipsrv\%3Aowld_wqp_src_p"); + } + + if ( url.includes("cipsrv%3Anhdplus_h_flowlines") ) { + url = url.replace(/cipsrv\%3Anhdplus_h_flowlines/g,"cipsrv\%3Anhdplus_h_networknhdflowline"); + } + + if ( url.includes("cipsrv%3Anhdplus_m_flowlines") ) { + url = url.replace(/cipsrv\%3Anhdplus_m_flowlines/g,"cipsrv\%3Anhdplus_m_networknhdflowline"); + } + console.log(url); return url; }, diff --git a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_a/featuretype.xml b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_a/featuretype.xml index 72d5fba..c6ec714 100644 --- a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_a/featuretype.xml +++ b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_a/featuretype.xml @@ -10,16 +10,36 @@ features owld_wqp_src_a + GEOGCS["NAD83", + DATUM["North American Datum 1983", + SPHEROID["GRS 1980", 6378137.0, 298.257222101, AUTHORITY["EPSG","7019"]], + TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + AUTHORITY["EPSG","6269"]], + PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], + UNIT["degree", 0.017453292519943295], + AXIS["Geodetic longitude", EAST], + AXIS["Geodetic latitude", NORTH], + AUTHORITY["EPSG","4269"]] EPSG:4269 + + -172.54 + 23.81 + -47.74 + 86.46 + EPSG:4269 + - -180.00000000000003 - 180.00000000000003 - -85.06 - 85.06 + -172.54 + 23.81 + -47.74 + 86.46 EPSG:4326 FORCE_DECLARED true + + false + DataStoreInfoImpl-42032311:192d83c2670:-7ff5 diff --git a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_a/layer.xml b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_a/layer.xml index 4238958..441f38a 100644 --- a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_a/layer.xml +++ b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_a/layer.xml @@ -3,7 +3,7 @@ LayerInfoImpl--7ce8039c:19445fc0d4c:-59ee VECTOR - StyleInfoImpl--7ce8039c:194431f70d0:-7ffc + StyleInfoImpl--4a49e71b:1948943599e:-4c4f FeatureTypeInfoImpl--7ce8039c:19445fc0d4c:-59ef @@ -13,4 +13,5 @@ 0 2025-01-08 14:18:01.968 UTC + 2025-01-24 14:15:39.256 UTC \ No newline at end of file diff --git a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_l/featuretype.xml b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_l/featuretype.xml index babded5..6fe66d8 100644 --- a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_l/featuretype.xml +++ b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_l/featuretype.xml @@ -10,7 +10,24 @@ features owld_wqp_src_l + GEOGCS["NAD83", + DATUM["North American Datum 1983", + SPHEROID["GRS 1980", 6378137.0, 298.257222101, AUTHORITY["EPSG","7019"]], + TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + AUTHORITY["EPSG","6269"]], + PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], + UNIT["degree", 0.017453292519943295], + AXIS["Geodetic longitude", EAST], + AXIS["Geodetic latitude", NORTH], + AUTHORITY["EPSG","4269"]] EPSG:4269 + + -172.54 + 23.81 + -47.74 + 86.46 + EPSG:4269 + -172.54 23.81 @@ -20,6 +37,9 @@ FORCE_DECLARED true + + false + DataStoreInfoImpl-42032311:192d83c2670:-7ff5 diff --git a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_l/layer.xml b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_l/layer.xml index a890cf9..1ae0d98 100644 --- a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_l/layer.xml +++ b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_l/layer.xml @@ -3,7 +3,7 @@ LayerInfoImpl--7ce8039c:19445fc0d4c:-59ec VECTOR - StyleInfoImpl--7ce8039c:194431f70d0:-7ffc + StyleInfoImpl--4a49e71b:1948943599e:-4c50 FeatureTypeInfoImpl--7ce8039c:19445fc0d4c:-59ed @@ -13,4 +13,5 @@ 0 2025-01-08 14:18:22.644 UTC + 2025-01-24 14:15:23.40 UTC \ No newline at end of file diff --git a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_p/layer.xml b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_p/layer.xml index 38bf392..c23abc5 100644 --- a/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_p/layer.xml +++ b/gis/geoserver/workspaces/cipsrv/cipsrv/owld_wqp_src_p/layer.xml @@ -3,7 +3,7 @@ LayerInfoImpl--7ce8039c:19445fc0d4c:-59ea VECTOR - StyleInfoImpl--7ce8039c:194464c949d:1000 + StyleInfoImpl--4a49e71b:1948943599e:-5c75 FeatureTypeInfoImpl--7ce8039c:19445fc0d4c:-59eb @@ -13,5 +13,5 @@ 0 2025-01-08 14:18:37.575 UTC - 2025-01-08 15:13:02.49 UTC + 2025-01-24 14:15:09.568 UTC \ No newline at end of file