Boost logo

Geometry :

Subject: Re: [geometry] Support for geographic coordinate system
From: Barend Gehrels (barend_at_[hidden])
Date: 2014-11-18 16:34:45


Hi Adam,

Adam Wulkiewicz wrote On 18-11-2014 1:53:
> Hi,
>
> Barend Gehrels wrote:
>> Adam Wulkiewicz wrote On 14-11-2014 12:33:
>>> Since we already have bg::cs namespace, somehow related to the
>>> reference system. We could reuse this scheme:
>>>
>>> boost::geometry::rs::spheroid<>
>>
>>
>> The common abbreviation is srs (spatial reference system), so as we
>> get to that direction, I would certainly use that one. That would
>> actually look quite good.
>>
>>
>>>
>>> but should spheroid and sphere be included in reference systems
>>> (namespace)? They're rather models describing the ref systems.
>>> Though it's possible that we'd need a place for more code related to
>>> reference systems, EPSGs, SRIDs, etc. so this code could be put
>>> there. But then I'd put the models in:
>>>
>>> boost::geometry::rs::model::sphere<>
>>> boost::geometry::rs::model::spheroid<>
>>>
>>> Or just reuse the namespace cs for this:
>>>
>>> boost::geometry::cs::model::sphere<>
>>> boost::geometry::cs::model::spheroid<>
>>>
>>> which would be probably the most general choice. The question is:
>>> could additional things be put in the bg::cs namespace?
>>
>>
>> I think I would prefer the srs namespace.
>
> Indeed srs is a better name than rs. Though I'm not sure that we
> should use it. On the wikipedia
> (http://en.wikipedia.org/wiki/Spatial_reference_system) there states:
>
> A spatial reference system (SRS) or coordinate reference system (CRS)
> is a coordinate-based local, regional or global system used to locate
> geographical entities. A spatial reference system defines a specific
> map projection, as well as transformations between different spatial
> reference systems.
> (...)
> Spatial reference systems can be referred to using a SRID integer,
> including EPSG codes (...)
>
> AFAIU SRS is higher-level concept than sphere and spheroid models
> representing a coordinate system. By using those models I'm not
> defining any particular SRS since AFAIR SRS should also define other
> things like units and the N/S W/E mapping, etc. The concept of SRS is
> bound closely with geography/GIS and on this level I'd prefer to be
> domain-agnostic, in other words be closer to mathematics. Newly added
> sphere/spheroid represent a global system, not necesarily for
> geographical entities.
>
> Does the above have some sense?

Sure, it makes sense and I agree (a bit). While srs describes a spatial
reference system, it includes a reference ellipsoid. So the spheroids
can be part of the namespace srs, defining also other things. But yes,
it is GIS-specific. But isn't the whole geographic coordinate system
GIS-specific?

OK, thinking more about this. In general what we try to model here is
called a refererence ellipsoid.
http://en.wikipedia.org/wiki/Reference_ellipsoid

You earlier mentioned that we should call it a spheroid, because the
Earth is in fact spheroid-shaped, so it is mathematically more correct
to call it a spheroid. For the Earth it is. But that makes it
GIS-specific too...

Each spheroid is an ellipsoid, where two axes happen to be the same. But
there are also bodies which are true ellipsoids, e.g. Jupiter's moon Io
(same article). So yes, why not call it in general an ellipsoid, it is
one, and that is the common name...

If we have that, we can use the namespace re (reference ellipsoid).

The model we are currently defining, of course, you can then still call
a spheroid because it defines only two axes.

So it then becomes for example:

boost::geometry::re::spheroid<>

srs is for me still an option too

Another alternative is "datum" which has the advantage that it is not an
abbreviation. Geodesic datum contains a reference ellipsoid and more,
but as a namespace it might be convenient.

boost::geometry::datum::spheroid<>

Regards, Barend


Geometry list run by mateusz at loskot.net