[postgis-devel] Issue 34 in postgis: .prj creation by pgsql2shp

codesite-noreply at google.com codesite-noreply at google.com
Fri Dec 12 03:33:41 PST 2008


Comment #17 on issue 34 by mark.cav... at siriusit.co.uk: .prj creation by  
pgsql2shp
http://code.google.com/p/postgis/issues/detail?id=34

Regina,

Looks good to me. I really wouldn't worry about the increased malloc() size  
(3 times
instead of 2) since the PostgreSQL documentation clearly states the output  
size
should be calculated as 2 * strlen(str) + 1. But what is there at the  
moment isn't
dangerous.

Also on reflection you are right to use free() rather than PQfree() since  
of course
we are allocating allocating the memory, and not libpq.

One other minor niggle I see is that you use the value 'm' to indicate a  
mixed SRID
table; but in the code you check this using "if (srtext[0] == 'm')". My  
concern is
that if there are any proj4text definitions begin with an 'm' then this  
condition
would be incorrectly triggered; I think using strcmp() to check the  
complete string
would probably be safer here, and possibly in the else section below it  
(i.e. what
would happen if a proj4text field accidentally had a leading space?)

I have no problem with you backporting to 1.3 branch, as an upgrade simple  
upgrades
the executable (i.e. nothing in your patch changes any command line options  
which may
cause existing scripts to break).


ATB,

Mark.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



More information about the postgis-devel mailing list