Although the APIs handle the Geoportal's cache access, it might be necessary to get connected to it by another mean.
This clause does not cover the rights management aspect (GeoDRM}) for accessing the Geoportal's WMS-C.
The Geoportal's cache is a pyramid of images for each covered territory whom resolutions can be found there. Each pyramid's level is made up by tiles of 256 by 256 pixels size. Each level point of origin is at (0, 0) expressed in the GEOPORTALxxx projection for large to small scales (xxx being the territory code, See API ad territories) or MILLER (for very small scales).
A WMS-C request is just a WMS request for which the bounding box parameter MUST be equal to a tile's extent within the pyramid. In addition, the request must add a TILED=true parameter.
The first step is to transform the geographical coordinates into the targetted SRS (GEOPORTALxxx for the large to small scales), MILLER (for the very small scales). One can use the cs2cs software from PROJ.4 or the Geoportal API that is built upon a port of PROJ.4, PROJ4JS. The source code of these libraries gives the needed algorithms for these projections, and, therefore, can be used with any other programming language.
The initial coordinates are, for instance : 2°28'44.1", 48°48'20.3" in sexagecimal degrees, which is 2.478917, 48.805639 in decimal degrees.
The IGNF:GEOPORTALFXX coordinates are (189952.67, 5433018.88) :
$ cs2cs -f "%.2f" +init=epsg:4326 +to +init=IGNF:GEOPORTALFXX 2.478917 48.805639 189952.67 5433018.88 -0.00
The IGNF:MILLER coordinates are (275951.78, 5910061.78) :
$ cs2cs -f "%.2f" +init=epsg:4326 +to +init=IGNF:MILLER 2.478917 48.805639 275951.78 5910061.78 0.00
If installing PROJ.4 is not possible, one can use the following simplified formula for the GEOPORTALxxx projection (lon being the longitude expressed in radians, lat being the latitude expressed in radians) :
X= Kx * lon Y= Ky * lat
Knowing that the parameters Kx, Ky depend upon the chosen territory, one can use the values below :
| Territory code | Kx | Ky |
|---|---|---|
| ANF | 6160807.2519099 | 6378137.0000000 |
| ASP | 5026040.5439769 | 6378137.0000000 |
| CRZ | 4430626.2549842 | 6378137.0000000 |
| FXX | 4390419.7883516 | 6378137.0000000 |
| GUF | 6362600.1788320 | 6378137.0000000 |
| KER | 4142268.6266325 | 6378137.0000000 |
| MYT | 6238759.4037015 | 6378137.0000000 |
| NCL | 5913705.6486150 | 6378137.0000000 |
| PYF | 6160807.2519099 | 6378137.0000000 |
| REU | 5954503.8607176 | 6378137.0000000 |
| SPM | 4349878.9742539 | 6378137.0000000 |
| WLF | 6188679.0727028 | 6378137.0000000 |
In the MILLER projection case, the formula is as follows (lon being the longitude expressed in radians, lat being the latitude expressed in radians) :
X= 6378137.0000000 * lon Y= 6378137.0000000 * log(tan(pi/4 + lat * .4)) * 1.25
The special case of TERA50STEREO is handled through to following formulas (lon being the longitude expressed in radians, lat being the latitude expressed in radians) :
X'= 1.9140939076700438*tan( 0.5*(pi/2 - lat) )/( ( (1.0+0.08199188997902919*sin(lat)) / (1.0-0.08199188997902919*sin(lat)) )^0.040995944989514595 ) X= (X' * sin(lon-2.443460952792061))*6378388.0 + 300000.0 Y= (X' * cos(lon-2.443460952792061))*6378388.0 - 2299363.482
In order to find out the tile containing this point at 1:2000 scale (1 pixel is worth 50 m x 50 m), one has to compute the lower left corner of the tile, knowing that a tile is 256 x 256 pixels :
The extent of the searched tile at 0.50 m resolution est then :
(189952, 5432960), (190080, 5433088)
The same process applies for the world resolution (1 : 156 543 000 scale) :
finally, the extent is :
(0, 0), (10018752, 10018752)
They are defined there.
http://wxs.ign.fr/geoportail/wmsc?LAYERS=ORTHOIMAGERY.ORTHOPHOTOS& EXCEPTIONS=text/xml&FORMAT=image/jpeg& SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=& SRS=IGNF:GEOPORTALFXX&BBOX=189952,5432960,190080,5433088& WIDTH=256&HEIGHT=256&TILED=true&
http://wxs.ign.fr/geoportail/wmsc?LAYERS=GEOGRAPHICALGRIDSYSTEMS.MAPS& EXCEPTIONS=text/xml&FORMAT=image/jpeg& SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=& SRS=IGNF:MILLER&BBOX=0,0,10018752,10018752& WIDTH=256&HEIGHT=256&TILED=true&