87 Commits

Author SHA1 Message Date
Blottiere Paul
270f3e1125 Fix compilation with GCC 10.1 2020-06-18 22:03:59 +02:00
Blottiere Paul
5b3c3981ef Add lazperf guards 2018-06-19 12:41:49 +01:00
Blottiere Paul
063a5b1651 Remove GHT support 2018-06-14 18:34:05 +01:00
Karl Pietrzak
4f738eb072 Add PC_MakePatch(pcid integer, values float8[])
Add PC_MakePatch to create a patch from a pcid and an array of float8 values.
2018-06-14 18:49:52 +02:00
Éric Lemoine
8e82233b56 Test datasize in test_patch_lazperf 2018-06-12 08:51:34 +02:00
Éric Lemoine
3aefbe250c Fix code style 2018-04-30 09:47:55 +02:00
Adam Chidlow
6e3d61a50a Move the freeing of stats into its own function
And call that function from all the different pc_patch_*_free functions.
2018-04-30 09:47:55 +02:00
Éric Lemoine
19075af104 Drop CMake support for building 2018-04-27 07:31:11 +02:00
Éric Lemoine
07c3ddd9f6 Prefix WKB API functions with pc_
This is to avoid conflicts with other libraries, like PostGIS.
2017-06-12 08:42:45 +02:00
Éric Lemoine
114b16dacd Use pc_patch_set_schema correctly in ght test 2017-05-11 06:42:08 +02:00
Éric Lemoine
d552002187 Add PC_Transform
This commit adds a `PC_Transform` function that returns a new patch with its data transformed based on the passed `pcid`.

