Width and height Pixel coordinates versus CRS coordinates

Copyright © 2012 Open Geospatial Consortium. 25

6.6.1 Width and height

As previously discussed, having a bounding box in CRS coordinates, and a width and height of the window in pixel coordinates is useful to know the relation between both coordinate systems and for the correct overlap of resources in both systems. We have developed an XSL document to transform an OWS context document into an HTML map representation. In this language we have calculated the transformation between both coordinate systems. xsl:variable name=mapwidth select=atom:feedowc:width xsl:variable name=mapheight select=atom:feedowc:height xsl:variable name=inv_pixelsize_x select=mapwidth div numbersubstring- beforeatom:feedgeorss:wheregml:Envelopegml:upperCorner, - numbersubstring-beforeatom:feedgeorss:wheregml:Envelopegml:lowerCorner, xsl:variable name=inv_pixelsize_y select=mapheight div numbersubstring- afteratom:feedgeorss:wheregml:Envelopegml:lowerCorner, - numbersubstring-afteratom:feedgeorss:wheregml:Envelopegml:upperCorner, xsl:variable name=offset_pixel_x select=-inv_pixelsize_x numbersubstring-beforeatom:feedgeorss:wheregml:Envelopegml:lowerCorner, xsl:variable name=offset_pixel_y select=-inv_pixelsize_y numbersubstring-afteratom:feedgeorss:wheregml:Envelopegml:upperCorner, -- How to do the conversion from CSR coordinates to pixel coordinates xsl:value-of select=inv_pixelsize_xX_in_CSR_coords+offset_pixel_x xsl:value-of select=inv_pixelsize_yY_in_CSR_coords+offset_pixel_y -- One of the main reasons for objects having width and height in the context document is that current visualization devices come with many sizes and screen proportions e.g. big computer screens, small smartphones and medium size tablets. The OWS Context standard does not want to give the impression that an OWS Context document is tied to a particular pixel size. In fact, when a client interprets the context document, it is free to adapt the full service URLs to the ones needed to fill the screen in a way that tries to keep either the bounding box or the scale. When the context document points to a WMTS service, it is better to keep the original scale of the map because trying to adapt to the bounding box can easily end in a scale not available in the server side. 26 Copyright © 2012 Open Geospatial Consortium.

6.6.2 scaleDenominator