[Mapserver-users] Definition Projections, raw proj parameters vs EPSG code
Daniel Morissette
morissette at dmsolutions.ca
Tue Jan 14 21:22:56 PST 2003
JF,
These are all very legitimate questions but unfortunately I don't think
anyone will have clear answers for you. Your questions are in a grey
area and we would need to do some checking to find the answers... read
on...
Jean-Francois.Doyon at ccrs.nrcan.gc.ca wrote:
>
> So, when defining the projection of a layer in a MapFile used for WMS (or
> WFS I guess), am I better off using the EPSG code, or a full definition ?
> does it matter ?
>
For readibility of the mapfile, the EPSG code is better, but in doing
some profiling we realized that PROJ's time spent reading the EPSG file
adds a non-negligible overhead to MapServer requests.
So I'm not sure what's best...
> In the case where the output projection is the same as the input, is there
> an advantage to defining the layer using the EPSG code (MapServer is smart
> enough to recognize no reprojection is needed, since the EPSG code for both
> ends is the same), or does it reproject anyways? What if the layer defines
> the projection using full PROJ.4 parameters, does MapServer recognize it as
> being that same EPSG code projection, and skip the re-projection, or does it
> reproject anyways (to the same projection)?
>
In theory it should recognize that the projections are the same and skip
the reprojection, there is a msProjectionDiffers() function in the code
for that but I'm not 100% sure that this is always happening properly
and/or that this function is used everywhere it should be.
So once again this would need some experimentation in order to give you
a clear answer. This is a very important question I agree since it
represents a potential waste of CPU cycles... (unfortunately all those
details take time...)
> I'm guessing specifying projections with the EPSG code everywhere possible
> is more efficient, but I want to check before I have to go and edit a bunch
> of layers.
>
As mentioned above, I'm not convinced that it would be more efficient.
The main reason being that PROJ seems to re-read the 'epsg' file
everytime it receives and EPSG code. I could be wrong on this, but
that's the impression that I have, and one of the many things I want to
check one day when I have some free CPU cycles. ;)
Daniel
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.ca
DM Solutions Group http://www.dmsolutions.ca/
------------------------------------------------------------
More information about the MapServer-users
mailing list