---
title: "GeoDjango"
version: 2.1
locale: zh-hans
source: https://docs.djangoproject.com/zh-hans/2.1/ref/contrib/gis/
canonical: https://djangodocs.dev/zh-hans/2.1/ref/contrib/gis/
---
# GeoDjango

GeoDjango intends to be a world-class geographic Web framework. Its goal is to
make it as easy as possible to build GIS Web applications and harness the power
of spatially enabled data.

- [GeoDjango Tutorial](/zh-hans/2.1/ref/contrib/gis/tutorial/)

  - [Introduction](/zh-hans/2.1/ref/contrib/gis/tutorial/#introduction)
  - [Setting Up](/zh-hans/2.1/ref/contrib/gis/tutorial/#setting-up)
  - [Geographic Data](/zh-hans/2.1/ref/contrib/gis/tutorial/#geographic-data)
  - [Geographic Models](/zh-hans/2.1/ref/contrib/gis/tutorial/#geographic-models)
  - [Importing Spatial Data](/zh-hans/2.1/ref/contrib/gis/tutorial/#importing-spatial-data)
  - [Spatial Queries](/zh-hans/2.1/ref/contrib/gis/tutorial/#spatial-queries)
  - [Putting your data on the map](/zh-hans/2.1/ref/contrib/gis/tutorial/#putting-your-data-on-the-map)
- [GeoDjango Installation](/zh-hans/2.1/ref/contrib/gis/install/)

  - [Overview](/zh-hans/2.1/ref/contrib/gis/install/#overview)
  - [Requirements](/zh-hans/2.1/ref/contrib/gis/install/#requirements)
  - [Installation](/zh-hans/2.1/ref/contrib/gis/install/#installation)
  - [Troubleshooting](/zh-hans/2.1/ref/contrib/gis/install/#troubleshooting)
  - [Platform-specific instructions](/zh-hans/2.1/ref/contrib/gis/install/#platform-specific-instructions)
- [GeoDjango Model API](/zh-hans/2.1/ref/contrib/gis/model-api/)

  - [Spatial Field Types](/zh-hans/2.1/ref/contrib/gis/model-api/#spatial-field-types)
  - [Spatial Field Options](/zh-hans/2.1/ref/contrib/gis/model-api/#spatial-field-options)
  - [Geometry Field Options](/zh-hans/2.1/ref/contrib/gis/model-api/#geometry-field-options)
- [GeoDjango Database API](/zh-hans/2.1/ref/contrib/gis/db-api/)

  - [Spatial Backends](/zh-hans/2.1/ref/contrib/gis/db-api/#module-django.contrib.gis.db.backends)
  - [Creating and Saving Models with Geometry Fields](/zh-hans/2.1/ref/contrib/gis/db-api/#creating-and-saving-models-with-geometry-fields)
  - [Creating and Saving Models with Raster Fields](/zh-hans/2.1/ref/contrib/gis/db-api/#creating-and-saving-models-with-raster-fields)
  - [Spatial Lookups](/zh-hans/2.1/ref/contrib/gis/db-api/#spatial-lookups)
  - [Distance Queries](/zh-hans/2.1/ref/contrib/gis/db-api/#distance-queries)
  - [Compatibility Tables](/zh-hans/2.1/ref/contrib/gis/db-api/#compatibility-tables)
- [GeoDjango Forms API](/zh-hans/2.1/ref/contrib/gis/forms-api/)

  - [Field arguments](/zh-hans/2.1/ref/contrib/gis/forms-api/#field-arguments)
  - [Form field classes](/zh-hans/2.1/ref/contrib/gis/forms-api/#form-field-classes)
  - [Form widgets](/zh-hans/2.1/ref/contrib/gis/forms-api/#module-django.contrib.gis.forms.widgets)
- [GIS QuerySet API Reference](/zh-hans/2.1/ref/contrib/gis/geoquerysets/)

  - [Spatial Lookups](/zh-hans/2.1/ref/contrib/gis/geoquerysets/#spatial-lookups)
  - [Distance Lookups](/zh-hans/2.1/ref/contrib/gis/geoquerysets/#distance-lookups)
- [Geographic Database Functions](/zh-hans/2.1/ref/contrib/gis/functions/)

  - [`Area`](/zh-hans/2.1/ref/contrib/gis/functions/#area)
  - [`AsGeoJSON`](/zh-hans/2.1/ref/contrib/gis/functions/#asgeojson)
  - [`AsGML`](/zh-hans/2.1/ref/contrib/gis/functions/#asgml)
  - [`AsKML`](/zh-hans/2.1/ref/contrib/gis/functions/#askml)
  - [`AsSVG`](/zh-hans/2.1/ref/contrib/gis/functions/#assvg)
  - [`Azimuth`](/zh-hans/2.1/ref/contrib/gis/functions/#azimuth)
  - [`BoundingCircle`](/zh-hans/2.1/ref/contrib/gis/functions/#boundingcircle)
  - [`Centroid`](/zh-hans/2.1/ref/contrib/gis/functions/#centroid)
  - [`Difference`](/zh-hans/2.1/ref/contrib/gis/functions/#difference)
  - [`Distance`](/zh-hans/2.1/ref/contrib/gis/functions/#distance)
  - [`Envelope`](/zh-hans/2.1/ref/contrib/gis/functions/#envelope)
  - [`ForcePolygonCW`](/zh-hans/2.1/ref/contrib/gis/functions/#forcepolygoncw)
  - [`ForceRHR`](/zh-hans/2.1/ref/contrib/gis/functions/#forcerhr)
  - [`GeoHash`](/zh-hans/2.1/ref/contrib/gis/functions/#geohash)
  - [`Intersection`](/zh-hans/2.1/ref/contrib/gis/functions/#intersection)
  - [`IsValid`](/zh-hans/2.1/ref/contrib/gis/functions/#isvalid)
  - [`Length`](/zh-hans/2.1/ref/contrib/gis/functions/#length)
  - [`LineLocatePoint`](/zh-hans/2.1/ref/contrib/gis/functions/#linelocatepoint)
  - [`MakeValid`](/zh-hans/2.1/ref/contrib/gis/functions/#makevalid)
  - [`MemSize`](/zh-hans/2.1/ref/contrib/gis/functions/#memsize)
  - [`NumGeometries`](/zh-hans/2.1/ref/contrib/gis/functions/#numgeometries)
  - [`NumPoints`](/zh-hans/2.1/ref/contrib/gis/functions/#numpoints)
  - [`Perimeter`](/zh-hans/2.1/ref/contrib/gis/functions/#perimeter)
  - [`PointOnSurface`](/zh-hans/2.1/ref/contrib/gis/functions/#pointonsurface)
  - [`Reverse`](/zh-hans/2.1/ref/contrib/gis/functions/#reverse)
  - [`Scale`](/zh-hans/2.1/ref/contrib/gis/functions/#scale)
  - [`SnapToGrid`](/zh-hans/2.1/ref/contrib/gis/functions/#snaptogrid)
  - [`SymDifference`](/zh-hans/2.1/ref/contrib/gis/functions/#symdifference)
  - [`Transform`](/zh-hans/2.1/ref/contrib/gis/functions/#transform)
  - [`Translate`](/zh-hans/2.1/ref/contrib/gis/functions/#translate)
  - [`Union`](/zh-hans/2.1/ref/contrib/gis/functions/#union)
- [Measurement Objects](/zh-hans/2.1/ref/contrib/gis/measure/)

  - [Example](/zh-hans/2.1/ref/contrib/gis/measure/#example)
  - [Supported units](/zh-hans/2.1/ref/contrib/gis/measure/#supported-units)
  - [Measurement API](/zh-hans/2.1/ref/contrib/gis/measure/#measurement-api)
- [GEOS API](/zh-hans/2.1/ref/contrib/gis/geos/)

  - [Background](/zh-hans/2.1/ref/contrib/gis/geos/#background)
  - [Tutorial](/zh-hans/2.1/ref/contrib/gis/geos/#tutorial)
  - [Geometry Objects](/zh-hans/2.1/ref/contrib/gis/geos/#geometry-objects)
  - [Geometry Collections](/zh-hans/2.1/ref/contrib/gis/geos/#geometry-collections)
  - [Prepared Geometries](/zh-hans/2.1/ref/contrib/gis/geos/#prepared-geometries)
  - [Geometry Factories](/zh-hans/2.1/ref/contrib/gis/geos/#geometry-factories)
  - [I/O Objects](/zh-hans/2.1/ref/contrib/gis/geos/#i-o-objects)
  - [Settings](/zh-hans/2.1/ref/contrib/gis/geos/#settings)
  - [Exceptions](/zh-hans/2.1/ref/contrib/gis/geos/#exceptions)
- [GDAL API](/zh-hans/2.1/ref/contrib/gis/gdal/)

  - [Overview](/zh-hans/2.1/ref/contrib/gis/gdal/#overview)
  - [Vector Data Source Objects](/zh-hans/2.1/ref/contrib/gis/gdal/#vector-data-source-objects)
  - [OGR Geometries](/zh-hans/2.1/ref/contrib/gis/gdal/#ogr-geometries)
  - [Coordinate System Objects](/zh-hans/2.1/ref/contrib/gis/gdal/#coordinate-system-objects)
  - [Raster Data Objects](/zh-hans/2.1/ref/contrib/gis/gdal/#raster-data-objects)
  - [Settings](/zh-hans/2.1/ref/contrib/gis/gdal/#settings)
  - [Exceptions](/zh-hans/2.1/ref/contrib/gis/gdal/#exceptions)
- [Geolocation with GeoIP2](/zh-hans/2.1/ref/contrib/gis/geoip2/)

  - [Example](/zh-hans/2.1/ref/contrib/gis/geoip2/#example)
  - [API Reference](/zh-hans/2.1/ref/contrib/gis/geoip2/#api-reference)
  - [Methods](/zh-hans/2.1/ref/contrib/gis/geoip2/#methods)
  - [Settings](/zh-hans/2.1/ref/contrib/gis/geoip2/#settings)
  - [Exceptions](/zh-hans/2.1/ref/contrib/gis/geoip2/#exceptions)
- [GeoDjango Utilities](/zh-hans/2.1/ref/contrib/gis/utils/)

  - [`LayerMapping` data import utility](/zh-hans/2.1/ref/contrib/gis/layermapping/)
  - [OGR Inspection](/zh-hans/2.1/ref/contrib/gis/ogrinspect/)
  - [`GeoJSON` Serializer](/zh-hans/2.1/ref/contrib/gis/serializers/)
- [GeoDjango Management Commands](/zh-hans/2.1/ref/contrib/gis/commands/)

  - [`inspectdb`](/zh-hans/2.1/ref/contrib/gis/commands/#inspectdb)
  - [`ogrinspect`](/zh-hans/2.1/ref/contrib/gis/commands/#ogrinspect)
- [GeoDjango's admin site](/zh-hans/2.1/ref/contrib/gis/admin/)

  - [`GeoModelAdmin`](/zh-hans/2.1/ref/contrib/gis/admin/#geomodeladmin)
  - [`OSMGeoAdmin`](/zh-hans/2.1/ref/contrib/gis/admin/#osmgeoadmin)
- [Geographic Feeds](/zh-hans/2.1/ref/contrib/gis/feeds/)

  - [Example](/zh-hans/2.1/ref/contrib/gis/feeds/#example)
  - [API Reference](/zh-hans/2.1/ref/contrib/gis/feeds/#api-reference)
- [Geographic Sitemaps](/zh-hans/2.1/ref/contrib/gis/sitemaps/)

  - [Example](/zh-hans/2.1/ref/contrib/gis/sitemaps/#example)
  - [Reference](/zh-hans/2.1/ref/contrib/gis/sitemaps/#reference)
- [Testing GeoDjango apps](/zh-hans/2.1/ref/contrib/gis/testing/)

  - [PostGIS](/zh-hans/2.1/ref/contrib/gis/testing/#postgis)
  - [GeoDjango tests](/zh-hans/2.1/ref/contrib/gis/testing/#geodjango-tests)
- [Deploying GeoDjango](/zh-hans/2.1/ref/contrib/gis/deployment/)
