-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEA]: Allow users to define precision of coordinates #1076
Comments
How does geopandas handle precision? |
geopandas might support the changing of precision through Shapely's I can do some testing later to check if geopandas overrides and provides a import geopandas as gpd
from shapely.geometry import Point
point = Point(0.9, 0.9)
set_precision(point, 1.0)
gdf = gpd.GeoDataFrame(geometry=[point])
type(gdf.loc[0, 'geometry']) |
Hmmm, that seems to snap values to a grid of the specified resolution. It doesn't say anything about storing them in lower precision. It provides no way to specify "32-bit", for example, it only mentions that |
libGEOS provides PrecisionModel. https://libgeos.org/doxygen/classgeos_1_1geom_1_1PrecisionModel.html#details Seems related to the above, but has explicit modes for fp32 and fp64. |
Yes you're right - I just tested: from shapely.geometry import Point
point = Point(0.9, 0.9)
point = set_precision(point, 1.0)
point.coords._coords.dtype
>>> float64 |
So, this looks like something not offered by our CPU Python counterparts |
However we decide to support this, at the header-only C++ API level it should be trivial, because it is a template library. Depending on whether or not the column-based API already dispatches to both types, supporting both fp32 and fp64 everywhere may double compile time. We already test everything in both single and double precision on the C++ side. |
Is this a new feature, an improvement, or a change to existing functionality?
New Feature
How would you describe the priority of this feature request
Medium
Please provide a clear description of problem you would like to solve.
Currently coordinates in cuSpatial are FP64 but many users do not require this level of precision.
We can see as much as 2x to 64x speedups dropping to FP32 depending on the hardware used to run cuSpatial. To support this, it would be nice to see a way to define coordinates, either on a global scale or on a per-geoseries scale.
Some potential implementations:
Or
On a geoseries/dataframe using
GeometryDType
and recording coordinatedtype
in there, along side with other geoseries specific info (iecrs
if we go that route).Describe any alternatives you have considered
N/A
Additional context
No response
The text was updated successfully, but these errors were encountered: