From e2816f1ff9640a1039d0ba46e2b3aaa5406c8805 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 10 Mar 2015 17:59:27 +0100 Subject: [PATCH] [1.8.x] Updated GIS docs wrt GIS test paths Backport of 1825365152c from master. --- docs/ref/contrib/gis/db-api.txt | 2 +- docs/ref/contrib/gis/gdal.txt | 14 +++++--------- docs/ref/contrib/gis/geoquerysets.txt | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/ref/contrib/gis/db-api.txt b/docs/ref/contrib/gis/db-api.txt index 20efb97a0c..2a323e783b 100644 --- a/docs/ref/contrib/gis/db-api.txt +++ b/docs/ref/contrib/gis/db-api.txt @@ -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(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: diff --git a/docs/ref/contrib/gis/gdal.txt b/docs/ref/contrib/gis/gdal.txt index b3f168ed4a..d3c77deb82 100644 --- a/docs/ref/contrib/gis/gdal.txt +++ b/docs/ref/contrib/gis/gdal.txt @@ -33,14 +33,10 @@ Sample Data 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 comes with a number of -simple data sets that you can use for testing. This snippet will -determine where these sample files are installed on your computer:: +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: - >>> import os - >>> 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') +https://github.com/django/django/raw/master/tests/gis_tests/data/cities/cities.shp Vector Data Source Objects ========================== @@ -77,8 +73,8 @@ each feature in that layer. >>> from django.contrib.gis.gdal import DataSource >>> ds = DataSource(CITIES_PATH) - >>> ds.name # The exact filename may be different on your computer - '/usr/local/lib/python3.4/site-packages/django/contrib/gis/tests/data/cities/cities.shp' + >>> ds.name + '/path/to/your/cities.shp' >>> ds.layer_count # This file only contains one layer 1 diff --git a/docs/ref/contrib/gis/geoquerysets.txt b/docs/ref/contrib/gis/geoquerysets.txt index 12e21d8cf1..ae99b3e67b 100644 --- a/docs/ref/contrib/gis/geoquerysets.txt +++ b/docs/ref/contrib/gis/geoquerysets.txt @@ -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 :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 ``length``