[postgis-devel] Typmod: Making my Life Harder

Paragon Corporation lr at pcorp.us
Mon Aug 3 13:42:02 PDT 2009


Paul,

The use geography go away is nice which would be fine (maybe) if there is no
explicit SRID , but we are talking about the wrong one.

If a newbie happens to give an SRID of 27... whatever -- then that newbie is
probably someone like me who forgot a certain table has data of a given
projections spatial ref who is misguided stuffing planar data into a
geography table.

Although you are doing this for geography -- IT WILL EVENTUALLY become the
standard for all -- so I don't see that as a "nothing to see here folks, its
just for geography" reasoning.  

I'm with David on this, that this seems to be an exploitation of a
misfeature if I understand your coersive model correctly.

Thanks,
Regina (just my 2 cents)

-----Original Message-----
From: postgis-devel-bounces at postgis.refractions.net
[mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of Paul
Ramsey
Sent: Monday, August 03, 2009 4:21 PM
To: PostGIS Development Discussion
Subject: [postgis-devel] Typmod: Making my Life Harder

Trying to think like a user, and taking into account some changes to the
typmod design. Note that I am doing this for GEOGRAPHY in the first place,
and GEOMETRY is not on the agenda until PostGIS 2.0.

So, first of all I have collapsed the dimensionality issues into the type
declarations. So you declare your type as:

POINT
POINTZ
POINTZM
LINESTRINGZ
...

And so on. That means that the typmod string signature is "only" two items
long:

CREATE TABLE foo (g geography(4326, POINT));

However, for geography this gets further pointless as the initial
implementation is only going to accept 4326 as an SRID. And even when it
*does* accept alternates most people will just want to use 4326.
Also, one of the user targets for geography is geo-newbies, the folks coming
in with lonlat data and a dream. They shouldn't need to know the "magic
number", they should just need to be told "use geography, go away".

CREATE TABLE foo (g geography(POINT));

So, should SRID be first? last? I'm actually thinking it could be either,
because I can test the arguments and if the argument is numeric it is the
srid and if it is letters that's the type. If we want a fixed ordering, then
I would now go for geography(type, srid).
I think for geometry, type *and* srid restrictions will be common, but for
geography, type-only restrictions will be the more frequent case.

P.
_______________________________________________
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