[postgis-users] Problem with PostGIS 1.0.0 RC1
Mark Cave-Ayland
m.cave-ayland at webbased.co.uk
Sat Jan 22 06:11:38 PST 2005
> -----Original Message-----
> From: strk at refractions.net [mailto:strk at refractions.net]
> Sent: 22 January 2005 13:25
> To: Mark Cave-Ayland
> Cc: 'PostGIS Users Discussion'
> Subject: Re: [postgis-users] Problem with PostGIS 1.0.0 RC1
(cut)
> Since postgis 1.0 GeomFromWKB wants a bytea.
> If you want to input a geometry using an hex-ewkb you can use
> canonical input, as in:
>
> select
> '010300000001000000050000003A6484B530A012418C2BD617CF7C48413A6
> 484B520A112418C2BD617CF7C48413A6484B520A112418C2BD617ED7C48413
> A6484B530A012418C2BD617ED7C48413A6484B530A012418C2BD617CF7C484
> 1'::geometry;
>
> Maybe we should revert GeomFromWKB back to accept 'GEOMETRY',
> as it was before (cheating). What do you think ?
Hi strk,
I see. I agree with you that GeometryFromWKB() should accept a binary
argument, but I can also see how inputting a text string could be useful.
Could we do this using the type system? For example, could we create a new
type called postgis_binary and then change GeomFromWKB to accept
postgis_binary instead of bytea? We then write two implicit casts: a bytea
to postgis_binary cast and a text to postgis_binary cast. In the case of the
bytea to postgis_binary cast, we simply return the binary data unaltered.
For the text to postgis_binary cast, we parse the hex string into binary and
return that. Hopefully this would allow GeometryFromWKB() to work with both
bytea and hex string data.... What do you think?
Kind regards,
Mark.
------------------------
WebBased Ltd
South West Technology Centre
Tamar Science Park
Plymouth
PL6 8BT
T: +44 (0)1752 791021
F: +44 (0)1752 791023
W: http://www.webbased.co.uk
More information about the postgis-users
mailing list