In contrast to `PC_SetPCId` this function may reinterpret the data if dimension interpretations, scales or offsets are different in the new schema. In the future `PC_Transform` will also re-project the patch data if the schema `srid` has changed, but that is not yet supported.
2017-04-26 16:46:40 +02:00
Éric Lemoine
9491f09dc6 Add PC_SetPCId
This commit adds a `PC_SetPCId` function that can be used to change the schema of a patch.
2017-04-12 09:15:48 +02:00
Éric Lemoine
4f033847fe Add a PC_BoundingDiagonalAsBinary(p PCPATCH) function 2017-04-03 11:29:13 +02:00
Mathieu Brédif
4088121eeb dim pointers instead of positions in PCSCHEMA
replaces `int32_t x_position` with `PCDIMENSION *xdim` (and similarly for y,z,m) in PCSCHEMA to get a direct access to the corresponding dimension
-> code readability improvement by discarding the `-1` constant and maybe slight expected performance increase of get/set functions
2017-04-01 10:03:25 +02:00
Mathieu Brédif
a6ceb504c3 test_point_geometry (pcpoint to geometry wkb tests)
xy, xyz, xym and xyzm test cases
2017-04-01 10:03:23 +02:00
Mathieu Brédif
f62481bc9b pcpoint_set/get API normalisation and testing
- definition of CU_ASSERT_FAILURE and CU_ASSERT_SUCCESS for easy checking of return values in tests.
- pcpoint_set functions were returning the PC_SUCCESS/PC_FAILURE as a double (!)
- add simple xy, xyz, xym and xyzm xml schemas for unit tests (test_point_xyzm)
2017-04-01 10:03:22 +02:00
Blottiere Paul
ccc6e2714e Add lazperf support to PC_PointN 2017-03-31 11:12:39 +02:00
Blottiere Paul
fb5f1dcca4 Add PC_Range(p PCPATCH, first int4, count int4)
This commit adds a PC_Range function. This function returns a patch of "count" points. These points are selected from the start-th point in the input patch.
2017-03-30 09:03:04 +02:00
Mathieu Brédif
3b8f165b35 PCSCHEMA *pc_schema_from_xml(const char *)
consistent return of pc_schema_from_xml : NULL on failure
2017-03-17 12:14:02 +01:00
Mathieu Brédif
8f4e7e5ecc Consistent error handling in pc_schema_from_xml (2)
slight rework of #108 from @achidlow
2017-03-17 12:13:08 +01:00
Éric Lemoine
abce712ec8 Support other dimensions for lazperf compression 2017-03-14 14:36:39 +01:00
Blottiere Paul
96de4159f7 Add unit test for pc_patch_filter with lazperf 2017-03-14 08:33:45 +01:00
Mathieu Brédif
165d9ea7be geometry cast of pcpoint with optional srid, z and m values, using caching of Z and M positions in schema. 2017-02-16 09:27:04 +01:00
Éric Lemoine
9f19f32536 Remove compile warning (#140)
When using `./configure CFLAGS="-Wall -O2 -g"` we get an "unused-function"
warning at compile time. This was raised by @strk in #130. This commit fixes
the issue.
2017-02-13 19:19:51 +01:00
Mathieu Brédif
ef5fc167d8 indentation normalization 2017-02-12 23:52:15 +01:00
Éric Lemoine
2b87e90d49 Fix indent in cu_pc_patch.c 2017-02-10 15:01:53 +01:00
Éric Lemoine
071d9a72a7 Make pc_patch_compress return the compressed patch
When compressing a patch from GHT to LAZPERF the pc_patch_compress function
currently returns the uncompressed patch.

This commit fixes the bug in pc_patch_compress and adds unit tests for
pc_patch_compress.
2017-02-10 15:01:53 +01:00
Éric Lemoine
87cb90cf29 Fix indent in cu_pc_sort.c (#131)
cu_pc_sort.c currently uses a mix of spaces and tabs. This commit changes all
the tabs to spaces.
2017-01-30 16:52:22 +01:00
Éric Lemoine
c9692411f9 Fix sort unit tests with cunit 2.1-3 (#132) 2017-01-30 16:51:28 +01:00
Mathieu Brédif
68caab7ae1 PC_Sort and PC_IsSorted (#106)
* PC_Sort and PC_IsSorted

* fixing -Wdeclaration-after-statement warnings

* using sort_r for a portable definition of qsort_r/qsort_s

* uncompression fallback for lazperf/is_sorted

* NEWS updated, sort_r github reference and README added
2017-01-29 23:12:31 +01:00
Éric Lemoine
e90e0ac166 Remove unused functions and vars (#128)
* Remove unused function in pc_patch_ght.c

* Remove unused vars in pc_patch_lazperf.c

* Remove unused vars in cu_pc_patch_ght.c

* Remove unused vars in cu_pc_point.c

* Remove unused vars in cu_pc_bytes.c
2017-01-27 17:22:37 +01:00
Éric Lemoine
8165600c61 Build issues when using a specific install prefix (Autotools) (#127)
* Introduce LAZPERF_CPPFLAGS

Without this the las.hpp header file is not found when lazperf was
installed in a non-system place.

* Use GHT_CPPFLAGS

Without this the ght.h header file is not found when libght was installed in
a non-system place.

* Use tabs in Makefiles
2017-01-26 17:43:03 +01:00
Éric Lemoine
8cd3f4c15a Fix unit tests with cunit 2.1-3 (#124)
In CUnit 2.1-2 and before the CU_SuiteInfo structure looks like this:

    typedef struct CU_SuiteInfo {
        const char       *pName;
        CU_InitializeFunc pInitFunc;
        CU_CleanupFunc    pCleanupFunc;
        CU_TestInfo      *pTests;
    } CU_SuiteInfo;

In CUnit 2.1-3 it looks like this:

    typedef struct CU_SuiteInfo {
        const char       *pName;
        CU_InitializeFunc pInitFunc;
        CU_CleanupFunc    pCleanupFunc;
        CU_SetUpFunc      pSetUpFunc;
        CU_TearDownFunc   pTearDownFunc;
        CU_TestInfo      *pTests;
    } CU_SuiteInfo;

This commit changes the test code so it works with both CUnit 2.1-2 and CUnit
2.1-3.
2017-01-24 16:29:33 +01:00
Blottiere Paul
8afd8f9c6d fix compilation issue with GHT support 2016-06-16 16:16:59 +02:00
Paul Ramsey
211258b78d Merge pull request #105 from pblottiere/laz
Add lazperf pcpatch
2016-06-14 05:59:51 -07:00
Blottiere Paul
b3764bd5dc Add lazperf pcpatch 2016-06-14 10:22:16 +02:00
Mathieu Brédif
5a0f7944fd new PC_PointN function 2016-03-07 15:57:05 +01:00
Blottiere Paul
1508f405bb fix crash when a child node is empty in pc schema
add unit test in case of an empty child node in schema
2016-03-06 15:48:08 +01:00
Sandro Santilli
e6a8e062a9 Merge pull request #101 from mbredif/patch-2
Enable valgrind checks in Travis, fix reported errors and leaks.
2016-03-05 15:55:06 +01:00
Mathieu Brédif
19a57ee89b Testing compression type of dimensional bytes 2016-03-03 17:35:20 +01:00
Mathieu Brédif
0826a986a0 fix memory leak in test_uncompressed_filter 2016-03-02 23:48:13 +01:00
Sandro Santilli
d345f927c0 Fix leaks in patch unit test 2015-04-21 16:19:57 +02:00
Sandro Santilli
3f3bdab31f Clone stats on dimensional compression
Closes #75
2015-04-21 12:13:17 +02:00
Sandro Santilli
291ccfe57a Fix crash in testcase (due to #75) 2015-04-21 12:01:18 +02:00
Sandro Santilli
44037b743e Leak some leaks from pc_patch unit test 2015-04-21 11:40:21 +02:00
Sandro Santilli
3011d8dace Fix crash on cloning schema with missing dimension name/description
Closes #66
Includes testcase
2015-04-09 16:00:27 +02:00
Sandro Santilli
53b4fa1dcb Add test for pc_schema_clone and plug memory leaks in the test
See #65
2015-04-09 12:24:47 +02:00
Sandro Santilli
11012357fd Support sigbits encoding for 64bit integers
Fixes #61
2015-04-02 16:26:30 +02:00
Sandro Santilli
74a0818f6a Add pc_point_to_double_array function
The function was written by Remi-C and slightly modified by me
to avoid the check for NULL and be const-correct.

Also I've added a unit test for the new library function.
2015-02-12 10:34:17 +01:00
Sandro Santilli
aebb3cb0d3 Add test for #28
Involves registering cu_tester specific error handler
2015-02-09 19:55:59 +01:00