211 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
33445f7d87 Fix pc_patch_uncompressed_from_lazperf
pc_patch_uncompressed_from_lazperf needs to set patch->datasize.
2018-06-11 21:50:35 +02:00
Éric Lemoine
6e7023f80a Add asserts to pc_patch_*_free functions 2018-04-30 10:50:20 +02:00
Éric Lemoine
fa5d7549b1 Remove unnecessary test
pc_patch_free_stats should always be called with a valid patch.
2018-04-30 09:47:55 +02:00
Éric Lemoine
a7c046e013 Rename pc_patch_common_free to pc_patch_free_stats 2018-04-30 09:47:55 +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
d7bb3ed395 Merge pull request #189 from landryb/master
Define inline for all systems, change for Windows to __inline
2017-08-21 17:44:31 +02:00
Vadim Zhukov
97891d35ef Use proper CMake idioms for libxml2 and zlib. 2017-07-27 18:58:05 +03:00
Landry Breuil
c0c0461a2e Define inline for all systems, change for Windows to __inline
Adapted from upstream commit 1eb3da5945bfb753b56e389379795f1408b152e1
2017-07-27 10:42:22 +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
7aefd367be Make hexbytes_from_bytes faster 2017-06-12 08:31:03 +02:00
Éric Lemoine
114b16dacd Use pc_patch_set_schema correctly in ght test 2017-05-11 06:42:08 +02:00
Éric Lemoine
d894f3f28a Use schema->xdim and ydim in ght code 2017-05-11 06:38:33 +02:00
robe2
c4474026ad fix compile error for mingw64 (both 64-bit and 32-bit variants). Issue #171 2017-05-08 17:01:27 -04: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
9d1768e89c Remove declaration of unused function 2017-04-21 08:55:49 +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
0389d77bbc pc_point_get_* == PC_SUCCESS
Make the result of pc_point_get_* more explicit in pc_point_to_geometry_wkb
2017-04-01 10:03:27 +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
Éric Lemoine
692a568101 Merge pull request #141 from elemoine/tabs
Remove tabs within if statements
2017-03-14 09:24:01 +01:00
Blottiere Paul
96de4159f7 Add unit test for pc_patch_filter with lazperf 2017-03-14 08:33:45 +01:00
Blottiere Paul
1254177326 Fix memory leak in pc_patch_filter for lazperf 2017-03-13 18:10:59 +01:00
Éric Lemoine
7be5f7fd67 Fix bug in pc_patch_filter for lazperf
In pc_patch_filter, when nset is 0, the empty patch returned was created with
an invalid maxpoints value in the case of lazperf.
2017-03-10 13:01:56 +01:00
Mathieu Brédif
ceefce2ca1 pc_point_to_geometry_wkb : get_m fix
A typo was introduced while rebasing this PR: `z` values were assigned to both `z` and `m` output points
2017-02-18 16:10:09 +01:00
Éric Lemoine
ac11a17a6f Remove tabs within if statements 2017-02-17 18:12:06 +01:00
Mathieu Brédif
266113d1cb pointlist memory fix, pc_pointlist_from_dimensional memory optimization
pointlist: opaque mem pointer rather than readonly attribute
pc_patch_uncompressed_readonly: transfers data ownership
pc_pointlist_from_dimensional: 1 pcalloc/patch rather than 1/point
2017-02-16 10:47:37 +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
3a04787079 Use __attribute__ ((format (printf, x, y))) (#126)
This commit adds __attribute__ ((format (printf, x, y))) where it makes sense.
2017-01-26 17:45:50 +01:00