[postgis-devel] Patch: preserve scale and precision when in pgsql2shp

Peter Hopfgartner peter.hopfgartner at r3-gis.com
Fri Jul 25 03:44:10 PDT 2014

On 07/21/2014 05:51 PM, Peter Hopfgartner wrote:
> On 07/21/2014 05:09 PM, Sandro Santilli wrote:
>> On Mon, Jul 21, 2014 at 04:51:27PM +0200, Peter Hopfgartner wrote:
>>> Hi
>>> This patch uses the precision and scale information from the
>>> database server in order to write the shape file. The advantage is
>>> twofold: a major control on the shape file format and less disk
>>> space used when writing DECIMALs/NUMERICs which have a precision of
>>> less then 32 digits.
>>> The topic was in some way discussed in 
>>> http://postgis.17.x6.nabble.com/Maintain-length-and-precision-for-numneric-fields-in-pgsql2shp-and-shp2pgsql-td3548722.html.
>>> The  patch is against branch 1.5. If the approach is ok, I can
>>> prepare a patch for trunk.
>> Could you please include a testcase to go with the patch ?
>> I'm not sure how it would look as if I recall correctly all current
>> dumper tests are "round-trip" tests that start with loading, and
>> are likely not checking the DBF at all. Maybe it would come as
>> an extension to the run_test.pl script.
>> Probably best to file a ticket on trac to deal with this, attaching
>> this patch for a start: http://trac.osgeo.org/postgis/newticket
>> --strk;
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> Hi strk,
> thanks for your quick reply. I've created 
> http://trac.osgeo.org/postgis/ticket/2850. Test and porting to trunk 
> will follow in the next days.
> Peter
> http://www.r3-gis.com
Hi Sandro,

I've subitted the patch for the current trunk. I'm not really happy 
about the two variables I've added, but I did not want to skrew up the 
rest of the code.
The test is in the tar file. Anyway, I fear that the dumper test scripts 
do not check the field width, so the test simply verifies that the shape 
is not broken, but not if the field has the specified width.



> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel

Peter Hopfgartner
R3 GIS Srl - GmbH
Via Johann Kravogl-Str. 2
I-39012 Meran/Merano (BZ)
web  : www.r3-gis.com
mail : peter.hopfgartner at r3-gis.com
phone: +39 0473 494949
fax  : +39 0473 069902

ATTENZIONE! Le informazioni contenute nella presente e-mail e nei documenti eventualmente allegati sono confidenziali. La loro diffusione, distribuzione e/o riproduzione da parte di terzi, senza autorizzazione del mittente è vietata e può violare il D. Lgs. 196/2003. In caso di ricezione per errore, Vogliate immediatamente informare il mittente del messaggio e distruggere la e-mail.

ACHTUNG! Die in dieser Nachricht oder in den beigelegten Dokumenten beinhalteten Informationen sind streng vertraulich. Ihre Verbreitung und/oder ihre Wiedergabe durch Dritte ist ohne Erlaubnis des Absenders verboten und verstößt gegen das Legislativdekret 196/2003. Sollten Sie diese Mitteilung irrtümlicherweise erhalten haben, bitten wir Sie uns umgehend zu informieren und anschließend die Mitteilung zu vernichten.

WARNING! This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden and could be against the law (D. Lgs. 196/2003)

More information about the postgis-devel mailing list