Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#16824 closed defect (othersoftware)

400 Bad Request Error with a WMS provider

Reported by: naoliv Owned by: team
Priority: normal Milestone:
Component: Core imagery Version:
Keywords: wms Cc: wiktorn

Description

Add a new WMS layer in JOSM with http://bdgex.eb.mil.br/mapcache?service=WMS&request=GetCapabilities as the URL, get the layers, choose any (the first capitais (Capitais dos estados brasileiros.), for example) and then add this new layer in JOSM.

It only errors with HTTP 400 (Bad Request)

With --trace it's possible to see that the problem is related with an unsuitable wms request: no <grid> with suitable srs found for layer capitais

2018-10-08 17:41:54.646 DETALHADO: JCS - Caching empty object http://bdgex.eb.mil.br/mapcache?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=capitais&STYLES=&SRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=-5635549.8403892,-2348144.5468108,-5557278.3267892,-2269873.0332108
2018-10-08 17:41:54.646 DETALHADO: tileLoadingFinished() tile: Tile 10/184/285@http://bdgex.eb.mil.br/mapcache?: capitais (Capitais dos estados brasileiros.) [loaded] [ERROR] success: false
2018-10-08 17:41:54.700 INFORMAÇÕES: GET http://bdgex.eb.mil.br/mapcache?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=capitais&STYLES=&SRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=-5635549.8403892,-2348144.5468108,-5479006.8131892,-2191601.5196108 -> 400 (361 B)
2018-10-08 17:41:54.700 DETALHADO: RESPONSE: {null=[HTTP/1.1 400 Bad Request], Server=[Apache/2.4.10 (Debian)], Connection=[close], Vary=[Host], Content-Length=[361], Date=[Mon, 08 Oct 2018 20:41:54 GMT], Content-Type=[application/vnd.ogc.se_xml]}
2018-10-08 17:41:54.701 DETALHADO: java.io.IOException: Server returned HTTP response code: 400 for URL: http://bdgex.eb.mil.br/mapcache?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=capitais&STYLES=&SRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=-5635549.8403892,-2348144.5468108,-5479006.8131892,-2191601.5196108. Causa: java.io.IOException: Server returned HTTP response code: 400 for URL: http://bdgex.eb.mil.br/mapcache?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=capitais&STYLES=&SRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=-5635549.8403892,-2348144.5468108,-5479006.8131892,-2191601.5196108
2018-10-08 17:41:54.701 DETALHADO: Baixando dados...
2018-10-08 17:41:54.702 DETALHADO: Response body: 
2018-10-08 17:41:54.702 DETALHADO: <?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
<ServiceException>
<![CDATA[
received unsuitable wms request: no <grid> with suitable srs found for layer capitais
]]>
</ServiceException>
</ServiceExceptionReport>

Adding the same layer in QGIS it's possible to properly view the data, without doing anything.

JOSM:

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-10-08 01:00:47 +0200 (Mon, 08 Oct 2018)
Revision:14306
Build-Date:2018-10-08 01:32:48
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (14306 pt_BR) Linux Debian GNU/Linux testing (buster)
Memory Usage: 759 MB / 6144 MB (215 MB allocated, but free)
Java version: 10.0.2+13-Debian-1, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1600x900, :0.1 1280x1024
Maximum Screen Size: 1600x1024
Java package: openjdk-10-jre:amd64-10.0.2+13-1
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-21
VM arguments: [-Dawt.useSystemAAFontSettings=gasp]

Attachments (1)

16824.png (5.4 KB ) - added by Don-vip 6 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by Don-vip, 6 years ago

It seems we request EPSG:3857 instead of EPSG:4326.

I don't know if we support cascaded layers:

<Layer>
    <Title>BDGEx</Title>
    <SRS>EPSG:3857</SRS>
    <SRS>EPSG:900913</SRS>
    <SRS>EPSG:4326</SRS>
    <SRS>EPSG:4326</SRS>
    <Layer cascaded="1" queryable="0">
        <Name>capitais</Name>
        <Title>capitais</Title>
        <Abstract>Capitais dos estados brasileiros.</Abstract>
        <LatLonBoundingBox minx="-125.000000" miny="-55.000000" maxx="0.000000" maxy="15.000000"/>
        <BoundingBox SRS="EPSG:4326" minx="-125.000000" miny="-55.000000" maxx="0.000000" maxy="15.000000"/>
        <SRS>EPSG:4326</SRS>
    </Layer>

comment:2 by Don-vip, 6 years ago

Keywords: wms added

comment:3 by Don-vip, 6 years ago

Milestone: 18.10

comment:4 by Don-vip, 6 years ago

In 14311/josm:

see #16824 - better display of WMS errors

by Don-vip, 6 years ago

Attachment: 16824.png added

in reply to:  description comment:5 by Don-vip, 6 years ago

Replying to naoliv:

With --trace it's possible to see that the problem is related with...

Now you don't need that anymore :)


comment:6 by Don-vip, 6 years ago

In LayerDetails.java we assume CRS/SRS defined in parent layer are applicable to child layers:

    /**
     * @return projections that are supported by this layer
     */
    public Collection<String> getCrs() {
        Collection<String> ret = new ArrayList<>();
        if (parentLayer != null) {
            ret.addAll(parentLayer.getCrs());
        }
        ret.addAll(crs);
        return ret;
    }

WMS spec, chapter 7.1.4.7 (WMS 1.1.1) / 7.2.4.8 (WMS 1.3.0) (inheritance of layer properties) says about CRS/SRS properties: child inherits any value(s) supplied by parent and adds any values of its own.

So JOSM follows the WMS specification but the server does not! I wonder how QGIS handles this.

comment:7 by Don-vip, 6 years ago

Cc: wiktorn added

I see no immediate and elegant solution. Wiktor, how would you do? :)

comment:8 by wiktorn, 6 years ago

QGis if I remember correctly allows user to set which projection imagery layer should use.

For this case I see following solutions:

  • user may switch to EPSG:4326
  • create WMS entry in JOSM wiki Maps with only EPSG:4326 as supported projection

What we could develop that user while adding WMS imagery may override supported server/layer projections (probably in expert mode).

comment:9 by stoecker, 6 years ago

Resolution: othersoftware
Status: newclosed

That's already possible. Create a local maps file and add it as imagery source. Thus that would be the third possible solution.

comment:10 by Don-vip, 6 years ago

Milestone: 18.10

in reply to:  9 ; comment:11 by naoliv, 6 years ago

Replying to stoecker:

That's already possible. Create a local maps file and add it as imagery source. Thus that would be the third possible solution.

Any instructions on how to do this, please?

in reply to:  11 comment:12 by stoecker, 6 years ago

That's already possible. Create a local maps file and add it as imagery source. Thus that would be the third possible solution.

Any instructions on how to do this, please?

Create a local file in the format of Maps. For example you can download maps or any the wiki page, like that small Maps/Venezuela, and strip and modify it. You even can use the preview function of our wiki to test the entry for validity (please preview only, don't submit such tests!). Then add the resulting file as expert option imagery.layers.sites. NOTE: The file must be complete including the outer XML tags, not only the entry!

comment:13 by stoecker, 6 years ago

P.S. You can add more than one entry and even exchange such files with others. I use such a file for non-OSM compatible background images which I often need for display purposes.

comment:14 by Don-vip, 6 years ago

In 14329/josm:

see #16824 - remove unneeded null-check

comment:15 by Don-vip, 6 years ago

In 14360/josm:

fix #16890, see #16824 - NPE

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.