mirror of
https://github.com/django/django.git
synced 2024-12-27 19:46:22 +00:00
Updated GIS docs wrt GIS test paths
This commit is contained in:
parent
0cb6a85f5e
commit
1825365152
@ -205,7 +205,7 @@ 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(mi=20)))
|
||||||
>>> qs = SouthTexasCity.objects.filter(point__distance_gte=(pnt, D(chain=100)))
|
>>> qs = SouthTexasCity.objects.filter(point__distance_gte=(pnt, D(chain=100)))
|
||||||
|
|
||||||
__ https://github.com/django/django/blob/master/django/contrib/gis/tests/distapp/models.py
|
__ https://github.com/django/django/blob/master/tests/gis_tests/distapp/models.py
|
||||||
|
|
||||||
.. _compatibility-table:
|
.. _compatibility-table:
|
||||||
|
|
||||||
|
@ -33,14 +33,10 @@ Sample Data
|
|||||||
The GDAL/OGR tools described here are designed to help you read in
|
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
|
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
|
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 comes with a number of
|
have any data of your own to use, GeoDjango tests contain a number of
|
||||||
simple data sets that you can use for testing. This snippet will
|
simple data sets that you can use for testing. You can download them here:
|
||||||
determine where these sample files are installed on your computer::
|
|
||||||
|
|
||||||
>>> import os
|
https://github.com/django/django/raw/master/tests/gis_tests/data/cities/cities.shp
|
||||||
>>> import django.contrib.gis
|
|
||||||
>>> GIS_PATH = os.path.dirname(django.contrib.gis.__file__)
|
|
||||||
>>> CITIES_PATH = os.path.join(GIS_PATH, 'tests/data/cities/cities.shp')
|
|
||||||
|
|
||||||
Vector Data Source Objects
|
Vector Data Source Objects
|
||||||
==========================
|
==========================
|
||||||
@ -77,8 +73,8 @@ each feature in that layer.
|
|||||||
|
|
||||||
>>> from django.contrib.gis.gdal import DataSource
|
>>> from django.contrib.gis.gdal import DataSource
|
||||||
>>> ds = DataSource(CITIES_PATH)
|
>>> ds = DataSource(CITIES_PATH)
|
||||||
>>> ds.name # The exact filename may be different on your computer
|
>>> ds.name
|
||||||
'/usr/local/lib/python3.4/site-packages/django/contrib/gis/tests/data/cities/cities.shp'
|
'/path/to/your/cities.shp'
|
||||||
>>> ds.layer_count # This file only contains one layer
|
>>> ds.layer_count # This file only contains one layer
|
||||||
1
|
1
|
||||||
|
|
||||||
|
@ -730,7 +730,7 @@ the distance from the `Tasmanian`__ city of Hobart to every other
|
|||||||
in kilometers. See :doc:`measure` for usage details and the list of
|
in kilometers. See :doc:`measure` for usage details and the list of
|
||||||
:ref:`supported_units`.
|
:ref:`supported_units`.
|
||||||
|
|
||||||
__ https://github.com/django/django/blob/master/django/contrib/gis/tests/distapp/models.py
|
__ https://github.com/django/django/blob/master/tests/gis_tests/distapp/models.py
|
||||||
__ http://en.wikipedia.org/wiki/Tasmania
|
__ http://en.wikipedia.org/wiki/Tasmania
|
||||||
|
|
||||||
``length``
|
``length``
|
||||||
|
Loading…
Reference in New Issue
Block a user