[postgis-devel] LWGEOM - XY,XYM,XYZ,XYZM

strk at refractions.net strk at refractions.net
Tue Oct 5 00:53:26 PDT 2004


Ok. The ZM flags are now handled as for internal representation.
If you have 3d or 4d data already within LWGEOM you'll probably
need a dump/restore. Internal storage size is the same, but two
bits gets interpreted differently (old:DD, new:ZM)

	DD 	ZM
2d	00	00
3d	01	10|01
4d	10	11

Old 3d geoms will be considered XYM.
Old 4d geoms will be considered XYZ (and will be messed up in coordinates).

The summary(geometry) function show all present flags for each geometry
and subgeometry (ZMBS).

Creation:

WKT:
	Type(0 0)	<=> TYPE
	Type(0 0 0)	<=> TYPEZ
	Type(0 0 0 0)	<=> TYPEZM
	TypeM(0 0 0)	<=> TYPEM

WKB:
	#define WKBZOFFSET 0x80000000
	#define WKBMOFFSET 0x40000000
	WARNING ! new WKB input is incompatible with previous version
	where 3D flag was current WKBZ and 4d flag was current WKBM
	This means that if you now use an OLD 4d WKB to create
	a NEW geometry it will be interpreted as TYPEM (3dimensions)
	thus corrupting the output.

Questions ?
--strk;

On Mon, Oct 04, 2004 at 11:22:31AM +0200, strk at refractions.net wrote:
> The adt work is on its way. We now have an LWGEOM abstract data type
> with deserialize/serialize/clone/release functionalities.
> 
> The GEOS<->POSTGIS conversion has been fixed to keep geometry structure,
> and the summary() function has a new format for better debugging.
> 
> Before going on with constructurs I think it's important to decide
> what to do with hasM, hasZ flags.
> 
> My idea was to use two flags so to support:
> 	XY 	- hasM=false hasZ=false
> 	XYM	- hasM=true hasZ=false
> 	XYZ	- hasM=false hasZ=true
> 	XYZM	- hasM=true hasZ=true
> 
> This would allow for space saving in the db and better semantic
> specification.
> 
> In order to keep semantic in input/output WKT functions we might 
> add a <GEOM>M type as a custom extension:
> 
> 	POINT(1 2) 	<--> POINT
> 	POINT(1 2 3)	<--> POINTZ
> 	POINT(1 2 3 4)	<--> POINTZM
> 	POINTM(1 2 4)	<--> POINTM
> 
> Comments ?
> 
> --strk;
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list