Skip to content

Height and Width values should not be constant in GetMap request (OGC webservices info on views' metadata) #1025

@antobenve

Description

@antobenve

Related to #887

The URL of the WMS GetMap request displayed in the OGC webservices module of the metadata of vector views has constant height and width = 512. The width and height of the resulting images are generally not proportioned which makes the image distorted.
A solid way to determine the value of height and width should be based on the ratio between the extent of latitude and of longitude:

ΔY = ymax- ymin
ΔX = xmax - xmin 
Ratio = ΔX / ΔY
Height = 512
Width = 512 * Ratio

Example view Exclusive Economic Zone (EEZ) (200 Nautical Mile Limit):

ymin:-85.5625
xmin: -180
ymax: 86.99401092529297
xmax: 180

ΔY = 86.99401092529297 - -85.5625 = 172.55651092529297
ΔX = 180 - -180 = 360
Ratio = 360 / 172.55651092529297 = 2.0862
Height = 512 
Width = 512 * 2.0862 = 1’068

Old GetMap request (WIDTH=512&HEIGHT=512)

New GetMap request (WIDTH=1068&HEIGHT=512)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    In prod 🚀

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions