Changes between Version 1 and Version 2 of GSoC/CAPI_PrecisionModel


Ignore:
Timestamp:
Mar 16, 2014, 11:19:28 AM (10 years ago)
Author:
sgillies
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GSoC/CAPI_PrecisionModel

    v1 v2  
    77 * Write test cases.
    88
     9= Requirements for Shapely =
     10
     11Shapely (https://github.com/Toblerity/Shapely) is one of the major Python users of GEOS. I want to let programmers select and use a precision model like this:
     12
     13{{{
     14from shapely.geometry import Point
     15from shapely.precision import fixed_model
     16
     17# make a fixed-precision model.
     18fixed = fixed_model(scale=1.0, offset=(0.0, 0.0))
     19
     20# make a point snapped to a fixed-precision grid.
     21p = Point(0, 0, model=fixed)
     22
     23# make a float-precision point.
     24q = Point(0, 0)
     25}}}
     26
     27The above is a bit of a reversal from what I've previously written about my precision model requirements. A Python API like the one above is going to be very reliable and doesn't leave any geometry objects twisting in the wind when their precision model goes away: they have references to the model which keep it "alive". So, my main requirement for the precision model in the C API is now:
     28
     29== No global state ==
     30
     31There shouldn't be a precision model in the global context. Or if there is, it shouldn't preclude precision models outside the global context.
     32