[postgis-devel] Re: [geos-devel] Proposals for ensuring correct semantics?

strk strk at keybit.net
Fri Dec 12 02:27:26 PST 2003


dblasby wrote:
> strk wrote:
> > About the buffer semantics I don't think geos should behave differently
> > from JTS, we just tried to use it for debugging purposes. I'll change
> > it back to previous behaviour.
> 
> Add a very simple GEOSnop() function that does a postgis->GEOS->postgis 
> convertion.

GEOSnoop committed. SQL create function is in postgis enabler, here
is a copy for quick reference:

CREATE FUNCTION geosnoop(geometry) returns geometry as
        '$libdir/libpostgis.so', 'GEOSnoop'
        LANGUAGE 'C' WITH (isstrict);

GEOSnoop latest bogus runs:

(1)

INPUT:  GEOMETRYCOLLECTION(
		LINESTRING(0 0,1 1),LINESTRING(0 0,1 1),
		LINESTRING(0 0,1 1),LINESTRING(0 0,1 1)
	)

OUTPUT: MULTILINESTRING(
		(0 0,1 1),(0 0,1 1),
		(0 0,1 1),(0 0,0 0) <-- LAST POINT SHOULD BE 1 1 !
	)

(2)

INPUT: 

OUTPUT: MULTILINESTRING(
		(0 0,1 1),(0 0,1 1),
		(0 0,1 1),(0 0,1 1),
		(0 0,10570.75 1.39069240546547e-309) <-- NOT ALLOC'D ?
	)


NOTE that enabling debugging will should you the correct output
     right before GEOSnoop returns. It seems like at GEOSnoop 
     PG_RETURN_POINTER call some memory is released that
     (erroneously?) contained the last part of our geometry.

--strk 



More information about the postgis-devel mailing list