[postgis-users] 1.3.3 Pre-Release Notice

Paul Ramsey pramsey at cleverelephant.ca
Wed Apr 9 09:10:34 PDT 2008


Regina,

Actually this logic is good, very old and hasn't worked since it was
written, but good.  Because if I ever want to change the value of "no
SRID" from -1 to 0 (and I *do* want to) then having "undefined"
generated as truly undefined is helpful to that end.

P.

On Wed, Apr 9, 2008 at 9:02 AM, Obe, Regina <robe.dnd at cityofboston.gov> wrote:
> This may be a dumb question, but why can't we just skip the strcmp
>  altogether?
>
>  I mean if you do
>
>  if (sr_id)
>
>  and someone did happen to explicity set their sr_id = "-1"
>
>  then  what happens
>
>  "SRID=-1;"
>
>  Isn't that still legal and gets kicked out by Postgis anyway.
>
>
>  Thanks,
>  Regina
>
>  -----Original Message-----
>  From: postgis-users-bounces at postgis.refractions.net
>  [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Paul
>  Ramsey
>
> Sent: Wednesday, April 09, 2008 11:23 AM
>  To: PostGIS Users Discussion
>  Subject: Re: [postgis-users] 1.3.3 Pre-Release Notice
>
>
>
> >  if ( sr_id && strcmp(sr_id,"-1") ) printf("SRID=%s;", sr_id);
>  >
>  >  I have a very strong feeling that evaluation order in C is
>  unspecified, rather
>  >  than being from left to right; so for example the compiler could
>  decide to
>  >  generate code that evaluates the strcmp() first, in which case it
>  would
>  >  segfault on a NULL :( I think you would need to re-write something
>  like this:
>
>  Should be fine: man -S7 operator
>
>  >  if (sr_id)
>  >         if (strcmp(sr_id,"-1") ) printf("SRID=%s;", sr_id);
>  >
>  >  (looks even closer...)
>
>  >  In fact, why is sr_id stored as a string anyway? We should make sr_id
>  an
>  >  integer with a default value of -1, and then use sscanf() within the
>  switch()
>  >  statement of pgis_getopt() to read its value.
>
>  I'll have a look at that, how is the estimated_extent investigation
>  coming?
>
> _______________________________________________
>  postgis-users mailing list
>  postgis-users at postgis.refractions.net
>  http://postgis.refractions.net/mailman/listinfo/postgis-users
>
> -----------------------------------------
>  The substance of this message, including any attachments, may be
>  confidential, legally privileged and/or exempt from disclosure
>  pursuant to Massachusetts law. It is intended
>  solely for the addressee. If you received this in error, please
>  contact the sender and delete the material from any computer.
>
>
>
> _______________________________________________
>  postgis-users mailing list
>  postgis-users at postgis.refractions.net
>  http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list