togo 0.1.1__cp38-cp38-musllinux_1_2_x86_64.whl

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.

Potentially problematic release.


This version of togo might be problematic. Click here for more details.

@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Giorgio Salluzzo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.1
2
+ Name: togo
3
+ Version: 0.1.1
4
+ Summary: Lightweight Python bindings for the TG geometry library
5
+ Author-email: Giorgio Salluzzo <giorgio.salluzzo@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/mindflayer/togo
8
+ Project-URL: Source, https://github.com/mindflayer/togo
9
+ Project-URL: Tracker, https://github.com/mindflayer/togo/issues
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: C
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Scientific/Engineering :: GIS
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+
19
+ # ToGo
20
+ Python bindings for [TG](https://github.com/tidwall/tg)
21
+ (Geometry library for C - Fast point-in-polygon)
22
+
23
+ ToGo is a high-performance Python library for computational geometry, providing a Cython wrapper around the above-mentioned C library.
24
+
25
+ The main goal is to offer a Pythonic, object-oriented, fast and memory-efficient library for geometric operations, including spatial predicates, format conversions, and spatial indexing.
26
+
27
+ While ToGo's API interfaces are still a work in progress, the underling C library is stable and well-tested.
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ pip install togo
33
+ ```
34
+
35
+ ## Features
36
+
37
+ - Fast and efficient geometric operations
38
+ - Support for standard geometry types: Point, Line, Ring, Polygon, and their multi-variants
39
+ - Geometric predicates: contains, intersects, covers, touches, etc.
40
+ - Format conversion between WKT, GeoJSON, WKB, and HEX
41
+ - Spatial indexing for accelerated queries
42
+ - Memory-efficient C implementation with Python-friendly interface
43
+
44
+ ## Basic Usage
45
+
46
+ ```python
47
+ from togo import Geometry, Point, Ring, Poly
48
+
49
+ # Create a geometry from GeoJSON
50
+ geom = Geometry('{"type":"Point","coordinates":[1.0,2.0]}')
51
+
52
+ # Create a point
53
+ point = Point(1.0, 2.0)
54
+
55
+ # Create a polygon
56
+ ring = Ring([(0,0), (10,0), (10,10), (0,10), (0,0)])
57
+ polygon = Poly(ring)
58
+
59
+ # Convert to various formats
60
+ wkt = polygon.as_geometry().to_wkt()
61
+ geojson = polygon.as_geometry().to_geojson()
62
+
63
+ # Perform spatial predicates
64
+ point_geom = point.as_geometry()
65
+ contains = polygon.as_geometry().contains(point_geom)
66
+ ```
67
+
68
+ ## Core Classes
69
+
70
+ ### Geometry
71
+
72
+ The base class that wraps tg_geom structures and provides core operations:
73
+
74
+ ```python
75
+ # Create from various formats
76
+ g1 = Geometry('POINT(1 2)', fmt='wkt')
77
+ g2 = Geometry('{"type":"Point","coordinates":[1,2]}', fmt='geojson')
78
+
79
+ # Geometric predicates
80
+ g1.intersects(g2)
81
+ g1.contains(g2)
82
+ g1.within(g2)
83
+
84
+ # Format conversion
85
+ g1.to_wkt()
86
+ g1.to_geojson()
87
+ ```
88
+
89
+ ### Point, Line, Ring, Poly
90
+
91
+ Building blocks for constructing geometries:
92
+
93
+ ```python
94
+ # Create a point
95
+ p = Point(1.0, 2.0)
96
+
97
+ # Create a line
98
+ line = Line([(0,0), (1,1), (2,2)])
99
+
100
+ # Create a ring (closed line)
101
+ ring = Ring([(0,0), (10,0), (10,10), (0,10), (0,0)])
102
+
103
+ # Create a polygon with holes
104
+ exterior = Ring([(0,0), (10,0), (10,10), (0,10), (0,0)])
105
+ hole = Ring([(2,2), (8,2), (8,8), (2,8), (2,2)])
106
+ poly = Poly(exterior, [hole])
107
+ ```
108
+
109
+ ### MultiGeometries
110
+
111
+ Creating collections of geometries:
112
+
113
+ ```python
114
+ # Create a MultiPoint
115
+ multi_point = Geometry.from_multipoint([(0,0), (1,1), Point(2,2)])
116
+
117
+ # Create a MultiLineString
118
+ multi_line = Geometry.from_multilinestring([
119
+ [(0,0), (1,1)],
120
+ Line([(2,2), (3,3)])
121
+ ])
122
+
123
+ # Create a MultiPolygon
124
+ poly1 = Poly(Ring([(0,0), (1,0), (1,1), (0,1), (0,0)]))
125
+ poly2 = Poly(Ring([(2,2), (3,2), (3,3), (2,3), (2,2)]))
126
+ multi_poly = Geometry.from_multipolygon([poly1, poly2])
127
+ ```
128
+
129
+ ## Polygon Indexing
130
+
131
+ Togo supports different polygon indexing strategies for optimized spatial operations:
132
+
133
+ ```python
134
+ from togo import TGIndex, set_polygon_indexing_mode
135
+
136
+ # Set the indexing mode
137
+ set_polygon_indexing_mode(TGIndex.NATURAL) # or NONE, YSTRIPES
138
+ ```
139
+
140
+ ## Performance Considerations
141
+
142
+ - Togo is optimized for speed and memory efficiency
143
+ - For large datasets, proper indexing can significantly improve performance
144
+ - Creating geometries with the appropriate format avoids unnecessary conversions
145
+
146
+ Soon there will be a full API documentation, for now please refer to the test suite for more usage examples.
@@ -0,0 +1,6 @@
1
+ togo.cpython-38-x86_64-linux-gnu.so,sha256=gy8NG5S-M-AuUueHVSRh7OkHPSuDjiakSLlxD7OlU68,2440400
2
+ togo-0.1.1.dist-info/LICENSE,sha256=OfTFHFMDSt9X89g-BWUVis-GuTPWAdjplg2z9d2dBCw,1073
3
+ togo-0.1.1.dist-info/METADATA,sha256=n95sQj4JthTc3N48uAuLUStU48rChvQOpiLRb_M8kBg,4089
4
+ togo-0.1.1.dist-info/WHEEL,sha256=AtKzrIIwO6LyEQPNa-CKogjoLSeXFnST8-hqmpwwZQA,110
5
+ togo-0.1.1.dist-info/top_level.txt,sha256=bldd6tssR8THqoSDFauQQdh_pg79DMHBDhiNKgS4ttM,5
6
+ togo-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.3.2)
3
+ Root-Is-Purelib: false
4
+ Tag: cp38-cp38-musllinux_1_2_x86_64
5
+
@@ -0,0 +1 @@
1
+ togo
Binary file