[postgis-users] Geographies, geometries, international date line

Paul Ramsey pramsey at opengeo.org
Thu Oct 11 08:10:15 PDT 2012


On Wed, Oct 10, 2012 at 1:27 PM, Maxime Poulin <mpoulin at expedia.com> wrote:
> I was expecting the geometry version to be much faster, but I actually find
> that performance is somewhat the same. Both queries use the special index,
> perform the index scan and so on.  So how can this be possible, how can I be
> sure that geometries are actually faster than geographies ?

Just from a design and computation point of view, you'll have to take
my word that geometry should always be faster than geography. That
said, for sufficiently simple inputs there's no reason both types
shouldn't be so fast that measuring the differences becomes an
error-prone exercise.

> The main issue with these two tests is regarding polygons crossing the
> international date line. So suppose I have a polygon that maps the Fiji
> islands. That polygon will cross the international date line. The geography

It sounds like you have a legitimately global database, so I'd
recommend sticking with the geography type rather than going with
geometry and trying to chop things up. Your application will be much
simpler without a whole bunch of layers of code chopping and joining
things on demand to fit the cartesian model.

> I have many quite precise and edgy questions regarding good practices and
> performance tuning for PostGIS.  I would like to provide samples and discuss
> around them, see what I / we can find. Is this list the right place to ask ?

No better place for free! If you want guaranteed support levels
consider plunking down some clams for an OpenGeo (or other) support
agreement.

P.



More information about the postgis-users mailing list