[postgis-devel] optional units parameter...

Paul Ramsey pramsey at cleverelephant.ca
Mon Oct 12 10:13:40 PDT 2009


On Mon, Oct 12, 2009 at 10:05 AM, Jeff Hamann
> having very familiarity with how this might be accomplished, I can envision
> the following examples:
> st_area( boundary, 'hectares')
> where boundary is from a google earth file (WGS84)
> st_buffer( stream, stream_buffer[1], 'feet' )
> where stream is in UTM (meters), stream buffer vector is in feet, and the
> resulting buffer area needs to be reported in acres or hectares.

As Regina pointed out, this conversation can segue very quickly from a
specific "what should geography do" question into a larger "what
should geometry and geography do" place. Supporting arbitrary output
units in geometry involves a great deal more new machinery than doing
it for geography (because the geometry is currently blissfully unaware
of what SRS it is in, except for the SRID number).

Geography, on the other hand, is already returning all answers in
metres, so supporting other units is "just" a matter of providing a
lookup table and mechanisms for parsing the string inputs of unit
names.

I think I'm going to err on the side of simplicity right now, which is
just return metres, since the story is so simple: we return metres. If
you want something else, scale appropriately.

P.



More information about the postgis-devel mailing list