[postgis-devel] Re: [postgis-users] how to identify the_geom that cause : RelateOperation called withLWGEOMCOLLECTION type
Mark Cave-Ayland
mark.cave-ayland at siriusit.co.uk
Tue Dec 9 02:19:56 PST 2008
Kevin Neufeld wrote:
> Mark,
>
> Is it fairly trivial to change the elog in lwgeom_geos.c to your fancy
> errhint so that when the error is thrown the user has an idea where the
> problem occurs?
Yeah sure. In fact, elog() has been deprecated for a very long time and
so in theory we should be using ereport() everywhere.
> The attached patch seems to work, but I got lost when trying to limit
> the output of the LWGEOMCOLLECTION to the first say 128 characters of
> the WKT representation.
Yup, code looks good. The only comment is that you want
PARSER_CHECK_NONE instead of PARSER_CHECK_ALL, otherwise the conversion
will fail on a non-OGC compliant geometry. So in other words, you only
really want PARSER_CHECK_ALL on the input/output functions.
In terms of truncating the output, you need to do this manually - see
http://svn.refractions.net/postgis/trunk/lwgeom/lwgeom_pg.c:pg_parser_errhint
for the code I used, although if it is needed in multiple places it may
be a good idea to make this a separate function available in liblwgeom.
HTH,
Mark.
--
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
More information about the postgis-devel
mailing list