[gdal-dev] OGR and Postgis : use simpler request to determine the spatial projection

Even Rouault even.rouault at mines-paris.org
Wed Apr 25 10:00:13 EDT 2012


Selon Alexandre Gacon <alexandre.gacon+gdal at gmail.com>:

> Hi,
>
> We use currently GDAL/OGR C++ API to execute complicated requests on a
> postgis database. Apparently, GDAL executes the request also to find the
> spatial reference of the result. Is it possible to bypass this behavior and
> thus to avoid the execution of our request ?

I suppose you are talking about a layer returned by ExecuteSQL() ? Ok, I see
indeed in OGRPGResultLayer::OGRPGResultLayer(...) the request that does the
getsrid(). I agree that it might be indeed not desirable. I don't see an obvious
way to disable that. Well, perhaps if you remove the getsrid() function from
your PostGIS DB, the request might fail at the beginning, but I'm not even sure
(and it might have side effect if you depend on it for other uses)

Would you mind opening a ticket in GDAL Trac about this ? At the very least, the
current code could be moved to an implementation of GetSpatialRef(), so it is
not triggered systematically.

>
> --
> Alexandre Gacon
>




More information about the gdal-dev mailing list