[OSM-dev] Eurasian Coastline and the 180 meridian
Martijn van Oosterhout
kleptog at gmail.com
Tue Nov 13 08:11:11 GMT 2007
On Nov 13, 2007 8:32 AM, Marcus Wolschon <Marcus at wolschon.biz> wrote:
> Dirk-Lüder Kreie schrieb:
> > Apart from implementing said limit, the api and/or the tools managing
> > the data must be made aware that -180 is the same as 180, maybe by
> > "cheating" (allowing numbers like 185°, automatically mapping to -175°
> > or somesuch).
>
> Wouldn't that just be the reminder when doing a divison by 180.0d?
> (Many languages use the reinder as the modulus-operator even as a
> modulus has no negative value.)
No, because -190 should go to +170. So it should be more like
((x+360+180) mod 360)-180
I notice that PROJ4 properly handles wrapping in this case but I don't
think the API takes values outside +/-180.
Have a nice day,
--
Martijn van Oosterhout <kleptog at gmail.com> http://svana.org/kleptog/
More information about the dev
mailing list