[OpenLayers-Dev] Patrch for getting vector drawing working over the 180 line going.

Andreas Hocevar ahocevar at opengeo.org
Thu Aug 19 03:35:36 EDT 2010


On Aug 18, 2010, at 23:25 , Phil Scadden wrote:

> 
>> Please don't try to bake in any assumptions about heading in a line
>> segment.  Our geometry model is based on coordinates on a plane.  My
>> opinion is that "crossing the dateline" is application logic.
>> 
> So when I try to draw say a zoom rectangle across the date line,

You mean using the ZoomBox control? This works fine. Try it out in our spherical-mercator.html example.

> or 
> measure a distance between two points which happen to be on opposite 
> sides of the dateline,

Using the geodesic measuring algorithm, this also works already.

> how do I put that logic in my application to cope 
> with this without altering OL? Or draw a selection polygon to choose 
> some data in a WFS layer?

Here you could use the sketch handlers after applying my patch, and then split the polygon at the maxExtent bounds (patches for polygon splitting welcome :-) ).

> This is where problems occurs. The reason for 
> looking at the renderer approach is that there remain problems with just 
> doing it in the handlers.

You may want to try the SVG2 renderer I am currently working on. There is a chance that it works with geometries that exceed the world bounds (like the ones you get from my patched sketch handlers when drawing over the date line with sciteCompliant set to false). The new renderer development is an ongoing process and can be found in this sandbox: http://svn.openlayers.org/sandbox/ahocevar/renderer-ng

Regards,
Andreas.

> Obviously its pointless for me to continue 
> work on renderer model if it wont be accepted into OL, so I'll the study 
> the remaining issues with the handlers in Andreas's patch today. But I 
> dont believe there is a solution to the problem without altering OL.
> 
>> Geometries should be split when the user tries to draw beyond the domain
>> of the coordinate system.
>> 
> Well to be honest I am sick to death of geometry models based on a plane 
> when we live on a spherical earth, and its especially a pain when you 
> live close to the 180 lines and  nightmare if you are working near the 
> pole. I would really like to see OL get onto a sphere. There is dearth 
> of tools for working on a sphere. Our inhouse software always manages it 
> because its taken into account from day 1 but reengineering flat earth 
> software to work with real world geometry is a mega pain. Would you be 
> so keen on applications having to split geometry if you lived on the 180 
> line?
> -- 
> Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
> Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232
> 
> Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.
> 
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Dev mailing list