[postgis-devel] LWGEOM: collection type
strk at refractions.net
strk at refractions.net
Wed Aug 25 05:42:14 PDT 2004
Ok. I've made a decision :)
W/ no dimension specification measuring functions to their
best (3d for 3d geoms, 2d for 2d geoms).
2d specification forces 2d computation (for speed or other needs).
Using force_2d(geometry) would be slower as the construction
of a new geometry would be required (I'm talking about LWGEOM).
3d specification is kept for backward compatibility.
Example:
length() // 2d or 3d length depending on input geometry dimension
length2d() // 2d length regardless input geometry dimension
lenth3d() // alias for length()
I think in this way things are more clear.
--strk;
On Wed, Aug 25, 2004 at 11:07:20AM +0200, Gino Lucrezi wrote:
> > Since OGC only defines 'length', what about dropping length3d and length2d ?
> > A 3d geom would get a 3d length computed, while a 2d length would get
> > a 2d length computed.
>
> It is true that length2d and length3d will yeld the same result for a 2d geom, so in this case there would be no need to have both.
>
> However, when you're using a 3d geometry the two functions would give different results, and you can't predict which one the user will need.
> In many instances, I think, even with a 3d geom you'll want the length calculated on a 2d basis, because that's the same result you'd get by doing this calculation on a map. In other instances you'll need the result using the Z coordinate.
> So, I think it's better to keep both versions.
>
> Gino Lucrezi
> Penta Consulting Services
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
More information about the postgis-devel
mailing list