[OpenLayers-Dev] Sector and Arc Geometry

Christopher Schmidt crschmidt at metacarta.com
Thu Sep 6 07:26:38 EDT 2007


On Thu, Sep 06, 2007 at 02:53:41PM +0400, Vladimir Elistratov wrote:
> 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?

It will be once it's in trunk. Currently, it's only in a patch, here:
http://trac.openlayers.org/attachment/ticket/828/regular_polygon_trunk.2.patch

> 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?

SVG images, or raster graphics? VML can't render SVG, so allowing SVG
graphics goes against the "don't expose platform differences to the user
whenever possible", but external raster graphics are already supported:
see http://openlayers.org/dev/examples/vector-features.html and the
description at the bottom of the page.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list