kartoza / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
http://geonode.org/
GNU General Public License v3.0
8 stars 17 forks source link

Fix thumbnail to default aspect ratios #522

Closed lucernae closed 5 years ago

lucernae commented 5 years ago

fix for #497 #517

Now, after we got meters unit, we can properly calculate new extent based on GeoNode default aspect ratios: [200, 150] pixels. We used 400, 300 for clarity, because we displayed the basemap. It helps for the label resolutions to become readable.

There are some weird bug though.

Previously, when we request to WMS in QGIS Server, we provided bbox in the format: [ymin,xmin,ymax,xmax] in EPSG:4326. However, in EPSG:3857, I had to use [xmin,ymin,xmax,ymax] for it to display the correct extent (took me a while to realize). I don't know if this is expected from QGIS Server, cc @gubuntu ?

lucernae commented 5 years ago

Waiting to fix the thumbnail unittests.

lucernae commented 5 years ago

Preview:

thumb-ash-fall

codecov[bot] commented 5 years ago

Codecov Report

Merging #522 into 2.8.x-qgis_server will increase coverage by 0.04%. The diff coverage is 93.47%.

Impacted file tree graph

@@                  Coverage Diff                  @@
##           2.8.x-qgis_server     #522      +/-   ##
=====================================================
+ Coverage              41.39%   41.44%   +0.04%     
=====================================================
  Files                    412      412              
  Lines                  29597    29625      +28     
  Branches                3746     3748       +2     
=====================================================
+ Hits                   12252    12278      +26     
+ Misses                 16590    16587       -3     
- Partials                 755      760       +5
Impacted Files Coverage Δ
geonode/qgis_server/tests/test_views.py 99.28% <87.5%> (-0.47%) :arrow_down:
geonode/qgis_server/helpers.py 69.15% <96.66%> (+0.82%) :arrow_up:
geonode/base/models.py 74.92% <0%> (-0.29%) :arrow_down:
geonode/qgis_server/tasks/update.py 77.1% <0%> (+3.61%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 66f33d8...5b5f8c7. Read the comment docs.

gubuntu commented 5 years ago

LGTM

@lucernae the swapped coordinate order for geographic CRS is a 'feature' of WMS 1.3.0

lucernae commented 5 years ago

@lucernae the swapped coordinate order for geographic CRS is a 'feature' of WMS 1.3.0

Oh no, this is true... https://gis.stackexchange.com/questions/23347/getmap-wms-1-1-0-vs-1-3-0

Now we used EPSG:3857 directly in the request, so it should be safe now.