[OpenLayers-Dev] Catch-22 with a polygon handler on 180 line - what does "citeCompliant" actually mean?

Andreas Hocevar ahocevar at opengeo.org
Wed Feb 8 08:45:35 EST 2012


Hey Phil,

I know this is not fun, so let me at least try to explain what
citeCompliant does, and how you could get geometries from your sketch
handler that work with your server:

You are right - all that citeCompliant: true does is set the
wrapDateLine option on the sketch layer to true. Which makes the
sketch layer behave like a base layer when getLonLatFromViewPortPx is
called on it - it will wrap coordinates around the dateline.

If you want to create geometries that can be used for queries, leave
citeCompliant set to false, but split your features at the dateline
and move the part that exceeds the world bounds by one world width, so
it is inside the world bounds again. You can do that easily with
OpenLayers, preferably in a beforefeature(s)added handler on the
vector layer.

I hope this helps,
Andreas.

On Wed, Feb 8, 2012 at 1:42 AM, Phil Scadden <p.scadden at gns.cri.nz> wrote:
> This is fun (not). If I create a polygon handler with handlerOptions of
> citeCompliant:false, then it will happily create a polygon that spans
> the 180. On the other hand, the geometry it returns will not intersect
> with any features on east side of 180 from a WFS because the coordinates
> exceed the maxEast value. On the other hand, if citeCompliant is true,
> then it will generate geom which works for a  WFS query - but then you
> cant draw a line over the 180. citeCompliant sets wrapDateLine for the
> handler but what else does it do? What does it actually mean?
>
> It looks like I need to post-process the geometry from the polygon
> before using it in the filter anyway. For starters, most wfs servers
> need the query split on the 180 line into two  and combined with an OR
> (grrrr!).
>
> 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 lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev



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


More information about the Dev mailing list