gpt4 book ai didi

django - 安装索引失败(Geodjango相关)

转载 作者:行者123 更新时间:2023-12-04 17:11:09 26 4
gpt4 key购买 nike

我正在使用 geoDjango .我已经安装了以下来自 Gdal 的软件包, proj1.4 , geos3.3.5Postgis2.0.1 .我是 ubuntu 用户。当我跑 syncdb之后我收到以下错误。我错过了什么吗?谢谢

Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Failed to install index for cities.City model: operator class "gist_geometry_ops" does not exist for access method "gist"

Failed to install index for cities.District model: operator class "gist_geometry_ops" does not exist for access method "gist"

Failed to install index for cities.PostalCodeCA model: operator class "gist_geometry_ops" does not exist for access method "gist"

Installed 0 object(s) from 0 fixture(s)

最佳答案

也许我有点晚了,但我解决了这个问题(Django 1.4.x、Postgis 2.0.1 和 PostgreSQL 9.2),在 template_postgis 数据库中创建了一个运算符类,如下所示:

CREATE OPERATOR CLASS gist_geometry_ops
FOR TYPE geometry USING GIST AS
STORAGE box2df,
OPERATOR 1 << ,
OPERATOR 2 &< ,
OPERATOR 3 && ,
OPERATOR 4 &> ,
OPERATOR 5 >> ,
OPERATOR 6 ~= ,
OPERATOR 7 ~ ,
OPERATOR 8 @ ,
OPERATOR 9 &<| ,
OPERATOR 10 <<| ,
OPERATOR 11 |>> ,
OPERATOR 12 |&> ,

OPERATOR 13 <-> FOR ORDER BY pg_catalog.float_ops,
OPERATOR 14 <#> FOR ORDER BY pg_catalog.float_ops,
FUNCTION 8 geometry_gist_distance_2d (internal, geometry, int4),

FUNCTION 1 geometry_gist_consistent_2d (internal, geometry, int4),
FUNCTION 2 geometry_gist_union_2d (bytea, internal),
FUNCTION 3 geometry_gist_compress_2d (internal),
FUNCTION 4 geometry_gist_decompress_2d (internal),
FUNCTION 5 geometry_gist_penalty_2d (internal, internal, internal),
FUNCTION 6 geometry_gist_picksplit_2d (internal, internal),
FUNCTION 7 geometry_gist_same_2d (geom1 geometry, geom2 geometry, internal);

这是从这个链接中提取的 http://trac.osgeo.org/postgis/ticket/1287#comment:8

关于django - 安装索引失败(Geodjango相关),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13119040/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com