[OpenLayers-Dev] Sector and Arc Geometry

Vladimir Elistratov v_elistratov at rambler.ru
Thu Sep 6 06:53:41 EDT 2007


On Tue, 4 Sep 2007 11:15:34 -0400
  Christopher Schmidt <crschmidt at metacarta.com> wrote:
> On Tue, Sep 04, 2007 at 03:57:47PM +0400, Vladimir Elistratov wrote:
>> I suggested to include Sector and Arc Geometry to the library. 
>>Example 
>> application is pie charts on a map.
>> What do you think?
>> 
>> I have already implemented Sector for SVG.

>For the most part, geometries in OpenLayers correspond to those
> described by the GML Simple Features Profile
> (http://www.ogcnetwork.net/gml-sf). In particular, they are "points,
> lines, polygons (and collections of these)."
> 
> In order to fit in with the other geometry classes, it is important that
> geometry.calculateBounds sets geometry.bounds as the the envelope of 
>the geometry.
> 
> In addition, the geometry.toString method returns Well-Known Text for
> all geometries. Geometries cannot only be serialized into WKT, but also
> GML, KML, GeoRSS, and GeoJSON. This is accomplished with the Format
> classes.
> 
> This last bit allows all geometries to be serialized and sent to some
> persistance layer.
> 
> All these things (in my mind) are important (and defining)
> characteristics of the geometry classes. 
> """
> 
> -- tschaub, #903
> 
> I'd be surprised to find that sectors and arcs can not be 
>represented by
> sufficiently complex polygons. There is an outstanding patch to add
> support for a Class instance on Polygon to support creation of
> regular-polygons: that is, multisided polygons with the same angle
> between each side. These approximate a circle for a sufficiently 
>large 
> side value. I would expect that a sector or arc would simply be a
> partial-circle, possibly a linestring instead of a polygon. Either 
>of
> these are probably welcome helper functions to the appropriate 
>geometry
> types, given sufficient tests.
> 
> I think this would resolve your specific use case. If it doesn't, I 
>may
> be misunderstanding: further feedback welcome. 

This function should solve the problem of Arc and Sector. Where can it 
be found? Is it available under the same license as OpenLayers?

The other solution would be to explicitly allow the use of SVG images 
loaded from a string or from a file like it is done now with markers. 
Is there a plan to do so?



More information about the Dev mailing list