mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #30573 -- Rephrased documentation to avoid words that minimise the involved difficulty.
This patch does not remove all occurrences of the words in question. Rather, I went through all of the occurrences of the words listed below, and judged if they a) suggested the reader had some kind of knowledge/experience, and b) if they added anything of value (including tone of voice, etc). I left most of the words alone. I looked at the following words: - simply/simple - easy/easier/easiest - obvious - just - merely - straightforward - ridiculous Thanks to Carlton Gibson for guidance on how to approach this issue, and to Tim Bell for providing the idea. But the enormous lion's share of thanks go to Adam Johnson for his patient and helpful review.
This commit is contained in:
committed by
Mariusz Felisiak
parent
addabc492b
commit
4a954cfd11
@@ -284,10 +284,10 @@ Then distance queries may be performed as follows::
|
||||
>>> qs = SouthTexasCity.objects.filter(point__distance_gte=(pnt, D(mi=20)))
|
||||
>>> qs = SouthTexasCity.objects.filter(point__distance_gte=(pnt, D(chain=100)))
|
||||
|
||||
Raster queries work the same way by simply replacing the geometry field
|
||||
``point`` with a raster field, or the ``pnt`` object with a raster object, or
|
||||
both. To specify the band index of a raster input on the right hand side, a
|
||||
3-tuple can be passed to the lookup as follows::
|
||||
Raster queries work the same way by replacing the geometry field ``point`` with
|
||||
a raster field, or the ``pnt`` object with a raster object, or both. To specify
|
||||
the band index of a raster input on the right hand side, a 3-tuple can be
|
||||
passed to the lookup as follows::
|
||||
|
||||
>>> qs = SouthTexasCity.objects.filter(point__distance_gte=(rst, 2, D(km=7)))
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ Form widgets
|
||||
GeoDjango form widgets allow you to display and edit geographic data on a
|
||||
visual map.
|
||||
Note that none of the currently available widgets supports 3D geometries, hence
|
||||
geometry fields will fallback using a simple ``Textarea`` widget for such data.
|
||||
geometry fields will fallback using a ``Textarea`` widget for such data.
|
||||
|
||||
Widget attributes
|
||||
-----------------
|
||||
|
||||
@@ -36,7 +36,7 @@ The GDAL/OGR tools described here are designed to help you read in
|
||||
your geospatial data, in order for most of them to be useful you have
|
||||
to have some data to work with. If you're starting out and don't yet
|
||||
have any data of your own to use, GeoDjango tests contain a number of
|
||||
simple data sets that you can use for testing. You can download them here::
|
||||
data sets that you can use for testing. You can download them here::
|
||||
|
||||
$ wget https://raw.githubusercontent.com/django/django/master/tests/gis_tests/data/cities/cities.{shp,prj,shx,dbf}
|
||||
$ wget https://raw.githubusercontent.com/django/django/master/tests/gis_tests/data/rasters/raster.tif
|
||||
@@ -49,7 +49,7 @@ Vector Data Source Objects
|
||||
|
||||
:class:`DataSource` is a wrapper for the OGR data source object that
|
||||
supports reading data from a variety of OGR-supported geospatial file
|
||||
formats and data sources using a simple, consistent interface. Each
|
||||
formats and data sources using a consistent interface. Each
|
||||
data source is represented by a :class:`DataSource` object which contains
|
||||
one or more layers of data. Each layer, represented by a :class:`Layer`
|
||||
object, contains some number of geographic features (:class:`Feature`),
|
||||
@@ -1085,7 +1085,7 @@ Raster Data Objects
|
||||
|
||||
:class:`GDALRaster` is a wrapper for the GDAL raster source object that
|
||||
supports reading data from a variety of GDAL-supported geospatial file
|
||||
formats and data sources using a simple, consistent interface. Each
|
||||
formats and data sources using a consistent interface. Each
|
||||
data source is represented by a :class:`GDALRaster` object which contains
|
||||
one or more layers of data named bands. Each band, represented by a
|
||||
:class:`GDALBand` object, contains georeferenced image data. For example, an RGB
|
||||
|
||||
@@ -887,8 +887,8 @@ SpatiaLite
|
||||
Returns a ``GEOMETRYCOLLECTION`` or a ``MULTI`` geometry object from the geometry
|
||||
column. This is analogous to a simplified version of the :class:`Union`
|
||||
aggregate, except it can be several orders of magnitude faster than performing
|
||||
a union because it simply rolls up geometries into a collection or multi object,
|
||||
not caring about dissolving boundaries.
|
||||
a union because it rolls up geometries into a collection or multi object, not
|
||||
caring about dissolving boundaries.
|
||||
|
||||
``Extent``
|
||||
~~~~~~~~~~
|
||||
|
||||
@@ -833,7 +833,7 @@ Geometry Collections
|
||||
Prepared Geometries
|
||||
===================
|
||||
|
||||
In order to obtain a prepared geometry, just access the
|
||||
In order to obtain a prepared geometry, access the
|
||||
:attr:`GEOSGeometry.prepared` property. Once you have a
|
||||
``PreparedGeometry`` instance its spatial predicate methods, listed below,
|
||||
may be used with other ``GEOSGeometry`` objects. An operation with a prepared
|
||||
@@ -911,8 +911,8 @@ I/O Objects
|
||||
Reader Objects
|
||||
--------------
|
||||
|
||||
The reader I/O classes simply return a :class:`GEOSGeometry` instance from the
|
||||
WKB and/or WKT input given to their ``read(geom)`` method.
|
||||
The reader I/O classes return a :class:`GEOSGeometry` instance from the WKB
|
||||
and/or WKT input given to their ``read(geom)`` method.
|
||||
|
||||
.. class:: WKBReader
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ totally fine with GeoDjango. Your mileage may vary.
|
||||
|
||||
The GeoDjango interfaces to GEOS, GDAL, and GeoIP may be used
|
||||
independently of Django. In other words, no database or settings file
|
||||
required -- just import them as normal from :mod:`django.contrib.gis`.
|
||||
required -- import them as normal from :mod:`django.contrib.gis`.
|
||||
|
||||
.. _PROJ.4: https://github.com/OSGeo/proj.4/wiki/
|
||||
__ https://postgis.net/
|
||||
|
||||
@@ -272,9 +272,9 @@ KyngChaos packages
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
William Kyngesburye provides a number of `geospatial library binary packages`__
|
||||
that make it simple to get GeoDjango installed on macOS without compiling
|
||||
them from source. However, `Xcode`_ is still necessary for compiling the
|
||||
Python database adapters :ref:`psycopg2_kyngchaos` (for PostGIS).
|
||||
that help to get GeoDjango installed on macOS without compiling them from
|
||||
source. However, `Xcode`_ is still necessary for compiling the Python database
|
||||
adapters :ref:`psycopg2_kyngchaos` (for PostGIS).
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -385,9 +385,9 @@ PostgreSQL
|
||||
~~~~~~~~~~
|
||||
|
||||
First, download the latest `PostgreSQL 9.x installer`__ from the
|
||||
`EnterpriseDB`__ website. After downloading, simply run the installer,
|
||||
follow the on-screen directions, and keep the default options unless
|
||||
you know the consequences of changing them.
|
||||
`EnterpriseDB`__ website. After downloading, run the installer, follow the
|
||||
on-screen directions, and keep the default options unless you know the
|
||||
consequences of changing them.
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -446,14 +446,13 @@ __ http://www.stickpeople.com/projects/python/win-psycopg/
|
||||
OSGeo4W
|
||||
~~~~~~~
|
||||
|
||||
The `OSGeo4W installer`_ makes it simple to install the PROJ.4, GDAL, and GEOS
|
||||
libraries required by GeoDjango. First, download the `OSGeo4W installer`_,
|
||||
and run it. Select :menuselection:`Express Web-GIS Install` and click next.
|
||||
In the 'Select Packages' list, ensure that GDAL is selected; MapServer and
|
||||
Apache are also enabled by default, but are not required by GeoDjango and
|
||||
may be unchecked safely. After clicking next, the packages will be
|
||||
automatically downloaded and installed, after which you may exit the
|
||||
installer.
|
||||
The `OSGeo4W installer`_ helps to install the PROJ.4, GDAL, and GEOS libraries
|
||||
required by GeoDjango. First, download the `OSGeo4W installer`_, and run it.
|
||||
Select :menuselection:`Express Web-GIS Install` and click next. In the 'Select
|
||||
Packages' list, ensure that GDAL is selected; MapServer and Apache are also
|
||||
enabled by default, but are not required by GeoDjango and may be unchecked
|
||||
safely. After clicking next, the packages will be automatically downloaded and
|
||||
installed, after which you may exit the installer.
|
||||
|
||||
.. _OSGeo4W installer: https://trac.osgeo.org/osgeo4w/
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ command line interface and enter the following query::
|
||||
sqlite> CREATE VIRTUAL TABLE testrtree USING rtree(id,minX,maxX,minY,maxY);
|
||||
|
||||
If you obtain an error, you will have to recompile SQLite from source. Otherwise,
|
||||
just skip this section.
|
||||
skip this section.
|
||||
|
||||
To install from sources, download the latest amalgamation source archive from
|
||||
the `SQLite download page`__, and extract::
|
||||
|
||||
@@ -25,8 +25,8 @@ then inserting into a GeoDjango model.
|
||||
that :class:`LayerMapping` is using too much memory, set
|
||||
:setting:`DEBUG` to ``False`` in your settings. When :setting:`DEBUG`
|
||||
is set to ``True``, Django :ref:`automatically logs <faq-see-raw-sql-queries>`
|
||||
*every* SQL query -- thus, when SQL statements contain geometries, it is
|
||||
easy to consume more memory than is typical.
|
||||
*every* SQL query -- and when SQL statements contain geometries, this may
|
||||
consume more memory than is typical.
|
||||
|
||||
Example
|
||||
=======
|
||||
@@ -75,10 +75,10 @@ Example
|
||||
Saved: Name: 2
|
||||
Saved: Name: 3
|
||||
|
||||
Here, :class:`LayerMapping` just transformed the three geometries from the
|
||||
shapefile in their original spatial reference system (WGS84) to the spatial
|
||||
reference system of the GeoDjango model (NAD83). If no spatial reference
|
||||
system is defined for the layer, use the ``source_srs`` keyword with a
|
||||
Here, :class:`LayerMapping` transformed the three geometries from the shapefile
|
||||
in their original spatial reference system (WGS84) to the spatial reference
|
||||
system of the GeoDjango model (NAD83). If no spatial reference system is
|
||||
defined for the layer, use the ``source_srs`` keyword with a
|
||||
:class:`~django.contrib.gis.gdal.SpatialReference` object to specify one.
|
||||
|
||||
``LayerMapping`` API
|
||||
|
||||
@@ -26,8 +26,8 @@ instantiated in units of kilometers (``km``) and miles (``mi``)::
|
||||
>>> print(d2)
|
||||
5.0 mi
|
||||
|
||||
Conversions are easy, just access the preferred unit attribute to get a
|
||||
converted distance quantity::
|
||||
For conversions, access the preferred unit attribute to get a converted
|
||||
distance quantity::
|
||||
|
||||
>>> print(d1.mi) # Converting 5 kilometers to miles
|
||||
3.10685596119
|
||||
|
||||
@@ -73,8 +73,8 @@ is done from an existing superuser account)::
|
||||
Windows
|
||||
-------
|
||||
|
||||
On Windows platforms the pgAdmin III utility may also be used as
|
||||
a simple way to add superuser privileges to your database user.
|
||||
On Windows platforms you can use the pgAdmin III utility to add superuser
|
||||
privileges to your database user.
|
||||
|
||||
By default, the PostGIS installer on Windows includes a template
|
||||
spatial database entitled ``template_postgis``.
|
||||
|
||||
@@ -758,8 +758,8 @@ available with the :class:`~django.contrib.gis.admin.GeoModelAdmin`
|
||||
The PROJ.4 datum shifting files must be installed (see the :ref:`PROJ.4
|
||||
installation instructions <proj4>` for more details).
|
||||
|
||||
If you meet this requirement, then just substitute the ``OSMGeoAdmin``
|
||||
option class in your ``admin.py`` file::
|
||||
If you meet this requirement, then substitute the ``OSMGeoAdmin`` option class
|
||||
in your ``admin.py`` file::
|
||||
|
||||
admin.site.register(WorldBorder, admin.OSMGeoAdmin)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user