[postgis-users] geos result sets

Wood Brent pcreso at pcreso.com
Thu Feb 26 09:43:50 PST 2004


--- James S reid <james.reid at ed.ac.uk> wrote:
> yeah - was kinda thinking along those lines ; ) interesting that ESRIs
> solution is not exact - does tat vary by patform and product I wonder?

I know one commercial GIS (not ESRI) which stores all coords in an internal 16
or 32 bit format. When the map is first defined, you choose which (16 or 32).
The system determines an arbitrary grid covering the map extent to get the full
available precision for each map. Data is then rounded to the nearest grid
point when loaded. It is reprojected on the fly, so projection in one sense
applies to the displayed output, not the internal representation of the data.
(this makes datum shifts & reprojection on the fly to overlay different
projections very effective).

While data is stored to a very high precision, it does mean that the same (for
example) lat/long coord pair has fractionally different values when stored in
maps of different extents, as the grids are not spatially synchronous. 

A similar thing happens when the same point is stored in two projections in any
system. They are likely to be slightly different at the limits of the system
precision. so 0.99999999999999999999 != 1.0 mathematically, but for spatial
queries, many systems will assume they are equivalent. 

Computationally a 16 bit 1.0 is not necessarily the same as a 32bit 1.0, as the
extra precision of the 32 bit number is a known for one and a null for the
other. We can assume they are the same, but cannot know it.

Is it likely that GEOS, being mathematically correct, will produce different
answers due to the effect of such tolerances?

eg: calclate the mid point of a simple line defined by two points. Add that
point to a copy of the line. Due to precision constraints, unless the line is
vertical or horizontal, if you draw both lines together, you will generally
have a triangle, (very narrow, but still a triangle).

So at the precision limits, fuzziness is always going to be there, the question
is how much do we allow for this, if at all?



More information about the postgis-users mailing list