Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2595 closed defect (fixed)

Merkaartor fails to calculate Viewport's BBOX

Reported by: David Paleino Owned by: cbro@…
Priority: major Milestone:
Component: merkaartor Version:
Keywords: Cc: merkaartor@…, d.paleino@…


Hello, I added a WMS [1] layer to Merkaartor, and it seems to fail setting the BBOX when doing the requests. In console I have:

---8<--- ImageMapLayer::drawFull: getting: "/arcgis/services/OrtofotoATA_20072008_f33/ MapServer?/WMSServer?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap?&TRANSPARENT=TRUE& LAYERS=0&SRS=EPSG:4326&STYLES=&FORMAT=image/png&WIDTH=583&HEIGHT=652& BBOX=nan,0.000000,nan,0.000000" --->8---

Notice the extremely wrong values of BBOX= :)

Grepping the source a bit, revealed that the URL is built in ImageMapLayer::drawFull() (src/Maps/ImageMapLayer.cpp:353). This url takes its BBOX values from some computation done in Projection::getProjectedViewport() (src/Maps/Projection.cpp:105). There, adding:

qDebug() << Viewport.topLeft().lon() << "," << Viewport.topLeft().lat();

right at the beginning of the function, reveals that the Viewport is effectively taken as a 0x0 box.

getProjectedViewport() is called at src/Maps/ImageMapLayer.cpp:355 :

QRectF vp = p->theProjection.getProjectedViewport(p->Viewport, rect);

"p" is a MapViewPrivate?, as defined at src/MapView.cpp:39 . Well, I can't go further than this, my limited C++ knowledge makes me stop here :/

Hope this can be of some help!

Thanks! David

(the linenumbers above are from the Debian package, version 0.14+svnfixes~20090912-2 -- I could test with a clean source)

Change History (7)

comment:1 Changed 11 years ago by David Paleino

The WMS I'm using is:

sorry for not including it at first (however, I believe this problem is not URL-specific).

comment:2 Changed 11 years ago by David Paleino

I just verified that this happens with all default WMS layers available in Merkaartor, only Yahoo! works -- I suspect because it has a separate adapter.

comment:3 Changed 11 years ago by Chris Browet

Please try from SVN. I cannot reproduce myself.

Just to be sure, please tell me the BBOX you were actually trying to download, i.e. the viewport coordinates in the statusbar (I assume those are not null...)

comment:4 Changed 11 years ago by David Paleino

Resolution: fixed
Status: newclosed

It works with the SVN version. \o/

Just one thing I'm missing is: the tiled WMS background. Merkaartor each time downloads the whole viewport from WMS, while JOSM (for example), downloads square tiles and then aligns them. This allows you not to wait for the image to be re-downloaded each time you move the viewport around. Is there any chance to have it like JOSM's? Should I open a new ticket for this? :)

Marking this bug as fixed, since it will in the next release :)

comment:5 Changed 11 years ago by Chris Browet

Cc: merkaartor@… added

If you compiled from SVN, you should have now the choice between "Yahoo (Tiled)" and "Yahoo (WMS)" (this was back recently).

Don't you?

comment:6 Changed 11 years ago by David Paleino

I don't see them.

However, what I meant was the tiling of a generic WMS, specified by user (like it's in my case), not only Yahoo!.

Thank you, David

comment:7 Changed 11 years ago by David Paleino

Cc: d.paleino@… added
Note: See TracTickets for help on using tickets.