[gdal-dev] OGREnvelope

Frank Warmerdam warmerdam at p...
Wed Jan 23 10:15:03 EST 2002


On Tue, Jan 22, 2002 at 11:22:01PM -0500, Aleksey wrote:
> Frank,
> 
> What do I use in GDAL to represent rectangles? OGREnvelope seems the only 
> choice, but contains only the four corners. Do you plan to (eventually) have 
> some methods, like e.g. union() and intersect() with another rectangle, as 
> well as simple things for convenience, like width(), height(), left(), top(), 
> etc.?
> These would come handy for example, when working with data extents of several 
> datasets. If you think it's worth doing, I could do a quick draft job and 
> send it to you for review.


Alexsey,

If you want you may add a few methods (preferably inline) on the 
OGREnvelope for stuff like width(), height() and so forth. Note that because
the envelope is min/max based rather than top left, and bottom right it is
hard to determine what is really the top or bottom. In odd coordinate 
systems with the origin not at the bottom left the meaning of stuff will
change and of course the envelope doesn't know anything about it. 

Note that OGREnvelope isn't intended to be a first class geometry type in
the sense of the other OGR geometry types. It is just a lightweight 
contain for extents. 

The OpenGIS simple features geometry set doesn't have a type which is
explicitly a rectangle. Normally it would be represented as a polygon. 

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list