[PROJ] [EXTERNAL] Re: Proj 6 API questions

Nyall Dawson nyall.dawson at gmail.com
Mon Mar 25 15:43:00 PDT 2019


On Fri, 22 Mar 2019 at 20:14, Even Rouault <even.rouault at spatialys.com> wrote:
>
> > Well - as soon as I'm done porting QGIS to proj6, it will be possible
> > for users to create projects using these ESRI:xxxx ellipsoid codes.
> > Could they be deprecated instead of removed? That would avoid any
> > possible regression for users.
>
> OK, we'll keep them then.
>
> <cultural_question>
> I'm interested to know why in QGIS an ellipsoid code is directly manipulated,
> or stored. I would have though QGIS would only manipulate higher level objects
> like CRS, and perhaps query their ellipsoid parameters for some computations.
> This is what I wondered while reviewing https://github.com/qgis/QGIS/pull/9557
> with QgsEllipsoidUtils offering API starting with an ellipsoid name.
> </cultural_question>

(Disclaimer: this functionality has been around much longer than I've
been involved with QGIS, so I may be missing some of the background
here)

QGIS exposes the choice of ellipsoid on a per-project level. This
project ellipsoid is independent of the map CRS[1][2], so a project in
WGS84 could have an ellipsoid of GRS80, and a project in Web Mercator
could use the WGS84 ellipsoid. The project ellipsoid is used ONLY when
calculating geodetic distances and areas of features. (It's also
possible to set no ellipsoid, which means distances/area calculation
is always purely Cartesian). It's also possible for users to enter a
custom ellipsoid for a project, if they have some compelling reason to
do so!

So we need a way to store the project ellipsoid within the project. In
current QGIS versions that's done by the ellipsoid name, from QGIS'
custom ellipsoid db. When we move to proj6 api I'm replacing this with
the unique auth:code combination.

Does that help clarify?

Nyall


[1] The choice is kept separate from project CRS, because a single
project can have many different CRSes (individual canvases can have
different CRS, layout map items can override the CRS, etc). Hence we
push the choice for an appropriate project-wide ellipsoid for
distance/area calculations back to the user -- it's their
responsibility to make an appropriate choice based on their particular
project.

[2] QGIS *does* initially set the default ellipsoid for the project to
match the main canvas CRS when you start a new project. But that's
just to help "guide" users to a mostly-appropriate choice.



>
> >
> > Nyall
> >
> > > - do not touch the ESRI definitions, and add IAU next to it
> > > - (more involved, would require database schema change, and likely
> > > software
> > > logic too to make something useful of it). Import IAU, and create a link
> > > from ESRI definitions to IAU ones (when identical/compatible)
> > >
> > > Even
> > >
> > > --
> > > Spatialys - Geospatial professional services
> > > http://www.spatialys.com
>
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com


More information about the PROJ mailing list