[OpenLayers-Dev] ModifyFeature for Geometry.Rectangle and others

Lourens Veen veen at science.uva.nl
Fri Nov 16 03:57:38 EST 2007


On Thursday 15 November 2007 17:51:20 Tim Schaub wrote:
> Hey-
>
> I'm a bit behind here, but I'll throw in my opinion.
>
> I don't want to support Geometry.Rectangle.  I think it was an accident
> to let it in the trunk, and I hope it goes away.
>
> I'm very much in favor of adding properties to a polygon like "regular"
> (boolean) and "sides" (integer).
>
> This way, controls could (optionally) respect these properties of a
> polygon - allowing for editing that would maintain the geometry "class."
>
> A rectangle is a four sided irregular polygon.

Yes, but so are a trapezoid, rhombus, a parallelogram and anything else with 
four sides. You need limitations on the angles of the corners and the lengths 
of the sides to do this correctly. Or redefine "irregular" to mean "stretched 
regular" but then how are you going to represent a completely free-form 
polygon?

At the very least you run the risk of inducing mailing list posts by random 
passers-by who haven't read the code :-).

> A circle is a many 
> (maybe 30, who knows) sided regular polygon.

Yes, and a distance filter is the same as a within polygon check. Or really, 
no it isn't. Sure, if it's better for performance go and render a circle as a 
many-sided regular polygon. But I don't think it would be a good idea to do 
the representation that way.

> Turning a circle into an 
> ellipse is as easy as modifying while respecting the number of sides and
> ignoring the "regular" property.

Are the axes always horizontal and vertical, or are you going to allow 
rotation? Also, there is still quite a lot of regularity in an ellipse, it 
just has one more degree of freedom than a circle (or two if you allow 
rotation).

Lourens

-- 
           ir. Lourens Veen           University of Amsterdam - IBED
                                      Nieuwe Achtergracht 166
     Scientific Software Engineer     1018 WV Amsterdam, The Netherlands
              EcoGRID-GAN             t: +31 20-5257453  f: +31 20-5257431



More information about the Dev mailing list