1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

Fixed #21547 -- Updated GeoDjango tutorial with PostGIS 2 output

Thanks awilliams at cironline.org for the report.
This commit is contained in:
Claude Paroz 2014-01-11 17:58:29 +01:00 committed by Anssi Kääriäinen
parent 8116726173
commit bd5a763bc2

View File

@ -289,13 +289,18 @@ This command should produce the following output:
"subregion" integer NOT NULL, "subregion" integer NOT NULL,
"lon" double precision NOT NULL, "lon" double precision NOT NULL,
"lat" double precision NOT NULL "lat" double precision NOT NULL
"mpoly" geometry(MULTIPOLYGON,4326) NOT NULL
) )
; ;
SELECT AddGeometryColumn('world_worldborder', 'mpoly', 4326, 'MULTIPOLYGON', 2); CREATE INDEX "world_worldborder_mpoly_id" ON "world_worldborder" USING GIST ( "mpoly" );
ALTER TABLE "world_worldborder" ALTER "mpoly" SET NOT NULL;
CREATE INDEX "world_worldborder_mpoly_id" ON "world_worldborder" USING GIST ( "mpoly" GIST_GEOMETRY_OPS );
COMMIT; COMMIT;
.. note::
With PostGIS < 2.0, the output is slightly different. The ``mpoly`` geometry
column is added through a separate ``SELECT AddGeometryColumn(...)``
statement.
If this looks correct, run :djadmin:`migrate` to create this table in the database:: If this looks correct, run :djadmin:`migrate` to create this table in the database::
$ python manage.py migrate $ python manage.py migrate