[postgis-users] AddGeometryColumn BOX3D
Jan Saalbach
fire at dubmosphere.de
Tue Oct 19 05:36:29 PDT 2010
Thank you Mike, you were absolutely right.
Now I am running into yet another problem with the box3d objects.
This command works fine:
INSERT INTO metadaten(box)
VALUES('BOX3D(3435970 5962930 -16.45,3439110 5967300 -3.28)'::BOX3D)
WHERE id=111;
When I try to do the same thing from within a python-script I get a "no
binary input-function available for type box3d" error. The original
error message is below this text, I took the liberty of translating it
into english.
I do not know whether it is the python-postgresql connector or a
database issue. To me it looks like the python connector can not handle
the box3d data-type.
DRIVER: postgresql.driver.pq3.Driver
http://pypi.python.org/pypi/py-postgresql/1.0.1
What I need to do is compute the box3d for about 150 datasets (point3d)
and save the boxes in a metadata table for fast access for later. Any
ideas how I could avoid doing this manually? It is just 2 commands, the
"get box" and the "save box" command but over and over again...
Regards
Jan
postgresql.exceptions.UndefinedFunctionError: keine binäre
Eingabefunktion verfügbar für Typ box3d
CODE: 42883
LOCATION: File 'lsyscache.c', line 2353, in getTypeBinaryInputInfo
from SERVER
RESULT:
type: SingleXactCopy
parameters: ('BOX3D(3421250 5968415 -22.96,3427355 5971725 -15.15)', 1)
STATEMENT: [prepared]
sql_parameter_types: ['public.box3d', 'INTEGER']
statement_id: py:0xb6eed3ac
string: Update metadaten SET box=$1::BOX3D WHERE id=$2
CONNECTION: [closed]
On 18.10.2010 17:14, Mike Toews wrote:
> Hi Jan,
>
> box3d is not a geometry, but it is it's very own type (along with
> box2d). If you have pgAdminIII, you can browse these types (you may need
> to enable visibility of "types" in the options), or if you use psql then
> the command "\dT" will show all types.
>
> Since it isn't a geometry, you can directly create it, e.g.:
>
> create table foo(
> id serial primary key,
> box box3d
> );
>
> insert into foo(box) values('BOX3D(0 0 0, 10 10 10)'::box3d);
>
> -Mike
More information about the postgis-users
mailing list