OpenLayers OpenLayers

Ticket #2424 (closed bug: fixed)

Opened 2 months ago

Last modified 1 month ago

Format.KML: always export coordinates in WGS84

Reported by: fredj Assigned to: tschaub
Priority: minor Milestone: 2.9 Release
Component: Format Version: SVN
Keywords: Cc:
State: Complete

Description

The KML OGC standard says that the geometry coordinated are always in WGS84.

If no internalProjection and externalProjection are given to the format, the exported coordinates may be wrong.

Attachments

2424.0.patch (2.2 kB) - added by fredj on 01/22/10 03:24:11.
work in progress
2424.1.patch (6.3 kB) - added by fredj on 01/25/10 03:43:03.
add unit tests
patch_2424.diff (6.3 kB) - added by pgiraud on 01/27/10 08:24:13.
same patch as fredj but with getCode instead of projCode

Change History

01/15/10 08:34:00 changed by crschmidt

I'm in favor of changing KML to have a default externalProjection of EPSG:4326; I think that solves this problem for most cases?

01/15/10 08:46:08 changed by fredj

yes, and we need to do the same for Format.GPX (internalProjection and externalProjection) (?)

01/15/10 09:57:51 changed by crschmidt

Yeah, defaulting for GPX also makes sense. Though we don't have anything to default internalProjection to? I mean, we don't know what projection the OL.Feature objects are in -- just what they should be out in.

01/15/10 10:25:28 changed by fredj

so we should add a new 'crs' property to the geometry ...

01/15/10 10:50:52 changed by crschmidt

That's a different issue. Right now, it's possible to do the right thing, but you have to know what you're doing. Adding a defualt externalProjection just removes one of the needs to know what you're doing; it doesn't eliminate everything, but it really can't without significant effort/overhaul.

01/22/10 03:24:11 changed by fredj

  • attachment 2424.0.patch added.

work in progress

01/25/10 03:43:03 changed by fredj

  • attachment 2424.1.patch added.

add unit tests

01/25/10 03:45:08 changed by fredj

  • state set to Review.
  • version changed from 2.8 to SVN.
  • component changed from Format.KML to Format.

attachment:"2424.1.patch" set a default externalProjection (EPSG:4326) to the GPX, KML and OSM format.

tests pass on FF3 and chrome, please review.

01/27/10 08:24:13 changed by pgiraud

  • attachment patch_2424.diff added.

same patch as fredj but with getCode instead of projCode

01/27/10 08:27:05 changed by pgiraud

  • state changed from Review to Commit.

Fredj, you're patch looks good to commit. I don't know if this is worth but I modified your patch to use the getCode() method instead of the projCode property. I don't really know if getter methods are to be prefered to properties though. What is the rule on that point ?

Please commit.

01/27/10 08:33:37 changed by fredj

You're right, getCode() is an api method, projCode not. Thanks.

01/27/10 08:36:46 changed by fredj

  • status changed from new to closed.
  • state changed from Commit to Complete.
  • resolution set to fixed.

(In [9975]) set a default EPSG:4326 externalProjection to the KML, OSM and GPX formats. r=pgiraud (closes #2424)