[fdo-internals] Functional SHP provider for 64-bit Linux

Jackie Ng jumpinjackie at gmail.com
Mon Jan 7 05:14:17 PST 2019


Hi All,

I've been hacking on a sandbox branch to finally get a functional SHP
provider for 64-bit Linux. 

Unified diff view of changes:

https://trac.osgeo.org/fdo/changeset?reponame=&new=7803%40sandbox%2Flinux64shp&old=7788%40trunk

The key changes are:

1. sizeof(unsigned long) on Windows != sizeof(unsigned long) on Linux, so a
new shpidx_ulong typedef is used to normalize this difference (this typedefs
to unsigned int on Linux) and used to ensure a consistent -1 value for
unspecified node file offsets when the SHP spatial index is being read. On
Linux this previously got set to 2^32 due to the size/limit difference on
Linux, producing nonsensical SHP spatial indices as a result which
completely throws off any resulting spatial queries.

2. Be more graceful with incomplete SHP physical classes when describing a
SHP schema. The unit test failures were due to "shp file not found"
exceptions thrown when a describe schema is executed, looping through all
physical classes and encountering a physical class that may have one of the
component file parts (dbf/shx/idx/cpg/etc), but not the .shp itself. The
testcommon class cleanup does a describe schema to get the feature class to
empty and/or delete. 

When describing a schema, a client application wouldn't know up front what
the logical classes it would get back, so in this respect an incomplete
physical class shouldn't really derail the operation as a whole with a
thrown exception and for such incomplete physical classes, it should just
skip them and move on to the next one. Combined with a SHP-specific class
cleanup helper and some missing documentation about needing to run
TestData/clean[.cmd] between test runs and setting up Japanese locales for a
particular test case, the SHP test suite now sits at 2 failures on both
Windows and Linux. Getting the SHP test suite to 0 failures was not the main
objective of this sandbox work, but getting it down to 2 was a useful side
mission.

Please review if you can. Thanks.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Internals-f3887985.html


More information about the fdo-internals mailing list