fastgpx 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastgpx-0.2.0 → fastgpx-0.2.2}/CMakeLists.txt +8 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/Development.md +4 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/PKG-INFO +14 -1
- {fastgpx-0.2.0 → fastgpx-0.2.2}/README.md +13 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/pyproject.toml +1 -1
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/CMakeLists.txt +12 -4
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/polyline.cpp +8 -8
- {fastgpx-0.2.0 → fastgpx-0.2.2}/.clang-format +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/.gitignore +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/.python-version +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/CMakeSettings.json +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/GPX.md +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/LICENSE.md +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/benchmarks/benchmark_gpx.py +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/benchmarks/benchmark_polyline.py +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/benchmarks/gpx_parse.md +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/catch2.py +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/coverage.bat +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/datetime.md +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/docs/Makefile +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/docs/make.bat +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/docs/source/api.rst +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/docs/source/conf.py +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/docs/source/index.rst +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/docs/source/overview.rst +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/profiling/profile_polyline.py +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/pytest.ini +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/app.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/expected_gpx_data.json +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/datetime.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/datetime.hpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/datetime_test.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/errors.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/errors.hpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/errors_test.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/fastgpx.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/fastgpx.hpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/fastgpx_test.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/filesystem.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/filesystem.hpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/filesystem_test.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/geom.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/geom.hpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/geom_test.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/polyline.hpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/test_data.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/test_data.hpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/test_data.json +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/fastgpx/test_data_test.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/python_fastgpx.cpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/cpp/python_utc_chrono.hpp +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/fastgpx/__init__.py +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/fastgpx/__init__.pyi +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/fastgpx/fastgpx/__init__.pyi +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/fastgpx/fastgpx/geo.pyi +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/fastgpx/fastgpx/polyline.pyi +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/src/fastgpx/py.typed +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/tests/test_bounds.py +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/tests/test_fastgpx.py +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/tests/test_polyline.py +0 -0
- {fastgpx-0.2.0 → fastgpx-0.2.2}/uv.lock +0 -0
@@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 3.30.2)
|
|
2
2
|
|
3
3
|
project(fastgpx)
|
4
4
|
|
5
|
+
if(NOT DEFINED FASTGPX_WARNINGS_AS_ERRORS)
|
6
|
+
set(FASTGPX_WARNINGS_AS_ERRORS "$ENV{FASTGPX_WARNINGS_AS_ERRORS}")
|
7
|
+
endif()
|
8
|
+
|
9
|
+
option(FASTGPX_WARNINGS_AS_ERRORS "Treat C++ warnings as errors" ${FASTGPX_WARNINGS_AS_ERRORS})
|
10
|
+
|
11
|
+
message(STATUS "FASTGPX_WARNINGS_AS_ERRORS: ${FASTGPX_WARNINGS_AS_ERRORS}")
|
12
|
+
|
5
13
|
# > The CTest module defines a BUILD_TESTING cache variable which defaults to true.
|
6
14
|
# > It is used to decide whether the module calls enable_testing() or not, so the
|
7
15
|
# > project does not have to make its own explicit call to enable_testing(). The
|
@@ -150,3 +150,7 @@ build\src\cpp\RelWithDebInfo\fastgpx_test.exe
|
|
150
150
|
```sh
|
151
151
|
build\src\cpp\RelWithDebInfo\fastgpx_test.exe [!benchmark]
|
152
152
|
```
|
153
|
+
|
154
|
+
## VSCode / CMake
|
155
|
+
|
156
|
+
Building directly with CMake require pybind11 installed. Currently this is defined as a build tool dependency in `pyproject.toml` and will therefore have to be manually installed into the `.venv` using `pip install pybind11`.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fastgpx
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.2
|
4
4
|
Summary: An experimental Python library for parsing GPX files fast.
|
5
5
|
Keywords: gpx,parser,fast
|
6
6
|
Author: Thomas Thomassen
|
@@ -45,6 +45,19 @@ for track in gpx.tracks:
|
|
45
45
|
|
46
46
|
[Documentation](https://thomthom.github.io/fastgpx/)
|
47
47
|
|
48
|
+
## Requirements
|
49
|
+
|
50
|
+
* Python 3.11+ (Tested with 3.11, 3.12)
|
51
|
+
* C++23 Compiler
|
52
|
+
|
53
|
+
### Windows
|
54
|
+
|
55
|
+
* Tested with MSVC 17.12.4+ and Clang-cl 19+.
|
56
|
+
|
57
|
+
### Linux (Tested on Ubuntu)
|
58
|
+
|
59
|
+
* C++23 compatible runtime (GCC libstdc++ 14+ or Clang libc++ 18.1+)
|
60
|
+
|
48
61
|
## GPX/XML Performance (Background)
|
49
62
|
|
50
63
|
`gpxpy` appear to be the most popular GPX library for Python.
|
@@ -28,6 +28,19 @@ for track in gpx.tracks:
|
|
28
28
|
|
29
29
|
[Documentation](https://thomthom.github.io/fastgpx/)
|
30
30
|
|
31
|
+
## Requirements
|
32
|
+
|
33
|
+
* Python 3.11+ (Tested with 3.11, 3.12)
|
34
|
+
* C++23 Compiler
|
35
|
+
|
36
|
+
### Windows
|
37
|
+
|
38
|
+
* Tested with MSVC 17.12.4+ and Clang-cl 19+.
|
39
|
+
|
40
|
+
### Linux (Tested on Ubuntu)
|
41
|
+
|
42
|
+
* C++23 compatible runtime (GCC libstdc++ 14+ or Clang libc++ 18.1+)
|
43
|
+
|
31
44
|
## GPX/XML Performance (Background)
|
32
45
|
|
33
46
|
`gpxpy` appear to be the most popular GPX library for Python.
|
@@ -40,12 +40,16 @@ function(set_common_properties TARGET)
|
|
40
40
|
# Elevate warning level.
|
41
41
|
# Ignore unknown pragmas (mac).
|
42
42
|
target_compile_options(${TARGET} PRIVATE
|
43
|
-
/W4
|
43
|
+
/W4
|
44
44
|
/wd4068
|
45
45
|
)
|
46
|
+
if(FASTGPX_WARNINGS_AS_ERRORS)
|
47
|
+
target_compile_options(${TARGET} PRIVATE /WX)
|
48
|
+
endif()
|
46
49
|
|
47
50
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
48
|
-
# Clang pretending to be MSVC – add Clang-specific warnings
|
51
|
+
# Clang pretending to be MSVC – add Clang-specific warnings what /W4 does
|
52
|
+
# not cover.
|
49
53
|
target_compile_options(${TARGET} PRIVATE
|
50
54
|
-Wshadow -Wconversion
|
51
55
|
-Wno-unknown-pragmas
|
@@ -59,14 +63,18 @@ function(set_common_properties TARGET)
|
|
59
63
|
# Ensure MSVC report up to date version for __cplusplus macro.
|
60
64
|
# https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160
|
61
65
|
target_compile_options(${TARGET} PRIVATE /Zc:__cplusplus)
|
66
|
+
|
62
67
|
else()
|
63
68
|
# Elevate warning level.
|
64
69
|
# Ignore unknown pragmas (win).
|
65
70
|
target_compile_options(${TARGET} PRIVATE
|
66
|
-
-Wall -Wextra -pedantic
|
71
|
+
-Wall -Wextra -pedantic
|
67
72
|
-Wshadow -Wconversion
|
68
73
|
-Wno-unknown-pragmas
|
69
74
|
)
|
75
|
+
if(FASTGPX_WARNINGS_AS_ERRORS)
|
76
|
+
target_compile_options(${TARGET} PRIVATE -Werror)
|
77
|
+
endif()
|
70
78
|
endif()
|
71
79
|
endfunction()
|
72
80
|
|
@@ -97,7 +105,7 @@ set_target_properties(fastgpx-static PROPERTIES
|
|
97
105
|
|
98
106
|
# fastgpx python module
|
99
107
|
|
100
|
-
find_package(Python3 3.11
|
108
|
+
find_package(Python3 3.11 REQUIRED COMPONENTS Interpreter Development)
|
101
109
|
|
102
110
|
set(PYBIND11_NEWPYTHON ON)
|
103
111
|
find_package(pybind11 CONFIG REQUIRED)
|
@@ -12,7 +12,7 @@ namespace polyline {
|
|
12
12
|
std::string encode(std::span<const LatLong> locations, Precision precision)
|
13
13
|
{
|
14
14
|
const int factor = (precision == Precision::Six) ? 1'000'000 : 100'000;
|
15
|
-
std::string
|
15
|
+
std::string encoded_polyline;
|
16
16
|
int last_lat = 0;
|
17
17
|
int last_lng = 0;
|
18
18
|
|
@@ -25,25 +25,25 @@ std::string encode(std::span<const LatLong> locations, Precision precision)
|
|
25
25
|
const int delta_lng = lng - last_lng;
|
26
26
|
|
27
27
|
auto encode_value = [](int value) -> std::string {
|
28
|
-
std::string
|
28
|
+
std::string encoded_latlong;
|
29
29
|
value = (value < 0) ? ~(value << 1) : (value << 1);
|
30
30
|
while (value >= 0x20)
|
31
31
|
{
|
32
|
-
|
32
|
+
encoded_latlong += static_cast<char>((0x20 | (value & 0x1f)) + 63);
|
33
33
|
value >>= 5;
|
34
34
|
}
|
35
|
-
|
36
|
-
return
|
35
|
+
encoded_latlong += static_cast<char>(value + 63);
|
36
|
+
return encoded_latlong;
|
37
37
|
};
|
38
38
|
|
39
|
-
|
40
|
-
|
39
|
+
encoded_polyline += encode_value(delta_lat);
|
40
|
+
encoded_polyline += encode_value(delta_lng);
|
41
41
|
|
42
42
|
last_lat = lat;
|
43
43
|
last_lng = lng;
|
44
44
|
}
|
45
45
|
|
46
|
-
return
|
46
|
+
return encoded_polyline;
|
47
47
|
}
|
48
48
|
|
49
49
|
std::vector<LatLong> decode(std::string_view encoded, Precision precision)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|