[OpenLayers-Users] 3D coordinates

Jani Tiainen redetin at gmail.com
Mon Apr 8 05:25:11 PDT 2013


Bummer, last one went as priavate message which wasn't my intention.

By looking at source code of Point:

https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Geometry/Point.js#L40

It seems that only X and Y coordinates are taken into account. Code in 
GML does indeed send Z coordinate but since there is no signature match 
(unless there is some monkey patching magic somewhere else) That does 
always work with two coordinates, X and Y.

Toplevel Geometry class only creates unique classname and it doesn't do 
anything with coordinates.

I even tested that:

proven that:
Following code is same as:
https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Format/GML.js#L282

pnt = new OpenLayers.Geometry.Point(1, 2, 3);

pnt doesn't have coordinate 3 anywhere. But it should be retained, right?

8.4.2013 14:21, Andreas Hocevar kirjoitti:
> What you need should work with the latest from OpenLayers master, at
> least for GML. Retaining the 3rd dimension was introduced after 2.12.
>
> Andreas.
>
> On Mon, Apr 8, 2013 at 11:15 AM, Jani Tiainen <redetin at gmail.com> wrote:
>> Hi,
>>
>> I've following needs to be fulfilled with OL 2.x
>>
>> - Be able to read 3d geometries (preferably WKT)
>> - Be able to retain 3rd coordinate (Z)
>> - Be able to create new vertices with predefined Z.
>>
>> I don't need calcs and such to take into account 3rd dimension. I just want
>> to retain it and later on when creating new features add a new ones with
>> some given Z coordinate (through custom tool).
>>
>> So far I've found following:
>>
>> WKT doesn't support it and adding support for 3rd coordinate might work by
>> modifying point adding.
>>
>> GML tries to preserve 3rd coordinate but actually doesn't do that.
>>
>> All ideas or pointers are welcome.
>>
>> --
>> Jani Tiainen
>>
>> - Well planned is half done and a half done has been sufficient before...
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
>


-- 
Jani Tiainen

- Well planned is half done and a half done has been sufficient before...


More information about the Users mailing list