From fe407193c200e03070928c1e2c1a6e067d32893d Mon Sep 17 00:00:00 2001 From: coderick14 Date: Wed, 17 May 2017 15:40:18 +0530 Subject: Upgrade to Django 1.11 - Database integration yet to be tested --- .../site-packages/django/contrib/gis/__init__.py | 6 - .../django/contrib/gis/admin/__init__.py | 12 - .../django/contrib/gis/admin/options.py | 139 --- .../django/contrib/gis/admin/widgets.py | 119 --- .../django/contrib/gis/db/__init__.py | 0 .../django/contrib/gis/db/backends/__init__.py | 0 .../django/contrib/gis/db/backends/adapter.py | 19 - .../django/contrib/gis/db/backends/base.py | 349 ------ .../contrib/gis/db/backends/mysql/__init__.py | 0 .../django/contrib/gis/db/backends/mysql/base.py | 13 - .../contrib/gis/db/backends/mysql/compiler.py | 35 - .../contrib/gis/db/backends/mysql/creation.py | 18 - .../contrib/gis/db/backends/mysql/introspection.py | 32 - .../contrib/gis/db/backends/mysql/operations.py | 67 -- .../contrib/gis/db/backends/oracle/__init__.py | 0 .../contrib/gis/db/backends/oracle/adapter.py | 5 - .../django/contrib/gis/db/backends/oracle/base.py | 12 - .../contrib/gis/db/backends/oracle/compiler.py | 25 - .../contrib/gis/db/backends/oracle/creation.py | 42 - .../gis/db/backends/oracle/introspection.py | 44 - .../contrib/gis/db/backends/oracle/models.py | 66 -- .../contrib/gis/db/backends/oracle/operations.py | 304 ------ .../contrib/gis/db/backends/postgis/__init__.py | 0 .../contrib/gis/db/backends/postgis/adapter.py | 46 - .../django/contrib/gis/db/backends/postgis/base.py | 12 - .../contrib/gis/db/backends/postgis/creation.py | 95 -- .../gis/db/backends/postgis/introspection.py | 103 -- .../contrib/gis/db/backends/postgis/models.py | 68 -- .../contrib/gis/db/backends/postgis/operations.py | 569 ---------- .../contrib/gis/db/backends/spatialite/__init__.py | 0 .../contrib/gis/db/backends/spatialite/adapter.py | 8 - .../contrib/gis/db/backends/spatialite/base.py | 60 -- .../contrib/gis/db/backends/spatialite/client.py | 5 - .../contrib/gis/db/backends/spatialite/creation.py | 129 --- .../gis/db/backends/spatialite/introspection.py | 52 - .../contrib/gis/db/backends/spatialite/models.py | 62 -- .../gis/db/backends/spatialite/operations.py | 373 ------- .../django/contrib/gis/db/backends/util.py | 44 - .../django/contrib/gis/db/models/__init__.py | 14 - .../django/contrib/gis/db/models/aggregates.py | 16 - .../django/contrib/gis/db/models/fields.py | 305 ------ .../django/contrib/gis/db/models/manager.py | 103 -- .../django/contrib/gis/db/models/proxy.py | 66 -- .../django/contrib/gis/db/models/query.py | 784 -------------- .../django/contrib/gis/db/models/sql/__init__.py | 3 - .../django/contrib/gis/db/models/sql/aggregates.py | 62 -- .../django/contrib/gis/db/models/sql/compiler.py | 313 ------ .../django/contrib/gis/db/models/sql/conversion.py | 27 - .../django/contrib/gis/db/models/sql/query.py | 121 --- .../django/contrib/gis/db/models/sql/where.py | 91 -- .../site-packages/django/contrib/gis/feeds.py | 137 --- .../django/contrib/gis/forms/__init__.py | 5 - .../django/contrib/gis/forms/fields.py | 137 --- .../django/contrib/gis/forms/widgets.py | 120 --- .../django/contrib/gis/gdal/__init__.py | 55 - .../site-packages/django/contrib/gis/gdal/base.py | 36 - .../django/contrib/gis/gdal/datasource.py | 135 --- .../django/contrib/gis/gdal/driver.py | 68 -- .../django/contrib/gis/gdal/envelope.py | 175 ---- .../site-packages/django/contrib/gis/gdal/error.py | 42 - .../django/contrib/gis/gdal/feature.py | 124 --- .../site-packages/django/contrib/gis/gdal/field.py | 194 ---- .../django/contrib/gis/gdal/geometries.py | 726 ------------- .../django/contrib/gis/gdal/geomtype.py | 87 -- .../site-packages/django/contrib/gis/gdal/layer.py | 218 ---- .../django/contrib/gis/gdal/libgdal.py | 109 -- .../django/contrib/gis/gdal/prototypes/__init__.py | 0 .../django/contrib/gis/gdal/prototypes/ds.py | 70 -- .../django/contrib/gis/gdal/prototypes/errcheck.py | 128 --- .../contrib/gis/gdal/prototypes/generation.py | 125 --- .../django/contrib/gis/gdal/prototypes/geom.py | 98 -- .../django/contrib/gis/gdal/prototypes/srs.py | 71 -- .../site-packages/django/contrib/gis/gdal/srs.py | 342 ------ .../django/contrib/gis/gdal/tests/__init__.py | 0 .../django/contrib/gis/gdal/tests/test_driver.py | 39 - .../django/contrib/gis/gdal/tests/test_ds.py | 244 ----- .../django/contrib/gis/gdal/tests/test_envelope.py | 93 -- .../django/contrib/gis/gdal/tests/test_geom.py | 485 --------- .../django/contrib/gis/gdal/tests/test_srs.py | 163 --- .../django/contrib/gis/geoip/__init__.py | 20 - .../site-packages/django/contrib/gis/geoip/base.py | 265 ----- .../django/contrib/gis/geoip/libgeoip.py | 31 - .../django/contrib/gis/geoip/prototypes.py | 115 -- .../django/contrib/gis/geoip/tests.py | 122 --- .../django/contrib/gis/geometry/__init__.py | 0 .../contrib/gis/geometry/backend/__init__.py | 21 - .../django/contrib/gis/geometry/backend/geos.py | 2 - .../django/contrib/gis/geometry/regex.py | 12 - .../django/contrib/gis/geometry/test_data.py | 106 -- .../django/contrib/gis/geos/__init__.py | 20 - .../site-packages/django/contrib/gis/geos/base.py | 51 - .../django/contrib/gis/geos/collections.py | 124 --- .../django/contrib/gis/geos/coordseq.py | 157 --- .../site-packages/django/contrib/gis/geos/error.py | 20 - .../django/contrib/gis/geos/factory.py | 35 - .../django/contrib/gis/geos/geometry.py | 715 ------------- .../site-packages/django/contrib/gis/geos/io.py | 20 - .../django/contrib/gis/geos/libgeos.py | 155 --- .../django/contrib/gis/geos/linestring.py | 153 --- .../django/contrib/gis/geos/mutable_list.py | 328 ------ .../site-packages/django/contrib/gis/geos/point.py | 137 --- .../django/contrib/gis/geos/polygon.py | 170 --- .../django/contrib/gis/geos/prepared.py | 35 - .../django/contrib/gis/geos/prototypes/__init__.py | 30 - .../django/contrib/gis/geos/prototypes/coordseq.py | 83 -- .../django/contrib/gis/geos/prototypes/errcheck.py | 95 -- .../django/contrib/gis/geos/prototypes/geom.py | 119 --- .../django/contrib/gis/geos/prototypes/io.py | 265 ----- .../django/contrib/gis/geos/prototypes/misc.py | 40 - .../contrib/gis/geos/prototypes/predicates.py | 44 - .../django/contrib/gis/geos/prototypes/prepared.py | 25 - .../contrib/gis/geos/prototypes/threadsafe.py | 86 -- .../django/contrib/gis/geos/prototypes/topology.py | 64 -- .../django/contrib/gis/geos/tests/__init__.py | 0 .../django/contrib/gis/geos/tests/test_geos.py | 1108 -------------------- .../contrib/gis/geos/tests/test_geos_mutation.py | 134 --- .../django/contrib/gis/geos/tests/test_io.py | 116 -- .../contrib/gis/geos/tests/test_mutable_list.py | 397 ------- .../contrib/gis/locale/ar/LC_MESSAGES/django.mo | Bin 1875 -> 0 bytes .../contrib/gis/locale/ar/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/az/LC_MESSAGES/django.mo | Bin 1385 -> 0 bytes .../contrib/gis/locale/az/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/be/LC_MESSAGES/django.mo | Bin 2150 -> 0 bytes .../contrib/gis/locale/be/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/bg/LC_MESSAGES/django.mo | Bin 2170 -> 0 bytes .../contrib/gis/locale/bg/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/bn/LC_MESSAGES/django.mo | Bin 812 -> 0 bytes .../contrib/gis/locale/bn/LC_MESSAGES/django.po | 92 -- .../contrib/gis/locale/br/LC_MESSAGES/django.mo | Bin 566 -> 0 bytes .../contrib/gis/locale/br/LC_MESSAGES/django.po | 92 -- .../contrib/gis/locale/bs/LC_MESSAGES/django.mo | Bin 1476 -> 0 bytes .../contrib/gis/locale/bs/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/ca/LC_MESSAGES/django.mo | Bin 1831 -> 0 bytes .../contrib/gis/locale/ca/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/cs/LC_MESSAGES/django.mo | Bin 1847 -> 0 bytes .../contrib/gis/locale/cs/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/cy/LC_MESSAGES/django.mo | Bin 488 -> 0 bytes .../contrib/gis/locale/cy/LC_MESSAGES/django.po | 92 -- .../contrib/gis/locale/da/LC_MESSAGES/django.mo | Bin 1740 -> 0 bytes .../contrib/gis/locale/da/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/de/LC_MESSAGES/django.mo | Bin 1806 -> 0 bytes .../contrib/gis/locale/de/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/el/LC_MESSAGES/django.mo | Bin 1784 -> 0 bytes .../contrib/gis/locale/el/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/en/LC_MESSAGES/django.mo | Bin 356 -> 0 bytes .../contrib/gis/locale/en/LC_MESSAGES/django.po | 88 -- .../contrib/gis/locale/en_GB/LC_MESSAGES/django.mo | Bin 1746 -> 0 bytes .../contrib/gis/locale/en_GB/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/eo/LC_MESSAGES/django.mo | Bin 1760 -> 0 bytes .../contrib/gis/locale/eo/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/es/LC_MESSAGES/django.mo | Bin 1850 -> 0 bytes .../contrib/gis/locale/es/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/es_AR/LC_MESSAGES/django.mo | Bin 1870 -> 0 bytes .../contrib/gis/locale/es_AR/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/es_MX/LC_MESSAGES/django.mo | Bin 1858 -> 0 bytes .../contrib/gis/locale/es_MX/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/et/LC_MESSAGES/django.mo | Bin 1328 -> 0 bytes .../contrib/gis/locale/et/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/eu/LC_MESSAGES/django.mo | Bin 1738 -> 0 bytes .../contrib/gis/locale/eu/LC_MESSAGES/django.po | 93 -- .../contrib/gis/locale/fa/LC_MESSAGES/django.mo | Bin 1954 -> 0 bytes .../contrib/gis/locale/fa/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/fi/LC_MESSAGES/django.mo | Bin 1320 -> 0 bytes .../contrib/gis/locale/fi/LC_MESSAGES/django.po | 93 -- .../contrib/gis/locale/fr/LC_MESSAGES/django.mo | Bin 1838 -> 0 bytes .../contrib/gis/locale/fr/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/fy_NL/LC_MESSAGES/django.mo | Bin 401 -> 0 bytes .../contrib/gis/locale/fy_NL/LC_MESSAGES/django.po | 89 -- .../contrib/gis/locale/ga/LC_MESSAGES/django.mo | Bin 1851 -> 0 bytes .../contrib/gis/locale/ga/LC_MESSAGES/django.po | 98 -- .../contrib/gis/locale/gl/LC_MESSAGES/django.mo | Bin 1865 -> 0 bytes .../contrib/gis/locale/gl/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/he/LC_MESSAGES/django.mo | Bin 1865 -> 0 bytes .../contrib/gis/locale/he/LC_MESSAGES/django.po | 93 -- .../contrib/gis/locale/hi/LC_MESSAGES/django.mo | Bin 2385 -> 0 bytes .../contrib/gis/locale/hi/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/hr/LC_MESSAGES/django.mo | Bin 1859 -> 0 bytes .../contrib/gis/locale/hr/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/hu/LC_MESSAGES/django.mo | Bin 1750 -> 0 bytes .../contrib/gis/locale/hu/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/ia/LC_MESSAGES/django.mo | Bin 1826 -> 0 bytes .../contrib/gis/locale/ia/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/id/LC_MESSAGES/django.mo | Bin 1732 -> 0 bytes .../contrib/gis/locale/id/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/is/LC_MESSAGES/django.mo | Bin 1652 -> 0 bytes .../contrib/gis/locale/is/LC_MESSAGES/django.po | 93 -- .../contrib/gis/locale/it/LC_MESSAGES/django.mo | Bin 1796 -> 0 bytes .../contrib/gis/locale/it/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/ja/LC_MESSAGES/django.mo | Bin 1895 -> 0 bytes .../contrib/gis/locale/ja/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/ka/LC_MESSAGES/django.mo | Bin 2589 -> 0 bytes .../contrib/gis/locale/ka/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/kk/LC_MESSAGES/django.mo | Bin 1583 -> 0 bytes .../contrib/gis/locale/kk/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/km/LC_MESSAGES/django.mo | Bin 391 -> 0 bytes .../contrib/gis/locale/km/LC_MESSAGES/django.po | 89 -- .../contrib/gis/locale/kn/LC_MESSAGES/django.mo | Bin 438 -> 0 bytes .../contrib/gis/locale/kn/LC_MESSAGES/django.po | 91 -- .../contrib/gis/locale/ko/LC_MESSAGES/django.mo | Bin 1418 -> 0 bytes .../contrib/gis/locale/ko/LC_MESSAGES/django.po | 93 -- .../contrib/gis/locale/lt/LC_MESSAGES/django.mo | Bin 1812 -> 0 bytes .../contrib/gis/locale/lt/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/lv/LC_MESSAGES/django.mo | Bin 1443 -> 0 bytes .../contrib/gis/locale/lv/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/mk/LC_MESSAGES/django.mo | Bin 2266 -> 0 bytes .../contrib/gis/locale/mk/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/ml/LC_MESSAGES/django.mo | Bin 2714 -> 0 bytes .../contrib/gis/locale/ml/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/mn/LC_MESSAGES/django.mo | Bin 2117 -> 0 bytes .../contrib/gis/locale/mn/LC_MESSAGES/django.po | 99 -- .../contrib/gis/locale/nb/LC_MESSAGES/django.mo | Bin 1725 -> 0 bytes .../contrib/gis/locale/nb/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/ne/LC_MESSAGES/django.mo | Bin 985 -> 0 bytes .../contrib/gis/locale/ne/LC_MESSAGES/django.po | 92 -- .../contrib/gis/locale/nl/LC_MESSAGES/django.mo | Bin 1778 -> 0 bytes .../contrib/gis/locale/nl/LC_MESSAGES/django.po | 99 -- .../contrib/gis/locale/nn/LC_MESSAGES/django.mo | Bin 1205 -> 0 bytes .../contrib/gis/locale/nn/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/os/LC_MESSAGES/django.mo | Bin 2034 -> 0 bytes .../contrib/gis/locale/os/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/pa/LC_MESSAGES/django.mo | Bin 1399 -> 0 bytes .../contrib/gis/locale/pa/LC_MESSAGES/django.po | 93 -- .../contrib/gis/locale/pl/LC_MESSAGES/django.mo | Bin 1860 -> 0 bytes .../contrib/gis/locale/pl/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/pt/LC_MESSAGES/django.mo | Bin 1788 -> 0 bytes .../contrib/gis/locale/pt/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/pt_BR/LC_MESSAGES/django.mo | Bin 1800 -> 0 bytes .../contrib/gis/locale/pt_BR/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/ro/LC_MESSAGES/django.mo | Bin 1435 -> 0 bytes .../contrib/gis/locale/ro/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/ru/LC_MESSAGES/django.mo | Bin 2207 -> 0 bytes .../contrib/gis/locale/ru/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/sk/LC_MESSAGES/django.mo | Bin 1815 -> 0 bytes .../contrib/gis/locale/sk/LC_MESSAGES/django.po | 93 -- .../contrib/gis/locale/sl/LC_MESSAGES/django.mo | Bin 1817 -> 0 bytes .../contrib/gis/locale/sl/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/sq/LC_MESSAGES/django.mo | Bin 1811 -> 0 bytes .../contrib/gis/locale/sq/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/sr/LC_MESSAGES/django.mo | Bin 2208 -> 0 bytes .../contrib/gis/locale/sr/LC_MESSAGES/django.po | 95 -- .../gis/locale/sr_Latn/LC_MESSAGES/django.mo | Bin 1874 -> 0 bytes .../gis/locale/sr_Latn/LC_MESSAGES/django.po | 95 -- .../contrib/gis/locale/sv/LC_MESSAGES/django.mo | Bin 1728 -> 0 bytes .../contrib/gis/locale/sv/LC_MESSAGES/django.po | 93 -- .../contrib/gis/locale/sw/LC_MESSAGES/django.mo | Bin 1419 -> 0 bytes .../contrib/gis/locale/sw/LC_MESSAGES/django.po | 93 -- .../contrib/gis/locale/ta/LC_MESSAGES/django.mo | Bin 443 -> 0 bytes .../contrib/gis/locale/ta/LC_MESSAGES/django.po | 91 -- .../contrib/gis/locale/te/LC_MESSAGES/django.mo | Bin 827 -> 0 bytes .../contrib/gis/locale/te/LC_MESSAGES/django.po | 92 -- .../contrib/gis/locale/th/LC_MESSAGES/django.mo | Bin 2409 -> 0 bytes .../contrib/gis/locale/th/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/tr/LC_MESSAGES/django.mo | Bin 1806 -> 0 bytes .../contrib/gis/locale/tr/LC_MESSAGES/django.po | 97 -- .../contrib/gis/locale/tt/LC_MESSAGES/django.mo | Bin 1679 -> 0 bytes .../contrib/gis/locale/tt/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/uk/LC_MESSAGES/django.mo | Bin 1421 -> 0 bytes .../contrib/gis/locale/uk/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/ur/LC_MESSAGES/django.mo | Bin 1600 -> 0 bytes .../contrib/gis/locale/ur/LC_MESSAGES/django.po | 94 -- .../contrib/gis/locale/vi/LC_MESSAGES/django.mo | Bin 1825 -> 0 bytes .../contrib/gis/locale/vi/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/zh_CN/LC_MESSAGES/django.mo | Bin 1684 -> 0 bytes .../contrib/gis/locale/zh_CN/LC_MESSAGES/django.po | 96 -- .../contrib/gis/locale/zh_TW/LC_MESSAGES/django.mo | Bin 1812 -> 0 bytes .../contrib/gis/locale/zh_TW/LC_MESSAGES/django.po | 94 -- .../django/contrib/gis/management/__init__.py | 0 .../contrib/gis/management/commands/__init__.py | 0 .../contrib/gis/management/commands/inspectdb.py | 29 - .../contrib/gis/management/commands/ogrinspect.py | 118 --- .../django/contrib/gis/maps/__init__.py | 0 .../django/contrib/gis/maps/google/__init__.py | 61 -- .../django/contrib/gis/maps/google/gmap.py | 233 ---- .../django/contrib/gis/maps/google/overlays.py | 311 ------ .../django/contrib/gis/maps/google/zoom.py | 162 --- .../django/contrib/gis/maps/openlayers/__init__.py | 0 .../site-packages/django/contrib/gis/measure.py | 330 ------ .../site-packages/django/contrib/gis/models.py | 9 - .../site-packages/django/contrib/gis/shortcuts.py | 33 - .../django/contrib/gis/sitemaps/__init__.py | 4 - .../django/contrib/gis/sitemaps/georss.py | 53 - .../django/contrib/gis/sitemaps/kml.py | 63 -- .../django/contrib/gis/sitemaps/views.py | 114 -- .../contrib/gis/static/gis/js/OLMapWidget.js | 376 ------- .../gis/templates/gis/admin/openlayers.html | 38 - .../contrib/gis/templates/gis/admin/openlayers.js | 176 ---- .../contrib/gis/templates/gis/admin/osm.html | 2 - .../django/contrib/gis/templates/gis/admin/osm.js | 2 - .../gis/templates/gis/google/google-map.html | 12 - .../contrib/gis/templates/gis/google/google-map.js | 37 - .../gis/templates/gis/google/google-multi.js | 8 - .../gis/templates/gis/google/google-single.js | 2 - .../django/contrib/gis/templates/gis/kml/base.kml | 6 - .../contrib/gis/templates/gis/kml/placemarks.kml | 8 - .../contrib/gis/templates/gis/openlayers-osm.html | 17 - .../contrib/gis/templates/gis/openlayers.html | 34 - .../gis/templates/gis/sitemaps/geo_sitemap.xml | 17 - .../django/contrib/gis/tests/__init__.py | 30 - .../contrib/gis/tests/data/ch-city/ch-city.dbf | Bin 285 -> 0 bytes .../contrib/gis/tests/data/ch-city/ch-city.prj | 1 - .../contrib/gis/tests/data/ch-city/ch-city.shp | Bin 128 -> 0 bytes .../contrib/gis/tests/data/ch-city/ch-city.shx | Bin 108 -> 0 bytes .../contrib/gis/tests/data/cities/cities.dbf | Bin 533 -> 0 bytes .../contrib/gis/tests/data/cities/cities.prj | 1 - .../contrib/gis/tests/data/cities/cities.shp | Bin 184 -> 0 bytes .../contrib/gis/tests/data/cities/cities.shx | Bin 124 -> 0 bytes .../contrib/gis/tests/data/counties/counties.dbf | Bin 3961 -> 0 bytes .../contrib/gis/tests/data/counties/counties.shp | Bin 37364 -> 0 bytes .../contrib/gis/tests/data/counties/counties.shx | Bin 292 -> 0 bytes .../django/contrib/gis/tests/data/geometries.json | 123 --- .../gis/tests/data/interstates/interstates.dbf | Bin 412 -> 0 bytes .../gis/tests/data/interstates/interstates.prj | 1 - .../gis/tests/data/interstates/interstates.shp | Bin 892 -> 0 bytes .../gis/tests/data/interstates/interstates.shx | Bin 124 -> 0 bytes .../contrib/gis/tests/data/invalid/emptypoints.dbf | Bin 77 -> 0 bytes .../contrib/gis/tests/data/invalid/emptypoints.shp | Bin 112 -> 0 bytes .../contrib/gis/tests/data/invalid/emptypoints.shx | Bin 108 -> 0 bytes .../gis/tests/data/test_point/test_point.dbf | Bin 749 -> 0 bytes .../gis/tests/data/test_point/test_point.prj | 1 - .../gis/tests/data/test_point/test_point.shp | Bin 240 -> 0 bytes .../gis/tests/data/test_point/test_point.shx | Bin 140 -> 0 bytes .../contrib/gis/tests/data/test_poly/test_poly.dbf | Bin 501 -> 0 bytes .../contrib/gis/tests/data/test_poly/test_poly.prj | 1 - .../contrib/gis/tests/data/test_poly/test_poly.shp | Bin 620 -> 0 bytes .../contrib/gis/tests/data/test_poly/test_poly.shx | Bin 124 -> 0 bytes .../contrib/gis/tests/data/test_vrt/test_vrt.csv | 4 - .../contrib/gis/tests/data/test_vrt/test_vrt.vrt | 7 - .../django/contrib/gis/tests/data/texas.dbf | Bin 660 -> 0 bytes .../django/contrib/gis/tests/distapp/__init__.py | 0 .../tests/distapp/fixtures/initial_data.json.gz | Bin 6499 -> 0 bytes .../django/contrib/gis/tests/distapp/models.py | 58 - .../django/contrib/gis/tests/distapp/tests.py | 367 ------- .../django/contrib/gis/tests/geo3d/__init__.py | 0 .../django/contrib/gis/tests/geo3d/models.py | 77 -- .../django/contrib/gis/tests/geo3d/tests.py | 278 ----- .../django/contrib/gis/tests/geo3d/views.py | 1 - .../django/contrib/gis/tests/geoadmin/__init__.py | 0 .../django/contrib/gis/tests/geoadmin/models.py | 12 - .../django/contrib/gis/tests/geoadmin/tests.py | 73 -- .../django/contrib/gis/tests/geoadmin/urls.py | 6 - .../django/contrib/gis/tests/geoapp/__init__.py | 0 .../django/contrib/gis/tests/geoapp/feeds.py | 66 -- .../gis/tests/geoapp/fixtures/initial_data.json.gz | Bin 131252 -> 0 bytes .../django/contrib/gis/tests/geoapp/models.py | 56 - .../django/contrib/gis/tests/geoapp/sitemaps.py | 12 - .../django/contrib/gis/tests/geoapp/test_feeds.py | 96 -- .../contrib/gis/tests/geoapp/test_regress.py | 87 -- .../contrib/gis/tests/geoapp/test_sitemaps.py | 104 -- .../django/contrib/gis/tests/geoapp/tests.py | 788 -------------- .../django/contrib/gis/tests/geoapp/urls.py | 18 - .../django/contrib/gis/tests/geogapp/__init__.py | 0 .../gis/tests/geogapp/fixtures/initial_data.json | 98 -- .../django/contrib/gis/tests/geogapp/models.py | 24 - .../django/contrib/gis/tests/geogapp/tests.py | 97 -- .../contrib/gis/tests/inspectapp/__init__.py | 0 .../django/contrib/gis/tests/inspectapp/models.py | 13 - .../django/contrib/gis/tests/inspectapp/tests.py | 143 --- .../django/contrib/gis/tests/layermap/__init__.py | 0 .../django/contrib/gis/tests/layermap/models.py | 70 -- .../django/contrib/gis/tests/layermap/tests.py | 331 ------ .../contrib/gis/tests/relatedapp/__init__.py | 0 .../tests/relatedapp/fixtures/initial_data.json.gz | Bin 526 -> 0 bytes .../django/contrib/gis/tests/relatedapp/models.py | 53 - .../django/contrib/gis/tests/relatedapp/tests.py | 305 ------ .../django/contrib/gis/tests/test_geoforms.py | 300 ------ .../django/contrib/gis/tests/test_measure.py | 290 ----- .../django/contrib/gis/tests/test_spatialrefsys.py | 104 -- .../django/contrib/gis/tests/utils.py | 46 - .../django/contrib/gis/utils/__init__.py | 17 - .../django/contrib/gis/utils/layermapping.py | 596 ----------- .../django/contrib/gis/utils/ogrinfo.py | 53 - .../django/contrib/gis/utils/ogrinspect.py | 225 ---- .../site-packages/django/contrib/gis/utils/srs.py | 80 -- .../site-packages/django/contrib/gis/utils/wkt.py | 57 - .../site-packages/django/contrib/gis/views.py | 25 - 375 files changed, 28940 deletions(-) delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/admin/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/admin/options.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/admin/widgets.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/adapter.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/base.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/base.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/compiler.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/creation.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/operations.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/adapter.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/base.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/compiler.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/creation.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/introspection.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/operations.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/adapter.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/creation.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/introspection.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/operations.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/adapter.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/base.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/client.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/creation.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/introspection.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/operations.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/backends/util.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/aggregates.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/manager.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/proxy.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/query.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/sql/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/sql/aggregates.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/sql/compiler.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/sql/conversion.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/sql/query.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/db/models/sql/where.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/feeds.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/forms/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/forms/fields.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/forms/widgets.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/base.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/datasource.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/driver.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/envelope.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/error.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/feature.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/field.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/geometries.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/geomtype.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/layer.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/libgdal.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/ds.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/errcheck.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/generation.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/geom.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/srs.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/srs.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/tests/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_driver.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_ds.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_envelope.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_geom.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_srs.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geoip/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geoip/base.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geoip/libgeoip.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geoip/prototypes.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geoip/tests.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geometry/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geometry/backend/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geometry/backend/geos.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geometry/regex.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geometry/test_data.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/base.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/collections.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/coordseq.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/error.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/factory.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/io.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/linestring.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/mutable_list.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/point.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/polygon.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prepared.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/coordseq.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/errcheck.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/geom.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/io.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/misc.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/predicates.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/prepared.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/topology.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/tests/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos_mutation.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_io.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_mutable_list.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ar/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ar/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/az/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/az/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/be/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/be/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/bg/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/bg/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/bn/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/bn/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/br/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/br/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/bs/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/bs/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ca/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ca/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/cs/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/cs/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/cy/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/cy/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/da/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/da/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/de/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/de/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/el/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/el/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/en/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/en/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/en_GB/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/en_GB/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/eo/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/eo/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/es/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/es/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/es_AR/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/es_AR/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/es_MX/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/es_MX/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/et/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/et/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/eu/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/eu/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/fa/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/fa/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/fi/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/fi/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/fr/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/fr/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/fy_NL/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/fy_NL/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ga/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ga/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/gl/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/gl/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/he/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/he/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/hi/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/hi/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/hr/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/hr/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/hu/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/hu/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ia/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ia/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/id/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/id/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/is/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/is/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ja/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ja/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ka/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ka/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/kk/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/kk/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/km/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/km/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/kn/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/kn/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ko/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ko/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/lt/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/lt/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/lv/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/lv/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/mk/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/mk/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ml/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ml/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/mn/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/mn/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/nb/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/nb/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ne/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ne/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/nl/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/nl/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/nn/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/nn/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/os/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/os/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/pa/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/pa/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/pl/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/pl/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/pt/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/pt/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ro/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ro/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ru/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ru/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sk/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sk/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sl/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sl/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sq/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sq/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sr/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sr/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sv/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sv/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sw/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/sw/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ta/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ta/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/te/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/te/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/th/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/th/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/tr/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/tr/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/tt/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/tt/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/uk/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/uk/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ur/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/ur/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/vi/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/vi/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/zh_CN/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/zh_CN/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/zh_TW/LC_MESSAGES/django.mo delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/locale/zh_TW/LC_MESSAGES/django.po delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/management/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/management/commands/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/management/commands/inspectdb.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/management/commands/ogrinspect.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/maps/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/maps/google/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/maps/google/gmap.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/maps/google/overlays.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/maps/google/zoom.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/maps/openlayers/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/measure.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/shortcuts.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/sitemaps/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/sitemaps/georss.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/sitemaps/kml.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/sitemaps/views.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/static/gis/js/OLMapWidget.js delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/admin/openlayers.html delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/admin/openlayers.js delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/admin/osm.html delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/admin/osm.js delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/google/google-map.html delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/google/google-map.js delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/google/google-multi.js delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/google/google-single.js delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/kml/base.kml delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/kml/placemarks.kml delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/openlayers-osm.html delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/openlayers.html delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/templates/gis/sitemaps/geo_sitemap.xml delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.dbf delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.prj delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.shp delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.shx delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.dbf delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.prj delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.shp delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.shx delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.dbf delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.shp delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.shx delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/geometries.json delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.dbf delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.prj delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.shp delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.shx delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.dbf delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.shp delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.shx delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.dbf delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.prj delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.shp delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.shx delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.dbf delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.prj delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shp delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shx delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_vrt/test_vrt.csv delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/test_vrt/test_vrt.vrt delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/data/texas.dbf delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/distapp/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/distapp/fixtures/initial_data.json.gz delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/distapp/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/distapp/tests.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/tests.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/views.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/tests.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/urls.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/feeds.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/fixtures/initial_data.json.gz delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/sitemaps.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_feeds.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_regress.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_sitemaps.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/tests.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/urls.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geogapp/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geogapp/fixtures/initial_data.json delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geogapp/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/geogapp/tests.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/inspectapp/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/inspectapp/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/inspectapp/tests.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/layermap/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/layermap/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/layermap/tests.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/relatedapp/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/relatedapp/fixtures/initial_data.json.gz delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/relatedapp/models.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/relatedapp/tests.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/test_geoforms.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/test_measure.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/test_spatialrefsys.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/tests/utils.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/utils/__init__.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/utils/layermapping.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/utils/ogrinfo.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/utils/ogrinspect.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/utils/srs.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/utils/wkt.py delete mode 100644 lib/python2.7/site-packages/django/contrib/gis/views.py (limited to 'lib/python2.7/site-packages/django/contrib/gis') diff --git a/lib/python2.7/site-packages/django/contrib/gis/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/__init__.py deleted file mode 100644 index c996fdf..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.utils import six - -if six.PY3: - memoryview = memoryview -else: - memoryview = buffer diff --git a/lib/python2.7/site-packages/django/contrib/gis/admin/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/admin/__init__.py deleted file mode 100644 index 2b56276..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/admin/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# Getting the normal admin routines, classes, and `site` instance. -from django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline, HORIZONTAL, VERTICAL - -# Geographic admin options classes and widgets. -from django.contrib.gis.admin.options import GeoModelAdmin -from django.contrib.gis.admin.widgets import OpenLayersWidget - -try: - from django.contrib.gis.admin.options import OSMGeoAdmin - HAS_OSM = True -except ImportError: - HAS_OSM = False diff --git a/lib/python2.7/site-packages/django/contrib/gis/admin/options.py b/lib/python2.7/site-packages/django/contrib/gis/admin/options.py deleted file mode 100644 index 7e79be1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/admin/options.py +++ /dev/null @@ -1,139 +0,0 @@ -from django.contrib.admin import ModelAdmin -from django.contrib.gis.admin.widgets import OpenLayersWidget -from django.contrib.gis.gdal import OGRGeomType -from django.contrib.gis.db import models - -class GeoModelAdmin(ModelAdmin): - """ - The administration options class for Geographic models. Map settings - may be overloaded from their defaults to create custom maps. - """ - # The default map settings that may be overloaded -- still subject - # to API changes. - default_lon = 0 - default_lat = 0 - default_zoom = 4 - display_wkt = False - display_srid = False - extra_js = [] - num_zoom = 18 - max_zoom = False - min_zoom = False - units = False - max_resolution = False - max_extent = False - modifiable = True - mouse_position = True - scale_text = True - layerswitcher = True - scrollable = True - map_width = 600 - map_height = 400 - map_srid = 4326 - map_template = 'gis/admin/openlayers.html' - openlayers_url = 'http://openlayers.org/api/2.11/OpenLayers.js' - point_zoom = num_zoom - 6 - wms_url = 'http://vmap0.tiles.osgeo.org/wms/vmap0' - wms_layer = 'basic' - wms_name = 'OpenLayers WMS' - wms_options = {'format': 'image/jpeg'} - debug = False - widget = OpenLayersWidget - - @property - def media(self): - "Injects OpenLayers JavaScript into the admin." - media = super(GeoModelAdmin, self).media - media.add_js([self.openlayers_url]) - media.add_js(self.extra_js) - return media - - def formfield_for_dbfield(self, db_field, **kwargs): - """ - Overloaded from ModelAdmin so that an OpenLayersWidget is used - for viewing/editing 2D GeometryFields (OpenLayers 2 does not support - 3D editing). - """ - if isinstance(db_field, models.GeometryField) and db_field.dim < 3: - request = kwargs.pop('request', None) - # Setting the widget with the newly defined widget. - kwargs['widget'] = self.get_map_widget(db_field) - return db_field.formfield(**kwargs) - else: - return super(GeoModelAdmin, self).formfield_for_dbfield(db_field, **kwargs) - - def get_map_widget(self, db_field): - """ - Returns a subclass of the OpenLayersWidget (or whatever was specified - in the `widget` attribute) using the settings from the attributes set - in this class. - """ - is_collection = db_field.geom_type in ('MULTIPOINT', 'MULTILINESTRING', 'MULTIPOLYGON', 'GEOMETRYCOLLECTION') - if is_collection: - if db_field.geom_type == 'GEOMETRYCOLLECTION': collection_type = 'Any' - else: collection_type = OGRGeomType(db_field.geom_type.replace('MULTI', '')) - else: - collection_type = 'None' - - class OLMap(self.widget): - template = self.map_template - geom_type = db_field.geom_type - - wms_options = '' - if self.wms_options: - wms_options = ["%s: '%s'" % pair for pair in self.wms_options.items()] - wms_options = ', %s' % ', '.join(wms_options) - - params = {'default_lon' : self.default_lon, - 'default_lat' : self.default_lat, - 'default_zoom' : self.default_zoom, - 'display_wkt' : self.debug or self.display_wkt, - 'geom_type' : OGRGeomType(db_field.geom_type), - 'field_name' : db_field.name, - 'is_collection' : is_collection, - 'scrollable' : self.scrollable, - 'layerswitcher' : self.layerswitcher, - 'collection_type' : collection_type, - 'is_generic' : db_field.geom_type == 'GEOMETRY', - 'is_linestring' : db_field.geom_type in ('LINESTRING', 'MULTILINESTRING'), - 'is_polygon' : db_field.geom_type in ('POLYGON', 'MULTIPOLYGON'), - 'is_point' : db_field.geom_type in ('POINT', 'MULTIPOINT'), - 'num_zoom' : self.num_zoom, - 'max_zoom' : self.max_zoom, - 'min_zoom' : self.min_zoom, - 'units' : self.units, #likely shoud get from object - 'max_resolution' : self.max_resolution, - 'max_extent' : self.max_extent, - 'modifiable' : self.modifiable, - 'mouse_position' : self.mouse_position, - 'scale_text' : self.scale_text, - 'map_width' : self.map_width, - 'map_height' : self.map_height, - 'point_zoom' : self.point_zoom, - 'srid' : self.map_srid, - 'display_srid' : self.display_srid, - 'wms_url' : self.wms_url, - 'wms_layer' : self.wms_layer, - 'wms_name' : self.wms_name, - 'wms_options' : wms_options, - 'debug' : self.debug, - } - return OLMap - -from django.contrib.gis import gdal -if gdal.HAS_GDAL: - # Use the official spherical mercator projection SRID on versions - # of GDAL that support it; otherwise, fallback to 900913. - if gdal.GDAL_VERSION >= (1, 7): - spherical_mercator_srid = 3857 - else: - spherical_mercator_srid = 900913 - - class OSMGeoAdmin(GeoModelAdmin): - map_template = 'gis/admin/osm.html' - num_zoom = 20 - map_srid = spherical_mercator_srid - max_extent = '-20037508,-20037508,20037508,20037508' - max_resolution = '156543.0339' - point_zoom = num_zoom - 6 - units = 'm' diff --git a/lib/python2.7/site-packages/django/contrib/gis/admin/widgets.py b/lib/python2.7/site-packages/django/contrib/gis/admin/widgets.py deleted file mode 100644 index 056d259..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/admin/widgets.py +++ /dev/null @@ -1,119 +0,0 @@ -import logging - -from django.forms.widgets import Textarea -from django.template import loader, Context -from django.utils import six -from django.utils import translation - -from django.contrib.gis.gdal import OGRException -from django.contrib.gis.geos import GEOSGeometry, GEOSException - -# Creating a template context that contains Django settings -# values needed by admin map templates. -geo_context = Context({'LANGUAGE_BIDI' : translation.get_language_bidi()}) -logger = logging.getLogger('django.contrib.gis') - - -class OpenLayersWidget(Textarea): - """ - Renders an OpenLayers map using the WKT of the geometry. - """ - def render(self, name, value, attrs=None): - # Update the template parameters with any attributes passed in. - if attrs: self.params.update(attrs) - - # Defaulting the WKT value to a blank string -- this - # will be tested in the JavaScript and the appropriate - # interface will be constructed. - self.params['wkt'] = '' - - # If a string reaches here (via a validation error on another - # field) then just reconstruct the Geometry. - if isinstance(value, six.string_types): - try: - value = GEOSGeometry(value) - except (GEOSException, ValueError) as err: - logger.error( - "Error creating geometry from value '%s' (%s)" % ( - value, err) - ) - value = None - - if (value and value.geom_type.upper() != self.geom_type and - self.geom_type != 'GEOMETRY'): - value = None - - # Constructing the dictionary of the map options. - self.params['map_options'] = self.map_options() - - # Constructing the JavaScript module name using the name of - # the GeometryField (passed in via the `attrs` keyword). - # Use the 'name' attr for the field name (rather than 'field') - self.params['name'] = name - # note: we must switch out dashes for underscores since js - # functions are created using the module variable - js_safe_name = self.params['name'].replace('-','_') - self.params['module'] = 'geodjango_%s' % js_safe_name - - if value: - # Transforming the geometry to the projection used on the - # OpenLayers map. - srid = self.params['srid'] - if value.srid != srid: - try: - ogr = value.ogr - ogr.transform(srid) - wkt = ogr.wkt - except OGRException as err: - logger.error( - "Error transforming geometry from srid '%s' to srid '%s' (%s)" % ( - value.srid, srid, err) - ) - wkt = '' - else: - wkt = value.wkt - - # Setting the parameter WKT with that of the transformed - # geometry. - self.params['wkt'] = wkt - - return loader.render_to_string(self.template, self.params, - context_instance=geo_context) - - def map_options(self): - "Builds the map options hash for the OpenLayers template." - - # JavaScript construction utilities for the Bounds and Projection. - def ol_bounds(extent): - return 'new OpenLayers.Bounds(%s)' % str(extent) - def ol_projection(srid): - return 'new OpenLayers.Projection("EPSG:%s")' % srid - - # An array of the parameter name, the name of their OpenLayers - # counterpart, and the type of variable they are. - map_types = [('srid', 'projection', 'srid'), - ('display_srid', 'displayProjection', 'srid'), - ('units', 'units', str), - ('max_resolution', 'maxResolution', float), - ('max_extent', 'maxExtent', 'bounds'), - ('num_zoom', 'numZoomLevels', int), - ('max_zoom', 'maxZoomLevels', int), - ('min_zoom', 'minZoomLevel', int), - ] - - # Building the map options hash. - map_options = {} - for param_name, js_name, option_type in map_types: - if self.params.get(param_name, False): - if option_type == 'srid': - value = ol_projection(self.params[param_name]) - elif option_type == 'bounds': - value = ol_bounds(self.params[param_name]) - elif option_type in (float, int): - value = self.params[param_name] - elif option_type in (str,): - value = '"%s"' % self.params[param_name] - else: - raise TypeError - map_options[js_name] = value - return map_options diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/db/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/adapter.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/adapter.py deleted file mode 100644 index ca77124..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/adapter.py +++ /dev/null @@ -1,19 +0,0 @@ -class WKTAdapter(object): - """ - This provides an adaptor for Geometries sent to the - MySQL and Oracle database backends. - """ - def __init__(self, geom): - self.wkt = geom.wkt - self.srid = geom.srid - - def __eq__(self, other): - if not isinstance(other, WKTAdapter): - return False - return self.wkt == other.wkt and self.srid == other.srid - - def __str__(self): - return self.wkt - - def prepare_database_save(self, unused): - return self diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/base.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/base.py deleted file mode 100644 index 7db7ce5..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/base.py +++ /dev/null @@ -1,349 +0,0 @@ -""" -Base/mixin classes for the spatial backend database operations and the -`SpatialRefSys` model the backend. -""" -import re - -from django.contrib.gis import gdal -from django.utils import six -from django.utils.encoding import python_2_unicode_compatible - - -class BaseSpatialOperations(object): - """ - This module holds the base `BaseSpatialBackend` object, which is - instantiated by each spatial database backend with the features - it has. - """ - distance_functions = {} - geometry_functions = {} - geometry_operators = {} - geography_operators = {} - geography_functions = {} - gis_terms = set() - truncate_params = {} - - # Quick booleans for the type of this spatial backend, and - # an attribute for the spatial database version tuple (if applicable) - postgis = False - spatialite = False - mysql = False - oracle = False - spatial_version = None - - # How the geometry column should be selected. - select = None - - # Does the spatial database have a geometry or geography type? - geography = False - geometry = False - - area = False - centroid = False - difference = False - distance = False - distance_sphere = False - distance_spheroid = False - envelope = False - force_rhr = False - mem_size = False - bounding_circle = False - num_geom = False - num_points = False - perimeter = False - perimeter3d = False - point_on_surface = False - polygonize = False - reverse = False - scale = False - snap_to_grid = False - sym_difference = False - transform = False - translate = False - union = False - - # Aggregates - collect = False - extent = False - extent3d = False - make_line = False - unionagg = False - - # Serialization - geohash = False - geojson = False - gml = False - kml = False - svg = False - - # Constructors - from_text = False - from_wkb = False - - # Default conversion functions for aggregates; will be overridden if implemented - # for the spatial backend. - def convert_extent(self, box): - raise NotImplementedError('Aggregate extent not implemented for this spatial backend.') - - def convert_extent3d(self, box): - raise NotImplementedError('Aggregate 3D extent not implemented for this spatial backend.') - - def convert_geom(self, geom_val, geom_field): - raise NotImplementedError('Aggregate method not implemented for this spatial backend.') - - # For quoting column values, rather than columns. - def geo_quote_name(self, name): - return "'%s'" % name - - # GeometryField operations - def geo_db_type(self, f): - """ - Returns the database column type for the geometry field on - the spatial backend. - """ - raise NotImplementedError - - def get_distance(self, f, value, lookup_type): - """ - Returns the distance parameters for the given geometry field, - lookup value, and lookup type. - """ - raise NotImplementedError('Distance operations not available on this spatial backend.') - - def get_geom_placeholder(self, f, value): - """ - Returns the placeholder for the given geometry field with the given - value. Depending on the spatial backend, the placeholder may contain a - stored procedure call to the transformation function of the spatial - backend. - """ - raise NotImplementedError - - def get_expression_column(self, evaluator): - """ - Helper method to return the quoted column string from the evaluator - for its expression. - """ - for expr, col_tup in evaluator.cols: - if expr is evaluator.expression: - return '%s.%s' % tuple(map(self.quote_name, col_tup)) - raise Exception("Could not find the column for the expression.") - - # Spatial SQL Construction - def spatial_aggregate_sql(self, agg): - raise NotImplementedError('Aggregate support not implemented for this spatial backend.') - - def spatial_lookup_sql(self, lvalue, lookup_type, value, field): - raise NotImplementedError - - # Routines for getting the OGC-compliant models. - def geometry_columns(self): - raise NotImplementedError - - def spatial_ref_sys(self): - raise NotImplementedError - -@python_2_unicode_compatible -class SpatialRefSysMixin(object): - """ - The SpatialRefSysMixin is a class used by the database-dependent - SpatialRefSys objects to reduce redundnant code. - """ - # For pulling out the spheroid from the spatial reference string. This - # regular expression is used only if the user does not have GDAL installed. - # TODO: Flattening not used in all ellipsoids, could also be a minor axis, - # or 'b' parameter. - spheroid_regex = re.compile(r'.+SPHEROID\[\"(?P.+)\",(?P\d+(\.\d+)?),(?P\d{3}\.\d+),') - - # For pulling out the units on platforms w/o GDAL installed. - # TODO: Figure out how to pull out angular units of projected coordinate system and - # fix for LOCAL_CS types. GDAL should be highly recommended for performing - # distance queries. - units_regex = re.compile(r'.+UNIT ?\["(?P[\w \'\(\)]+)", ?(?P[\d\.]+)(,AUTHORITY\["(?P[\w \'\(\)]+)","(?P\d+)"\])?\]([\w ]+)?(,AUTHORITY\["(?P[\w \'\(\)]+)","(?P\d+)"\])?\]$') - - @property - def srs(self): - """ - Returns a GDAL SpatialReference object, if GDAL is installed. - """ - if gdal.HAS_GDAL: - # TODO: Is caching really necessary here? Is complexity worth it? - if hasattr(self, '_srs'): - # Returning a clone of the cached SpatialReference object. - return self._srs.clone() - else: - # Attempting to cache a SpatialReference object. - - # Trying to get from WKT first. - try: - self._srs = gdal.SpatialReference(self.wkt) - return self.srs - except Exception as msg: - pass - - try: - self._srs = gdal.SpatialReference(self.proj4text) - return self.srs - except Exception as msg: - pass - - raise Exception('Could not get OSR SpatialReference from WKT: %s\nError:\n%s' % (self.wkt, msg)) - else: - raise Exception('GDAL is not installed.') - - @property - def ellipsoid(self): - """ - Returns a tuple of the ellipsoid parameters: - (semimajor axis, semiminor axis, and inverse flattening). - """ - if gdal.HAS_GDAL: - return self.srs.ellipsoid - else: - m = self.spheroid_regex.match(self.wkt) - if m: return (float(m.group('major')), float(m.group('flattening'))) - else: return None - - @property - def name(self): - "Returns the projection name." - return self.srs.name - - @property - def spheroid(self): - "Returns the spheroid name for this spatial reference." - return self.srs['spheroid'] - - @property - def datum(self): - "Returns the datum for this spatial reference." - return self.srs['datum'] - - @property - def projected(self): - "Is this Spatial Reference projected?" - if gdal.HAS_GDAL: - return self.srs.projected - else: - return self.wkt.startswith('PROJCS') - - @property - def local(self): - "Is this Spatial Reference local?" - if gdal.HAS_GDAL: - return self.srs.local - else: - return self.wkt.startswith('LOCAL_CS') - - @property - def geographic(self): - "Is this Spatial Reference geographic?" - if gdal.HAS_GDAL: - return self.srs.geographic - else: - return self.wkt.startswith('GEOGCS') - - @property - def linear_name(self): - "Returns the linear units name." - if gdal.HAS_GDAL: - return self.srs.linear_name - elif self.geographic: - return None - else: - m = self.units_regex.match(self.wkt) - return m.group('unit_name') - - @property - def linear_units(self): - "Returns the linear units." - if gdal.HAS_GDAL: - return self.srs.linear_units - elif self.geographic: - return None - else: - m = self.units_regex.match(self.wkt) - return m.group('unit') - - @property - def angular_name(self): - "Returns the name of the angular units." - if gdal.HAS_GDAL: - return self.srs.angular_name - elif self.projected: - return None - else: - m = self.units_regex.match(self.wkt) - return m.group('unit_name') - - @property - def angular_units(self): - "Returns the angular units." - if gdal.HAS_GDAL: - return self.srs.angular_units - elif self.projected: - return None - else: - m = self.units_regex.match(self.wkt) - return m.group('unit') - - @property - def units(self): - "Returns a tuple of the units and the name." - if self.projected or self.local: - return (self.linear_units, self.linear_name) - elif self.geographic: - return (self.angular_units, self.angular_name) - else: - return (None, None) - - @classmethod - def get_units(cls, wkt): - """ - Class method used by GeometryField on initialization to - retrive the units on the given WKT, without having to use - any of the database fields. - """ - if gdal.HAS_GDAL: - return gdal.SpatialReference(wkt).units - else: - m = cls.units_regex.match(wkt) - return m.group('unit'), m.group('unit_name') - - @classmethod - def get_spheroid(cls, wkt, string=True): - """ - Class method used by GeometryField on initialization to - retrieve the `SPHEROID[..]` parameters from the given WKT. - """ - if gdal.HAS_GDAL: - srs = gdal.SpatialReference(wkt) - sphere_params = srs.ellipsoid - sphere_name = srs['spheroid'] - else: - m = cls.spheroid_regex.match(wkt) - if m: - sphere_params = (float(m.group('major')), float(m.group('flattening'))) - sphere_name = m.group('name') - else: - return None - - if not string: - return sphere_name, sphere_params - else: - # `string` parameter used to place in format acceptable by PostGIS - if len(sphere_params) == 3: - radius, flattening = sphere_params[0], sphere_params[2] - else: - radius, flattening = sphere_params - return 'SPHEROID["%s",%s,%s]' % (sphere_name, radius, flattening) - - def __str__(self): - """ - Returns the string representation. If GDAL is installed, - it will be 'pretty' OGC WKT. - """ - try: - return six.text_type(self.srs) - except: - return six.text_type(self.wkt) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/base.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/base.py deleted file mode 100644 index 7d94458..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/base.py +++ /dev/null @@ -1,13 +0,0 @@ -from django.db.backends.mysql.base import * -from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper -from django.contrib.gis.db.backends.mysql.creation import MySQLCreation -from django.contrib.gis.db.backends.mysql.introspection import MySQLIntrospection -from django.contrib.gis.db.backends.mysql.operations import MySQLOperations - -class DatabaseWrapper(MySQLDatabaseWrapper): - - def __init__(self, *args, **kwargs): - super(DatabaseWrapper, self).__init__(*args, **kwargs) - self.creation = MySQLCreation(self) - self.ops = MySQLOperations(self) - self.introspection = MySQLIntrospection(self) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/compiler.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/compiler.py deleted file mode 100644 index f4654ef..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/compiler.py +++ /dev/null @@ -1,35 +0,0 @@ -from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler -from django.db.backends.mysql import compiler - -SQLCompiler = compiler.SQLCompiler - -class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler): - def resolve_columns(self, row, fields=()): - """ - Integrate the cases handled both by the base GeoSQLCompiler and the - main MySQL compiler (converting 0/1 to True/False for boolean fields). - - Refs #15169. - - """ - row = BaseGeoSQLCompiler.resolve_columns(self, row, fields) - return SQLCompiler.resolve_columns(self, row, fields) - - -class SQLInsertCompiler(compiler.SQLInsertCompiler, GeoSQLCompiler): - pass - -class SQLDeleteCompiler(compiler.SQLDeleteCompiler, GeoSQLCompiler): - pass - -class SQLUpdateCompiler(compiler.SQLUpdateCompiler, GeoSQLCompiler): - pass - -class SQLAggregateCompiler(compiler.SQLAggregateCompiler, GeoSQLCompiler): - pass - -class SQLDateCompiler(compiler.SQLDateCompiler, GeoSQLCompiler): - pass - -class SQLDateTimeCompiler(compiler.SQLDateTimeCompiler, GeoSQLCompiler): - pass diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/creation.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/creation.py deleted file mode 100644 index dda77ea..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/creation.py +++ /dev/null @@ -1,18 +0,0 @@ -from django.db.backends.mysql.creation import DatabaseCreation - -class MySQLCreation(DatabaseCreation): - - def sql_indexes_for_field(self, model, f, style): - from django.contrib.gis.db.models.fields import GeometryField - output = super(MySQLCreation, self).sql_indexes_for_field(model, f, style) - - if isinstance(f, GeometryField) and f.spatial_index: - qn = self.connection.ops.quote_name - db_table = model._meta.db_table - idx_name = '%s_%s_id' % (db_table, f.column) - output.append(style.SQL_KEYWORD('CREATE SPATIAL INDEX ') + - style.SQL_TABLE(qn(idx_name)) + - style.SQL_KEYWORD(' ON ') + - style.SQL_TABLE(qn(db_table)) + '(' + - style.SQL_FIELD(qn(f.column)) + ');') - return output diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py deleted file mode 100644 index 59d0f62..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py +++ /dev/null @@ -1,32 +0,0 @@ -from MySQLdb.constants import FIELD_TYPE - -from django.contrib.gis.gdal import OGRGeomType -from django.db.backends.mysql.introspection import DatabaseIntrospection - -class MySQLIntrospection(DatabaseIntrospection): - # Updating the data_types_reverse dictionary with the appropriate - # type for Geometry fields. - data_types_reverse = DatabaseIntrospection.data_types_reverse.copy() - data_types_reverse[FIELD_TYPE.GEOMETRY] = 'GeometryField' - - def get_geometry_type(self, table_name, geo_col): - cursor = self.connection.cursor() - try: - # In order to get the specific geometry type of the field, - # we introspect on the table definition using `DESCRIBE`. - cursor.execute('DESCRIBE %s' % - self.connection.ops.quote_name(table_name)) - # Increment over description info until we get to the geometry - # column. - for column, typ, null, key, default, extra in cursor.fetchall(): - if column == geo_col: - # Using OGRGeomType to convert from OGC name to Django field. - # MySQL does not support 3D or SRIDs, so the field params - # are empty. - field_type = OGRGeomType(typ).django - field_params = {} - break - finally: - cursor.close() - - return field_type, field_params diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/operations.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/operations.py deleted file mode 100644 index 26cec74..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/operations.py +++ /dev/null @@ -1,67 +0,0 @@ -from django.db.backends.mysql.base import DatabaseOperations - -from django.contrib.gis.db.backends.adapter import WKTAdapter -from django.contrib.gis.db.backends.base import BaseSpatialOperations - - -class MySQLOperations(DatabaseOperations, BaseSpatialOperations): - - compiler_module = 'django.contrib.gis.db.backends.mysql.compiler' - mysql = True - name = 'mysql' - select = 'AsText(%s)' - from_wkb = 'GeomFromWKB' - from_text = 'GeomFromText' - - Adapter = WKTAdapter - Adaptor = Adapter # Backwards-compatibility alias. - - geometry_functions = { - 'bbcontains': 'MBRContains', # For consistency w/PostGIS API - 'bboverlaps': 'MBROverlaps', # .. .. - 'contained': 'MBRWithin', # .. .. - 'contains': 'MBRContains', - 'disjoint': 'MBRDisjoint', - 'equals': 'MBREqual', - 'exact': 'MBREqual', - 'intersects': 'MBRIntersects', - 'overlaps': 'MBROverlaps', - 'same_as': 'MBREqual', - 'touches': 'MBRTouches', - 'within': 'MBRWithin', - } - - gis_terms = set(geometry_functions) | set(['isnull']) - - def geo_db_type(self, f): - return f.geom_type - - def get_geom_placeholder(self, value, srid): - """ - The placeholder here has to include MySQL's WKT constructor. Because - MySQL does not support spatial transformations, there is no need to - modify the placeholder based on the contents of the given value. - """ - if hasattr(value, 'expression'): - placeholder = self.get_expression_column(value) - else: - placeholder = '%s(%%s)' % self.from_text - return placeholder - - def spatial_lookup_sql(self, lvalue, lookup_type, value, field, qn): - alias, col, db_type = lvalue - - geo_col = '%s.%s' % (qn(alias), qn(col)) - - lookup_info = self.geometry_functions.get(lookup_type, False) - if lookup_info: - sql = "%s(%s, %s)" % (lookup_info, geo_col, - self.get_geom_placeholder(value, field.srid)) - return sql, [] - - # TODO: Is this really necessary? MySQL can't handle NULL geometries - # in its spatial indexes anyways. - if lookup_type == 'isnull': - return "%s IS %sNULL" % (geo_col, ('' if value else 'NOT ')), [] - - raise TypeError("Got invalid lookup_type: %s" % repr(lookup_type)) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/adapter.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/adapter.py deleted file mode 100644 index ea340d9..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/adapter.py +++ /dev/null @@ -1,5 +0,0 @@ -from cx_Oracle import CLOB -from django.contrib.gis.db.backends.adapter import WKTAdapter - -class OracleSpatialAdapter(WKTAdapter): - input_size = CLOB diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/base.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/base.py deleted file mode 100644 index 398b3d3..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/base.py +++ /dev/null @@ -1,12 +0,0 @@ -from django.db.backends.oracle.base import * -from django.db.backends.oracle.base import DatabaseWrapper as OracleDatabaseWrapper -from django.contrib.gis.db.backends.oracle.creation import OracleCreation -from django.contrib.gis.db.backends.oracle.introspection import OracleIntrospection -from django.contrib.gis.db.backends.oracle.operations import OracleOperations - -class DatabaseWrapper(OracleDatabaseWrapper): - def __init__(self, *args, **kwargs): - super(DatabaseWrapper, self).__init__(*args, **kwargs) - self.ops = OracleOperations(self) - self.creation = OracleCreation(self) - self.introspection = OracleIntrospection(self) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/compiler.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/compiler.py deleted file mode 100644 index d00af7f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/compiler.py +++ /dev/null @@ -1,25 +0,0 @@ -from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler -from django.db.backends.oracle import compiler - -SQLCompiler = compiler.SQLCompiler - -class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler): - pass - -class SQLInsertCompiler(compiler.SQLInsertCompiler, GeoSQLCompiler): - pass - -class SQLDeleteCompiler(compiler.SQLDeleteCompiler, GeoSQLCompiler): - pass - -class SQLUpdateCompiler(compiler.SQLUpdateCompiler, GeoSQLCompiler): - pass - -class SQLAggregateCompiler(compiler.SQLAggregateCompiler, GeoSQLCompiler): - pass - -class SQLDateCompiler(compiler.SQLDateCompiler, GeoSQLCompiler): - pass - -class SQLDateTimeCompiler(compiler.SQLDateTimeCompiler, GeoSQLCompiler): - pass diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/creation.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/creation.py deleted file mode 100644 index 043da91..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/creation.py +++ /dev/null @@ -1,42 +0,0 @@ -from django.db.backends.oracle.creation import DatabaseCreation -from django.db.backends.util import truncate_name - -class OracleCreation(DatabaseCreation): - - def sql_indexes_for_field(self, model, f, style): - "Return any spatial index creation SQL for the field." - from django.contrib.gis.db.models.fields import GeometryField - - output = super(OracleCreation, self).sql_indexes_for_field(model, f, style) - - if isinstance(f, GeometryField): - gqn = self.connection.ops.geo_quote_name - qn = self.connection.ops.quote_name - db_table = model._meta.db_table - - output.append(style.SQL_KEYWORD('INSERT INTO ') + - style.SQL_TABLE('USER_SDO_GEOM_METADATA') + - ' (%s, %s, %s, %s)\n ' % tuple(map(qn, ['TABLE_NAME', 'COLUMN_NAME', 'DIMINFO', 'SRID'])) + - style.SQL_KEYWORD(' VALUES ') + '(\n ' + - style.SQL_TABLE(gqn(db_table)) + ',\n ' + - style.SQL_FIELD(gqn(f.column)) + ',\n ' + - style.SQL_KEYWORD("MDSYS.SDO_DIM_ARRAY") + '(\n ' + - style.SQL_KEYWORD("MDSYS.SDO_DIM_ELEMENT") + - ("('LONG', %s, %s, %s),\n " % (f._extent[0], f._extent[2], f._tolerance)) + - style.SQL_KEYWORD("MDSYS.SDO_DIM_ELEMENT") + - ("('LAT', %s, %s, %s)\n ),\n" % (f._extent[1], f._extent[3], f._tolerance)) + - ' %s\n );' % f.srid) - - if f.spatial_index: - # Getting the index name, Oracle doesn't allow object - # names > 30 characters. - idx_name = truncate_name('%s_%s_id' % (db_table, f.column), 30) - - output.append(style.SQL_KEYWORD('CREATE INDEX ') + - style.SQL_TABLE(qn(idx_name)) + - style.SQL_KEYWORD(' ON ') + - style.SQL_TABLE(qn(db_table)) + '(' + - style.SQL_FIELD(qn(f.column)) + ') ' + - style.SQL_KEYWORD('INDEXTYPE IS ') + - style.SQL_TABLE('MDSYS.SPATIAL_INDEX') + ';') - return output diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/introspection.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/introspection.py deleted file mode 100644 index d6c8f45..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/introspection.py +++ /dev/null @@ -1,44 +0,0 @@ -import cx_Oracle -import sys -from django.db.backends.oracle.introspection import DatabaseIntrospection -from django.utils import six - -class OracleIntrospection(DatabaseIntrospection): - # Associating any OBJECTVAR instances with GeometryField. Of course, - # this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY, - # but it is the only object type supported within Django anyways. - data_types_reverse = DatabaseIntrospection.data_types_reverse.copy() - data_types_reverse[cx_Oracle.OBJECT] = 'GeometryField' - - def get_geometry_type(self, table_name, geo_col): - cursor = self.connection.cursor() - try: - # Querying USER_SDO_GEOM_METADATA to get the SRID and dimension information. - try: - cursor.execute('SELECT "DIMINFO", "SRID" FROM "USER_SDO_GEOM_METADATA" WHERE "TABLE_NAME"=%s AND "COLUMN_NAME"=%s', - (table_name.upper(), geo_col.upper())) - row = cursor.fetchone() - except Exception as msg: - new_msg = ( - 'Could not find entry in USER_SDO_GEOM_METADATA ' - 'corresponding to "%s"."%s"\n' - 'Error message: %s.') % (table_name, geo_col, msg) - six.reraise(Exception, Exception(new_msg), sys.exc_info()[2]) - - # TODO: Research way to find a more specific geometry field type for - # the column's contents. - field_type = 'GeometryField' - - # Getting the field parameters. - field_params = {} - dim, srid = row - if srid != 4326: - field_params['srid'] = srid - # Length of object array ( SDO_DIM_ARRAY ) is number of dimensions. - dim = len(dim) - if dim != 2: - field_params['dim'] = dim - finally: - cursor.close() - - return field_type, field_params diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/models.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/models.py deleted file mode 100644 index b7deb3a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/models.py +++ /dev/null @@ -1,66 +0,0 @@ -""" - The GeometryColumns and SpatialRefSys models for the Oracle spatial - backend. - - It should be noted that Oracle Spatial does not have database tables - named according to the OGC standard, so the closest analogs are used. - For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns - model and the `SDO_COORD_REF_SYS` is used for the SpatialRefSys model. -""" -from django.contrib.gis.db import models -from django.contrib.gis.db.backends.base import SpatialRefSysMixin -from django.utils.encoding import python_2_unicode_compatible - -@python_2_unicode_compatible -class GeometryColumns(models.Model): - "Maps to the Oracle USER_SDO_GEOM_METADATA table." - table_name = models.CharField(max_length=32) - column_name = models.CharField(max_length=1024) - srid = models.IntegerField(primary_key=True) - # TODO: Add support for `diminfo` column (type MDSYS.SDO_DIM_ARRAY). - class Meta: - db_table = 'USER_SDO_GEOM_METADATA' - managed = False - - @classmethod - def table_name_col(cls): - """ - Returns the name of the metadata column used to store the - the feature table name. - """ - return 'table_name' - - @classmethod - def geom_col_name(cls): - """ - Returns the name of the metadata column used to store the - the feature geometry column. - """ - return 'column_name' - - def __str__(self): - return '%s - %s (SRID: %s)' % (self.table_name, self.column_name, self.srid) - -class SpatialRefSys(models.Model, SpatialRefSysMixin): - "Maps to the Oracle MDSYS.CS_SRS table." - cs_name = models.CharField(max_length=68) - srid = models.IntegerField(primary_key=True) - auth_srid = models.IntegerField() - auth_name = models.CharField(max_length=256) - wktext = models.CharField(max_length=2046) - # Optional geometry representing the bounds of this coordinate - # system. By default, all are NULL in the table. - cs_bounds = models.PolygonField(null=True) - objects = models.GeoManager() - - class Meta: - db_table = 'CS_SRS' - managed = False - - @property - def wkt(self): - return self.wktext - - @classmethod - def wkt_col(cls): - return 'wktext' diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/operations.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/operations.py deleted file mode 100644 index 84217c3..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/operations.py +++ /dev/null @@ -1,304 +0,0 @@ -""" - This module contains the spatial lookup types, and the `get_geo_where_clause` - routine for Oracle Spatial. - - Please note that WKT support is broken on the XE version, and thus - this backend will not work on such platforms. Specifically, XE lacks - support for an internal JVM, and Java libraries are required to use - the WKT constructors. -""" -import re -from decimal import Decimal - -from django.db.backends.oracle.base import DatabaseOperations -from django.contrib.gis.db.backends.base import BaseSpatialOperations -from django.contrib.gis.db.backends.oracle.adapter import OracleSpatialAdapter -from django.contrib.gis.db.backends.util import SpatialFunction -from django.contrib.gis.geometry.backend import Geometry -from django.contrib.gis.measure import Distance -from django.utils import six - - -class SDOOperation(SpatialFunction): - "Base class for SDO* Oracle operations." - sql_template = "%(function)s(%(geo_col)s, %(geometry)s) %(operator)s '%(result)s'" - - def __init__(self, func, **kwargs): - kwargs.setdefault('operator', '=') - kwargs.setdefault('result', 'TRUE') - super(SDOOperation, self).__init__(func, **kwargs) - -class SDODistance(SpatialFunction): - "Class for Distance queries." - sql_template = ('%(function)s(%(geo_col)s, %(geometry)s, %(tolerance)s) ' - '%(operator)s %(result)s') - dist_func = 'SDO_GEOM.SDO_DISTANCE' - - def __init__(self, op, tolerance=0.05): - super(SDODistance, self).__init__(self.dist_func, - tolerance=tolerance, - operator=op, result='%s') - -class SDODWithin(SpatialFunction): - dwithin_func = 'SDO_WITHIN_DISTANCE' - sql_template = "%(function)s(%(geo_col)s, %(geometry)s, %%s) = 'TRUE'" - - def __init__(self): - super(SDODWithin, self).__init__(self.dwithin_func) - -class SDOGeomRelate(SpatialFunction): - "Class for using SDO_GEOM.RELATE." - relate_func = 'SDO_GEOM.RELATE' - sql_template = ("%(function)s(%(geo_col)s, '%(mask)s', %(geometry)s, " - "%(tolerance)s) %(operator)s '%(mask)s'") - - def __init__(self, mask, tolerance=0.05): - # SDO_GEOM.RELATE(...) has a peculiar argument order: column, mask, geom, tolerance. - # Moreover, the runction result is the mask (e.g., 'DISJOINT' instead of 'TRUE'). - super(SDOGeomRelate, self).__init__(self.relate_func, operator='=', - mask=mask, tolerance=tolerance) - -class SDORelate(SpatialFunction): - "Class for using SDO_RELATE." - masks = 'TOUCH|OVERLAPBDYDISJOINT|OVERLAPBDYINTERSECT|EQUAL|INSIDE|COVEREDBY|CONTAINS|COVERS|ANYINTERACT|ON' - mask_regex = re.compile(r'^(%s)(\+(%s))*$' % (masks, masks), re.I) - sql_template = "%(function)s(%(geo_col)s, %(geometry)s, 'mask=%(mask)s') = 'TRUE'" - relate_func = 'SDO_RELATE' - - def __init__(self, mask): - if not self.mask_regex.match(mask): - raise ValueError('Invalid %s mask: "%s"' % (self.relate_func, mask)) - super(SDORelate, self).__init__(self.relate_func, mask=mask) - -# Valid distance types and substitutions -dtypes = (Decimal, Distance, float) + six.integer_types - -class OracleOperations(DatabaseOperations, BaseSpatialOperations): - compiler_module = "django.contrib.gis.db.backends.oracle.compiler" - - name = 'oracle' - oracle = True - valid_aggregates = dict([(a, None) for a in ('Union', 'Extent')]) - - Adapter = OracleSpatialAdapter - Adaptor = Adapter # Backwards-compatibility alias. - - area = 'SDO_GEOM.SDO_AREA' - gml = 'SDO_UTIL.TO_GMLGEOMETRY' - centroid = 'SDO_GEOM.SDO_CENTROID' - difference = 'SDO_GEOM.SDO_DIFFERENCE' - distance = 'SDO_GEOM.SDO_DISTANCE' - extent = 'SDO_AGGR_MBR' - intersection = 'SDO_GEOM.SDO_INTERSECTION' - length = 'SDO_GEOM.SDO_LENGTH' - num_geom = 'SDO_UTIL.GETNUMELEM' - num_points = 'SDO_UTIL.GETNUMVERTICES' - perimeter = length - point_on_surface = 'SDO_GEOM.SDO_POINTONSURFACE' - reverse = 'SDO_UTIL.REVERSE_LINESTRING' - sym_difference = 'SDO_GEOM.SDO_XOR' - transform = 'SDO_CS.TRANSFORM' - union = 'SDO_GEOM.SDO_UNION' - unionagg = 'SDO_AGGR_UNION' - - # We want to get SDO Geometries as WKT because it is much easier to - # instantiate GEOS proxies from WKT than SDO_GEOMETRY(...) strings. - # However, this adversely affects performance (i.e., Java is called - # to convert to WKT on every query). If someone wishes to write a - # SDO_GEOMETRY(...) parser in Python, let me know =) - select = 'SDO_UTIL.TO_WKTGEOMETRY(%s)' - - distance_functions = { - 'distance_gt' : (SDODistance('>'), dtypes), - 'distance_gte' : (SDODistance('>='), dtypes), - 'distance_lt' : (SDODistance('<'), dtypes), - 'distance_lte' : (SDODistance('<='), dtypes), - 'dwithin' : (SDODWithin(), dtypes), - } - - geometry_functions = { - 'contains' : SDOOperation('SDO_CONTAINS'), - 'coveredby' : SDOOperation('SDO_COVEREDBY'), - 'covers' : SDOOperation('SDO_COVERS'), - 'disjoint' : SDOGeomRelate('DISJOINT'), - 'intersects' : SDOOperation('SDO_OVERLAPBDYINTERSECT'), # TODO: Is this really the same as ST_Intersects()? - 'equals' : SDOOperation('SDO_EQUAL'), - 'exact' : SDOOperation('SDO_EQUAL'), - 'overlaps' : SDOOperation('SDO_OVERLAPS'), - 'same_as' : SDOOperation('SDO_EQUAL'), - 'relate' : (SDORelate, six.string_types), # Oracle uses a different syntax, e.g., 'mask=inside+touch' - 'touches' : SDOOperation('SDO_TOUCH'), - 'within' : SDOOperation('SDO_INSIDE'), - } - geometry_functions.update(distance_functions) - - gis_terms = set(['isnull']) - gis_terms.update(geometry_functions) - - truncate_params = {'relate' : None} - - def convert_extent(self, clob): - if clob: - # Generally, Oracle returns a polygon for the extent -- however, - # it can return a single point if there's only one Point in the - # table. - ext_geom = Geometry(clob.read()) - gtype = str(ext_geom.geom_type) - if gtype == 'Polygon': - # Construct the 4-tuple from the coordinates in the polygon. - shell = ext_geom.shell - ll, ur = shell[0][:2], shell[2][:2] - elif gtype == 'Point': - ll = ext_geom.coords[:2] - ur = ll - else: - raise Exception('Unexpected geometry type returned for extent: %s' % gtype) - xmin, ymin = ll - xmax, ymax = ur - return (xmin, ymin, xmax, ymax) - else: - return None - - def convert_geom(self, clob, geo_field): - if clob: - return Geometry(clob.read(), geo_field.srid) - else: - return None - - def geo_db_type(self, f): - """ - Returns the geometry database type for Oracle. Unlike other spatial - backends, no stored procedure is necessary and it's the same for all - geometry types. - """ - return 'MDSYS.SDO_GEOMETRY' - - def get_distance(self, f, value, lookup_type): - """ - Returns the distance parameters given the value and the lookup type. - On Oracle, geometry columns with a geodetic coordinate system behave - implicitly like a geography column, and thus meters will be used as - the distance parameter on them. - """ - if not value: - return [] - value = value[0] - if isinstance(value, Distance): - if f.geodetic(self.connection): - dist_param = value.m - else: - dist_param = getattr(value, Distance.unit_attname(f.units_name(self.connection))) - else: - dist_param = value - - # dwithin lookups on oracle require a special string parameter - # that starts with "distance=". - if lookup_type == 'dwithin': - dist_param = 'distance=%s' % dist_param - - return [dist_param] - - def get_geom_placeholder(self, f, value): - """ - Provides a proper substitution value for Geometries that are not in the - SRID of the field. Specifically, this routine will substitute in the - SDO_CS.TRANSFORM() function call. - """ - if value is None: - return 'NULL' - - def transform_value(val, srid): - return val.srid != srid - - if hasattr(value, 'expression'): - if transform_value(value, f.srid): - placeholder = '%s(%%s, %s)' % (self.transform, f.srid) - else: - placeholder = '%s' - # No geometry value used for F expression, substitue in - # the column name instead. - return placeholder % self.get_expression_column(value) - else: - if transform_value(value, f.srid): - return '%s(SDO_GEOMETRY(%%s, %s), %s)' % (self.transform, value.srid, f.srid) - else: - return 'SDO_GEOMETRY(%%s, %s)' % f.srid - - def spatial_lookup_sql(self, lvalue, lookup_type, value, field, qn): - "Returns the SQL WHERE clause for use in Oracle spatial SQL construction." - alias, col, db_type = lvalue - - # Getting the quoted table name as `geo_col`. - geo_col = '%s.%s' % (qn(alias), qn(col)) - - # See if a Oracle Geometry function matches the lookup type next - lookup_info = self.geometry_functions.get(lookup_type, False) - if lookup_info: - # Lookup types that are tuples take tuple arguments, e.g., 'relate' and - # 'dwithin' lookup types. - if isinstance(lookup_info, tuple): - # First element of tuple is lookup type, second element is the type - # of the expected argument (e.g., str, float) - sdo_op, arg_type = lookup_info - geom = value[0] - - # Ensuring that a tuple _value_ was passed in from the user - if not isinstance(value, tuple): - raise ValueError('Tuple required for `%s` lookup type.' % lookup_type) - if len(value) != 2: - raise ValueError('2-element tuple required for %s lookup type.' % lookup_type) - - # Ensuring the argument type matches what we expect. - if not isinstance(value[1], arg_type): - raise ValueError('Argument type should be %s, got %s instead.' % (arg_type, type(value[1]))) - - if lookup_type == 'relate': - # The SDORelate class handles construction for these queries, - # and verifies the mask argument. - return sdo_op(value[1]).as_sql(geo_col, self.get_geom_placeholder(field, geom)) - else: - # Otherwise, just call the `as_sql` method on the SDOOperation instance. - return sdo_op.as_sql(geo_col, self.get_geom_placeholder(field, geom)) - else: - # Lookup info is a SDOOperation instance, whose `as_sql` method returns - # the SQL necessary for the geometry function call. For example: - # SDO_CONTAINS("geoapp_country"."poly", SDO_GEOMTRY('POINT(5 23)', 4326)) = 'TRUE' - return lookup_info.as_sql(geo_col, self.get_geom_placeholder(field, value)) - elif lookup_type == 'isnull': - # Handling 'isnull' lookup type - return "%s IS %sNULL" % (geo_col, ('' if value else 'NOT ')), [] - - raise TypeError("Got invalid lookup_type: %s" % repr(lookup_type)) - - def spatial_aggregate_sql(self, agg): - """ - Returns the spatial aggregate SQL template and function for the - given Aggregate instance. - """ - agg_name = agg.__class__.__name__.lower() - if agg_name == 'union': - agg_name += 'agg' - if agg.is_extent: - sql_template = '%(function)s(%(field)s)' - else: - sql_template = '%(function)s(SDOAGGRTYPE(%(field)s,%(tolerance)s))' - sql_function = getattr(self, agg_name) - return self.select % sql_template, sql_function - - # Routines for getting the OGC-compliant models. - def geometry_columns(self): - from django.contrib.gis.db.backends.oracle.models import GeometryColumns - return GeometryColumns - - def spatial_ref_sys(self): - from django.contrib.gis.db.backends.oracle.models import SpatialRefSys - return SpatialRefSys - - def modify_insert_params(self, placeholders, params): - """Drop out insert parameters for NULL placeholder. Needed for Oracle Spatial - backend due to #10888 - """ - # This code doesn't work for bulk insert cases. - assert len(placeholders) == 1 - return [[param for pholder, param - in six.moves.zip(placeholders[0], params[0]) if pholder != 'NULL'], ] diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/adapter.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/adapter.py deleted file mode 100644 index 8bb514d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/adapter.py +++ /dev/null @@ -1,46 +0,0 @@ -""" - This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. -""" -from __future__ import unicode_literals - -from psycopg2 import Binary -from psycopg2.extensions import ISQLQuote - -class PostGISAdapter(object): - def __init__(self, geom): - "Initializes on the geometry." - # Getting the WKB (in string form, to allow easy pickling of - # the adaptor) and the SRID from the geometry. - self.ewkb = bytes(geom.ewkb) - self.srid = geom.srid - self._adapter = Binary(self.ewkb) - - def __conform__(self, proto): - # Does the given protocol conform to what Psycopg2 expects? - if proto == ISQLQuote: - return self - else: - raise Exception('Error implementing psycopg2 protocol. Is psycopg2 installed?') - - def __eq__(self, other): - if not isinstance(other, PostGISAdapter): - return False - return (self.ewkb == other.ewkb) and (self.srid == other.srid) - - def __str__(self): - return self.getquoted() - - def prepare(self, conn): - """ - This method allows escaping the binary in the style required by the - server's `standard_conforming_string` setting. - """ - self._adapter.prepare(conn) - - def getquoted(self): - "Returns a properly quoted string for use in PostgreSQL/PostGIS." - # psycopg will figure out whether to use E'\\000' or '\000' - return str('ST_GeomFromEWKB(%s)' % self._adapter.getquoted().decode()) - - def prepare_database_save(self, unused): - return self diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py deleted file mode 100644 index 634a7d5..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py +++ /dev/null @@ -1,12 +0,0 @@ -from django.db.backends.postgresql_psycopg2.base import * -from django.db.backends.postgresql_psycopg2.base import DatabaseWrapper as Psycopg2DatabaseWrapper -from django.contrib.gis.db.backends.postgis.creation import PostGISCreation -from django.contrib.gis.db.backends.postgis.introspection import PostGISIntrospection -from django.contrib.gis.db.backends.postgis.operations import PostGISOperations - -class DatabaseWrapper(Psycopg2DatabaseWrapper): - def __init__(self, *args, **kwargs): - super(DatabaseWrapper, self).__init__(*args, **kwargs) - self.creation = PostGISCreation(self) - self.ops = PostGISOperations(self) - self.introspection = PostGISIntrospection(self) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/creation.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/creation.py deleted file mode 100644 index 4f64ecc..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/creation.py +++ /dev/null @@ -1,95 +0,0 @@ -from django.conf import settings -from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation -from django.utils.functional import cached_property - - -class PostGISCreation(DatabaseCreation): - geom_index_type = 'GIST' - geom_index_ops = 'GIST_GEOMETRY_OPS' - geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND' - - @cached_property - def template_postgis(self): - template_postgis = getattr(settings, 'POSTGIS_TEMPLATE', 'template_postgis') - cursor = self.connection.cursor() - cursor.execute('SELECT 1 FROM pg_database WHERE datname = %s LIMIT 1;', (template_postgis,)) - if cursor.fetchone(): - return template_postgis - return None - - def sql_indexes_for_field(self, model, f, style): - "Return any spatial index creation SQL for the field." - from django.contrib.gis.db.models.fields import GeometryField - - output = super(PostGISCreation, self).sql_indexes_for_field(model, f, style) - - if isinstance(f, GeometryField): - gqn = self.connection.ops.geo_quote_name - qn = self.connection.ops.quote_name - db_table = model._meta.db_table - - if f.geography or self.connection.ops.geometry: - # Geography and Geometry (PostGIS 2.0+) columns are - # created normally. - pass - else: - # Geometry columns are created by `AddGeometryColumn` - # stored procedure. - output.append(style.SQL_KEYWORD('SELECT ') + - style.SQL_TABLE('AddGeometryColumn') + '(' + - style.SQL_TABLE(gqn(db_table)) + ', ' + - style.SQL_FIELD(gqn(f.column)) + ', ' + - style.SQL_FIELD(str(f.srid)) + ', ' + - style.SQL_COLTYPE(gqn(f.geom_type)) + ', ' + - style.SQL_KEYWORD(str(f.dim)) + ');') - - if not f.null: - # Add a NOT NULL constraint to the field - output.append(style.SQL_KEYWORD('ALTER TABLE ') + - style.SQL_TABLE(qn(db_table)) + - style.SQL_KEYWORD(' ALTER ') + - style.SQL_FIELD(qn(f.column)) + - style.SQL_KEYWORD(' SET NOT NULL') + ';') - - if f.spatial_index: - # Spatial indexes created the same way for both Geometry and - # Geography columns. - # PostGIS 2.0 does not support GIST_GEOMETRY_OPS. So, on 1.5 - # we use GIST_GEOMETRY_OPS, on 2.0 we use either "nd" ops - # which are fast on multidimensional cases, or just plain - # gist index for the 2d case. - if f.geography: - index_ops = '' - elif self.connection.ops.geometry: - if f.dim > 2: - index_ops = ' ' + style.SQL_KEYWORD(self.geom_index_ops_nd) - else: - index_ops = '' - else: - index_ops = ' ' + style.SQL_KEYWORD(self.geom_index_ops) - output.append(style.SQL_KEYWORD('CREATE INDEX ') + - style.SQL_TABLE(qn('%s_%s_id' % (db_table, f.column))) + - style.SQL_KEYWORD(' ON ') + - style.SQL_TABLE(qn(db_table)) + - style.SQL_KEYWORD(' USING ') + - style.SQL_COLTYPE(self.geom_index_type) + ' ( ' + - style.SQL_FIELD(qn(f.column)) + index_ops + ' );') - return output - - def sql_table_creation_suffix(self): - if self.template_postgis is not None: - return ' TEMPLATE %s' % ( - self.connection.ops.quote_name(self.template_postgis),) - return '' - - def _create_test_db(self, verbosity, autoclobber): - test_database_name = super(PostGISCreation, self)._create_test_db(verbosity, autoclobber) - if self.template_postgis is None: - # Connect to the test database in order to create the postgis extension - self.connection.close() - self.connection.settings_dict["NAME"] = test_database_name - cursor = self.connection.cursor() - cursor.execute("CREATE EXTENSION postgis") - cursor.connection.commit() - - return test_database_name diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/introspection.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/introspection.py deleted file mode 100644 index 7df09d0..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/introspection.py +++ /dev/null @@ -1,103 +0,0 @@ -from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection -from django.contrib.gis.gdal import OGRGeomType - -class GeoIntrospectionError(Exception): - pass - -class PostGISIntrospection(DatabaseIntrospection): - # Reverse dictionary for PostGIS geometry types not populated until - # introspection is actually performed. - postgis_types_reverse = {} - - ignored_tables = DatabaseIntrospection.ignored_tables + [ - 'geography_columns', - 'geometry_columns', - 'raster_columns', - 'spatial_ref_sys', - 'raster_overviews', - ] - - def get_postgis_types(self): - """ - Returns a dictionary with keys that are the PostgreSQL object - identification integers for the PostGIS geometry and/or - geography types (if supported). - """ - cursor = self.connection.cursor() - # The OID integers associated with the geometry type may - # be different across versions; hence, this is why we have - # to query the PostgreSQL pg_type table corresponding to the - # PostGIS custom data types. - oid_sql = 'SELECT "oid" FROM "pg_type" WHERE "typname" = %s' - try: - cursor.execute(oid_sql, ('geometry',)) - GEOM_TYPE = cursor.fetchone()[0] - postgis_types = { GEOM_TYPE : 'GeometryField' } - if self.connection.ops.geography: - cursor.execute(oid_sql, ('geography',)) - GEOG_TYPE = cursor.fetchone()[0] - # The value for the geography type is actually a tuple - # to pass in the `geography=True` keyword to the field - # definition. - postgis_types[GEOG_TYPE] = ('GeometryField', {'geography' : True}) - finally: - cursor.close() - - return postgis_types - - def get_field_type(self, data_type, description): - if not self.postgis_types_reverse: - # If the PostGIS types reverse dictionary is not populated, do so - # now. In order to prevent unnecessary requests upon connection - # intialization, the `data_types_reverse` dictionary is not updated - # with the PostGIS custom types until introspection is actually - # performed -- in other words, when this function is called. - self.postgis_types_reverse = self.get_postgis_types() - self.data_types_reverse.update(self.postgis_types_reverse) - return super(PostGISIntrospection, self).get_field_type(data_type, description) - - def get_geometry_type(self, table_name, geo_col): - """ - The geometry type OID used by PostGIS does not indicate the particular - type of field that a geometry column is (e.g., whether it's a - PointField or a PolygonField). Thus, this routine queries the PostGIS - metadata tables to determine the geometry type, - """ - cursor = self.connection.cursor() - try: - try: - # First seeing if this geometry column is in the `geometry_columns` - cursor.execute('SELECT "coord_dimension", "srid", "type" ' - 'FROM "geometry_columns" ' - 'WHERE "f_table_name"=%s AND "f_geometry_column"=%s', - (table_name, geo_col)) - row = cursor.fetchone() - if not row: raise GeoIntrospectionError - except GeoIntrospectionError: - if self.connection.ops.geography: - cursor.execute('SELECT "coord_dimension", "srid", "type" ' - 'FROM "geography_columns" ' - 'WHERE "f_table_name"=%s AND "f_geography_column"=%s', - (table_name, geo_col)) - row = cursor.fetchone() - - if not row: - raise Exception('Could not find a geometry or geography column for "%s"."%s"' % - (table_name, geo_col)) - - # OGRGeomType does not require GDAL and makes it easy to convert - # from OGC geom type name to Django field. - field_type = OGRGeomType(row[2]).django - - # Getting any GeometryField keyword arguments that are not the default. - dim = row[0] - srid = row[1] - field_params = {} - if srid != 4326: - field_params['srid'] = srid - if dim != 2: - field_params['dim'] = dim - finally: - cursor.close() - - return field_type, field_params diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/models.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/models.py deleted file mode 100644 index e805259..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/models.py +++ /dev/null @@ -1,68 +0,0 @@ -""" - The GeometryColumns and SpatialRefSys models for the PostGIS backend. -""" -from django.db import models -from django.contrib.gis.db.backends.base import SpatialRefSysMixin -from django.utils.encoding import python_2_unicode_compatible - -@python_2_unicode_compatible -class GeometryColumns(models.Model): - """ - The 'geometry_columns' table from the PostGIS. See the PostGIS - documentation at Ch. 4.2.2. - """ - f_table_catalog = models.CharField(max_length=256) - f_table_schema = models.CharField(max_length=256) - f_table_name = models.CharField(max_length=256) - f_geometry_column = models.CharField(max_length=256) - coord_dimension = models.IntegerField() - srid = models.IntegerField(primary_key=True) - type = models.CharField(max_length=30) - - class Meta: - db_table = 'geometry_columns' - managed = False - - @classmethod - def table_name_col(cls): - """ - Returns the name of the metadata column used to store the - the feature table name. - """ - return 'f_table_name' - - @classmethod - def geom_col_name(cls): - """ - Returns the name of the metadata column used to store the - the feature geometry column. - """ - return 'f_geometry_column' - - def __str__(self): - return "%s.%s - %dD %s field (SRID: %d)" % \ - (self.f_table_name, self.f_geometry_column, - self.coord_dimension, self.type, self.srid) - -class SpatialRefSys(models.Model, SpatialRefSysMixin): - """ - The 'spatial_ref_sys' table from PostGIS. See the PostGIS - documentaiton at Ch. 4.2.1. - """ - srid = models.IntegerField(primary_key=True) - auth_name = models.CharField(max_length=256) - auth_srid = models.IntegerField() - srtext = models.CharField(max_length=2048) - proj4text = models.CharField(max_length=2048) - - class Meta: - db_table = 'spatial_ref_sys' - managed = False - - @property - def wkt(self): - return self.srtext - - @classmethod - def wkt_col(cls): - return 'srtext' diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/operations.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/operations.py deleted file mode 100644 index 84dbda3..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/operations.py +++ /dev/null @@ -1,569 +0,0 @@ -import re -from decimal import Decimal - -from django.conf import settings -from django.contrib.gis.db.backends.base import BaseSpatialOperations -from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction -from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter -from django.contrib.gis.geometry.backend import Geometry -from django.contrib.gis.measure import Distance -from django.core.exceptions import ImproperlyConfigured -from django.db.backends.postgresql_psycopg2.base import DatabaseOperations -from django.db.utils import DatabaseError -from django.utils import six -from django.utils.functional import cached_property - -from .models import GeometryColumns, SpatialRefSys - - -#### Classes used in constructing PostGIS spatial SQL #### -class PostGISOperator(SpatialOperation): - "For PostGIS operators (e.g. `&&`, `~`)." - def __init__(self, operator): - super(PostGISOperator, self).__init__(operator=operator) - -class PostGISFunction(SpatialFunction): - "For PostGIS function calls (e.g., `ST_Contains(table, geom)`)." - def __init__(self, prefix, function, **kwargs): - super(PostGISFunction, self).__init__(prefix + function, **kwargs) - -class PostGISFunctionParam(PostGISFunction): - "For PostGIS functions that take another parameter (e.g. DWithin, Relate)." - sql_template = '%(function)s(%(geo_col)s, %(geometry)s, %%s)' - -class PostGISDistance(PostGISFunction): - "For PostGIS distance operations." - dist_func = 'Distance' - sql_template = '%(function)s(%(geo_col)s, %(geometry)s) %(operator)s %%s' - - def __init__(self, prefix, operator): - super(PostGISDistance, self).__init__(prefix, self.dist_func, - operator=operator) - -class PostGISSpheroidDistance(PostGISFunction): - "For PostGIS spherical distance operations (using the spheroid)." - dist_func = 'distance_spheroid' - sql_template = '%(function)s(%(geo_col)s, %(geometry)s, %%s) %(operator)s %%s' - def __init__(self, prefix, operator): - # An extra parameter in `end_subst` is needed for the spheroid string. - super(PostGISSpheroidDistance, self).__init__(prefix, self.dist_func, - operator=operator) - -class PostGISSphereDistance(PostGISDistance): - "For PostGIS spherical distance operations." - dist_func = 'distance_sphere' - -class PostGISRelate(PostGISFunctionParam): - "For PostGIS Relate(, ) calls." - pattern_regex = re.compile(r'^[012TF\*]{9}$') - def __init__(self, prefix, pattern): - if not self.pattern_regex.match(pattern): - raise ValueError('Invalid intersection matrix pattern "%s".' % pattern) - super(PostGISRelate, self).__init__(prefix, 'Relate') - - -class PostGISOperations(DatabaseOperations, BaseSpatialOperations): - compiler_module = 'django.contrib.gis.db.models.sql.compiler' - name = 'postgis' - postgis = True - geom_func_prefix = 'ST_' - version_regex = re.compile(r'^(?P\d)\.(?P\d)\.(?P\d+)') - valid_aggregates = dict([(k, None) for k in - ('Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union')]) - - Adapter = PostGISAdapter - Adaptor = Adapter # Backwards-compatibility alias. - - def __init__(self, connection): - super(PostGISOperations, self).__init__(connection) - - prefix = self.geom_func_prefix - # PostGIS-specific operators. The commented descriptions of these - # operators come from Section 7.6 of the PostGIS 1.4 documentation. - self.geometry_operators = { - # The "&<" operator returns true if A's bounding box overlaps or - # is to the left of B's bounding box. - 'overlaps_left' : PostGISOperator('&<'), - # The "&>" operator returns true if A's bounding box overlaps or - # is to the right of B's bounding box. - 'overlaps_right' : PostGISOperator('&>'), - # The "<<" operator returns true if A's bounding box is strictly - # to the left of B's bounding box. - 'left' : PostGISOperator('<<'), - # The ">>" operator returns true if A's bounding box is strictly - # to the right of B's bounding box. - 'right' : PostGISOperator('>>'), - # The "&<|" operator returns true if A's bounding box overlaps or - # is below B's bounding box. - 'overlaps_below' : PostGISOperator('&<|'), - # The "|&>" operator returns true if A's bounding box overlaps or - # is above B's bounding box. - 'overlaps_above' : PostGISOperator('|&>'), - # The "<<|" operator returns true if A's bounding box is strictly - # below B's bounding box. - 'strictly_below' : PostGISOperator('<<|'), - # The "|>>" operator returns true if A's bounding box is strictly - # above B's bounding box. - 'strictly_above' : PostGISOperator('|>>'), - # The "~=" operator is the "same as" operator. It tests actual - # geometric equality of two features. So if A and B are the same feature, - # vertex-by-vertex, the operator returns true. - 'same_as' : PostGISOperator('~='), - 'exact' : PostGISOperator('~='), - # The "@" operator returns true if A's bounding box is completely contained - # by B's bounding box. - 'contained' : PostGISOperator('@'), - # The "~" operator returns true if A's bounding box completely contains - # by B's bounding box. - 'bbcontains' : PostGISOperator('~'), - # The "&&" operator returns true if A's bounding box overlaps - # B's bounding box. - 'bboverlaps' : PostGISOperator('&&'), - } - - self.geometry_functions = { - 'equals' : PostGISFunction(prefix, 'Equals'), - 'disjoint' : PostGISFunction(prefix, 'Disjoint'), - 'touches' : PostGISFunction(prefix, 'Touches'), - 'crosses' : PostGISFunction(prefix, 'Crosses'), - 'within' : PostGISFunction(prefix, 'Within'), - 'overlaps' : PostGISFunction(prefix, 'Overlaps'), - 'contains' : PostGISFunction(prefix, 'Contains'), - 'intersects' : PostGISFunction(prefix, 'Intersects'), - 'relate' : (PostGISRelate, six.string_types), - 'coveredby' : PostGISFunction(prefix, 'CoveredBy'), - 'covers' : PostGISFunction(prefix, 'Covers'), - } - - # Valid distance types and substitutions - dtypes = (Decimal, Distance, float) + six.integer_types - def get_dist_ops(operator): - "Returns operations for both regular and spherical distances." - return {'cartesian' : PostGISDistance(prefix, operator), - 'sphere' : PostGISSphereDistance(prefix, operator), - 'spheroid' : PostGISSpheroidDistance(prefix, operator), - } - self.distance_functions = { - 'distance_gt' : (get_dist_ops('>'), dtypes), - 'distance_gte' : (get_dist_ops('>='), dtypes), - 'distance_lt' : (get_dist_ops('<'), dtypes), - 'distance_lte' : (get_dist_ops('<='), dtypes), - 'dwithin' : (PostGISFunctionParam(prefix, 'DWithin'), dtypes) - } - - # Adding the distance functions to the geometries lookup. - self.geometry_functions.update(self.distance_functions) - - # Only PostGIS versions 1.3.4+ have GeoJSON serialization support. - if self.spatial_version < (1, 3, 4): - GEOJSON = False - else: - GEOJSON = prefix + 'AsGeoJson' - - # ST_ContainsProperly ST_MakeLine, and ST_GeoHash added in 1.4. - if self.spatial_version >= (1, 4, 0): - GEOHASH = 'ST_GeoHash' - BOUNDINGCIRCLE = 'ST_MinimumBoundingCircle' - self.geometry_functions['contains_properly'] = PostGISFunction(prefix, 'ContainsProperly') - else: - GEOHASH, BOUNDINGCIRCLE = False, False - - # Geography type support added in 1.5. - if self.spatial_version >= (1, 5, 0): - self.geography = True - # Only a subset of the operators and functions are available - # for the geography type. - self.geography_functions = self.distance_functions.copy() - self.geography_functions.update({ - 'coveredby': self.geometry_functions['coveredby'], - 'covers': self.geometry_functions['covers'], - 'intersects': self.geometry_functions['intersects'], - }) - self.geography_operators = { - 'bboverlaps': PostGISOperator('&&'), - } - - # Native geometry type support added in PostGIS 2.0. - if self.spatial_version >= (2, 0, 0): - self.geometry = True - - # Creating a dictionary lookup of all GIS terms for PostGIS. - self.gis_terms = set(['isnull']) - self.gis_terms.update(self.geometry_operators) - self.gis_terms.update(self.geometry_functions) - - self.area = prefix + 'Area' - self.bounding_circle = BOUNDINGCIRCLE - self.centroid = prefix + 'Centroid' - self.collect = prefix + 'Collect' - self.difference = prefix + 'Difference' - self.distance = prefix + 'Distance' - self.distance_sphere = prefix + 'distance_sphere' - self.distance_spheroid = prefix + 'distance_spheroid' - self.envelope = prefix + 'Envelope' - self.extent = prefix + 'Extent' - self.force_rhr = prefix + 'ForceRHR' - self.geohash = GEOHASH - self.geojson = GEOJSON - self.gml = prefix + 'AsGML' - self.intersection = prefix + 'Intersection' - self.kml = prefix + 'AsKML' - self.length = prefix + 'Length' - self.length_spheroid = prefix + 'length_spheroid' - self.makeline = prefix + 'MakeLine' - self.mem_size = prefix + 'mem_size' - self.num_geom = prefix + 'NumGeometries' - self.num_points = prefix + 'npoints' - self.perimeter = prefix + 'Perimeter' - self.point_on_surface = prefix + 'PointOnSurface' - self.polygonize = prefix + 'Polygonize' - self.reverse = prefix + 'Reverse' - self.scale = prefix + 'Scale' - self.snap_to_grid = prefix + 'SnapToGrid' - self.svg = prefix + 'AsSVG' - self.sym_difference = prefix + 'SymDifference' - self.transform = prefix + 'Transform' - self.translate = prefix + 'Translate' - self.union = prefix + 'Union' - self.unionagg = prefix + 'Union' - - if self.spatial_version >= (2, 0, 0): - self.extent3d = prefix + '3DExtent' - self.length3d = prefix + '3DLength' - self.perimeter3d = prefix + '3DPerimeter' - else: - self.extent3d = prefix + 'Extent3D' - self.length3d = prefix + 'Length3D' - self.perimeter3d = prefix + 'Perimeter3D' - - @cached_property - def spatial_version(self): - """Determine the version of the PostGIS library.""" - # Trying to get the PostGIS version because the function - # signatures will depend on the version used. The cost - # here is a database query to determine the version, which - # can be mitigated by setting `POSTGIS_VERSION` with a 3-tuple - # comprising user-supplied values for the major, minor, and - # subminor revision of PostGIS. - if hasattr(settings, 'POSTGIS_VERSION'): - version = settings.POSTGIS_VERSION - else: - try: - vtup = self.postgis_version_tuple() - except DatabaseError: - raise ImproperlyConfigured( - 'Cannot determine PostGIS version for database "%s". ' - 'GeoDjango requires at least PostGIS version 1.3. ' - 'Was the database created from a spatial database ' - 'template?' % self.connection.settings_dict['NAME'] - ) - version = vtup[1:] - return version - - def check_aggregate_support(self, aggregate): - """ - Checks if the given aggregate name is supported (that is, if it's - in `self.valid_aggregates`). - """ - agg_name = aggregate.__class__.__name__ - return agg_name in self.valid_aggregates - - def convert_extent(self, box): - """ - Returns a 4-tuple extent for the `Extent` aggregate by converting - the bounding box text returned by PostGIS (`box` argument), for - example: "BOX(-90.0 30.0, -85.0 40.0)". - """ - ll, ur = box[4:-1].split(',') - xmin, ymin = map(float, ll.split()) - xmax, ymax = map(float, ur.split()) - return (xmin, ymin, xmax, ymax) - - def convert_extent3d(self, box3d): - """ - Returns a 6-tuple extent for the `Extent3D` aggregate by converting - the 3d bounding-box text returnded by PostGIS (`box3d` argument), for - example: "BOX3D(-90.0 30.0 1, -85.0 40.0 2)". - """ - ll, ur = box3d[6:-1].split(',') - xmin, ymin, zmin = map(float, ll.split()) - xmax, ymax, zmax = map(float, ur.split()) - return (xmin, ymin, zmin, xmax, ymax, zmax) - - def convert_geom(self, hex, geo_field): - """ - Converts the geometry returned from PostGIS aggretates. - """ - if hex: - return Geometry(hex) - else: - return None - - def geo_db_type(self, f): - """ - Return the database field type for the given geometry field. - Typically this is `None` because geometry columns are added via - the `AddGeometryColumn` stored procedure, unless the field - has been specified to be of geography type instead. - """ - if f.geography: - if not self.geography: - raise NotImplementedError('PostGIS 1.5 required for geography column support.') - - if f.srid != 4326: - raise NotImplementedError('PostGIS 1.5 supports geography columns ' - 'only with an SRID of 4326.') - - return 'geography(%s,%d)' % (f.geom_type, f.srid) - elif self.geometry: - # Postgis 2.0 supports type-based geometries. - # TODO: Support 'M' extension. - if f.dim == 3: - geom_type = f.geom_type + 'Z' - else: - geom_type = f.geom_type - return 'geometry(%s,%d)' % (geom_type, f.srid) - else: - return None - - def get_distance(self, f, dist_val, lookup_type): - """ - Retrieve the distance parameters for the given geometry field, - distance lookup value, and the distance lookup type. - - This is the most complex implementation of the spatial backends due to - what is supported on geodetic geometry columns vs. what's available on - projected geometry columns. In addition, it has to take into account - the newly introduced geography column type introudced in PostGIS 1.5. - """ - # Getting the distance parameter and any options. - if len(dist_val) == 1: - value, option = dist_val[0], None - else: - value, option = dist_val - - # Shorthand boolean flags. - geodetic = f.geodetic(self.connection) - geography = f.geography and self.geography - - if isinstance(value, Distance): - if geography: - dist_param = value.m - elif geodetic: - if lookup_type == 'dwithin': - raise ValueError('Only numeric values of degree units are ' - 'allowed on geographic DWithin queries.') - dist_param = value.m - else: - dist_param = getattr(value, Distance.unit_attname(f.units_name(self.connection))) - else: - # Assuming the distance is in the units of the field. - dist_param = value - - if (not geography and geodetic and lookup_type != 'dwithin' - and option == 'spheroid'): - # using distance_spheroid requires the spheroid of the field as - # a parameter. - return [f._spheroid, dist_param] - else: - return [dist_param] - - def get_geom_placeholder(self, f, value): - """ - Provides a proper substitution value for Geometries that are not in the - SRID of the field. Specifically, this routine will substitute in the - ST_Transform() function call. - """ - if value is None or value.srid == f.srid: - placeholder = '%s' - else: - # Adding Transform() to the SQL placeholder. - placeholder = '%s(%%s, %s)' % (self.transform, f.srid) - - if hasattr(value, 'expression'): - # If this is an F expression, then we don't really want - # a placeholder and instead substitute in the column - # of the expression. - placeholder = placeholder % self.get_expression_column(value) - - return placeholder - - def _get_postgis_func(self, func): - """ - Helper routine for calling PostGIS functions and returning their result. - """ - # Close out the connection. See #9437. - with self.connection.temporary_connection() as cursor: - cursor.execute('SELECT %s()' % func) - return cursor.fetchone()[0] - - def postgis_geos_version(self): - "Returns the version of the GEOS library used with PostGIS." - return self._get_postgis_func('postgis_geos_version') - - def postgis_lib_version(self): - "Returns the version number of the PostGIS library used with PostgreSQL." - return self._get_postgis_func('postgis_lib_version') - - def postgis_proj_version(self): - "Returns the version of the PROJ.4 library used with PostGIS." - return self._get_postgis_func('postgis_proj_version') - - def postgis_version(self): - "Returns PostGIS version number and compile-time options." - return self._get_postgis_func('postgis_version') - - def postgis_full_version(self): - "Returns PostGIS version number and compile-time options." - return self._get_postgis_func('postgis_full_version') - - def postgis_version_tuple(self): - """ - Returns the PostGIS version as a tuple (version string, major, - minor, subminor). - """ - # Getting the PostGIS version - version = self.postgis_lib_version() - m = self.version_regex.match(version) - - if m: - major = int(m.group('major')) - minor1 = int(m.group('minor1')) - minor2 = int(m.group('minor2')) - else: - raise Exception('Could not parse PostGIS version string: %s' % version) - - return (version, major, minor1, minor2) - - def proj_version_tuple(self): - """ - Return the version of PROJ.4 used by PostGIS as a tuple of the - major, minor, and subminor release numbers. - """ - proj_regex = re.compile(r'(\d+)\.(\d+)\.(\d+)') - proj_ver_str = self.postgis_proj_version() - m = proj_regex.search(proj_ver_str) - if m: - return tuple(map(int, [m.group(1), m.group(2), m.group(3)])) - else: - raise Exception('Could not determine PROJ.4 version from PostGIS.') - - def num_params(self, lookup_type, num_param): - """ - Helper routine that returns a boolean indicating whether the number of - parameters is correct for the lookup type. - """ - def exactly_two(np): return np == 2 - def two_to_three(np): return np >= 2 and np <=3 - if (lookup_type in self.distance_functions and - lookup_type != 'dwithin'): - return two_to_three(num_param) - else: - return exactly_two(num_param) - - def spatial_lookup_sql(self, lvalue, lookup_type, value, field, qn): - """ - Constructs spatial SQL from the given lookup value tuple a - (alias, col, db_type), the lookup type string, lookup value, and - the geometry field. - """ - alias, col, db_type = lvalue - - # Getting the quoted geometry column. - geo_col = '%s.%s' % (qn(alias), qn(col)) - - if lookup_type in self.geometry_operators: - if field.geography and not lookup_type in self.geography_operators: - raise ValueError('PostGIS geography does not support the ' - '"%s" lookup.' % lookup_type) - # Handling a PostGIS operator. - op = self.geometry_operators[lookup_type] - return op.as_sql(geo_col, self.get_geom_placeholder(field, value)) - elif lookup_type in self.geometry_functions: - if field.geography and not lookup_type in self.geography_functions: - raise ValueError('PostGIS geography type does not support the ' - '"%s" lookup.' % lookup_type) - - # See if a PostGIS geometry function matches the lookup type. - tmp = self.geometry_functions[lookup_type] - - # Lookup types that are tuples take tuple arguments, e.g., 'relate' and - # distance lookups. - if isinstance(tmp, tuple): - # First element of tuple is the PostGISOperation instance, and the - # second element is either the type or a tuple of acceptable types - # that may passed in as further parameters for the lookup type. - op, arg_type = tmp - - # Ensuring that a tuple _value_ was passed in from the user - if not isinstance(value, (tuple, list)): - raise ValueError('Tuple required for `%s` lookup type.' % lookup_type) - - # Geometry is first element of lookup tuple. - geom = value[0] - - # Number of valid tuple parameters depends on the lookup type. - nparams = len(value) - if not self.num_params(lookup_type, nparams): - raise ValueError('Incorrect number of parameters given for `%s` lookup type.' % lookup_type) - - # Ensuring the argument type matches what we expect. - if not isinstance(value[1], arg_type): - raise ValueError('Argument type should be %s, got %s instead.' % (arg_type, type(value[1]))) - - # For lookup type `relate`, the op instance is not yet created (has - # to be instantiated here to check the pattern parameter). - if lookup_type == 'relate': - op = op(self.geom_func_prefix, value[1]) - elif lookup_type in self.distance_functions and lookup_type != 'dwithin': - if not field.geography and field.geodetic(self.connection): - # Geodetic distances are only available from Points to - # PointFields on PostGIS 1.4 and below. - if not self.connection.ops.geography: - if field.geom_type != 'POINT': - raise ValueError('PostGIS spherical operations are only valid on PointFields.') - - if str(geom.geom_type) != 'Point': - raise ValueError('PostGIS geometry distance parameter is required to be of type Point.') - - # Setting up the geodetic operation appropriately. - if nparams == 3 and value[2] == 'spheroid': - op = op['spheroid'] - else: - op = op['sphere'] - else: - op = op['cartesian'] - else: - op = tmp - geom = value - - # Calling the `as_sql` function on the operation instance. - return op.as_sql(geo_col, self.get_geom_placeholder(field, geom)) - - elif lookup_type == 'isnull': - # Handling 'isnull' lookup type - return "%s IS %sNULL" % (geo_col, ('' if value else 'NOT ')), [] - - raise TypeError("Got invalid lookup_type: %s" % repr(lookup_type)) - - def spatial_aggregate_sql(self, agg): - """ - Returns the spatial aggregate SQL template and function for the - given Aggregate instance. - """ - agg_name = agg.__class__.__name__ - if not self.check_aggregate_support(agg): - raise NotImplementedError('%s spatial aggregate is not implmented for this backend.' % agg_name) - agg_name = agg_name.lower() - if agg_name == 'union': - agg_name += 'agg' - sql_template = '%(function)s(%(field)s)' - sql_function = getattr(self, agg_name) - return sql_template, sql_function - - # Routines for getting the OGC-compliant models. - def geometry_columns(self): - return GeometryColumns - - def spatial_ref_sys(self): - return SpatialRefSys diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/adapter.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/adapter.py deleted file mode 100644 index d8fefba..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/adapter.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.db.backends.sqlite3.base import Database -from django.contrib.gis.db.backends.adapter import WKTAdapter - -class SpatiaLiteAdapter(WKTAdapter): - "SQLite adaptor for geometry objects." - def __conform__(self, protocol): - if protocol is Database.PrepareProtocol: - return str(self) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/base.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/base.py deleted file mode 100644 index 7b49d71..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/base.py +++ /dev/null @@ -1,60 +0,0 @@ -import sys -from ctypes.util import find_library -from django.conf import settings - -from django.core.exceptions import ImproperlyConfigured -from django.db.backends.sqlite3.base import (Database, - DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper) -from django.contrib.gis.db.backends.spatialite.client import SpatiaLiteClient -from django.contrib.gis.db.backends.spatialite.creation import SpatiaLiteCreation -from django.contrib.gis.db.backends.spatialite.introspection import SpatiaLiteIntrospection -from django.contrib.gis.db.backends.spatialite.operations import SpatiaLiteOperations -from django.utils import six - -class DatabaseWrapper(SQLiteDatabaseWrapper): - def __init__(self, *args, **kwargs): - # Before we get too far, make sure pysqlite 2.5+ is installed. - if Database.version_info < (2, 5, 0): - raise ImproperlyConfigured('Only versions of pysqlite 2.5+ are ' - 'compatible with SpatiaLite and GeoDjango.') - - # Trying to find the location of the SpatiaLite library. - # Here we are figuring out the path to the SpatiaLite library - # (`libspatialite`). If it's not in the system library path (e.g., it - # cannot be found by `ctypes.util.find_library`), then it may be set - # manually in the settings via the `SPATIALITE_LIBRARY_PATH` setting. - self.spatialite_lib = getattr(settings, 'SPATIALITE_LIBRARY_PATH', - find_library('spatialite')) - if not self.spatialite_lib: - raise ImproperlyConfigured('Unable to locate the SpatiaLite library. ' - 'Make sure it is in your library path, or set ' - 'SPATIALITE_LIBRARY_PATH in your settings.' - ) - super(DatabaseWrapper, self).__init__(*args, **kwargs) - self.ops = SpatiaLiteOperations(self) - self.client = SpatiaLiteClient(self) - self.creation = SpatiaLiteCreation(self) - self.introspection = SpatiaLiteIntrospection(self) - - def get_new_connection(self, conn_params): - conn = super(DatabaseWrapper, self).get_new_connection(conn_params) - # Enabling extension loading on the SQLite connection. - try: - conn.enable_load_extension(True) - except AttributeError: - raise ImproperlyConfigured( - 'The pysqlite library does not support C extension loading. ' - 'Both SQLite and pysqlite must be configured to allow ' - 'the loading of extensions to use SpatiaLite.') - # Loading the SpatiaLite library extension on the connection, and returning - # the created cursor. - cur = conn.cursor(factory=SQLiteCursorWrapper) - try: - cur.execute("SELECT load_extension(%s)", (self.spatialite_lib,)) - except Exception as msg: - new_msg = ( - 'Unable to load the SpatiaLite library extension ' - '"%s" because: %s') % (self.spatialite_lib, msg) - six.reraise(ImproperlyConfigured, ImproperlyConfigured(new_msg), sys.exc_info()[2]) - cur.close() - return conn diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/client.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/client.py deleted file mode 100644 index 536065a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/client.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.db.backends.sqlite3.client import DatabaseClient - -class SpatiaLiteClient(DatabaseClient): - executable_name = 'spatialite' - diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/creation.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/creation.py deleted file mode 100644 index d0a5f82..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/creation.py +++ /dev/null @@ -1,129 +0,0 @@ -import os -from django.conf import settings -from django.core.cache import get_cache -from django.core.cache.backends.db import BaseDatabaseCache -from django.core.exceptions import ImproperlyConfigured -from django.db.backends.sqlite3.creation import DatabaseCreation - -class SpatiaLiteCreation(DatabaseCreation): - - def create_test_db(self, verbosity=1, autoclobber=False): - """ - Creates a test database, prompting the user for confirmation if the - database already exists. Returns the name of the test database created. - - This method is overloaded to load up the SpatiaLite initialization - SQL prior to calling the `syncdb` command. - """ - # Don't import django.core.management if it isn't needed. - from django.core.management import call_command - - test_database_name = self._get_test_db_name() - - if verbosity >= 1: - test_db_repr = '' - if verbosity >= 2: - test_db_repr = " ('%s')" % test_database_name - print("Creating test database for alias '%s'%s..." % (self.connection.alias, test_db_repr)) - - self._create_test_db(verbosity, autoclobber) - - self.connection.close() - self.connection.settings_dict["NAME"] = test_database_name - - # Need to load the SpatiaLite initialization SQL before running `syncdb`. - self.load_spatialite_sql() - - # Report syncdb messages at one level lower than that requested. - # This ensures we don't get flooded with messages during testing - # (unless you really ask to be flooded) - call_command('syncdb', - verbosity=max(verbosity - 1, 0), - interactive=False, - database=self.connection.alias, - load_initial_data=False) - - # We need to then do a flush to ensure that any data installed by - # custom SQL has been removed. The only test data should come from - # test fixtures, or autogenerated from post_syncdb triggers. - # This has the side effect of loading initial data (which was - # intentionally skipped in the syncdb). - call_command('flush', - verbosity=max(verbosity - 1, 0), - interactive=False, - database=self.connection.alias) - - from django.core.cache import get_cache - from django.core.cache.backends.db import BaseDatabaseCache - for cache_alias in settings.CACHES: - cache = get_cache(cache_alias) - if isinstance(cache, BaseDatabaseCache): - call_command('createcachetable', cache._table, database=self.connection.alias) - - # Get a cursor (even though we don't need one yet). This has - # the side effect of initializing the test database. - cursor = self.connection.cursor() - - return test_database_name - - def sql_indexes_for_field(self, model, f, style): - "Return any spatial index creation SQL for the field." - from django.contrib.gis.db.models.fields import GeometryField - - output = super(SpatiaLiteCreation, self).sql_indexes_for_field(model, f, style) - - if isinstance(f, GeometryField): - gqn = self.connection.ops.geo_quote_name - qn = self.connection.ops.quote_name - db_table = model._meta.db_table - - output.append(style.SQL_KEYWORD('SELECT ') + - style.SQL_TABLE('AddGeometryColumn') + '(' + - style.SQL_TABLE(gqn(db_table)) + ', ' + - style.SQL_FIELD(gqn(f.column)) + ', ' + - style.SQL_FIELD(str(f.srid)) + ', ' + - style.SQL_COLTYPE(gqn(f.geom_type)) + ', ' + - style.SQL_KEYWORD(str(f.dim)) + ', ' + - style.SQL_KEYWORD(str(int(not f.null))) + - ');') - - if f.spatial_index: - output.append(style.SQL_KEYWORD('SELECT ') + - style.SQL_TABLE('CreateSpatialIndex') + '(' + - style.SQL_TABLE(gqn(db_table)) + ', ' + - style.SQL_FIELD(gqn(f.column)) + ');') - - return output - - def load_spatialite_sql(self): - """ - This routine loads up the SpatiaLite SQL file. - """ - if self.connection.ops.spatial_version[:2] >= (2, 4): - # Spatialite >= 2.4 -- No need to load any SQL file, calling - # InitSpatialMetaData() transparently creates the spatial metadata - # tables - cur = self.connection._cursor() - cur.execute("SELECT InitSpatialMetaData()") - else: - # Spatialite < 2.4 -- Load the initial SQL - - # Getting the location of the SpatiaLite SQL file, and confirming - # it exists. - spatialite_sql = self.spatialite_init_file() - if not os.path.isfile(spatialite_sql): - raise ImproperlyConfigured('Could not find the required SpatiaLite initialization ' - 'SQL file (necessary for testing): %s' % spatialite_sql) - - # Opening up the SpatiaLite SQL initialization file and executing - # as a script. - with open(spatialite_sql, 'r') as sql_fh: - cur = self.connection._cursor() - cur.executescript(sql_fh.read()) - - def spatialite_init_file(self): - # SPATIALITE_SQL may be placed in settings to tell GeoDjango - # to use a specific path to the SpatiaLite initilization SQL. - return getattr(settings, 'SPATIALITE_SQL', - 'init_spatialite-%s.%s.sql' % - self.connection.ops.spatial_version[:2]) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/introspection.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/introspection.py deleted file mode 100644 index 4f12ade..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/introspection.py +++ /dev/null @@ -1,52 +0,0 @@ -from django.contrib.gis.gdal import OGRGeomType -from django.db.backends.sqlite3.introspection import DatabaseIntrospection, FlexibleFieldLookupDict -from django.utils import six - -class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict): - """ - Sublcass that includes updates the `base_data_types_reverse` dict - for geometry field types. - """ - base_data_types_reverse = FlexibleFieldLookupDict.base_data_types_reverse.copy() - base_data_types_reverse.update( - {'point' : 'GeometryField', - 'linestring' : 'GeometryField', - 'polygon' : 'GeometryField', - 'multipoint' : 'GeometryField', - 'multilinestring' : 'GeometryField', - 'multipolygon' : 'GeometryField', - 'geometrycollection' : 'GeometryField', - }) - -class SpatiaLiteIntrospection(DatabaseIntrospection): - data_types_reverse = GeoFlexibleFieldLookupDict() - - def get_geometry_type(self, table_name, geo_col): - cursor = self.connection.cursor() - try: - # Querying the `geometry_columns` table to get additional metadata. - cursor.execute('SELECT "coord_dimension", "srid", "type" ' - 'FROM "geometry_columns" ' - 'WHERE "f_table_name"=%s AND "f_geometry_column"=%s', - (table_name, geo_col)) - row = cursor.fetchone() - if not row: - raise Exception('Could not find a geometry column for "%s"."%s"' % - (table_name, geo_col)) - - # OGRGeomType does not require GDAL and makes it easy to convert - # from OGC geom type name to Django field. - field_type = OGRGeomType(row[2]).django - - # Getting any GeometryField keyword arguments that are not the default. - dim = row[0] - srid = row[1] - field_params = {} - if srid != 4326: - field_params['srid'] = srid - if isinstance(dim, six.string_types) and 'Z' in dim: - field_params['dim'] = 3 - finally: - cursor.close() - - return field_type, field_params diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/models.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/models.py deleted file mode 100644 index b281f0b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/models.py +++ /dev/null @@ -1,62 +0,0 @@ -""" - The GeometryColumns and SpatialRefSys models for the SpatiaLite backend. -""" -from django.db import models -from django.contrib.gis.db.backends.base import SpatialRefSysMixin -from django.utils.encoding import python_2_unicode_compatible - -@python_2_unicode_compatible -class GeometryColumns(models.Model): - """ - The 'geometry_columns' table from SpatiaLite. - """ - f_table_name = models.CharField(max_length=256) - f_geometry_column = models.CharField(max_length=256) - type = models.CharField(max_length=30) - coord_dimension = models.IntegerField() - srid = models.IntegerField(primary_key=True) - spatial_index_enabled = models.IntegerField() - - class Meta: - db_table = 'geometry_columns' - managed = False - - @classmethod - def table_name_col(cls): - """ - Returns the name of the metadata column used to store the - the feature table name. - """ - return 'f_table_name' - - @classmethod - def geom_col_name(cls): - """ - Returns the name of the metadata column used to store the - the feature geometry column. - """ - return 'f_geometry_column' - - def __str__(self): - return "%s.%s - %dD %s field (SRID: %d)" % \ - (self.f_table_name, self.f_geometry_column, - self.coord_dimension, self.type, self.srid) - -class SpatialRefSys(models.Model, SpatialRefSysMixin): - """ - The 'spatial_ref_sys' table from SpatiaLite. - """ - srid = models.IntegerField(primary_key=True) - auth_name = models.CharField(max_length=256) - auth_srid = models.IntegerField() - ref_sys_name = models.CharField(max_length=256) - proj4text = models.CharField(max_length=2048) - - @property - def wkt(self): - from django.contrib.gis.gdal import SpatialReference - return SpatialReference(self.proj4text).wkt - - class Meta: - db_table = 'spatial_ref_sys' - managed = False diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/operations.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/operations.py deleted file mode 100644 index 4281caf..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/operations.py +++ /dev/null @@ -1,373 +0,0 @@ -import re -import sys -from decimal import Decimal - -from django.contrib.gis.db.backends.base import BaseSpatialOperations -from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction -from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter -from django.contrib.gis.geometry.backend import Geometry -from django.contrib.gis.measure import Distance -from django.core.exceptions import ImproperlyConfigured -from django.db.backends.sqlite3.base import DatabaseOperations -from django.db.utils import DatabaseError -from django.utils import six -from django.utils.functional import cached_property - - -class SpatiaLiteOperator(SpatialOperation): - "For SpatiaLite operators (e.g. `&&`, `~`)." - def __init__(self, operator): - super(SpatiaLiteOperator, self).__init__(operator=operator) - -class SpatiaLiteFunction(SpatialFunction): - "For SpatiaLite function calls." - def __init__(self, function, **kwargs): - super(SpatiaLiteFunction, self).__init__(function, **kwargs) - -class SpatiaLiteFunctionParam(SpatiaLiteFunction): - "For SpatiaLite functions that take another parameter." - sql_template = '%(function)s(%(geo_col)s, %(geometry)s, %%s)' - -class SpatiaLiteDistance(SpatiaLiteFunction): - "For SpatiaLite distance operations." - dist_func = 'Distance' - sql_template = '%(function)s(%(geo_col)s, %(geometry)s) %(operator)s %%s' - - def __init__(self, operator): - super(SpatiaLiteDistance, self).__init__(self.dist_func, - operator=operator) - -class SpatiaLiteRelate(SpatiaLiteFunctionParam): - "For SpatiaLite Relate(, ) calls." - pattern_regex = re.compile(r'^[012TF\*]{9}$') - def __init__(self, pattern): - if not self.pattern_regex.match(pattern): - raise ValueError('Invalid intersection matrix pattern "%s".' % pattern) - super(SpatiaLiteRelate, self).__init__('Relate') - -# Valid distance types and substitutions -dtypes = (Decimal, Distance, float) + six.integer_types -def get_dist_ops(operator): - "Returns operations for regular distances; spherical distances are not currently supported." - return (SpatiaLiteDistance(operator),) - -class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations): - compiler_module = 'django.contrib.gis.db.models.sql.compiler' - name = 'spatialite' - spatialite = True - version_regex = re.compile(r'^(?P\d)\.(?P\d)\.(?P\d+)') - valid_aggregates = dict([(k, None) for k in ('Extent', 'Union')]) - - Adapter = SpatiaLiteAdapter - Adaptor = Adapter # Backwards-compatibility alias. - - area = 'Area' - centroid = 'Centroid' - contained = 'MbrWithin' - difference = 'Difference' - distance = 'Distance' - envelope = 'Envelope' - intersection = 'Intersection' - length = 'GLength' # OpenGis defines Length, but this conflicts with an SQLite reserved keyword - num_geom = 'NumGeometries' - num_points = 'NumPoints' - point_on_surface = 'PointOnSurface' - scale = 'ScaleCoords' - svg = 'AsSVG' - sym_difference = 'SymDifference' - transform = 'Transform' - translate = 'ShiftCoords' - union = 'GUnion' # OpenGis defines Union, but this conflicts with an SQLite reserved keyword - unionagg = 'GUnion' - - from_text = 'GeomFromText' - from_wkb = 'GeomFromWKB' - select = 'AsText(%s)' - - geometry_functions = { - 'equals' : SpatiaLiteFunction('Equals'), - 'disjoint' : SpatiaLiteFunction('Disjoint'), - 'touches' : SpatiaLiteFunction('Touches'), - 'crosses' : SpatiaLiteFunction('Crosses'), - 'within' : SpatiaLiteFunction('Within'), - 'overlaps' : SpatiaLiteFunction('Overlaps'), - 'contains' : SpatiaLiteFunction('Contains'), - 'intersects' : SpatiaLiteFunction('Intersects'), - 'relate' : (SpatiaLiteRelate, six.string_types), - # Returns true if B's bounding box completely contains A's bounding box. - 'contained' : SpatiaLiteFunction('MbrWithin'), - # Returns true if A's bounding box completely contains B's bounding box. - 'bbcontains' : SpatiaLiteFunction('MbrContains'), - # Returns true if A's bounding box overlaps B's bounding box. - 'bboverlaps' : SpatiaLiteFunction('MbrOverlaps'), - # These are implemented here as synonyms for Equals - 'same_as' : SpatiaLiteFunction('Equals'), - 'exact' : SpatiaLiteFunction('Equals'), - } - - distance_functions = { - 'distance_gt' : (get_dist_ops('>'), dtypes), - 'distance_gte' : (get_dist_ops('>='), dtypes), - 'distance_lt' : (get_dist_ops('<'), dtypes), - 'distance_lte' : (get_dist_ops('<='), dtypes), - } - geometry_functions.update(distance_functions) - - def __init__(self, connection): - super(DatabaseOperations, self).__init__(connection) - - # Creating the GIS terms dictionary. - self.gis_terms = set(['isnull']) - self.gis_terms.update(self.geometry_functions) - - @cached_property - def spatial_version(self): - """Determine the version of the SpatiaLite library.""" - try: - version = self.spatialite_version_tuple()[1:] - except Exception as msg: - new_msg = ( - 'Cannot determine the SpatiaLite version for the "%s" ' - 'database (error was "%s"). Was the SpatiaLite initialization ' - 'SQL loaded on this database?') % (self.connection.settings_dict['NAME'], msg) - six.reraise(ImproperlyConfigured, ImproperlyConfigured(new_msg), sys.exc_info()[2]) - if version < (2, 3, 0): - raise ImproperlyConfigured('GeoDjango only supports SpatiaLite versions ' - '2.3.0 and above') - return version - - @property - def _version_greater_2_4_0_rc4(self): - if self.spatial_version >= (2, 4, 1): - return True - elif self.spatial_version < (2, 4, 0): - return False - else: - # Spatialite 2.4.0-RC4 added AsGML and AsKML, however both - # RC2 (shipped in popular Debian/Ubuntu packages) and RC4 - # report version as '2.4.0', so we fall back to feature detection - try: - self._get_spatialite_func("AsGML(GeomFromText('POINT(1 1)'))") - except DatabaseError: - return False - return True - - @cached_property - def gml(self): - return 'AsGML' if self._version_greater_2_4_0_rc4 else None - - @cached_property - def kml(self): - return 'AsKML' if self._version_greater_2_4_0_rc4 else None - - @cached_property - def geojson(self): - return 'AsGeoJSON' if self.spatial_version >= (3, 0, 0) else None - - def check_aggregate_support(self, aggregate): - """ - Checks if the given aggregate name is supported (that is, if it's - in `self.valid_aggregates`). - """ - agg_name = aggregate.__class__.__name__ - return agg_name in self.valid_aggregates - - def convert_geom(self, wkt, geo_field): - """ - Converts geometry WKT returned from a SpatiaLite aggregate. - """ - if wkt: - return Geometry(wkt, geo_field.srid) - else: - return None - - def geo_db_type(self, f): - """ - Returns None because geometry columnas are added via the - `AddGeometryColumn` stored procedure on SpatiaLite. - """ - return None - - def get_distance(self, f, value, lookup_type): - """ - Returns the distance parameters for the given geometry field, - lookup value, and lookup type. SpatiaLite only supports regular - cartesian-based queries (no spheroid/sphere calculations for point - geometries like PostGIS). - """ - if not value: - return [] - value = value[0] - if isinstance(value, Distance): - if f.geodetic(self.connection): - raise ValueError('SpatiaLite does not support distance queries on ' - 'geometry fields with a geodetic coordinate system. ' - 'Distance objects; use a numeric value of your ' - 'distance in degrees instead.') - else: - dist_param = getattr(value, Distance.unit_attname(f.units_name(self.connection))) - else: - dist_param = value - return [dist_param] - - def get_geom_placeholder(self, f, value): - """ - Provides a proper substitution value for Geometries that are not in the - SRID of the field. Specifically, this routine will substitute in the - Transform() and GeomFromText() function call(s). - """ - def transform_value(value, srid): - return not (value is None or value.srid == srid) - if hasattr(value, 'expression'): - if transform_value(value, f.srid): - placeholder = '%s(%%s, %s)' % (self.transform, f.srid) - else: - placeholder = '%s' - # No geometry value used for F expression, substitue in - # the column name instead. - return placeholder % self.get_expression_column(value) - else: - if transform_value(value, f.srid): - # Adding Transform() to the SQL placeholder. - return '%s(%s(%%s,%s), %s)' % (self.transform, self.from_text, value.srid, f.srid) - else: - return '%s(%%s,%s)' % (self.from_text, f.srid) - - def _get_spatialite_func(self, func): - """ - Helper routine for calling SpatiaLite functions and returning - their result. - """ - cursor = self.connection._cursor() - try: - try: - cursor.execute('SELECT %s' % func) - row = cursor.fetchone() - except: - # Responsibility of caller to perform error handling. - raise - finally: - cursor.close() - return row[0] - - def geos_version(self): - "Returns the version of GEOS used by SpatiaLite as a string." - return self._get_spatialite_func('geos_version()') - - def proj4_version(self): - "Returns the version of the PROJ.4 library used by SpatiaLite." - return self._get_spatialite_func('proj4_version()') - - def spatialite_version(self): - "Returns the SpatiaLite library version as a string." - return self._get_spatialite_func('spatialite_version()') - - def spatialite_version_tuple(self): - """ - Returns the SpatiaLite version as a tuple (version string, major, - minor, subminor). - """ - # Getting the SpatiaLite version. - try: - version = self.spatialite_version() - except DatabaseError: - # The `spatialite_version` function first appeared in version 2.3.1 - # of SpatiaLite, so doing a fallback test for 2.3.0 (which is - # used by popular Debian/Ubuntu packages). - version = None - try: - tmp = self._get_spatialite_func("X(GeomFromText('POINT(1 1)'))") - if tmp == 1.0: version = '2.3.0' - except DatabaseError: - pass - # If no version string defined, then just re-raise the original - # exception. - if version is None: raise - - m = self.version_regex.match(version) - if m: - major = int(m.group('major')) - minor1 = int(m.group('minor1')) - minor2 = int(m.group('minor2')) - else: - raise Exception('Could not parse SpatiaLite version string: %s' % version) - - return (version, major, minor1, minor2) - - def spatial_aggregate_sql(self, agg): - """ - Returns the spatial aggregate SQL template and function for the - given Aggregate instance. - """ - agg_name = agg.__class__.__name__ - if not self.check_aggregate_support(agg): - raise NotImplementedError('%s spatial aggregate is not implmented for this backend.' % agg_name) - agg_name = agg_name.lower() - if agg_name == 'union': agg_name += 'agg' - sql_template = self.select % '%(function)s(%(field)s)' - sql_function = getattr(self, agg_name) - return sql_template, sql_function - - def spatial_lookup_sql(self, lvalue, lookup_type, value, field, qn): - """ - Returns the SpatiaLite-specific SQL for the given lookup value - [a tuple of (alias, column, db_type)], lookup type, lookup - value, the model field, and the quoting function. - """ - alias, col, db_type = lvalue - - # Getting the quoted field as `geo_col`. - geo_col = '%s.%s' % (qn(alias), qn(col)) - - if lookup_type in self.geometry_functions: - # See if a SpatiaLite geometry function matches the lookup type. - tmp = self.geometry_functions[lookup_type] - - # Lookup types that are tuples take tuple arguments, e.g., 'relate' and - # distance lookups. - if isinstance(tmp, tuple): - # First element of tuple is the SpatiaLiteOperation instance, and the - # second element is either the type or a tuple of acceptable types - # that may passed in as further parameters for the lookup type. - op, arg_type = tmp - - # Ensuring that a tuple _value_ was passed in from the user - if not isinstance(value, (tuple, list)): - raise ValueError('Tuple required for `%s` lookup type.' % lookup_type) - - # Geometry is first element of lookup tuple. - geom = value[0] - - # Number of valid tuple parameters depends on the lookup type. - if len(value) != 2: - raise ValueError('Incorrect number of parameters given for `%s` lookup type.' % lookup_type) - - # Ensuring the argument type matches what we expect. - if not isinstance(value[1], arg_type): - raise ValueError('Argument type should be %s, got %s instead.' % (arg_type, type(value[1]))) - - # For lookup type `relate`, the op instance is not yet created (has - # to be instantiated here to check the pattern parameter). - if lookup_type == 'relate': - op = op(value[1]) - elif lookup_type in self.distance_functions: - op = op[0] - else: - op = tmp - geom = value - # Calling the `as_sql` function on the operation instance. - return op.as_sql(geo_col, self.get_geom_placeholder(field, geom)) - elif lookup_type == 'isnull': - # Handling 'isnull' lookup type - return "%s IS %sNULL" % (geo_col, ('' if value else 'NOT ')), [] - - raise TypeError("Got invalid lookup_type: %s" % repr(lookup_type)) - - # Routines for getting the OGC-compliant models. - def geometry_columns(self): - from django.contrib.gis.db.backends.spatialite.models import GeometryColumns - return GeometryColumns - - def spatial_ref_sys(self): - from django.contrib.gis.db.backends.spatialite.models import SpatialRefSys - return SpatialRefSys diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/backends/util.py b/lib/python2.7/site-packages/django/contrib/gis/db/backends/util.py deleted file mode 100644 index 2612810..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/backends/util.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -A collection of utility routines and classes used by the spatial -backends. -""" - -class SpatialOperation(object): - """ - Base class for generating spatial SQL. - """ - sql_template = '%(geo_col)s %(operator)s %(geometry)s' - - def __init__(self, function='', operator='', result='', **kwargs): - self.function = function - self.operator = operator - self.result = result - self.extra = kwargs - - def as_sql(self, geo_col, geometry='%s'): - return self.sql_template % self.params(geo_col, geometry), [] - - def params(self, geo_col, geometry): - params = {'function' : self.function, - 'geo_col' : geo_col, - 'geometry' : geometry, - 'operator' : self.operator, - 'result' : self.result, - } - params.update(self.extra) - return params - -class SpatialFunction(SpatialOperation): - """ - Base class for generating spatial SQL related to a function. - """ - sql_template = '%(function)s(%(geo_col)s, %(geometry)s)' - - def __init__(self, func, result='', operator='', **kwargs): - # Getting the function prefix. - default = {'function' : func, - 'operator' : operator, - 'result' : result - } - kwargs.update(default) - super(SpatialFunction, self).__init__(**kwargs) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/__init__.py deleted file mode 100644 index e36aa36..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Want to get everything from the 'normal' models package. -from django.db.models import * - -# Geographic aggregate functions -from django.contrib.gis.db.models.aggregates import * - -# The GeoManager -from django.contrib.gis.db.models.manager import GeoManager - -# The geographic-enabled fields. -from django.contrib.gis.db.models.fields import ( - GeometryField, PointField, LineStringField, PolygonField, - MultiPointField, MultiLineStringField, MultiPolygonField, - GeometryCollectionField) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/aggregates.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/aggregates.py deleted file mode 100644 index d0fc6d3..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/aggregates.py +++ /dev/null @@ -1,16 +0,0 @@ -from django.db.models import Aggregate - -class Collect(Aggregate): - name = 'Collect' - -class Extent(Aggregate): - name = 'Extent' - -class Extent3D(Aggregate): - name = 'Extent3D' - -class MakeLine(Aggregate): - name = 'MakeLine' - -class Union(Aggregate): - name = 'Union' diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py deleted file mode 100644 index 2e221b7..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py +++ /dev/null @@ -1,305 +0,0 @@ -from django.db.models.fields import Field -from django.db.models.sql.expressions import SQLEvaluator -from django.utils.translation import ugettext_lazy as _ -from django.contrib.gis import forms -from django.contrib.gis.db.models.proxy import GeometryProxy -from django.contrib.gis.geometry.backend import Geometry, GeometryException -from django.utils import six - -# Local cache of the spatial_ref_sys table, which holds SRID data for each -# spatial database alias. This cache exists so that the database isn't queried -# for SRID info each time a distance query is constructed. -_srid_cache = {} - -def get_srid_info(srid, connection): - """ - Returns the units, unit name, and spheroid WKT associated with the - given SRID from the `spatial_ref_sys` (or equivalent) spatial database - table for the given database connection. These results are cached. - """ - global _srid_cache - - try: - # The SpatialRefSys model for the spatial backend. - SpatialRefSys = connection.ops.spatial_ref_sys() - except NotImplementedError: - # No `spatial_ref_sys` table in spatial backend (e.g., MySQL). - return None, None, None - - if not connection.alias in _srid_cache: - # Initialize SRID dictionary for database if it doesn't exist. - _srid_cache[connection.alias] = {} - - if not srid in _srid_cache[connection.alias]: - # Use `SpatialRefSys` model to query for spatial reference info. - sr = SpatialRefSys.objects.using(connection.alias).get(srid=srid) - units, units_name = sr.units - spheroid = SpatialRefSys.get_spheroid(sr.wkt) - _srid_cache[connection.alias][srid] = (units, units_name, spheroid) - - return _srid_cache[connection.alias][srid] - -class GeometryField(Field): - "The base GIS field -- maps to the OpenGIS Specification Geometry type." - - # The OpenGIS Geometry name. - geom_type = 'GEOMETRY' - form_class = forms.GeometryField - - # Geodetic units. - geodetic_units = ('Decimal Degree', 'degree') - - description = _("The base GIS field -- maps to the OpenGIS Specification Geometry type.") - - def __init__(self, verbose_name=None, srid=4326, spatial_index=True, dim=2, - geography=False, **kwargs): - """ - The initialization function for geometry fields. Takes the following - as keyword arguments: - - srid: - The spatial reference system identifier, an OGC standard. - Defaults to 4326 (WGS84). - - spatial_index: - Indicates whether to create a spatial index. Defaults to True. - Set this instead of 'db_index' for geographic fields since index - creation is different for geometry columns. - - dim: - The number of dimensions for this geometry. Defaults to 2. - - extent: - Customize the extent, in a 4-tuple of WGS 84 coordinates, for the - geometry field entry in the `USER_SDO_GEOM_METADATA` table. Defaults - to (-180.0, -90.0, 180.0, 90.0). - - tolerance: - Define the tolerance, in meters, to use for the geometry field - entry in the `USER_SDO_GEOM_METADATA` table. Defaults to 0.05. - """ - - # Setting the index flag with the value of the `spatial_index` keyword. - self.spatial_index = spatial_index - - # Setting the SRID and getting the units. Unit information must be - # easily available in the field instance for distance queries. - self.srid = srid - - # Setting the dimension of the geometry field. - self.dim = dim - - # Setting the verbose_name keyword argument with the positional - # first parameter, so this works like normal fields. - kwargs['verbose_name'] = verbose_name - - # Is this a geography rather than a geometry column? - self.geography = geography - - # Oracle-specific private attributes for creating the entry in - # `USER_SDO_GEOM_METADATA` - self._extent = kwargs.pop('extent', (-180.0, -90.0, 180.0, 90.0)) - self._tolerance = kwargs.pop('tolerance', 0.05) - - super(GeometryField, self).__init__(**kwargs) - - # The following functions are used to get the units, their name, and - # the spheroid corresponding to the SRID of the GeometryField. - def _get_srid_info(self, connection): - # Get attributes from `get_srid_info`. - self._units, self._units_name, self._spheroid = get_srid_info(self.srid, connection) - - def spheroid(self, connection): - if not hasattr(self, '_spheroid'): - self._get_srid_info(connection) - return self._spheroid - - def units(self, connection): - if not hasattr(self, '_units'): - self._get_srid_info(connection) - return self._units - - def units_name(self, connection): - if not hasattr(self, '_units_name'): - self._get_srid_info(connection) - return self._units_name - - ### Routines specific to GeometryField ### - def geodetic(self, connection): - """ - Returns true if this field's SRID corresponds with a coordinate - system that uses non-projected units (e.g., latitude/longitude). - """ - return self.units_name(connection) in self.geodetic_units - - def get_distance(self, value, lookup_type, connection): - """ - Returns a distance number in units of the field. For example, if - `D(km=1)` was passed in and the units of the field were in meters, - then 1000 would be returned. - """ - return connection.ops.get_distance(self, value, lookup_type) - - def get_prep_value(self, value): - """ - Spatial lookup values are either a parameter that is (or may be - converted to) a geometry, or a sequence of lookup values that - begins with a geometry. This routine will setup the geometry - value properly, and preserve any other lookup parameters before - returning to the caller. - """ - if isinstance(value, SQLEvaluator): - return value - elif isinstance(value, (tuple, list)): - geom = value[0] - seq_value = True - else: - geom = value - seq_value = False - - # When the input is not a GEOS geometry, attempt to construct one - # from the given string input. - if isinstance(geom, Geometry): - pass - elif isinstance(geom, (bytes, six.string_types)) or hasattr(geom, '__geo_interface__'): - try: - geom = Geometry(geom) - except GeometryException: - raise ValueError('Could not create geometry from lookup value.') - else: - raise ValueError('Cannot use object with type %s for a geometry lookup parameter.' % type(geom).__name__) - - # Assigning the SRID value. - geom.srid = self.get_srid(geom) - - if seq_value: - lookup_val = [geom] - lookup_val.extend(value[1:]) - return tuple(lookup_val) - else: - return geom - - def get_srid(self, geom): - """ - Returns the default SRID for the given geometry, taking into account - the SRID set for the field. For example, if the input geometry - has no SRID, then that of the field will be returned. - """ - gsrid = geom.srid # SRID of given geometry. - if gsrid is None or self.srid == -1 or (gsrid == -1 and self.srid != -1): - return self.srid - else: - return gsrid - - ### Routines overloaded from Field ### - def contribute_to_class(self, cls, name): - super(GeometryField, self).contribute_to_class(cls, name) - - # Setup for lazy-instantiated Geometry object. - setattr(cls, self.attname, GeometryProxy(Geometry, self)) - - def db_type(self, connection): - return connection.ops.geo_db_type(self) - - def formfield(self, **kwargs): - defaults = {'form_class' : self.form_class, - 'geom_type' : self.geom_type, - 'srid' : self.srid, - } - defaults.update(kwargs) - if (self.dim > 2 and not 'widget' in kwargs and - not getattr(defaults['form_class'].widget, 'supports_3d', False)): - defaults['widget'] = forms.Textarea - return super(GeometryField, self).formfield(**defaults) - - def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False): - """ - Prepare for the database lookup, and return any spatial parameters - necessary for the query. This includes wrapping any geometry - parameters with a backend-specific adapter and formatting any distance - parameters into the correct units for the coordinate system of the - field. - """ - if lookup_type in connection.ops.gis_terms: - # special case for isnull lookup - if lookup_type == 'isnull': - return [] - - # Populating the parameters list, and wrapping the Geometry - # with the Adapter of the spatial backend. - if isinstance(value, (tuple, list)): - params = [connection.ops.Adapter(value[0])] - if lookup_type in connection.ops.distance_functions: - # Getting the distance parameter in the units of the field. - params += self.get_distance(value[1:], lookup_type, connection) - elif lookup_type in connection.ops.truncate_params: - # Lookup is one where SQL parameters aren't needed from the - # given lookup value. - pass - else: - params += value[1:] - elif isinstance(value, SQLEvaluator): - params = [] - else: - params = [connection.ops.Adapter(value)] - - return params - else: - raise ValueError('%s is not a valid spatial lookup for %s.' % - (lookup_type, self.__class__.__name__)) - - def get_prep_lookup(self, lookup_type, value): - if lookup_type == 'isnull': - return bool(value) - else: - return self.get_prep_value(value) - - def get_db_prep_save(self, value, connection): - "Prepares the value for saving in the database." - if value is None: - return None - else: - return connection.ops.Adapter(self.get_prep_value(value)) - - def get_placeholder(self, value, connection): - """ - Returns the placeholder for the geometry column for the - given value. - """ - return connection.ops.get_geom_placeholder(self, value) - -# The OpenGIS Geometry Type Fields -class PointField(GeometryField): - geom_type = 'POINT' - form_class = forms.PointField - description = _("Point") - -class LineStringField(GeometryField): - geom_type = 'LINESTRING' - form_class = forms.LineStringField - description = _("Line string") - -class PolygonField(GeometryField): - geom_type = 'POLYGON' - form_class = forms.PolygonField - description = _("Polygon") - -class MultiPointField(GeometryField): - geom_type = 'MULTIPOINT' - form_class = forms.MultiPointField - description = _("Multi-point") - -class MultiLineStringField(GeometryField): - geom_type = 'MULTILINESTRING' - form_class = forms.MultiLineStringField - description = _("Multi-line string") - -class MultiPolygonField(GeometryField): - geom_type = 'MULTIPOLYGON' - form_class = forms.MultiPolygonField - description = _("Multi polygon") - -class GeometryCollectionField(GeometryField): - geom_type = 'GEOMETRYCOLLECTION' - form_class = forms.GeometryCollectionField - description = _("Geometry collection") diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/manager.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/manager.py deleted file mode 100644 index aa57e3a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/manager.py +++ /dev/null @@ -1,103 +0,0 @@ -from django.db.models.manager import Manager -from django.contrib.gis.db.models.query import GeoQuerySet - -class GeoManager(Manager): - "Overrides Manager to return Geographic QuerySets." - - # This manager should be used for queries on related fields - # so that geometry columns on Oracle and MySQL are selected - # properly. - use_for_related_fields = True - - def get_queryset(self): - return GeoQuerySet(self.model, using=self._db) - - def area(self, *args, **kwargs): - return self.get_queryset().area(*args, **kwargs) - - def centroid(self, *args, **kwargs): - return self.get_queryset().centroid(*args, **kwargs) - - def collect(self, *args, **kwargs): - return self.get_queryset().collect(*args, **kwargs) - - def difference(self, *args, **kwargs): - return self.get_queryset().difference(*args, **kwargs) - - def distance(self, *args, **kwargs): - return self.get_queryset().distance(*args, **kwargs) - - def envelope(self, *args, **kwargs): - return self.get_queryset().envelope(*args, **kwargs) - - def extent(self, *args, **kwargs): - return self.get_queryset().extent(*args, **kwargs) - - def extent3d(self, *args, **kwargs): - return self.get_queryset().extent3d(*args, **kwargs) - - def force_rhr(self, *args, **kwargs): - return self.get_queryset().force_rhr(*args, **kwargs) - - def geohash(self, *args, **kwargs): - return self.get_queryset().geohash(*args, **kwargs) - - def geojson(self, *args, **kwargs): - return self.get_queryset().geojson(*args, **kwargs) - - def gml(self, *args, **kwargs): - return self.get_queryset().gml(*args, **kwargs) - - def intersection(self, *args, **kwargs): - return self.get_queryset().intersection(*args, **kwargs) - - def kml(self, *args, **kwargs): - return self.get_queryset().kml(*args, **kwargs) - - def length(self, *args, **kwargs): - return self.get_queryset().length(*args, **kwargs) - - def make_line(self, *args, **kwargs): - return self.get_queryset().make_line(*args, **kwargs) - - def mem_size(self, *args, **kwargs): - return self.get_queryset().mem_size(*args, **kwargs) - - def num_geom(self, *args, **kwargs): - return self.get_queryset().num_geom(*args, **kwargs) - - def num_points(self, *args, **kwargs): - return self.get_queryset().num_points(*args, **kwargs) - - def perimeter(self, *args, **kwargs): - return self.get_queryset().perimeter(*args, **kwargs) - - def point_on_surface(self, *args, **kwargs): - return self.get_queryset().point_on_surface(*args, **kwargs) - - def reverse_geom(self, *args, **kwargs): - return self.get_queryset().reverse_geom(*args, **kwargs) - - def scale(self, *args, **kwargs): - return self.get_queryset().scale(*args, **kwargs) - - def snap_to_grid(self, *args, **kwargs): - return self.get_queryset().snap_to_grid(*args, **kwargs) - - def svg(self, *args, **kwargs): - return self.get_queryset().svg(*args, **kwargs) - - def sym_difference(self, *args, **kwargs): - return self.get_queryset().sym_difference(*args, **kwargs) - - def transform(self, *args, **kwargs): - return self.get_queryset().transform(*args, **kwargs) - - def translate(self, *args, **kwargs): - return self.get_queryset().translate(*args, **kwargs) - - def union(self, *args, **kwargs): - return self.get_queryset().union(*args, **kwargs) - - def unionagg(self, *args, **kwargs): - return self.get_queryset().unionagg(*args, **kwargs) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/proxy.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/proxy.py deleted file mode 100644 index 1fdc503..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/proxy.py +++ /dev/null @@ -1,66 +0,0 @@ -""" -The GeometryProxy object, allows for lazy-geometries. The proxy uses -Python descriptors for instantiating and setting Geometry objects -corresponding to geographic model fields. - -Thanks to Robert Coup for providing this functionality (see #4322). -""" -from django.contrib.gis import memoryview -from django.utils import six - -class GeometryProxy(object): - def __init__(self, klass, field): - """ - Proxy initializes on the given Geometry class (not an instance) and - the GeometryField. - """ - self._field = field - self._klass = klass - - def __get__(self, obj, type=None): - """ - This accessor retrieves the geometry, initializing it using the geometry - class specified during initialization and the HEXEWKB value of the field. - Currently, only GEOS or OGR geometries are supported. - """ - if obj is None: - # Accessed on a class, not an instance - return self - - # Getting the value of the field. - geom_value = obj.__dict__[self._field.attname] - - if isinstance(geom_value, self._klass): - geom = geom_value - elif (geom_value is None) or (geom_value==''): - geom = None - else: - # Otherwise, a Geometry object is built using the field's contents, - # and the model's corresponding attribute is set. - geom = self._klass(geom_value) - setattr(obj, self._field.attname, geom) - return geom - - def __set__(self, obj, value): - """ - This accessor sets the proxied geometry with the geometry class - specified during initialization. Values of None, HEXEWKB, or WKT may - be used to set the geometry as well. - """ - # The OGC Geometry type of the field. - gtype = self._field.geom_type - - # The geometry type must match that of the field -- unless the - # general GeometryField is used. - if isinstance(value, self._klass) and (str(value.geom_type).upper() == gtype or gtype == 'GEOMETRY'): - # Assigning the SRID to the geometry. - if value.srid is None: value.srid = self._field.srid - elif value is None or isinstance(value, six.string_types + (memoryview,)): - # Set with None, WKT, HEX, or WKB - pass - else: - raise TypeError('cannot set %s GeometryProxy with value of type: %s' % (obj.__class__.__name__, type(value))) - - # Setting the objects dictionary with the value, and returning. - obj.__dict__[self._field.attname] = value - return value diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/query.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/query.py deleted file mode 100644 index c89912b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/query.py +++ /dev/null @@ -1,784 +0,0 @@ -from django.db import connections -from django.db.models.query import QuerySet, ValuesQuerySet, ValuesListQuerySet - -from django.contrib.gis import memoryview -from django.contrib.gis.db.models import aggregates -from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField -from django.contrib.gis.db.models.sql import AreaField, DistanceField, GeomField, GeoQuery -from django.contrib.gis.geometry.backend import Geometry -from django.contrib.gis.measure import Area, Distance - -from django.utils import six - - -class GeoQuerySet(QuerySet): - "The Geographic QuerySet." - - ### Methods overloaded from QuerySet ### - def __init__(self, model=None, query=None, using=None): - super(GeoQuerySet, self).__init__(model=model, query=query, using=using) - self.query = query or GeoQuery(self.model) - - def values(self, *fields): - return self._clone(klass=GeoValuesQuerySet, setup=True, _fields=fields) - - def values_list(self, *fields, **kwargs): - flat = kwargs.pop('flat', False) - if kwargs: - raise TypeError('Unexpected keyword arguments to values_list: %s' - % (list(kwargs),)) - if flat and len(fields) > 1: - raise TypeError("'flat' is not valid when values_list is called with more than one field.") - return self._clone(klass=GeoValuesListQuerySet, setup=True, flat=flat, - _fields=fields) - - ### GeoQuerySet Methods ### - def area(self, tolerance=0.05, **kwargs): - """ - Returns the area of the geographic field in an `area` attribute on - each element of this GeoQuerySet. - """ - # Peforming setup here rather than in `_spatial_attribute` so that - # we can get the units for `AreaField`. - procedure_args, geo_field = self._spatial_setup('area', field_name=kwargs.get('field_name', None)) - s = {'procedure_args' : procedure_args, - 'geo_field' : geo_field, - 'setup' : False, - } - connection = connections[self.db] - backend = connection.ops - if backend.oracle: - s['procedure_fmt'] = '%(geo_col)s,%(tolerance)s' - s['procedure_args']['tolerance'] = tolerance - s['select_field'] = AreaField('sq_m') # Oracle returns area in units of meters. - elif backend.postgis or backend.spatialite: - if backend.geography: - # Geography fields support area calculation, returns square meters. - s['select_field'] = AreaField('sq_m') - elif not geo_field.geodetic(connection): - # Getting the area units of the geographic field. - s['select_field'] = AreaField(Area.unit_attname(geo_field.units_name(connection))) - else: - # TODO: Do we want to support raw number areas for geodetic fields? - raise Exception('Area on geodetic coordinate systems not supported.') - return self._spatial_attribute('area', s, **kwargs) - - def centroid(self, **kwargs): - """ - Returns the centroid of the geographic field in a `centroid` - attribute on each element of this GeoQuerySet. - """ - return self._geom_attribute('centroid', **kwargs) - - def collect(self, **kwargs): - """ - Performs an aggregate collect operation on the given geometry field. - This is analagous to a union operation, but much faster because - boundaries are not dissolved. - """ - return self._spatial_aggregate(aggregates.Collect, **kwargs) - - def difference(self, geom, **kwargs): - """ - Returns the spatial difference of the geographic field in a `difference` - attribute on each element of this GeoQuerySet. - """ - return self._geomset_attribute('difference', geom, **kwargs) - - def distance(self, geom, **kwargs): - """ - Returns the distance from the given geographic field name to the - given geometry in a `distance` attribute on each element of the - GeoQuerySet. - - Keyword Arguments: - `spheroid` => If the geometry field is geodetic and PostGIS is - the spatial database, then the more accurate - spheroid calculation will be used instead of the - quicker sphere calculation. - - `tolerance` => Used only for Oracle. The tolerance is - in meters -- a default of 5 centimeters (0.05) - is used. - """ - return self._distance_attribute('distance', geom, **kwargs) - - def envelope(self, **kwargs): - """ - Returns a Geometry representing the bounding box of the - Geometry field in an `envelope` attribute on each element of - the GeoQuerySet. - """ - return self._geom_attribute('envelope', **kwargs) - - def extent(self, **kwargs): - """ - Returns the extent (aggregate) of the features in the GeoQuerySet. The - extent will be returned as a 4-tuple, consisting of (xmin, ymin, xmax, ymax). - """ - return self._spatial_aggregate(aggregates.Extent, **kwargs) - - def extent3d(self, **kwargs): - """ - Returns the aggregate extent, in 3D, of the features in the - GeoQuerySet. It is returned as a 6-tuple, comprising: - (xmin, ymin, zmin, xmax, ymax, zmax). - """ - return self._spatial_aggregate(aggregates.Extent3D, **kwargs) - - def force_rhr(self, **kwargs): - """ - Returns a modified version of the Polygon/MultiPolygon in which - all of the vertices follow the Right-Hand-Rule. By default, - this is attached as the `force_rhr` attribute on each element - of the GeoQuerySet. - """ - return self._geom_attribute('force_rhr', **kwargs) - - def geojson(self, precision=8, crs=False, bbox=False, **kwargs): - """ - Returns a GeoJSON representation of the geomtry field in a `geojson` - attribute on each element of the GeoQuerySet. - - The `crs` and `bbox` keywords may be set to True if the users wants - the coordinate reference system and the bounding box to be included - in the GeoJSON representation of the geometry. - """ - backend = connections[self.db].ops - if not backend.geojson: - raise NotImplementedError('Only PostGIS 1.3.4+ and SpatiaLite 3.0+ ' - 'support GeoJSON serialization.') - - if not isinstance(precision, six.integer_types): - raise TypeError('Precision keyword must be set with an integer.') - - # Setting the options flag -- which depends on which version of - # PostGIS we're using. SpatiaLite only uses the first group of options. - if backend.spatial_version >= (1, 4, 0): - options = 0 - if crs and bbox: options = 3 - elif bbox: options = 1 - elif crs: options = 2 - else: - options = 0 - if crs and bbox: options = 3 - elif crs: options = 1 - elif bbox: options = 2 - s = {'desc' : 'GeoJSON', - 'procedure_args' : {'precision' : precision, 'options' : options}, - 'procedure_fmt' : '%(geo_col)s,%(precision)s,%(options)s', - } - return self._spatial_attribute('geojson', s, **kwargs) - - def geohash(self, precision=20, **kwargs): - """ - Returns a GeoHash representation of the given field in a `geohash` - attribute on each element of the GeoQuerySet. - - The `precision` keyword may be used to custom the number of - _characters_ used in the output GeoHash, the default is 20. - """ - s = {'desc' : 'GeoHash', - 'procedure_args': {'precision': precision}, - 'procedure_fmt': '%(geo_col)s,%(precision)s', - } - return self._spatial_attribute('geohash', s, **kwargs) - - def gml(self, precision=8, version=2, **kwargs): - """ - Returns GML representation of the given field in a `gml` attribute - on each element of the GeoQuerySet. - """ - backend = connections[self.db].ops - s = {'desc' : 'GML', 'procedure_args' : {'precision' : precision}} - if backend.postgis: - # PostGIS AsGML() aggregate function parameter order depends on the - # version -- uggh. - if backend.spatial_version > (1, 3, 1): - s['procedure_fmt'] = '%(version)s,%(geo_col)s,%(precision)s' - else: - s['procedure_fmt'] = '%(geo_col)s,%(precision)s,%(version)s' - s['procedure_args'] = {'precision' : precision, 'version' : version} - - return self._spatial_attribute('gml', s, **kwargs) - - def intersection(self, geom, **kwargs): - """ - Returns the spatial intersection of the Geometry field in - an `intersection` attribute on each element of this - GeoQuerySet. - """ - return self._geomset_attribute('intersection', geom, **kwargs) - - def kml(self, **kwargs): - """ - Returns KML representation of the geometry field in a `kml` - attribute on each element of this GeoQuerySet. - """ - s = {'desc' : 'KML', - 'procedure_fmt' : '%(geo_col)s,%(precision)s', - 'procedure_args' : {'precision' : kwargs.pop('precision', 8)}, - } - return self._spatial_attribute('kml', s, **kwargs) - - def length(self, **kwargs): - """ - Returns the length of the geometry field as a `Distance` object - stored in a `length` attribute on each element of this GeoQuerySet. - """ - return self._distance_attribute('length', None, **kwargs) - - def make_line(self, **kwargs): - """ - Creates a linestring from all of the PointField geometries in the - this GeoQuerySet and returns it. This is a spatial aggregate - method, and thus returns a geometry rather than a GeoQuerySet. - """ - return self._spatial_aggregate(aggregates.MakeLine, geo_field_type=PointField, **kwargs) - - def mem_size(self, **kwargs): - """ - Returns the memory size (number of bytes) that the geometry field takes - in a `mem_size` attribute on each element of this GeoQuerySet. - """ - return self._spatial_attribute('mem_size', {}, **kwargs) - - def num_geom(self, **kwargs): - """ - Returns the number of geometries if the field is a - GeometryCollection or Multi* Field in a `num_geom` - attribute on each element of this GeoQuerySet; otherwise - the sets with None. - """ - return self._spatial_attribute('num_geom', {}, **kwargs) - - def num_points(self, **kwargs): - """ - Returns the number of points in the first linestring in the - Geometry field in a `num_points` attribute on each element of - this GeoQuerySet; otherwise sets with None. - """ - return self._spatial_attribute('num_points', {}, **kwargs) - - def perimeter(self, **kwargs): - """ - Returns the perimeter of the geometry field as a `Distance` object - stored in a `perimeter` attribute on each element of this GeoQuerySet. - """ - return self._distance_attribute('perimeter', None, **kwargs) - - def point_on_surface(self, **kwargs): - """ - Returns a Point geometry guaranteed to lie on the surface of the - Geometry field in a `point_on_surface` attribute on each element - of this GeoQuerySet; otherwise sets with None. - """ - return self._geom_attribute('point_on_surface', **kwargs) - - def reverse_geom(self, **kwargs): - """ - Reverses the coordinate order of the geometry, and attaches as a - `reverse` attribute on each element of this GeoQuerySet. - """ - s = {'select_field' : GeomField(),} - kwargs.setdefault('model_att', 'reverse_geom') - if connections[self.db].ops.oracle: - s['geo_field_type'] = LineStringField - return self._spatial_attribute('reverse', s, **kwargs) - - def scale(self, x, y, z=0.0, **kwargs): - """ - Scales the geometry to a new size by multiplying the ordinates - with the given x,y,z scale factors. - """ - if connections[self.db].ops.spatialite: - if z != 0.0: - raise NotImplementedError('SpatiaLite does not support 3D scaling.') - s = {'procedure_fmt' : '%(geo_col)s,%(x)s,%(y)s', - 'procedure_args' : {'x' : x, 'y' : y}, - 'select_field' : GeomField(), - } - else: - s = {'procedure_fmt' : '%(geo_col)s,%(x)s,%(y)s,%(z)s', - 'procedure_args' : {'x' : x, 'y' : y, 'z' : z}, - 'select_field' : GeomField(), - } - return self._spatial_attribute('scale', s, **kwargs) - - def snap_to_grid(self, *args, **kwargs): - """ - Snap all points of the input geometry to the grid. How the - geometry is snapped to the grid depends on how many arguments - were given: - - 1 argument : A single size to snap both the X and Y grids to. - - 2 arguments: X and Y sizes to snap the grid to. - - 4 arguments: X, Y sizes and the X, Y origins. - """ - if False in [isinstance(arg, (float,) + six.integer_types) for arg in args]: - raise TypeError('Size argument(s) for the grid must be a float or integer values.') - - nargs = len(args) - if nargs == 1: - size = args[0] - procedure_fmt = '%(geo_col)s,%(size)s' - procedure_args = {'size' : size} - elif nargs == 2: - xsize, ysize = args - procedure_fmt = '%(geo_col)s,%(xsize)s,%(ysize)s' - procedure_args = {'xsize' : xsize, 'ysize' : ysize} - elif nargs == 4: - xsize, ysize, xorigin, yorigin = args - procedure_fmt = '%(geo_col)s,%(xorigin)s,%(yorigin)s,%(xsize)s,%(ysize)s' - procedure_args = {'xsize' : xsize, 'ysize' : ysize, - 'xorigin' : xorigin, 'yorigin' : yorigin} - else: - raise ValueError('Must provide 1, 2, or 4 arguments to `snap_to_grid`.') - - s = {'procedure_fmt' : procedure_fmt, - 'procedure_args' : procedure_args, - 'select_field' : GeomField(), - } - - return self._spatial_attribute('snap_to_grid', s, **kwargs) - - def svg(self, relative=False, precision=8, **kwargs): - """ - Returns SVG representation of the geographic field in a `svg` - attribute on each element of this GeoQuerySet. - - Keyword Arguments: - `relative` => If set to True, this will evaluate the path in - terms of relative moves (rather than absolute). - - `precision` => May be used to set the maximum number of decimal - digits used in output (defaults to 8). - """ - relative = int(bool(relative)) - if not isinstance(precision, six.integer_types): - raise TypeError('SVG precision keyword argument must be an integer.') - s = {'desc' : 'SVG', - 'procedure_fmt' : '%(geo_col)s,%(rel)s,%(precision)s', - 'procedure_args' : {'rel' : relative, - 'precision' : precision, - } - } - return self._spatial_attribute('svg', s, **kwargs) - - def sym_difference(self, geom, **kwargs): - """ - Returns the symmetric difference of the geographic field in a - `sym_difference` attribute on each element of this GeoQuerySet. - """ - return self._geomset_attribute('sym_difference', geom, **kwargs) - - def translate(self, x, y, z=0.0, **kwargs): - """ - Translates the geometry to a new location using the given numeric - parameters as offsets. - """ - if connections[self.db].ops.spatialite: - if z != 0.0: - raise NotImplementedError('SpatiaLite does not support 3D translation.') - s = {'procedure_fmt' : '%(geo_col)s,%(x)s,%(y)s', - 'procedure_args' : {'x' : x, 'y' : y}, - 'select_field' : GeomField(), - } - else: - s = {'procedure_fmt' : '%(geo_col)s,%(x)s,%(y)s,%(z)s', - 'procedure_args' : {'x' : x, 'y' : y, 'z' : z}, - 'select_field' : GeomField(), - } - return self._spatial_attribute('translate', s, **kwargs) - - def transform(self, srid=4326, **kwargs): - """ - Transforms the given geometry field to the given SRID. If no SRID is - provided, the transformation will default to using 4326 (WGS84). - """ - if not isinstance(srid, six.integer_types): - raise TypeError('An integer SRID must be provided.') - field_name = kwargs.get('field_name', None) - tmp, geo_field = self._spatial_setup('transform', field_name=field_name) - - # Getting the selection SQL for the given geographic field. - field_col = self._geocol_select(geo_field, field_name) - - # Why cascading substitutions? Because spatial backends like - # Oracle and MySQL already require a function call to convert to text, thus - # when there's also a transformation we need to cascade the substitutions. - # For example, 'SDO_UTIL.TO_WKTGEOMETRY(SDO_CS.TRANSFORM( ... )' - geo_col = self.query.custom_select.get(geo_field, field_col) - - # Setting the key for the field's column with the custom SELECT SQL to - # override the geometry column returned from the database. - custom_sel = '%s(%s, %s)' % (connections[self.db].ops.transform, geo_col, srid) - # TODO: Should we have this as an alias? - # custom_sel = '(%s(%s, %s)) AS %s' % (SpatialBackend.transform, geo_col, srid, qn(geo_field.name)) - self.query.transformed_srid = srid # So other GeoQuerySet methods - self.query.custom_select[geo_field] = custom_sel - return self._clone() - - def union(self, geom, **kwargs): - """ - Returns the union of the geographic field with the given - Geometry in a `union` attribute on each element of this GeoQuerySet. - """ - return self._geomset_attribute('union', geom, **kwargs) - - def unionagg(self, **kwargs): - """ - Performs an aggregate union on the given geometry field. Returns - None if the GeoQuerySet is empty. The `tolerance` keyword is for - Oracle backends only. - """ - return self._spatial_aggregate(aggregates.Union, **kwargs) - - ### Private API -- Abstracted DRY routines. ### - def _spatial_setup(self, att, desc=None, field_name=None, geo_field_type=None): - """ - Performs set up for executing the spatial function. - """ - # Does the spatial backend support this? - connection = connections[self.db] - func = getattr(connection.ops, att, False) - if desc is None: desc = att - if not func: - raise NotImplementedError('%s stored procedure not available on ' - 'the %s backend.' % - (desc, connection.ops.name)) - - # Initializing the procedure arguments. - procedure_args = {'function' : func} - - # Is there a geographic field in the model to perform this - # operation on? - geo_field = self.query._geo_field(field_name) - if not geo_field: - raise TypeError('%s output only available on GeometryFields.' % func) - - # If the `geo_field_type` keyword was used, then enforce that - # type limitation. - if not geo_field_type is None and not isinstance(geo_field, geo_field_type): - raise TypeError('"%s" stored procedures may only be called on %ss.' % (func, geo_field_type.__name__)) - - # Setting the procedure args. - procedure_args['geo_col'] = self._geocol_select(geo_field, field_name) - - return procedure_args, geo_field - - def _spatial_aggregate(self, aggregate, field_name=None, - geo_field_type=None, tolerance=0.05): - """ - DRY routine for calling aggregate spatial stored procedures and - returning their result to the caller of the function. - """ - # Getting the field the geographic aggregate will be called on. - geo_field = self.query._geo_field(field_name) - if not geo_field: - raise TypeError('%s aggregate only available on GeometryFields.' % aggregate.name) - - # Checking if there are any geo field type limitations on this - # aggregate (e.g. ST_Makeline only operates on PointFields). - if not geo_field_type is None and not isinstance(geo_field, geo_field_type): - raise TypeError('%s aggregate may only be called on %ss.' % (aggregate.name, geo_field_type.__name__)) - - # Getting the string expression of the field name, as this is the - # argument taken by `Aggregate` objects. - agg_col = field_name or geo_field.name - - # Adding any keyword parameters for the Aggregate object. Oracle backends - # in particular need an additional `tolerance` parameter. - agg_kwargs = {} - if connections[self.db].ops.oracle: agg_kwargs['tolerance'] = tolerance - - # Calling the QuerySet.aggregate, and returning only the value of the aggregate. - return self.aggregate(geoagg=aggregate(agg_col, **agg_kwargs))['geoagg'] - - def _spatial_attribute(self, att, settings, field_name=None, model_att=None): - """ - DRY routine for calling a spatial stored procedure on a geometry column - and attaching its output as an attribute of the model. - - Arguments: - att: - The name of the spatial attribute that holds the spatial - SQL function to call. - - settings: - Dictonary of internal settings to customize for the spatial procedure. - - Public Keyword Arguments: - - field_name: - The name of the geographic field to call the spatial - function on. May also be a lookup to a geometry field - as part of a foreign key relation. - - model_att: - The name of the model attribute to attach the output of - the spatial function to. - """ - # Default settings. - settings.setdefault('desc', None) - settings.setdefault('geom_args', ()) - settings.setdefault('geom_field', None) - settings.setdefault('procedure_args', {}) - settings.setdefault('procedure_fmt', '%(geo_col)s') - settings.setdefault('select_params', []) - - connection = connections[self.db] - backend = connection.ops - - # Performing setup for the spatial column, unless told not to. - if settings.get('setup', True): - default_args, geo_field = self._spatial_setup(att, desc=settings['desc'], field_name=field_name, - geo_field_type=settings.get('geo_field_type', None)) - for k, v in six.iteritems(default_args): settings['procedure_args'].setdefault(k, v) - else: - geo_field = settings['geo_field'] - - # The attribute to attach to the model. - if not isinstance(model_att, six.string_types): model_att = att - - # Special handling for any argument that is a geometry. - for name in settings['geom_args']: - # Using the field's get_placeholder() routine to get any needed - # transformation SQL. - geom = geo_field.get_prep_value(settings['procedure_args'][name]) - params = geo_field.get_db_prep_lookup('contains', geom, connection=connection) - geom_placeholder = geo_field.get_placeholder(geom, connection) - - # Replacing the procedure format with that of any needed - # transformation SQL. - old_fmt = '%%(%s)s' % name - new_fmt = geom_placeholder % '%%s' - settings['procedure_fmt'] = settings['procedure_fmt'].replace(old_fmt, new_fmt) - settings['select_params'].extend(params) - - # Getting the format for the stored procedure. - fmt = '%%(function)s(%s)' % settings['procedure_fmt'] - - # If the result of this function needs to be converted. - if settings.get('select_field', False): - sel_fld = settings['select_field'] - if isinstance(sel_fld, GeomField) and backend.select: - self.query.custom_select[model_att] = backend.select - if connection.ops.oracle: - sel_fld.empty_strings_allowed = False - self.query.extra_select_fields[model_att] = sel_fld - - # Finally, setting the extra selection attribute with - # the format string expanded with the stored procedure - # arguments. - return self.extra(select={model_att : fmt % settings['procedure_args']}, - select_params=settings['select_params']) - - def _distance_attribute(self, func, geom=None, tolerance=0.05, spheroid=False, **kwargs): - """ - DRY routine for GeoQuerySet distance attribute routines. - """ - # Setting up the distance procedure arguments. - procedure_args, geo_field = self._spatial_setup(func, field_name=kwargs.get('field_name', None)) - - # If geodetic defaulting distance attribute to meters (Oracle and - # PostGIS spherical distances return meters). Otherwise, use the - # units of the geometry field. - connection = connections[self.db] - geodetic = geo_field.geodetic(connection) - geography = geo_field.geography - - if geodetic: - dist_att = 'm' - else: - dist_att = Distance.unit_attname(geo_field.units_name(connection)) - - # Shortcut booleans for what distance function we're using and - # whether the geometry field is 3D. - distance = func == 'distance' - length = func == 'length' - perimeter = func == 'perimeter' - if not (distance or length or perimeter): - raise ValueError('Unknown distance function: %s' % func) - geom_3d = geo_field.dim == 3 - - # The field's get_db_prep_lookup() is used to get any - # extra distance parameters. Here we set up the - # parameters that will be passed in to field's function. - lookup_params = [geom or 'POINT (0 0)', 0] - - # Getting the spatial backend operations. - backend = connection.ops - - # If the spheroid calculation is desired, either by the `spheroid` - # keyword or when calculating the length of geodetic field, make - # sure the 'spheroid' distance setting string is passed in so we - # get the correct spatial stored procedure. - if spheroid or (backend.postgis and geodetic and - (not geography) and length): - lookup_params.append('spheroid') - lookup_params = geo_field.get_prep_value(lookup_params) - params = geo_field.get_db_prep_lookup('distance_lte', lookup_params, connection=connection) - - # The `geom_args` flag is set to true if a geometry parameter was - # passed in. - geom_args = bool(geom) - - if backend.oracle: - if distance: - procedure_fmt = '%(geo_col)s,%(geom)s,%(tolerance)s' - elif length or perimeter: - procedure_fmt = '%(geo_col)s,%(tolerance)s' - procedure_args['tolerance'] = tolerance - else: - # Getting whether this field is in units of degrees since the field may have - # been transformed via the `transform` GeoQuerySet method. - if self.query.transformed_srid: - u, unit_name, s = get_srid_info(self.query.transformed_srid, connection) - geodetic = unit_name in geo_field.geodetic_units - - if backend.spatialite and geodetic: - raise ValueError('SQLite does not support linear distance calculations on geodetic coordinate systems.') - - if distance: - if self.query.transformed_srid: - # Setting the `geom_args` flag to false because we want to handle - # transformation SQL here, rather than the way done by default - # (which will transform to the original SRID of the field rather - # than to what was transformed to). - geom_args = False - procedure_fmt = '%s(%%(geo_col)s, %s)' % (backend.transform, self.query.transformed_srid) - if geom.srid is None or geom.srid == self.query.transformed_srid: - # If the geom parameter srid is None, it is assumed the coordinates - # are in the transformed units. A placeholder is used for the - # geometry parameter. `GeomFromText` constructor is also needed - # to wrap geom placeholder for SpatiaLite. - if backend.spatialite: - procedure_fmt += ', %s(%%%%s, %s)' % (backend.from_text, self.query.transformed_srid) - else: - procedure_fmt += ', %%s' - else: - # We need to transform the geom to the srid specified in `transform()`, - # so wrapping the geometry placeholder in transformation SQL. - # SpatiaLite also needs geometry placeholder wrapped in `GeomFromText` - # constructor. - if backend.spatialite: - procedure_fmt += ', %s(%s(%%%%s, %s), %s)' % (backend.transform, backend.from_text, - geom.srid, self.query.transformed_srid) - else: - procedure_fmt += ', %s(%%%%s, %s)' % (backend.transform, self.query.transformed_srid) - else: - # `transform()` was not used on this GeoQuerySet. - procedure_fmt = '%(geo_col)s,%(geom)s' - - if not geography and geodetic: - # Spherical distance calculation is needed (because the geographic - # field is geodetic). However, the PostGIS ST_distance_sphere/spheroid() - # procedures may only do queries from point columns to point geometries - # some error checking is required. - if not backend.geography: - if not isinstance(geo_field, PointField): - raise ValueError('Spherical distance calculation only supported on PointFields.') - if not str(Geometry(memoryview(params[0].ewkb)).geom_type) == 'Point': - raise ValueError('Spherical distance calculation only supported with Point Geometry parameters') - # The `function` procedure argument needs to be set differently for - # geodetic distance calculations. - if spheroid: - # Call to distance_spheroid() requires spheroid param as well. - procedure_fmt += ",'%(spheroid)s'" - procedure_args.update({'function' : backend.distance_spheroid, 'spheroid' : params[1]}) - else: - procedure_args.update({'function' : backend.distance_sphere}) - elif length or perimeter: - procedure_fmt = '%(geo_col)s' - if not geography and geodetic and length: - # There's no `length_sphere`, and `length_spheroid` also - # works on 3D geometries. - procedure_fmt += ",'%(spheroid)s'" - procedure_args.update({'function' : backend.length_spheroid, 'spheroid' : params[1]}) - elif geom_3d and backend.postgis: - # Use 3D variants of perimeter and length routines on PostGIS. - if perimeter: - procedure_args.update({'function' : backend.perimeter3d}) - elif length: - procedure_args.update({'function' : backend.length3d}) - - # Setting up the settings for `_spatial_attribute`. - s = {'select_field' : DistanceField(dist_att), - 'setup' : False, - 'geo_field' : geo_field, - 'procedure_args' : procedure_args, - 'procedure_fmt' : procedure_fmt, - } - if geom_args: - s['geom_args'] = ('geom',) - s['procedure_args']['geom'] = geom - elif geom: - # The geometry is passed in as a parameter because we handled - # transformation conditions in this routine. - s['select_params'] = [backend.Adapter(geom)] - return self._spatial_attribute(func, s, **kwargs) - - def _geom_attribute(self, func, tolerance=0.05, **kwargs): - """ - DRY routine for setting up a GeoQuerySet method that attaches a - Geometry attribute (e.g., `centroid`, `point_on_surface`). - """ - s = {'select_field' : GeomField(),} - if connections[self.db].ops.oracle: - s['procedure_fmt'] = '%(geo_col)s,%(tolerance)s' - s['procedure_args'] = {'tolerance' : tolerance} - return self._spatial_attribute(func, s, **kwargs) - - def _geomset_attribute(self, func, geom, tolerance=0.05, **kwargs): - """ - DRY routine for setting up a GeoQuerySet method that attaches a - Geometry attribute and takes a Geoemtry parameter. This is used - for geometry set-like operations (e.g., intersection, difference, - union, sym_difference). - """ - s = {'geom_args' : ('geom',), - 'select_field' : GeomField(), - 'procedure_fmt' : '%(geo_col)s,%(geom)s', - 'procedure_args' : {'geom' : geom}, - } - if connections[self.db].ops.oracle: - s['procedure_fmt'] += ',%(tolerance)s' - s['procedure_args']['tolerance'] = tolerance - return self._spatial_attribute(func, s, **kwargs) - - def _geocol_select(self, geo_field, field_name): - """ - Helper routine for constructing the SQL to select the geographic - column. Takes into account if the geographic field is in a - ForeignKey relation to the current model. - """ - opts = self.model._meta - if not geo_field in opts.fields: - # Is this operation going to be on a related geographic field? - # If so, it'll have to be added to the select related information - # (e.g., if 'location__point' was given as the field name). - self.query.add_select_related([field_name]) - compiler = self.query.get_compiler(self.db) - compiler.pre_sql_setup() - for (rel_table, rel_col), field in self.query.related_select_cols: - if field == geo_field: - return compiler._field_column(geo_field, rel_table) - raise ValueError("%r not in self.query.related_select_cols" % geo_field) - elif not geo_field in opts.local_fields: - # This geographic field is inherited from another model, so we have to - # use the db table for the _parent_ model instead. - tmp_fld, parent_model, direct, m2m = opts.get_field_by_name(geo_field.name) - return self.query.get_compiler(self.db)._field_column(geo_field, parent_model._meta.db_table) - else: - return self.query.get_compiler(self.db)._field_column(geo_field) - -class GeoValuesQuerySet(ValuesQuerySet): - def __init__(self, *args, **kwargs): - super(GeoValuesQuerySet, self).__init__(*args, **kwargs) - # This flag tells `resolve_columns` to run the values through - # `convert_values`. This ensures that Geometry objects instead - # of string values are returned with `values()` or `values_list()`. - self.query.geo_values = True - -class GeoValuesListQuerySet(GeoValuesQuerySet, ValuesListQuerySet): - pass diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/__init__.py deleted file mode 100644 index 38d9507..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField -from django.contrib.gis.db.models.sql.query import GeoQuery -from django.contrib.gis.db.models.sql.where import GeoWhereNode diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/aggregates.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/aggregates.py deleted file mode 100644 index ae848c0..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/aggregates.py +++ /dev/null @@ -1,62 +0,0 @@ -from django.db.models.sql.aggregates import * -from django.contrib.gis.db.models.fields import GeometryField - -class GeoAggregate(Aggregate): - # Default SQL template for spatial aggregates. - sql_template = '%(function)s(%(field)s)' - - # Conversion class, if necessary. - conversion_class = None - - # Flags for indicating the type of the aggregate. - is_extent = False - - def __init__(self, col, source=None, is_summary=False, tolerance=0.05, **extra): - super(GeoAggregate, self).__init__(col, source, is_summary, **extra) - - # Required by some Oracle aggregates. - self.tolerance = tolerance - - # Can't use geographic aggregates on non-geometry fields. - if not isinstance(self.source, GeometryField): - raise ValueError('Geospatial aggregates only allowed on geometry fields.') - - def as_sql(self, qn, connection): - "Return the aggregate, rendered as SQL with parameters." - - if connection.ops.oracle: - self.extra['tolerance'] = self.tolerance - - params = [] - - if hasattr(self.col, 'as_sql'): - field_name, params = self.col.as_sql(qn, connection) - elif isinstance(self.col, (list, tuple)): - field_name = '.'.join([qn(c) for c in self.col]) - else: - field_name = self.col - - sql_template, sql_function = connection.ops.spatial_aggregate_sql(self) - - substitutions = { - 'function': sql_function, - 'field': field_name - } - substitutions.update(self.extra) - - return sql_template % substitutions, params - -class Collect(GeoAggregate): - pass - -class Extent(GeoAggregate): - is_extent = '2D' - -class Extent3D(GeoAggregate): - is_extent = '3D' - -class MakeLine(GeoAggregate): - pass - -class Union(GeoAggregate): - pass diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/compiler.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/compiler.py deleted file mode 100644 index 3fc9c17..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/compiler.py +++ /dev/null @@ -1,313 +0,0 @@ -import datetime - -from django.conf import settings -from django.db.backends.util import truncate_name, typecast_date, typecast_timestamp -from django.db.models.sql import compiler -from django.db.models.sql.constants import MULTI -from django.utils import six -from django.utils.six.moves import zip, zip_longest -from django.utils import timezone - -SQLCompiler = compiler.SQLCompiler - -class GeoSQLCompiler(compiler.SQLCompiler): - - def get_columns(self, with_aliases=False): - """ - Return the list of columns to use in the select statement. If no - columns have been specified, returns all columns relating to fields in - the model. - - If 'with_aliases' is true, any column names that are duplicated - (without the table names) are given unique aliases. This is needed in - some cases to avoid ambiguitity with nested queries. - - This routine is overridden from Query to handle customized selection of - geometry columns. - """ - qn = self.quote_name_unless_alias - qn2 = self.connection.ops.quote_name - result = ['(%s) AS %s' % (self.get_extra_select_format(alias) % col[0], qn2(alias)) - for alias, col in six.iteritems(self.query.extra_select)] - params = [] - aliases = set(self.query.extra_select.keys()) - if with_aliases: - col_aliases = aliases.copy() - else: - col_aliases = set() - if self.query.select: - only_load = self.deferred_to_columns() - # This loop customized for GeoQuery. - for col, field in self.query.select: - if isinstance(col, (list, tuple)): - alias, column = col - table = self.query.alias_map[alias].table_name - if table in only_load and column not in only_load[table]: - continue - r = self.get_field_select(field, alias, column) - if with_aliases: - if col[1] in col_aliases: - c_alias = 'Col%d' % len(col_aliases) - result.append('%s AS %s' % (r, c_alias)) - aliases.add(c_alias) - col_aliases.add(c_alias) - else: - result.append('%s AS %s' % (r, qn2(col[1]))) - aliases.add(r) - col_aliases.add(col[1]) - else: - result.append(r) - aliases.add(r) - col_aliases.add(col[1]) - else: - col_sql, col_params = col.as_sql(qn, self.connection) - result.append(col_sql) - params.extend(col_params) - - if hasattr(col, 'alias'): - aliases.add(col.alias) - col_aliases.add(col.alias) - - elif self.query.default_cols: - cols, new_aliases = self.get_default_columns(with_aliases, - col_aliases) - result.extend(cols) - aliases.update(new_aliases) - - max_name_length = self.connection.ops.max_name_length() - for alias, aggregate in self.query.aggregate_select.items(): - agg_sql, agg_params = aggregate.as_sql(qn, self.connection) - if alias is None: - result.append(agg_sql) - else: - result.append('%s AS %s' % (agg_sql, qn(truncate_name(alias, max_name_length)))) - params.extend(agg_params) - - # This loop customized for GeoQuery. - for (table, col), field in self.query.related_select_cols: - r = self.get_field_select(field, table, col) - if with_aliases and col in col_aliases: - c_alias = 'Col%d' % len(col_aliases) - result.append('%s AS %s' % (r, c_alias)) - aliases.add(c_alias) - col_aliases.add(c_alias) - else: - result.append(r) - aliases.add(r) - col_aliases.add(col) - - self._select_aliases = aliases - return result, params - - def get_default_columns(self, with_aliases=False, col_aliases=None, - start_alias=None, opts=None, as_pairs=False, from_parent=None): - """ - Computes the default columns for selecting every field in the base - model. Will sometimes be called to pull in related models (e.g. via - select_related), in which case "opts" and "start_alias" will be given - to provide a starting point for the traversal. - - Returns a list of strings, quoted appropriately for use in SQL - directly, as well as a set of aliases used in the select statement (if - 'as_pairs' is True, returns a list of (alias, col_name) pairs instead - of strings as the first component and None as the second component). - - This routine is overridden from Query to handle customized selection of - geometry columns. - """ - result = [] - if opts is None: - opts = self.query.get_meta() - aliases = set() - only_load = self.deferred_to_columns() - seen = self.query.included_inherited_models.copy() - if start_alias: - seen[None] = start_alias - for field, model in opts.get_concrete_fields_with_model(): - if from_parent and model is not None and issubclass(from_parent, model): - # Avoid loading data for already loaded parents. - continue - alias = self.query.join_parent_model(opts, model, start_alias, seen) - table = self.query.alias_map[alias].table_name - if table in only_load and field.column not in only_load[table]: - continue - if as_pairs: - result.append((alias, field)) - aliases.add(alias) - continue - # This part of the function is customized for GeoQuery. We - # see if there was any custom selection specified in the - # dictionary, and set up the selection format appropriately. - field_sel = self.get_field_select(field, alias) - if with_aliases and field.column in col_aliases: - c_alias = 'Col%d' % len(col_aliases) - result.append('%s AS %s' % (field_sel, c_alias)) - col_aliases.add(c_alias) - aliases.add(c_alias) - else: - r = field_sel - result.append(r) - aliases.add(r) - if with_aliases: - col_aliases.add(field.column) - return result, aliases - - def resolve_columns(self, row, fields=()): - """ - This routine is necessary so that distances and geometries returned - from extra selection SQL get resolved appropriately into Python - objects. - """ - values = [] - aliases = list(self.query.extra_select) - - # Have to set a starting row number offset that is used for - # determining the correct starting row index -- needed for - # doing pagination with Oracle. - rn_offset = 0 - if self.connection.ops.oracle: - if self.query.high_mark is not None or self.query.low_mark: rn_offset = 1 - index_start = rn_offset + len(aliases) - - # Converting any extra selection values (e.g., geometries and - # distance objects added by GeoQuerySet methods). - values = [self.query.convert_values(v, - self.query.extra_select_fields.get(a, None), - self.connection) - for v, a in zip(row[rn_offset:index_start], aliases)] - if self.connection.ops.oracle or getattr(self.query, 'geo_values', False): - # We resolve the rest of the columns if we're on Oracle or if - # the `geo_values` attribute is defined. - for value, field in zip_longest(row[index_start:], fields): - values.append(self.query.convert_values(value, field, self.connection)) - else: - values.extend(row[index_start:]) - return tuple(values) - - #### Routines unique to GeoQuery #### - def get_extra_select_format(self, alias): - sel_fmt = '%s' - if hasattr(self.query, 'custom_select') and alias in self.query.custom_select: - sel_fmt = sel_fmt % self.query.custom_select[alias] - return sel_fmt - - def get_field_select(self, field, alias=None, column=None): - """ - Returns the SELECT SQL string for the given field. Figures out - if any custom selection SQL is needed for the column The `alias` - keyword may be used to manually specify the database table where - the column exists, if not in the model associated with this - `GeoQuery`. Similarly, `column` may be used to specify the exact - column name, rather than using the `column` attribute on `field`. - """ - sel_fmt = self.get_select_format(field) - if field in self.query.custom_select: - field_sel = sel_fmt % self.query.custom_select[field] - else: - field_sel = sel_fmt % self._field_column(field, alias, column) - return field_sel - - def get_select_format(self, fld): - """ - Returns the selection format string, depending on the requirements - of the spatial backend. For example, Oracle and MySQL require custom - selection formats in order to retrieve geometries in OGC WKT. For all - other fields a simple '%s' format string is returned. - """ - if self.connection.ops.select and hasattr(fld, 'geom_type'): - # This allows operations to be done on fields in the SELECT, - # overriding their values -- used by the Oracle and MySQL - # spatial backends to get database values as WKT, and by the - # `transform` method. - sel_fmt = self.connection.ops.select - - # Because WKT doesn't contain spatial reference information, - # the SRID is prefixed to the returned WKT to ensure that the - # transformed geometries have an SRID different than that of the - # field -- this is only used by `transform` for Oracle and - # SpatiaLite backends. - if self.query.transformed_srid and ( self.connection.ops.oracle or - self.connection.ops.spatialite ): - sel_fmt = "'SRID=%d;'||%s" % (self.query.transformed_srid, sel_fmt) - else: - sel_fmt = '%s' - return sel_fmt - - # Private API utilities, subject to change. - def _field_column(self, field, table_alias=None, column=None): - """ - Helper function that returns the database column for the given field. - The table and column are returned (quoted) in the proper format, e.g., - `"geoapp_city"."point"`. If `table_alias` is not specified, the - database table associated with the model of this `GeoQuery` will be - used. If `column` is specified, it will be used instead of the value - in `field.column`. - """ - if table_alias is None: table_alias = self.query.get_meta().db_table - return "%s.%s" % (self.quote_name_unless_alias(table_alias), - self.connection.ops.quote_name(column or field.column)) - -class SQLInsertCompiler(compiler.SQLInsertCompiler, GeoSQLCompiler): - pass - -class SQLDeleteCompiler(compiler.SQLDeleteCompiler, GeoSQLCompiler): - pass - -class SQLUpdateCompiler(compiler.SQLUpdateCompiler, GeoSQLCompiler): - pass - -class SQLAggregateCompiler(compiler.SQLAggregateCompiler, GeoSQLCompiler): - pass - -class SQLDateCompiler(compiler.SQLDateCompiler, GeoSQLCompiler): - """ - This is overridden for GeoDjango to properly cast date columns, since - `GeoQuery.resolve_columns` is used for spatial values. - See #14648, #16757. - """ - def results_iter(self): - if self.connection.ops.oracle: - from django.db.models.fields import DateTimeField - fields = [DateTimeField()] - else: - needs_string_cast = self.connection.features.needs_datetime_string_cast - - offset = len(self.query.extra_select) - for rows in self.execute_sql(MULTI): - for row in rows: - date = row[offset] - if self.connection.ops.oracle: - date = self.resolve_columns(row, fields)[offset] - elif needs_string_cast: - date = typecast_date(str(date)) - if isinstance(date, datetime.datetime): - date = date.date() - yield date - -class SQLDateTimeCompiler(compiler.SQLDateTimeCompiler, GeoSQLCompiler): - """ - This is overridden for GeoDjango to properly cast date columns, since - `GeoQuery.resolve_columns` is used for spatial values. - See #14648, #16757. - """ - def results_iter(self): - if self.connection.ops.oracle: - from django.db.models.fields import DateTimeField - fields = [DateTimeField()] - else: - needs_string_cast = self.connection.features.needs_datetime_string_cast - - offset = len(self.query.extra_select) - for rows in self.execute_sql(MULTI): - for row in rows: - datetime = row[offset] - if self.connection.ops.oracle: - datetime = self.resolve_columns(row, fields)[offset] - elif needs_string_cast: - datetime = typecast_timestamp(str(datetime)) - # Datetimes are artifically returned in UTC on databases that - # don't support time zone. Restore the zone used in the query. - if settings.USE_TZ: - datetime = datetime.replace(tzinfo=None) - datetime = timezone.make_aware(datetime, self.query.tzinfo) - yield datetime diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/conversion.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/conversion.py deleted file mode 100644 index 160b623..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/conversion.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -This module holds simple classes used by GeoQuery.convert_values -to convert geospatial values from the database. -""" - -class BaseField(object): - empty_strings_allowed = True - def get_internal_type(self): - "Overloaded method so OracleQuery.convert_values doesn't balk." - return None - -class AreaField(BaseField): - "Wrapper for Area values." - def __init__(self, area_att): - self.area_att = area_att - -class DistanceField(BaseField): - "Wrapper for Distance values." - def __init__(self, distance_att): - self.distance_att = distance_att - -class GeomField(BaseField): - """ - Wrapper for Geometry values. It is a lightweight alternative to - using GeometryField (which requires an SQL query upon instantiation). - """ - pass diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/query.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/query.py deleted file mode 100644 index 5877f29..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/query.py +++ /dev/null @@ -1,121 +0,0 @@ -from django.db import connections -from django.db.models.query import sql - -from django.contrib.gis.db.models.fields import GeometryField -from django.contrib.gis.db.models.sql import aggregates as gis_aggregates -from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField -from django.contrib.gis.db.models.sql.where import GeoWhereNode -from django.contrib.gis.geometry.backend import Geometry -from django.contrib.gis.measure import Area, Distance - - -ALL_TERMS = set([ - 'bbcontains', 'bboverlaps', 'contained', 'contains', - 'contains_properly', 'coveredby', 'covers', 'crosses', 'disjoint', - 'distance_gt', 'distance_gte', 'distance_lt', 'distance_lte', - 'dwithin', 'equals', 'exact', - 'intersects', 'overlaps', 'relate', 'same_as', 'touches', 'within', - 'left', 'right', 'overlaps_left', 'overlaps_right', - 'overlaps_above', 'overlaps_below', - 'strictly_above', 'strictly_below' - ]) -ALL_TERMS.update(sql.constants.QUERY_TERMS) - -class GeoQuery(sql.Query): - """ - A single spatial SQL query. - """ - # Overridding the valid query terms. - query_terms = ALL_TERMS - aggregates_module = gis_aggregates - - compiler = 'GeoSQLCompiler' - - #### Methods overridden from the base Query class #### - def __init__(self, model, where=GeoWhereNode): - super(GeoQuery, self).__init__(model, where) - # The following attributes are customized for the GeoQuerySet. - # The GeoWhereNode and SpatialBackend classes contain backend-specific - # routines and functions. - self.custom_select = {} - self.transformed_srid = None - self.extra_select_fields = {} - - def clone(self, *args, **kwargs): - obj = super(GeoQuery, self).clone(*args, **kwargs) - # Customized selection dictionary and transformed srid flag have - # to also be added to obj. - obj.custom_select = self.custom_select.copy() - obj.transformed_srid = self.transformed_srid - obj.extra_select_fields = self.extra_select_fields.copy() - return obj - - def convert_values(self, value, field, connection): - """ - Using the same routines that Oracle does we can convert our - extra selection objects into Geometry and Distance objects. - TODO: Make converted objects 'lazy' for less overhead. - """ - if connection.ops.oracle: - # Running through Oracle's first. - value = super(GeoQuery, self).convert_values(value, field or GeomField(), connection) - - if value is None: - # Output from spatial function is NULL (e.g., called - # function on a geometry field with NULL value). - pass - elif isinstance(field, DistanceField): - # Using the field's distance attribute, can instantiate - # `Distance` with the right context. - value = Distance(**{field.distance_att : value}) - elif isinstance(field, AreaField): - value = Area(**{field.area_att : value}) - elif isinstance(field, (GeomField, GeometryField)) and value: - value = Geometry(value) - elif field is not None: - return super(GeoQuery, self).convert_values(value, field, connection) - return value - - def get_aggregation(self, using): - # Remove any aggregates marked for reduction from the subquery - # and move them to the outer AggregateQuery. - connection = connections[using] - for alias, aggregate in self.aggregate_select.items(): - if isinstance(aggregate, gis_aggregates.GeoAggregate): - if not getattr(aggregate, 'is_extent', False) or connection.ops.oracle: - self.extra_select_fields[alias] = GeomField() - return super(GeoQuery, self).get_aggregation(using) - - def resolve_aggregate(self, value, aggregate, connection): - """ - Overridden from GeoQuery's normalize to handle the conversion of - GeoAggregate objects. - """ - if isinstance(aggregate, self.aggregates_module.GeoAggregate): - if aggregate.is_extent: - if aggregate.is_extent == '3D': - return connection.ops.convert_extent3d(value) - else: - return connection.ops.convert_extent(value) - else: - return connection.ops.convert_geom(value, aggregate.source) - else: - return super(GeoQuery, self).resolve_aggregate(value, aggregate, connection) - - # Private API utilities, subject to change. - def _geo_field(self, field_name=None): - """ - Returns the first Geometry field encountered; or specified via the - `field_name` keyword. The `field_name` may be a string specifying - the geometry field on this GeoQuery's model, or a lookup string - to a geometry field via a ForeignKey relation. - """ - if field_name is None: - # Incrementing until the first geographic field is found. - for fld in self.model._meta.fields: - if isinstance(fld, GeometryField): return fld - return False - else: - # Otherwise, check by the given field name -- which may be - # a lookup to a _related_ geographic field. - return GeoWhereNode._check_geo_field(self.model._meta, field_name) diff --git a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/where.py b/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/where.py deleted file mode 100644 index c29533b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/where.py +++ /dev/null @@ -1,91 +0,0 @@ -from django.db.models.constants import LOOKUP_SEP -from django.db.models.fields import FieldDoesNotExist -from django.db.models.sql.expressions import SQLEvaluator -from django.db.models.sql.where import Constraint, WhereNode -from django.contrib.gis.db.models.fields import GeometryField - -class GeoConstraint(Constraint): - """ - This subclass overrides `process` to better handle geographic SQL - construction. - """ - def __init__(self, init_constraint): - self.alias = init_constraint.alias - self.col = init_constraint.col - self.field = init_constraint.field - - def process(self, lookup_type, value, connection): - if isinstance(value, SQLEvaluator): - # Make sure the F Expression destination field exists, and - # set an `srid` attribute with the same as that of the - # destination. - geo_fld = GeoWhereNode._check_geo_field(value.opts, value.expression.name) - if not geo_fld: - raise ValueError('No geographic field found in expression.') - value.srid = geo_fld.srid - db_type = self.field.db_type(connection=connection) - params = self.field.get_db_prep_lookup(lookup_type, value, connection=connection) - return (self.alias, self.col, db_type), params - -class GeoWhereNode(WhereNode): - """ - Used to represent the SQL where-clause for spatial databases -- - these are tied to the GeoQuery class that created it. - """ - - def _prepare_data(self, data): - if isinstance(data, (list, tuple)): - obj, lookup_type, value = data - if ( isinstance(obj, Constraint) and - isinstance(obj.field, GeometryField) ): - data = (GeoConstraint(obj), lookup_type, value) - return super(GeoWhereNode, self)._prepare_data(data) - - def make_atom(self, child, qn, connection): - lvalue, lookup_type, value_annot, params_or_value = child - if isinstance(lvalue, GeoConstraint): - data, params = lvalue.process(lookup_type, params_or_value, connection) - spatial_sql, spatial_params = connection.ops.spatial_lookup_sql( - data, lookup_type, params_or_value, lvalue.field, qn) - return spatial_sql, spatial_params + params - else: - return super(GeoWhereNode, self).make_atom(child, qn, connection) - - @classmethod - def _check_geo_field(cls, opts, lookup): - """ - Utility for checking the given lookup with the given model options. - The lookup is a string either specifying the geographic field, e.g. - 'point, 'the_geom', or a related lookup on a geographic field like - 'address__point'. - - If a GeometryField exists according to the given lookup on the model - options, it will be returned. Otherwise returns None. - """ - # This takes into account the situation where the lookup is a - # lookup to a related geographic field, e.g., 'address__point'. - field_list = lookup.split(LOOKUP_SEP) - - # Reversing so list operates like a queue of related lookups, - # and popping the top lookup. - field_list.reverse() - fld_name = field_list.pop() - - try: - geo_fld = opts.get_field(fld_name) - # If the field list is still around, then it means that the - # lookup was for a geometry field across a relationship -- - # thus we keep on getting the related model options and the - # model field associated with the next field in the list - # until there's no more left. - while len(field_list): - opts = geo_fld.rel.to._meta - geo_fld = opts.get_field(field_list.pop()) - except (FieldDoesNotExist, AttributeError): - return False - - # Finally, make sure we got a Geographic field and return. - if isinstance(geo_fld, GeometryField): - return geo_fld - else: - return False diff --git a/lib/python2.7/site-packages/django/contrib/gis/feeds.py b/lib/python2.7/site-packages/django/contrib/gis/feeds.py deleted file mode 100644 index d7c52bf..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/feeds.py +++ /dev/null @@ -1,137 +0,0 @@ -from __future__ import unicode_literals - -from django.contrib.syndication.views import Feed as BaseFeed -from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed - -class GeoFeedMixin(object): - """ - This mixin provides the necessary routines for SyndicationFeed subclasses - to produce simple GeoRSS or W3C Geo elements. - """ - - def georss_coords(self, coords): - """ - In GeoRSS coordinate pairs are ordered by lat/lon and separated by - a single white space. Given a tuple of coordinates, this will return - a unicode GeoRSS representation. - """ - return ' '.join(['%f %f' % (coord[1], coord[0]) for coord in coords]) - - def add_georss_point(self, handler, coords, w3c_geo=False): - """ - Adds a GeoRSS point with the given coords using the given handler. - Handles the differences between simple GeoRSS and the more pouplar - W3C Geo specification. - """ - if w3c_geo: - lon, lat = coords[:2] - handler.addQuickElement('geo:lat', '%f' % lat) - handler.addQuickElement('geo:lon', '%f' % lon) - else: - handler.addQuickElement('georss:point', self.georss_coords((coords,))) - - def add_georss_element(self, handler, item, w3c_geo=False): - """ - This routine adds a GeoRSS XML element using the given item and handler. - """ - # Getting the Geometry object. - geom = item.get('geometry', None) - if not geom is None: - if isinstance(geom, (list, tuple)): - # Special case if a tuple/list was passed in. The tuple may be - # a point or a box - box_coords = None - if isinstance(geom[0], (list, tuple)): - # Box: ( (X0, Y0), (X1, Y1) ) - if len(geom) == 2: - box_coords = geom - else: - raise ValueError('Only should be two sets of coordinates.') - else: - if len(geom) == 2: - # Point: (X, Y) - self.add_georss_point(handler, geom, w3c_geo=w3c_geo) - elif len(geom) == 4: - # Box: (X0, Y0, X1, Y1) - box_coords = (geom[:2], geom[2:]) - else: - raise ValueError('Only should be 2 or 4 numeric elements.') - # If a GeoRSS box was given via tuple. - if not box_coords is None: - if w3c_geo: raise ValueError('Cannot use simple GeoRSS box in W3C Geo feeds.') - handler.addQuickElement('georss:box', self.georss_coords(box_coords)) - else: - # Getting the lower-case geometry type. - gtype = str(geom.geom_type).lower() - if gtype == 'point': - self.add_georss_point(handler, geom.coords, w3c_geo=w3c_geo) - else: - if w3c_geo: raise ValueError('W3C Geo only supports Point geometries.') - # For formatting consistent w/the GeoRSS simple standard: - # http://georss.org/1.0#simple - if gtype in ('linestring', 'linearring'): - handler.addQuickElement('georss:line', self.georss_coords(geom.coords)) - elif gtype in ('polygon',): - # Only support the exterior ring. - handler.addQuickElement('georss:polygon', self.georss_coords(geom[0].coords)) - else: - raise ValueError('Geometry type "%s" not supported.' % geom.geom_type) - -### SyndicationFeed subclasses ### -class GeoRSSFeed(Rss201rev2Feed, GeoFeedMixin): - def rss_attributes(self): - attrs = super(GeoRSSFeed, self).rss_attributes() - attrs['xmlns:georss'] = 'http://www.georss.org/georss' - return attrs - - def add_item_elements(self, handler, item): - super(GeoRSSFeed, self).add_item_elements(handler, item) - self.add_georss_element(handler, item) - - def add_root_elements(self, handler): - super(GeoRSSFeed, self).add_root_elements(handler) - self.add_georss_element(handler, self.feed) - -class GeoAtom1Feed(Atom1Feed, GeoFeedMixin): - def root_attributes(self): - attrs = super(GeoAtom1Feed, self).root_attributes() - attrs['xmlns:georss'] = 'http://www.georss.org/georss' - return attrs - - def add_item_elements(self, handler, item): - super(GeoAtom1Feed, self).add_item_elements(handler, item) - self.add_georss_element(handler, item) - - def add_root_elements(self, handler): - super(GeoAtom1Feed, self).add_root_elements(handler) - self.add_georss_element(handler, self.feed) - -class W3CGeoFeed(Rss201rev2Feed, GeoFeedMixin): - def rss_attributes(self): - attrs = super(W3CGeoFeed, self).rss_attributes() - attrs['xmlns:geo'] = 'http://www.w3.org/2003/01/geo/wgs84_pos#' - return attrs - - def add_item_elements(self, handler, item): - super(W3CGeoFeed, self).add_item_elements(handler, item) - self.add_georss_element(handler, item, w3c_geo=True) - - def add_root_elements(self, handler): - super(W3CGeoFeed, self).add_root_elements(handler) - self.add_georss_element(handler, self.feed, w3c_geo=True) - -### Feed subclass ### -class Feed(BaseFeed): - """ - This is a subclass of the `Feed` from `django.contrib.syndication`. - This allows users to define a `geometry(obj)` and/or `item_geometry(item)` - methods on their own subclasses so that geo-referenced information may - placed in the feed. - """ - feed_type = GeoRSSFeed - - def feed_extra_kwargs(self, obj): - return {'geometry' : self.__get_dynamic_attr('geometry', obj)} - - def item_extra_kwargs(self, item): - return {'geometry' : self.__get_dynamic_attr('item_geometry', item)} diff --git a/lib/python2.7/site-packages/django/contrib/gis/forms/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/forms/__init__.py deleted file mode 100644 index 93a2d38..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/forms/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.forms import * -from .fields import (GeometryField, GeometryCollectionField, PointField, - MultiPointField, LineStringField, MultiLineStringField, PolygonField, - MultiPolygonField) -from .widgets import BaseGeometryWidget, OpenLayersWidget, OSMWidget diff --git a/lib/python2.7/site-packages/django/contrib/gis/forms/fields.py b/lib/python2.7/site-packages/django/contrib/gis/forms/fields.py deleted file mode 100644 index b1c0308..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/forms/fields.py +++ /dev/null @@ -1,137 +0,0 @@ -from __future__ import unicode_literals - -import warnings - -from django import forms -from django.utils import six -from django.utils.translation import ugettext_lazy as _ - -# While this couples the geographic forms to the GEOS library, -# it decouples from database (by not importing SpatialBackend). -from django.contrib.gis.geos import GEOSException, GEOSGeometry, fromstr -from .widgets import OpenLayersWidget - - -class GeometryField(forms.Field): - """ - This is the basic form field for a Geometry. Any textual input that is - accepted by GEOSGeometry is accepted by this form. By default, - this includes WKT, HEXEWKB, WKB (in a buffer), and GeoJSON. - """ - widget = OpenLayersWidget - geom_type = 'GEOMETRY' - - default_error_messages = { - 'required' : _('No geometry value provided.'), - 'invalid_geom' : _('Invalid geometry value.'), - 'invalid_geom_type' : _('Invalid geometry type.'), - 'transform_error' : _('An error occurred when transforming the geometry ' - 'to the SRID of the geometry form field.'), - } - - def __init__(self, **kwargs): - # Pop out attributes from the database field, or use sensible - # defaults (e.g., allow None). - self.srid = kwargs.pop('srid', None) - self.geom_type = kwargs.pop('geom_type', self.geom_type) - if 'null' in kwargs: - kwargs.pop('null', True) - warnings.warn("Passing 'null' keyword argument to GeometryField is deprecated.", - DeprecationWarning, stacklevel=2) - super(GeometryField, self).__init__(**kwargs) - self.widget.attrs['geom_type'] = self.geom_type - - def to_python(self, value): - """ - Transforms the value to a Geometry object. - """ - if value in self.empty_values: - return None - - if not isinstance(value, GEOSGeometry): - try: - value = GEOSGeometry(value) - except (GEOSException, ValueError, TypeError): - raise forms.ValidationError(self.error_messages['invalid_geom'], code='invalid_geom') - - # Try to set the srid - if not value.srid: - try: - value.srid = self.widget.map_srid - except AttributeError: - if self.srid: - value.srid = self.srid - return value - - def clean(self, value): - """ - Validates that the input value can be converted to a Geometry - object (which is returned). A ValidationError is raised if - the value cannot be instantiated as a Geometry. - """ - geom = super(GeometryField, self).clean(value) - if geom is None: - return geom - - # Ensuring that the geometry is of the correct type (indicated - # using the OGC string label). - if str(geom.geom_type).upper() != self.geom_type and not self.geom_type == 'GEOMETRY': - raise forms.ValidationError(self.error_messages['invalid_geom_type'], code='invalid_geom_type') - - # Transforming the geometry if the SRID was set. - if self.srid and self.srid != -1 and self.srid != geom.srid: - try: - geom.transform(self.srid) - except: - raise forms.ValidationError( - self.error_messages['transform_error'], code='transform_error') - - return geom - - def _has_changed(self, initial, data): - """ Compare geographic value of data with its initial value. """ - - try: - data = self.to_python(data) - initial = self.to_python(initial) - except ValidationError: - return True - - # Only do a geographic comparison if both values are available - if initial and data: - data.transform(initial.srid) - # If the initial value was not added by the browser, the geometry - # provided may be slightly different, the first time it is saved. - # The comparison is done with a very low tolerance. - return not initial.equals_exact(data, tolerance=0.000001) - else: - # Check for change of state of existence - return bool(initial) != bool(data) - - -class GeometryCollectionField(GeometryField): - geom_type = 'GEOMETRYCOLLECTION' - - -class PointField(GeometryField): - geom_type = 'POINT' - - -class MultiPointField(GeometryField): - geom_type = 'MULTIPOINT' - - -class LineStringField(GeometryField): - geom_type = 'LINESTRING' - - -class MultiLineStringField(GeometryField): - geom_type = 'MULTILINESTRING' - - -class PolygonField(GeometryField): - geom_type = 'POLYGON' - - -class MultiPolygonField(GeometryField): - geom_type = 'MULTIPOLYGON' diff --git a/lib/python2.7/site-packages/django/contrib/gis/forms/widgets.py b/lib/python2.7/site-packages/django/contrib/gis/forms/widgets.py deleted file mode 100644 index 909684e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/forms/widgets.py +++ /dev/null @@ -1,120 +0,0 @@ -from __future__ import unicode_literals - -import logging - -from django.conf import settings -from django.contrib.gis import gdal -from django.contrib.gis.geos import GEOSGeometry, GEOSException -from django.forms.widgets import Widget -from django.template import loader -from django.utils import six -from django.utils import translation - -logger = logging.getLogger('django.contrib.gis') - - -class BaseGeometryWidget(Widget): - """ - The base class for rich geometry widgets. - Renders a map using the WKT of the geometry. - """ - geom_type = 'GEOMETRY' - map_srid = 4326 - map_width = 600 - map_height = 400 - display_raw = False - - supports_3d = False - template_name = '' # set on subclasses - - def __init__(self, attrs=None): - self.attrs = {} - for key in ('geom_type', 'map_srid', 'map_width', 'map_height', 'display_raw'): - self.attrs[key] = getattr(self, key) - if attrs: - self.attrs.update(attrs) - - def serialize(self, value): - return value.wkt if value else '' - - def deserialize(self, value): - try: - return GEOSGeometry(value, self.map_srid) - except (GEOSException, ValueError) as err: - logger.error( - "Error creating geometry from value '%s' (%s)" % ( - value, err) - ) - return None - - def render(self, name, value, attrs=None): - # If a string reaches here (via a validation error on another - # field) then just reconstruct the Geometry. - if isinstance(value, six.string_types): - value = self.deserialize(value) - - if value: - # Check that srid of value and map match - if value.srid != self.map_srid: - try: - ogr = value.ogr - ogr.transform(self.map_srid) - value = ogr - except gdal.OGRException as err: - logger.error( - "Error transforming geometry from srid '%s' to srid '%s' (%s)" % ( - value.srid, self.map_srid, err) - ) - - context = self.build_attrs(attrs, - name=name, - module='geodjango_%s' % name.replace('-','_'), # JS-safe - serialized=self.serialize(value), - geom_type=gdal.OGRGeomType(self.attrs['geom_type']), - STATIC_URL=settings.STATIC_URL, - LANGUAGE_BIDI=translation.get_language_bidi(), - ) - return loader.render_to_string(self.template_name, context) - - -class OpenLayersWidget(BaseGeometryWidget): - template_name = 'gis/openlayers.html' - class Media: - js = ( - 'http://openlayers.org/api/2.11/OpenLayers.js', - 'gis/js/OLMapWidget.js', - ) - - -class OSMWidget(BaseGeometryWidget): - """ - An OpenLayers/OpenStreetMap-based widget. - """ - template_name = 'gis/openlayers-osm.html' - default_lon = 5 - default_lat = 47 - - class Media: - js = ( - 'http://openlayers.org/api/2.11/OpenLayers.js', - 'http://www.openstreetmap.org/openlayers/OpenStreetMap.js', - 'gis/js/OLMapWidget.js', - ) - - @property - def map_srid(self): - # Use the official spherical mercator projection SRID on versions - # of GDAL that support it; otherwise, fallback to 900913. - if gdal.HAS_GDAL and gdal.GDAL_VERSION >= (1, 7): - return 3857 - else: - return 900913 - - def render(self, name, value, attrs=None): - default_attrs = { - 'default_lon': self.default_lon, - 'default_lat': self.default_lat, - } - if attrs: - default_attrs.update(attrs) - return super(OSMWidget, self).render(name, value, default_attrs) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/__init__.py deleted file mode 100644 index 2aa867b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/__init__.py +++ /dev/null @@ -1,55 +0,0 @@ -""" - This module houses ctypes interfaces for GDAL objects. The following GDAL - objects are supported: - - CoordTransform: Used for coordinate transformations from one spatial - reference system to another. - - Driver: Wraps an OGR data source driver. - - DataSource: Wrapper for the OGR data source object, supports - OGR-supported data sources. - - Envelope: A ctypes structure for bounding boxes (GDAL library - not required). - - OGRGeometry: Object for accessing OGR Geometry functionality. - - OGRGeomType: A class for representing the different OGR Geometry - types (GDAL library not required). - - SpatialReference: Represents OSR Spatial Reference objects. - - The GDAL library will be imported from the system path using the default - library name for the current OS. The default library path may be overridden - by setting `GDAL_LIBRARY_PATH` in your settings with the path to the GDAL C - library on your system. - - GDAL links to a large number of external libraries that consume RAM when - loaded. Thus, it may desirable to disable GDAL on systems with limited - RAM resources -- this may be accomplished by setting `GDAL_LIBRARY_PATH` - to a non-existant file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; - setting to None/False/'' will not work as a string must be given). -""" -from django.contrib.gis.gdal.error import check_err, OGRException, OGRIndexError, SRSException -from django.contrib.gis.gdal.geomtype import OGRGeomType - -# Attempting to import objects that depend on the GDAL library. The -# HAS_GDAL flag will be set to True if the library is present on -# the system. -try: - from django.contrib.gis.gdal.driver import Driver - from django.contrib.gis.gdal.datasource import DataSource - from django.contrib.gis.gdal.libgdal import gdal_version, gdal_full_version, GDAL_VERSION - from django.contrib.gis.gdal.srs import SpatialReference, CoordTransform - from django.contrib.gis.gdal.geometries import OGRGeometry - HAS_GDAL = True -except OGRException: - HAS_GDAL = False - -try: - from django.contrib.gis.gdal.envelope import Envelope -except ImportError: - # No ctypes, but don't raise an exception. - pass - diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/base.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/base.py deleted file mode 100644 index e86277e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/base.py +++ /dev/null @@ -1,36 +0,0 @@ -from ctypes import c_void_p - -from django.contrib.gis.gdal.error import GDALException -from django.utils import six - -class GDALBase(object): - """ - Base object for GDAL objects that has a pointer access property - that controls access to the underlying C pointer. - """ - # Initially the pointer is NULL. - _ptr = None - - # Default allowed pointer type. - ptr_type = c_void_p - - # Pointer access property. - def _get_ptr(self): - # Raise an exception if the pointer isn't valid don't - # want to be passing NULL pointers to routines -- - # that's very bad. - if self._ptr: return self._ptr - else: raise GDALException('GDAL %s pointer no longer valid.' % self.__class__.__name__) - - def _set_ptr(self, ptr): - # Only allow the pointer to be set with pointers of the - # compatible type or None (NULL). - if isinstance(ptr, six.integer_types): - self._ptr = self.ptr_type(ptr) - elif ptr is None or isinstance(ptr, self.ptr_type): - self._ptr = ptr - else: - raise TypeError('Incompatible pointer type') - - ptr = property(_get_ptr, _set_ptr) - diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/datasource.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/datasource.py deleted file mode 100644 index c92b2e1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/datasource.py +++ /dev/null @@ -1,135 +0,0 @@ -""" - DataSource is a wrapper for the OGR Data Source object, which provides - an interface for reading vector geometry data from many different file - formats (including ESRI shapefiles). - - When instantiating a DataSource object, use the filename of a - GDAL-supported data source. For example, a SHP file or a - TIGER/Line file from the government. - - The ds_driver keyword is used internally when a ctypes pointer - is passed in directly. - - Example: - ds = DataSource('/home/foo/bar.shp') - for layer in ds: - for feature in layer: - # Getting the geometry for the feature. - g = feature.geom - - # Getting the 'description' field for the feature. - desc = feature['description'] - - # We can also increment through all of the fields - # attached to this feature. - for field in feature: - # Get the name of the field (e.g. 'description') - nm = field.name - - # Get the type (integer) of the field, e.g. 0 => OFTInteger - t = field.type - - # Returns the value the field; OFTIntegers return ints, - # OFTReal returns floats, all else returns string. - val = field.value -""" -# ctypes prerequisites. -from ctypes import byref - -# The GDAL C library, OGR exceptions, and the Layer object. -from django.contrib.gis.gdal.base import GDALBase -from django.contrib.gis.gdal.driver import Driver -from django.contrib.gis.gdal.error import OGRException, OGRIndexError -from django.contrib.gis.gdal.layer import Layer - -# Getting the ctypes prototypes for the DataSource. -from django.contrib.gis.gdal.prototypes import ds as capi - -from django.utils.encoding import force_bytes, force_text -from django.utils import six -from django.utils.six.moves import xrange - -# For more information, see the OGR C API source code: -# http://www.gdal.org/ogr/ogr__api_8h.html -# -# The OGR_DS_* routines are relevant here. -class DataSource(GDALBase): - "Wraps an OGR Data Source object." - - #### Python 'magic' routines #### - def __init__(self, ds_input, ds_driver=False, write=False, encoding='utf-8'): - # The write flag. - if write: - self._write = 1 - else: - self._write = 0 - # See also http://trac.osgeo.org/gdal/wiki/rfc23_ogr_unicode - self.encoding = encoding - - # Registering all the drivers, this needs to be done - # _before_ we try to open up a data source. - if not capi.get_driver_count(): - capi.register_all() - - if isinstance(ds_input, six.string_types): - # The data source driver is a void pointer. - ds_driver = Driver.ptr_type() - try: - # OGROpen will auto-detect the data source type. - ds = capi.open_ds(force_bytes(ds_input), self._write, byref(ds_driver)) - except OGRException: - # Making the error message more clear rather than something - # like "Invalid pointer returned from OGROpen". - raise OGRException('Could not open the datasource at "%s"' % ds_input) - elif isinstance(ds_input, self.ptr_type) and isinstance(ds_driver, Driver.ptr_type): - ds = ds_input - else: - raise OGRException('Invalid data source input type: %s' % type(ds_input)) - - if bool(ds): - self.ptr = ds - self.driver = Driver(ds_driver) - else: - # Raise an exception if the returned pointer is NULL - raise OGRException('Invalid data source file "%s"' % ds_input) - - def __del__(self): - "Destroys this DataStructure object." - if self._ptr: capi.destroy_ds(self._ptr) - - def __iter__(self): - "Allows for iteration over the layers in a data source." - for i in xrange(self.layer_count): - yield self[i] - - def __getitem__(self, index): - "Allows use of the index [] operator to get a layer at the index." - if isinstance(index, six.string_types): - l = capi.get_layer_by_name(self.ptr, force_bytes(index)) - if not l: raise OGRIndexError('invalid OGR Layer name given: "%s"' % index) - elif isinstance(index, int): - if index < 0 or index >= self.layer_count: - raise OGRIndexError('index out of range') - l = capi.get_layer(self._ptr, index) - else: - raise TypeError('Invalid index type: %s' % type(index)) - return Layer(l, self) - - def __len__(self): - "Returns the number of layers within the data source." - return self.layer_count - - def __str__(self): - "Returns OGR GetName and Driver for the Data Source." - return '%s (%s)' % (self.name, str(self.driver)) - - @property - def layer_count(self): - "Returns the number of layers in the data source." - return capi.get_layer_count(self._ptr) - - @property - def name(self): - "Returns the name of the data source." - name = capi.get_ds_name(self._ptr) - return force_text(name, self.encoding, strings_only=True) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/driver.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/driver.py deleted file mode 100644 index 55a5d77..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/driver.py +++ /dev/null @@ -1,68 +0,0 @@ -# prerequisites imports -from ctypes import c_void_p -from django.contrib.gis.gdal.base import GDALBase -from django.contrib.gis.gdal.error import OGRException -from django.contrib.gis.gdal.prototypes import ds as capi - -from django.utils import six -from django.utils.encoding import force_bytes - -# For more information, see the OGR C API source code: -# http://www.gdal.org/ogr/ogr__api_8h.html -# -# The OGR_Dr_* routines are relevant here. -class Driver(GDALBase): - "Wraps an OGR Data Source Driver." - - # Case-insensitive aliases for OGR Drivers. - _alias = {'esri' : 'ESRI Shapefile', - 'shp' : 'ESRI Shapefile', - 'shape' : 'ESRI Shapefile', - 'tiger' : 'TIGER', - 'tiger/line' : 'TIGER', - } - - def __init__(self, dr_input): - "Initializes an OGR driver on either a string or integer input." - - if isinstance(dr_input, six.string_types): - # If a string name of the driver was passed in - self._register() - - # Checking the alias dictionary (case-insensitive) to see if an alias - # exists for the given driver. - if dr_input.lower() in self._alias: - name = self._alias[dr_input.lower()] - else: - name = dr_input - - # Attempting to get the OGR driver by the string name. - dr = capi.get_driver_by_name(force_bytes(name)) - elif isinstance(dr_input, int): - self._register() - dr = capi.get_driver(dr_input) - elif isinstance(dr_input, c_void_p): - dr = dr_input - else: - raise OGRException('Unrecognized input type for OGR Driver: %s' % str(type(dr_input))) - - # Making sure we get a valid pointer to the OGR Driver - if not dr: - raise OGRException('Could not initialize OGR Driver on input: %s' % str(dr_input)) - self.ptr = dr - - def __str__(self): - "Returns the string name of the OGR Driver." - return capi.get_driver_name(self.ptr) - - def _register(self): - "Attempts to register all the data source drivers." - # Only register all if the driver count is 0 (or else all drivers - # will be registered over and over again) - if not self.driver_count: capi.register_all() - - # Driver properties - @property - def driver_count(self): - "Returns the number of OGR data source drivers registered." - return capi.get_driver_count() diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/envelope.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/envelope.py deleted file mode 100644 index f145526..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/envelope.py +++ /dev/null @@ -1,175 +0,0 @@ -""" - The GDAL/OGR library uses an Envelope structure to hold the bounding - box information for a geometry. The envelope (bounding box) contains - two pairs of coordinates, one for the lower left coordinate and one - for the upper right coordinate: - - +----------o Upper right; (max_x, max_y) - | | - | | - | | - Lower left (min_x, min_y) o----------+ -""" -from ctypes import Structure, c_double -from django.contrib.gis.gdal.error import OGRException - -# The OGR definition of an Envelope is a C structure containing four doubles. -# See the 'ogr_core.h' source file for more information: -# http://www.gdal.org/ogr/ogr__core_8h-source.html -class OGREnvelope(Structure): - "Represents the OGREnvelope C Structure." - _fields_ = [("MinX", c_double), - ("MaxX", c_double), - ("MinY", c_double), - ("MaxY", c_double), - ] - -class Envelope(object): - """ - The Envelope object is a C structure that contains the minimum and - maximum X, Y coordinates for a rectangle bounding box. The naming - of the variables is compatible with the OGR Envelope structure. - """ - - def __init__(self, *args): - """ - The initialization function may take an OGREnvelope structure, 4-element - tuple or list, or 4 individual arguments. - """ - - if len(args) == 1: - if isinstance(args[0], OGREnvelope): - # OGREnvelope (a ctypes Structure) was passed in. - self._envelope = args[0] - elif isinstance(args[0], (tuple, list)): - # A tuple was passed in. - if len(args[0]) != 4: - raise OGRException('Incorrect number of tuple elements (%d).' % len(args[0])) - else: - self._from_sequence(args[0]) - else: - raise TypeError('Incorrect type of argument: %s' % str(type(args[0]))) - elif len(args) == 4: - # Individual parameters passed in. - # Thanks to ww for the help - self._from_sequence([float(a) for a in args]) - else: - raise OGRException('Incorrect number (%d) of arguments.' % len(args)) - - # Checking the x,y coordinates - if self.min_x > self.max_x: - raise OGRException('Envelope minimum X > maximum X.') - if self.min_y > self.max_y: - raise OGRException('Envelope minimum Y > maximum Y.') - - def __eq__(self, other): - """ - Returns True if the envelopes are equivalent; can compare against - other Envelopes and 4-tuples. - """ - if isinstance(other, Envelope): - return (self.min_x == other.min_x) and (self.min_y == other.min_y) and \ - (self.max_x == other.max_x) and (self.max_y == other.max_y) - elif isinstance(other, tuple) and len(other) == 4: - return (self.min_x == other[0]) and (self.min_y == other[1]) and \ - (self.max_x == other[2]) and (self.max_y == other[3]) - else: - raise OGRException('Equivalence testing only works with other Envelopes.') - - def __str__(self): - "Returns a string representation of the tuple." - return str(self.tuple) - - def _from_sequence(self, seq): - "Initializes the C OGR Envelope structure from the given sequence." - self._envelope = OGREnvelope() - self._envelope.MinX = seq[0] - self._envelope.MinY = seq[1] - self._envelope.MaxX = seq[2] - self._envelope.MaxY = seq[3] - - def expand_to_include(self, *args): - """ - Modifies the envelope to expand to include the boundaries of - the passed-in 2-tuple (a point), 4-tuple (an extent) or - envelope. - """ - # We provide a number of different signatures for this method, - # and the logic here is all about converting them into a - # 4-tuple single parameter which does the actual work of - # expanding the envelope. - if len(args) == 1: - if isinstance(args[0], Envelope): - return self.expand_to_include(args[0].tuple) - elif hasattr(args[0], 'x') and hasattr(args[0], 'y'): - return self.expand_to_include(args[0].x, args[0].y, args[0].x, args[0].y) - elif isinstance(args[0], (tuple, list)): - # A tuple was passed in. - if len(args[0]) == 2: - return self.expand_to_include((args[0][0], args[0][1], args[0][0], args[0][1])) - elif len(args[0]) == 4: - (minx, miny, maxx, maxy) = args[0] - if minx < self._envelope.MinX: - self._envelope.MinX = minx - if miny < self._envelope.MinY: - self._envelope.MinY = miny - if maxx > self._envelope.MaxX: - self._envelope.MaxX = maxx - if maxy > self._envelope.MaxY: - self._envelope.MaxY = maxy - else: - raise OGRException('Incorrect number of tuple elements (%d).' % len(args[0])) - else: - raise TypeError('Incorrect type of argument: %s' % str(type(args[0]))) - elif len(args) == 2: - # An x and an y parameter were passed in - return self.expand_to_include((args[0], args[1], args[0], args[1])) - elif len(args) == 4: - # Individual parameters passed in. - return self.expand_to_include(args) - else: - raise OGRException('Incorrect number (%d) of arguments.' % len(args[0])) - - @property - def min_x(self): - "Returns the value of the minimum X coordinate." - return self._envelope.MinX - - @property - def min_y(self): - "Returns the value of the minimum Y coordinate." - return self._envelope.MinY - - @property - def max_x(self): - "Returns the value of the maximum X coordinate." - return self._envelope.MaxX - - @property - def max_y(self): - "Returns the value of the maximum Y coordinate." - return self._envelope.MaxY - - @property - def ur(self): - "Returns the upper-right coordinate." - return (self.max_x, self.max_y) - - @property - def ll(self): - "Returns the lower-left coordinate." - return (self.min_x, self.min_y) - - @property - def tuple(self): - "Returns a tuple representing the envelope." - return (self.min_x, self.min_y, self.max_x, self.max_y) - - @property - def wkt(self): - "Returns WKT representing a Polygon for this envelope." - # TODO: Fix significant figures. - return 'POLYGON((%s %s,%s %s,%s %s,%s %s,%s %s))' % \ - (self.min_x, self.min_y, self.min_x, self.max_y, - self.max_x, self.max_y, self.max_x, self.min_y, - self.min_x, self.min_y) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/error.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/error.py deleted file mode 100644 index 1d89ad1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/error.py +++ /dev/null @@ -1,42 +0,0 @@ -""" - This module houses the OGR & SRS Exception objects, and the - check_err() routine which checks the status code returned by - OGR methods. -""" -#### OGR & SRS Exceptions #### -class GDALException(Exception): pass -class OGRException(Exception): pass -class SRSException(Exception): pass -class OGRIndexError(OGRException, KeyError): - """ - This exception is raised when an invalid index is encountered, and has - the 'silent_variable_feature' attribute set to true. This ensures that - django's templates proceed to use the next lookup type gracefully when - an Exception is raised. Fixes ticket #4740. - """ - silent_variable_failure = True - -#### OGR error checking codes and routine #### - -# OGR Error Codes -OGRERR_DICT = { 1 : (OGRException, 'Not enough data.'), - 2 : (OGRException, 'Not enough memory.'), - 3 : (OGRException, 'Unsupported geometry type.'), - 4 : (OGRException, 'Unsupported operation.'), - 5 : (OGRException, 'Corrupt data.'), - 6 : (OGRException, 'OGR failure.'), - 7 : (SRSException, 'Unsupported SRS.'), - 8 : (OGRException, 'Invalid handle.'), - } -OGRERR_NONE = 0 - -def check_err(code): - "Checks the given OGRERR, and raises an exception where appropriate." - - if code == OGRERR_NONE: - return - elif code in OGRERR_DICT: - e, msg = OGRERR_DICT[code] - raise e(msg) - else: - raise OGRException('Unknown error code: "%s"' % code) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/feature.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/feature.py deleted file mode 100644 index a11a687..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/feature.py +++ /dev/null @@ -1,124 +0,0 @@ -# The GDAL C library, OGR exception, and the Field object -from django.contrib.gis.gdal.base import GDALBase -from django.contrib.gis.gdal.error import OGRException, OGRIndexError -from django.contrib.gis.gdal.field import Field -from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType - -# ctypes function prototypes -from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api - -from django.utils.encoding import force_bytes, force_text -from django.utils import six -from django.utils.six.moves import xrange - -# For more information, see the OGR C API source code: -# http://www.gdal.org/ogr/ogr__api_8h.html -# -# The OGR_F_* routines are relevant here. -class Feature(GDALBase): - """ - This class that wraps an OGR Feature, needs to be instantiated - from a Layer object. - """ - - #### Python 'magic' routines #### - def __init__(self, feat, layer): - """ - Initializes Feature from a pointer and its Layer object. - """ - if not feat: - raise OGRException('Cannot create OGR Feature, invalid pointer given.') - self.ptr = feat - self._layer = layer - - def __del__(self): - "Releases a reference to this object." - if self._ptr: capi.destroy_feature(self._ptr) - - def __getitem__(self, index): - """ - Gets the Field object at the specified index, which may be either - an integer or the Field's string label. Note that the Field object - is not the field's _value_ -- use the `get` method instead to - retrieve the value (e.g. an integer) instead of a Field instance. - """ - if isinstance(index, six.string_types): - i = self.index(index) - else: - if index < 0 or index > self.num_fields: - raise OGRIndexError('index out of range') - i = index - return Field(self, i) - - def __iter__(self): - "Iterates over each field in the Feature." - for i in xrange(self.num_fields): - yield self[i] - - def __len__(self): - "Returns the count of fields in this feature." - return self.num_fields - - def __str__(self): - "The string name of the feature." - return 'Feature FID %d in Layer<%s>' % (self.fid, self.layer_name) - - def __eq__(self, other): - "Does equivalence testing on the features." - return bool(capi.feature_equal(self.ptr, other._ptr)) - - #### Feature Properties #### - @property - def encoding(self): - return self._layer._ds.encoding - - @property - def fid(self): - "Returns the feature identifier." - return capi.get_fid(self.ptr) - - @property - def layer_name(self): - "Returns the name of the layer for the feature." - name = capi.get_feat_name(self._layer._ldefn) - return force_text(name, self.encoding, strings_only=True) - - @property - def num_fields(self): - "Returns the number of fields in the Feature." - return capi.get_feat_field_count(self.ptr) - - @property - def fields(self): - "Returns a list of fields in the Feature." - return [capi.get_field_name(capi.get_field_defn(self._layer._ldefn, i)) - for i in xrange(self.num_fields)] - - @property - def geom(self): - "Returns the OGR Geometry for this Feature." - # Retrieving the geometry pointer for the feature. - geom_ptr = capi.get_feat_geom_ref(self.ptr) - return OGRGeometry(geom_api.clone_geom(geom_ptr)) - - @property - def geom_type(self): - "Returns the OGR Geometry Type for this Feture." - return OGRGeomType(capi.get_fd_geom_type(self._layer._ldefn)) - - #### Feature Methods #### - def get(self, field): - """ - Returns the value of the field, instead of an instance of the Field - object. May take a string of the field name or a Field object as - parameters. - """ - field_name = getattr(field, 'name', field) - return self[field_name].value - - def index(self, field_name): - "Returns the index of the given field name." - i = capi.get_field_index(self.ptr, force_bytes(field_name)) - if i < 0: - raise OGRIndexError('invalid OFT field name given: "%s"' % field_name) - return i diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/field.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/field.py deleted file mode 100644 index 2415f32..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/field.py +++ /dev/null @@ -1,194 +0,0 @@ -from ctypes import byref, c_int -from datetime import date, datetime, time -from django.contrib.gis.gdal.base import GDALBase -from django.contrib.gis.gdal.error import OGRException -from django.contrib.gis.gdal.prototypes import ds as capi -from django.utils.encoding import force_text - - -# For more information, see the OGR C API source code: -# http://www.gdal.org/ogr/ogr__api_8h.html -# -# The OGR_Fld_* routines are relevant here. -class Field(GDALBase): - """ - This class wraps an OGR Field, and needs to be instantiated - from a Feature object. - """ - - #### Python 'magic' routines #### - def __init__(self, feat, index): - """ - Initializes on the feature object and the integer index of - the field within the feature. - """ - # Setting the feature pointer and index. - self._feat = feat - self._index = index - - # Getting the pointer for this field. - fld_ptr = capi.get_feat_field_defn(feat.ptr, index) - if not fld_ptr: - raise OGRException('Cannot create OGR Field, invalid pointer given.') - self.ptr = fld_ptr - - # Setting the class depending upon the OGR Field Type (OFT) - self.__class__ = OGRFieldTypes[self.type] - - # OFTReal with no precision should be an OFTInteger. - if isinstance(self, OFTReal) and self.precision == 0: - self.__class__ = OFTInteger - self._double = True - - def __str__(self): - "Returns the string representation of the Field." - return str(self.value).strip() - - #### Field Methods #### - def as_double(self): - "Retrieves the Field's value as a double (float)." - return capi.get_field_as_double(self._feat.ptr, self._index) - - def as_int(self): - "Retrieves the Field's value as an integer." - return capi.get_field_as_integer(self._feat.ptr, self._index) - - def as_string(self): - "Retrieves the Field's value as a string." - string = capi.get_field_as_string(self._feat.ptr, self._index) - return force_text(string, encoding=self._feat.encoding, strings_only=True) - - def as_datetime(self): - "Retrieves the Field's value as a tuple of date & time components." - yy, mm, dd, hh, mn, ss, tz = [c_int() for i in range(7)] - status = capi.get_field_as_datetime( - self._feat.ptr, self._index, byref(yy), byref(mm), byref(dd), - byref(hh), byref(mn), byref(ss), byref(tz)) - if status: - return (yy, mm, dd, hh, mn, ss, tz) - else: - raise OGRException('Unable to retrieve date & time information from the field.') - - #### Field Properties #### - @property - def name(self): - "Returns the name of this Field." - name = capi.get_field_name(self.ptr) - return force_text(name, encoding=self._feat.encoding, strings_only=True) - - @property - def precision(self): - "Returns the precision of this Field." - return capi.get_field_precision(self.ptr) - - @property - def type(self): - "Returns the OGR type of this Field." - return capi.get_field_type(self.ptr) - - @property - def type_name(self): - "Return the OGR field type name for this Field." - return capi.get_field_type_name(self.type) - - @property - def value(self): - "Returns the value of this Field." - # Default is to get the field as a string. - return self.as_string() - - @property - def width(self): - "Returns the width of this Field." - return capi.get_field_width(self.ptr) - -### The Field sub-classes for each OGR Field type. ### -class OFTInteger(Field): - _double = False - - @property - def value(self): - "Returns an integer contained in this field." - if self._double: - # If this is really from an OFTReal field with no precision, - # read as a double and cast as Python int (to prevent overflow). - return int(self.as_double()) - else: - return self.as_int() - - @property - def type(self): - """ - GDAL uses OFTReals to represent OFTIntegers in created - shapefiles -- forcing the type here since the underlying field - type may actually be OFTReal. - """ - return 0 - -class OFTReal(Field): - @property - def value(self): - "Returns a float contained in this field." - return self.as_double() - -# String & Binary fields, just subclasses -class OFTString(Field): pass -class OFTWideString(Field): pass -class OFTBinary(Field): pass - -# OFTDate, OFTTime, OFTDateTime fields. -class OFTDate(Field): - @property - def value(self): - "Returns a Python `date` object for the OFTDate field." - try: - yy, mm, dd, hh, mn, ss, tz = self.as_datetime() - return date(yy.value, mm.value, dd.value) - except (ValueError, OGRException): - return None - -class OFTDateTime(Field): - @property - def value(self): - "Returns a Python `datetime` object for this OFTDateTime field." - # TODO: Adapt timezone information. - # See http://lists.osgeo.org/pipermail/gdal-dev/2006-February/007990.html - # The `tz` variable has values of: 0=unknown, 1=localtime (ambiguous), - # 100=GMT, 104=GMT+1, 80=GMT-5, etc. - try: - yy, mm, dd, hh, mn, ss, tz = self.as_datetime() - return datetime(yy.value, mm.value, dd.value, hh.value, mn.value, ss.value) - except (ValueError, OGRException): - return None - -class OFTTime(Field): - @property - def value(self): - "Returns a Python `time` object for this OFTTime field." - try: - yy, mm, dd, hh, mn, ss, tz = self.as_datetime() - return time(hh.value, mn.value, ss.value) - except (ValueError, OGRException): - return None - -# List fields are also just subclasses -class OFTIntegerList(Field): pass -class OFTRealList(Field): pass -class OFTStringList(Field): pass -class OFTWideStringList(Field): pass - -# Class mapping dictionary for OFT Types and reverse mapping. -OGRFieldTypes = { 0 : OFTInteger, - 1 : OFTIntegerList, - 2 : OFTReal, - 3 : OFTRealList, - 4 : OFTString, - 5 : OFTStringList, - 6 : OFTWideString, - 7 : OFTWideStringList, - 8 : OFTBinary, - 9 : OFTDate, - 10 : OFTTime, - 11 : OFTDateTime, - } -ROGRFieldTypes = dict([(cls, num) for num, cls in OGRFieldTypes.items()]) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/geometries.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/geometries.py deleted file mode 100644 index 0d75620..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/geometries.py +++ /dev/null @@ -1,726 +0,0 @@ -""" - The OGRGeometry is a wrapper for using the OGR Geometry class - (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry - may be instantiated when reading geometries from OGR Data Sources - (e.g. SHP files), or when given OGC WKT (a string). - - While the 'full' API is not present yet, the API is "pythonic" unlike - the traditional and "next-generation" OGR Python bindings. One major - advantage OGR Geometries have over their GEOS counterparts is support - for spatial reference systems and their transformation. - - Example: - >>> from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, SpatialReference - >>> wkt1, wkt2 = 'POINT(-90 30)', 'POLYGON((0 0, 5 0, 5 5, 0 5)' - >>> pnt = OGRGeometry(wkt1) - >>> print(pnt) - POINT (-90 30) - >>> mpnt = OGRGeometry(OGRGeomType('MultiPoint'), SpatialReference('WGS84')) - >>> mpnt.add(wkt1) - >>> mpnt.add(wkt1) - >>> print(mpnt) - MULTIPOINT (-90 30,-90 30) - >>> print(mpnt.srs.name) - WGS 84 - >>> print(mpnt.srs.proj) - +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs - >>> mpnt.transform_to(SpatialReference('NAD27')) - >>> print(mpnt.proj) - +proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs - >>> print(mpnt) - MULTIPOINT (-89.999930378602485 29.999797886557641,-89.999930378602485 29.999797886557641) - - The OGRGeomType class is to make it easy to specify an OGR geometry type: - >>> from django.contrib.gis.gdal import OGRGeomType - >>> gt1 = OGRGeomType(3) # Using an integer for the type - >>> gt2 = OGRGeomType('Polygon') # Using a string - >>> gt3 = OGRGeomType('POLYGON') # It's case-insensitive - >>> print(gt1 == 3, gt1 == 'Polygon') # Equivalence works w/non-OGRGeomType objects - True True -""" -# Python library requisites. -import sys -from binascii import a2b_hex, b2a_hex -from ctypes import byref, string_at, c_char_p, c_double, c_ubyte, c_void_p - -from django.contrib.gis import memoryview - -# Getting GDAL prerequisites -from django.contrib.gis.gdal.base import GDALBase -from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope -from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException -from django.contrib.gis.gdal.geomtype import OGRGeomType -from django.contrib.gis.gdal.libgdal import GDAL_VERSION -from django.contrib.gis.gdal.srs import SpatialReference, CoordTransform - -# Getting the ctypes prototype functions that interface w/the GDAL C library. -from django.contrib.gis.gdal.prototypes import geom as capi, srs as srs_api - -# For recognizing geometry input. -from django.contrib.gis.geometry.regex import hex_regex, wkt_regex, json_regex - -from django.utils import six -from django.utils.six.moves import xrange - -# For more information, see the OGR C API source code: -# http://www.gdal.org/ogr/ogr__api_8h.html -# -# The OGR_G_* routines are relevant here. - -#### OGRGeometry Class #### -class OGRGeometry(GDALBase): - "Generally encapsulates an OGR geometry." - - def __init__(self, geom_input, srs=None): - "Initializes Geometry on either WKT or an OGR pointer as input." - - str_instance = isinstance(geom_input, six.string_types) - - # If HEX, unpack input to a binary buffer. - if str_instance and hex_regex.match(geom_input): - geom_input = memoryview(a2b_hex(geom_input.upper().encode())) - str_instance = False - - # Constructing the geometry, - if str_instance: - wkt_m = wkt_regex.match(geom_input) - json_m = json_regex.match(geom_input) - if wkt_m: - if wkt_m.group('srid'): - # If there's EWKT, set the SRS w/value of the SRID. - srs = int(wkt_m.group('srid')) - if wkt_m.group('type').upper() == 'LINEARRING': - # OGR_G_CreateFromWkt doesn't work with LINEARRING WKT. - # See http://trac.osgeo.org/gdal/ticket/1992. - g = capi.create_geom(OGRGeomType(wkt_m.group('type')).num) - capi.import_wkt(g, byref(c_char_p(wkt_m.group('wkt').encode()))) - else: - g = capi.from_wkt(byref(c_char_p(wkt_m.group('wkt').encode())), None, byref(c_void_p())) - elif json_m: - g = capi.from_json(geom_input.encode()) - else: - # Seeing if the input is a valid short-hand string - # (e.g., 'Point', 'POLYGON'). - ogr_t = OGRGeomType(geom_input) - g = capi.create_geom(OGRGeomType(geom_input).num) - elif isinstance(geom_input, memoryview): - # WKB was passed in - g = capi.from_wkb(bytes(geom_input), None, byref(c_void_p()), len(geom_input)) - elif isinstance(geom_input, OGRGeomType): - # OGRGeomType was passed in, an empty geometry will be created. - g = capi.create_geom(geom_input.num) - elif isinstance(geom_input, self.ptr_type): - # OGR pointer (c_void_p) was the input. - g = geom_input - else: - raise OGRException('Invalid input type for OGR Geometry construction: %s' % type(geom_input)) - - # Now checking the Geometry pointer before finishing initialization - # by setting the pointer for the object. - if not g: - raise OGRException('Cannot create OGR Geometry from input: %s' % str(geom_input)) - self.ptr = g - - # Assigning the SpatialReference object to the geometry, if valid. - if bool(srs): self.srs = srs - - # Setting the class depending upon the OGR Geometry Type - self.__class__ = GEO_CLASSES[self.geom_type.num] - - def __del__(self): - "Deletes this Geometry." - if self._ptr: capi.destroy_geom(self._ptr) - - # Pickle routines - def __getstate__(self): - srs = self.srs - if srs: - srs = srs.wkt - else: - srs = None - return bytes(self.wkb), srs - - def __setstate__(self, state): - wkb, srs = state - ptr = capi.from_wkb(wkb, None, byref(c_void_p()), len(wkb)) - if not ptr: raise OGRException('Invalid OGRGeometry loaded from pickled state.') - self.ptr = ptr - self.srs = srs - - @classmethod - def from_bbox(cls, bbox): - "Constructs a Polygon from a bounding box (4-tuple)." - x0, y0, x1, y1 = bbox - return OGRGeometry( 'POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))' % ( - x0, y0, x0, y1, x1, y1, x1, y0, x0, y0) ) - - ### Geometry set-like operations ### - # g = g1 | g2 - def __or__(self, other): - "Returns the union of the two geometries." - return self.union(other) - - # g = g1 & g2 - def __and__(self, other): - "Returns the intersection of this Geometry and the other." - return self.intersection(other) - - # g = g1 - g2 - def __sub__(self, other): - "Return the difference this Geometry and the other." - return self.difference(other) - - # g = g1 ^ g2 - def __xor__(self, other): - "Return the symmetric difference of this Geometry and the other." - return self.sym_difference(other) - - def __eq__(self, other): - "Is this Geometry equal to the other?" - if isinstance(other, OGRGeometry): - return self.equals(other) - else: - return False - - def __ne__(self, other): - "Tests for inequality." - return not (self == other) - - def __str__(self): - "WKT is used for the string representation." - return self.wkt - - #### Geometry Properties #### - @property - def dimension(self): - "Returns 0 for points, 1 for lines, and 2 for surfaces." - return capi.get_dims(self.ptr) - - def _get_coord_dim(self): - "Returns the coordinate dimension of the Geometry." - if isinstance(self, GeometryCollection) and GDAL_VERSION < (1, 5, 2): - # On GDAL versions prior to 1.5.2, there exists a bug in which - # the coordinate dimension of geometry collections is always 2: - # http://trac.osgeo.org/gdal/ticket/2334 - # Here we workaround by returning the coordinate dimension of the - # first geometry in the collection instead. - if len(self): - return capi.get_coord_dim(capi.get_geom_ref(self.ptr, 0)) - return capi.get_coord_dim(self.ptr) - - def _set_coord_dim(self, dim): - "Sets the coordinate dimension of this Geometry." - if not dim in (2, 3): - raise ValueError('Geometry dimension must be either 2 or 3') - capi.set_coord_dim(self.ptr, dim) - - coord_dim = property(_get_coord_dim, _set_coord_dim) - - @property - def geom_count(self): - "The number of elements in this Geometry." - return capi.get_geom_count(self.ptr) - - @property - def point_count(self): - "Returns the number of Points in this Geometry." - return capi.get_point_count(self.ptr) - - @property - def num_points(self): - "Alias for `point_count` (same name method in GEOS API.)" - return self.point_count - - @property - def num_coords(self): - "Alais for `point_count`." - return self.point_count - - @property - def geom_type(self): - "Returns the Type for this Geometry." - return OGRGeomType(capi.get_geom_type(self.ptr)) - - @property - def geom_name(self): - "Returns the Name of this Geometry." - return capi.get_geom_name(self.ptr) - - @property - def area(self): - "Returns the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise." - return capi.get_area(self.ptr) - - @property - def envelope(self): - "Returns the envelope for this Geometry." - # TODO: Fix Envelope() for Point geometries. - return Envelope(capi.get_envelope(self.ptr, byref(OGREnvelope()))) - - @property - def extent(self): - "Returns the envelope as a 4-tuple, instead of as an Envelope object." - return self.envelope.tuple - - #### SpatialReference-related Properties #### - - # The SRS property - def _get_srs(self): - "Returns the Spatial Reference for this Geometry." - try: - srs_ptr = capi.get_geom_srs(self.ptr) - return SpatialReference(srs_api.clone_srs(srs_ptr)) - except SRSException: - return None - - def _set_srs(self, srs): - "Sets the SpatialReference for this geometry." - # Do not have to clone the `SpatialReference` object pointer because - # when it is assigned to this `OGRGeometry` it's internal OGR - # reference count is incremented, and will likewise be released - # (decremented) when this geometry's destructor is called. - if isinstance(srs, SpatialReference): - srs_ptr = srs.ptr - elif isinstance(srs, six.integer_types + six.string_types): - sr = SpatialReference(srs) - srs_ptr = sr.ptr - else: - raise TypeError('Cannot assign spatial reference with object of type: %s' % type(srs)) - capi.assign_srs(self.ptr, srs_ptr) - - srs = property(_get_srs, _set_srs) - - # The SRID property - def _get_srid(self): - srs = self.srs - if srs: return srs.srid - return None - - def _set_srid(self, srid): - if isinstance(srid, six.integer_types): - self.srs = srid - else: - raise TypeError('SRID must be set with an integer.') - - srid = property(_get_srid, _set_srid) - - #### Output Methods #### - @property - def geos(self): - "Returns a GEOSGeometry object from this OGRGeometry." - from django.contrib.gis.geos import GEOSGeometry - return GEOSGeometry(self.wkb, self.srid) - - @property - def gml(self): - "Returns the GML representation of the Geometry." - return capi.to_gml(self.ptr) - - @property - def hex(self): - "Returns the hexadecimal representation of the WKB (a string)." - return b2a_hex(self.wkb).upper() - - @property - def json(self): - """ - Returns the GeoJSON representation of this Geometry. - """ - return capi.to_json(self.ptr) - geojson = json - - @property - def kml(self): - "Returns the KML representation of the Geometry." - return capi.to_kml(self.ptr, None) - - @property - def wkb_size(self): - "Returns the size of the WKB buffer." - return capi.get_wkbsize(self.ptr) - - @property - def wkb(self): - "Returns the WKB representation of the Geometry." - if sys.byteorder == 'little': - byteorder = 1 # wkbNDR (from ogr_core.h) - else: - byteorder = 0 # wkbXDR - sz = self.wkb_size - # Creating the unsigned character buffer, and passing it in by reference. - buf = (c_ubyte * sz)() - wkb = capi.to_wkb(self.ptr, byteorder, byref(buf)) - # Returning a buffer of the string at the pointer. - return memoryview(string_at(buf, sz)) - - @property - def wkt(self): - "Returns the WKT representation of the Geometry." - return capi.to_wkt(self.ptr, byref(c_char_p())) - - @property - def ewkt(self): - "Returns the EWKT representation of the Geometry." - srs = self.srs - if srs and srs.srid: - return 'SRID=%s;%s' % (srs.srid, self.wkt) - else: - return self.wkt - - #### Geometry Methods #### - def clone(self): - "Clones this OGR Geometry." - return OGRGeometry(capi.clone_geom(self.ptr), self.srs) - - def close_rings(self): - """ - If there are any rings within this geometry that have not been - closed, this routine will do so by adding the starting point at the - end. - """ - # Closing the open rings. - capi.geom_close_rings(self.ptr) - - def transform(self, coord_trans, clone=False): - """ - Transforms this geometry to a different spatial reference system. - May take a CoordTransform object, a SpatialReference object, string - WKT or PROJ.4, and/or an integer SRID. By default nothing is returned - and the geometry is transformed in-place. However, if the `clone` - keyword is set, then a transformed clone of this geometry will be - returned. - """ - if clone: - klone = self.clone() - klone.transform(coord_trans) - return klone - - # Have to get the coordinate dimension of the original geometry - # so it can be used to reset the transformed geometry's dimension - # afterwards. This is done because of GDAL bug (in versions prior - # to 1.7) that turns geometries 3D after transformation, see: - # http://trac.osgeo.org/gdal/changeset/17792 - if GDAL_VERSION < (1, 7): - orig_dim = self.coord_dim - - # Depending on the input type, use the appropriate OGR routine - # to perform the transformation. - if isinstance(coord_trans, CoordTransform): - capi.geom_transform(self.ptr, coord_trans.ptr) - elif isinstance(coord_trans, SpatialReference): - capi.geom_transform_to(self.ptr, coord_trans.ptr) - elif isinstance(coord_trans, six.integer_types + six.string_types): - sr = SpatialReference(coord_trans) - capi.geom_transform_to(self.ptr, sr.ptr) - else: - raise TypeError('Transform only accepts CoordTransform, ' - 'SpatialReference, string, and integer objects.') - - # Setting with original dimension, see comment above. - if GDAL_VERSION < (1, 7): - if isinstance(self, GeometryCollection): - # With geometry collections have to set dimension on - # each internal geometry reference, as the collection - # dimension isn't affected. - for i in xrange(len(self)): - internal_ptr = capi.get_geom_ref(self.ptr, i) - if orig_dim != capi.get_coord_dim(internal_ptr): - capi.set_coord_dim(internal_ptr, orig_dim) - else: - if self.coord_dim != orig_dim: - self.coord_dim = orig_dim - - def transform_to(self, srs): - "For backwards-compatibility." - self.transform(srs) - - #### Topology Methods #### - def _topology(self, func, other): - """A generalized function for topology operations, takes a GDAL function and - the other geometry to perform the operation on.""" - if not isinstance(other, OGRGeometry): - raise TypeError('Must use another OGRGeometry object for topology operations!') - - # Returning the output of the given function with the other geometry's - # pointer. - return func(self.ptr, other.ptr) - - def intersects(self, other): - "Returns True if this geometry intersects with the other." - return self._topology(capi.ogr_intersects, other) - - def equals(self, other): - "Returns True if this geometry is equivalent to the other." - return self._topology(capi.ogr_equals, other) - - def disjoint(self, other): - "Returns True if this geometry and the other are spatially disjoint." - return self._topology(capi.ogr_disjoint, other) - - def touches(self, other): - "Returns True if this geometry touches the other." - return self._topology(capi.ogr_touches, other) - - def crosses(self, other): - "Returns True if this geometry crosses the other." - return self._topology(capi.ogr_crosses, other) - - def within(self, other): - "Returns True if this geometry is within the other." - return self._topology(capi.ogr_within, other) - - def contains(self, other): - "Returns True if this geometry contains the other." - return self._topology(capi.ogr_contains, other) - - def overlaps(self, other): - "Returns True if this geometry overlaps the other." - return self._topology(capi.ogr_overlaps, other) - - #### Geometry-generation Methods #### - def _geomgen(self, gen_func, other=None): - "A helper routine for the OGR routines that generate geometries." - if isinstance(other, OGRGeometry): - return OGRGeometry(gen_func(self.ptr, other.ptr), self.srs) - else: - return OGRGeometry(gen_func(self.ptr), self.srs) - - @property - def boundary(self): - "Returns the boundary of this geometry." - return self._geomgen(capi.get_boundary) - - @property - def convex_hull(self): - """ - Returns the smallest convex Polygon that contains all the points in - this Geometry. - """ - return self._geomgen(capi.geom_convex_hull) - - def difference(self, other): - """ - Returns a new geometry consisting of the region which is the difference - of this geometry and the other. - """ - return self._geomgen(capi.geom_diff, other) - - def intersection(self, other): - """ - Returns a new geometry consisting of the region of intersection of this - geometry and the other. - """ - return self._geomgen(capi.geom_intersection, other) - - def sym_difference(self, other): - """ - Returns a new geometry which is the symmetric difference of this - geometry and the other. - """ - return self._geomgen(capi.geom_sym_diff, other) - - def union(self, other): - """ - Returns a new geometry consisting of the region which is the union of - this geometry and the other. - """ - return self._geomgen(capi.geom_union, other) - -# The subclasses for OGR Geometry. -class Point(OGRGeometry): - - @property - def x(self): - "Returns the X coordinate for this Point." - return capi.getx(self.ptr, 0) - - @property - def y(self): - "Returns the Y coordinate for this Point." - return capi.gety(self.ptr, 0) - - @property - def z(self): - "Returns the Z coordinate for this Point." - if self.coord_dim == 3: - return capi.getz(self.ptr, 0) - - @property - def tuple(self): - "Returns the tuple of this point." - if self.coord_dim == 2: - return (self.x, self.y) - elif self.coord_dim == 3: - return (self.x, self.y, self.z) - coords = tuple - -class LineString(OGRGeometry): - - def __getitem__(self, index): - "Returns the Point at the given index." - if index >= 0 and index < self.point_count: - x, y, z = c_double(), c_double(), c_double() - capi.get_point(self.ptr, index, byref(x), byref(y), byref(z)) - dim = self.coord_dim - if dim == 1: - return (x.value,) - elif dim == 2: - return (x.value, y.value) - elif dim == 3: - return (x.value, y.value, z.value) - else: - raise OGRIndexError('index out of range: %s' % str(index)) - - def __iter__(self): - "Iterates over each point in the LineString." - for i in xrange(self.point_count): - yield self[i] - - def __len__(self): - "The length returns the number of points in the LineString." - return self.point_count - - @property - def tuple(self): - "Returns the tuple representation of this LineString." - return tuple([self[i] for i in xrange(len(self))]) - coords = tuple - - def _listarr(self, func): - """ - Internal routine that returns a sequence (list) corresponding with - the given function. - """ - return [func(self.ptr, i) for i in xrange(len(self))] - - @property - def x(self): - "Returns the X coordinates in a list." - return self._listarr(capi.getx) - - @property - def y(self): - "Returns the Y coordinates in a list." - return self._listarr(capi.gety) - - @property - def z(self): - "Returns the Z coordinates in a list." - if self.coord_dim == 3: - return self._listarr(capi.getz) - -# LinearRings are used in Polygons. -class LinearRing(LineString): pass - -class Polygon(OGRGeometry): - - def __len__(self): - "The number of interior rings in this Polygon." - return self.geom_count - - def __iter__(self): - "Iterates through each ring in the Polygon." - for i in xrange(self.geom_count): - yield self[i] - - def __getitem__(self, index): - "Gets the ring at the specified index." - if index < 0 or index >= self.geom_count: - raise OGRIndexError('index out of range: %s' % index) - else: - return OGRGeometry(capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs) - - # Polygon Properties - @property - def shell(self): - "Returns the shell of this Polygon." - return self[0] # First ring is the shell - exterior_ring = shell - - @property - def tuple(self): - "Returns a tuple of LinearRing coordinate tuples." - return tuple([self[i].tuple for i in xrange(self.geom_count)]) - coords = tuple - - @property - def point_count(self): - "The number of Points in this Polygon." - # Summing up the number of points in each ring of the Polygon. - return sum([self[i].point_count for i in xrange(self.geom_count)]) - - @property - def centroid(self): - "Returns the centroid (a Point) of this Polygon." - # The centroid is a Point, create a geometry for this. - p = OGRGeometry(OGRGeomType('Point')) - capi.get_centroid(self.ptr, p.ptr) - return p - -# Geometry Collection base class. -class GeometryCollection(OGRGeometry): - "The Geometry Collection class." - - def __getitem__(self, index): - "Gets the Geometry at the specified index." - if index < 0 or index >= self.geom_count: - raise OGRIndexError('index out of range: %s' % index) - else: - return OGRGeometry(capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs) - - def __iter__(self): - "Iterates over each Geometry." - for i in xrange(self.geom_count): - yield self[i] - - def __len__(self): - "The number of geometries in this Geometry Collection." - return self.geom_count - - def add(self, geom): - "Add the geometry to this Geometry Collection." - if isinstance(geom, OGRGeometry): - if isinstance(geom, self.__class__): - for g in geom: capi.add_geom(self.ptr, g.ptr) - else: - capi.add_geom(self.ptr, geom.ptr) - elif isinstance(geom, six.string_types): - tmp = OGRGeometry(geom) - capi.add_geom(self.ptr, tmp.ptr) - else: - raise OGRException('Must add an OGRGeometry.') - - @property - def point_count(self): - "The number of Points in this Geometry Collection." - # Summing up the number of points in each geometry in this collection - return sum([self[i].point_count for i in xrange(self.geom_count)]) - - @property - def tuple(self): - "Returns a tuple representation of this Geometry Collection." - return tuple([self[i].tuple for i in xrange(self.geom_count)]) - coords = tuple - -# Multiple Geometry types. -class MultiPoint(GeometryCollection): pass -class MultiLineString(GeometryCollection): pass -class MultiPolygon(GeometryCollection): pass - -# Class mapping dictionary (using the OGRwkbGeometryType as the key) -GEO_CLASSES = {1 : Point, - 2 : LineString, - 3 : Polygon, - 4 : MultiPoint, - 5 : MultiLineString, - 6 : MultiPolygon, - 7 : GeometryCollection, - 101: LinearRing, - 1 + OGRGeomType.wkb25bit : Point, - 2 + OGRGeomType.wkb25bit : LineString, - 3 + OGRGeomType.wkb25bit : Polygon, - 4 + OGRGeomType.wkb25bit : MultiPoint, - 5 + OGRGeomType.wkb25bit : MultiLineString, - 6 + OGRGeomType.wkb25bit : MultiPolygon, - 7 + OGRGeomType.wkb25bit : GeometryCollection, - } diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/geomtype.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/geomtype.py deleted file mode 100644 index fe4b89a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/geomtype.py +++ /dev/null @@ -1,87 +0,0 @@ -from django.contrib.gis.gdal.error import OGRException - -from django.utils import six - -#### OGRGeomType #### -class OGRGeomType(object): - "Encapulates OGR Geometry Types." - - wkb25bit = -2147483648 - - # Dictionary of acceptable OGRwkbGeometryType s and their string names. - _types = {0 : 'Unknown', - 1 : 'Point', - 2 : 'LineString', - 3 : 'Polygon', - 4 : 'MultiPoint', - 5 : 'MultiLineString', - 6 : 'MultiPolygon', - 7 : 'GeometryCollection', - 100 : 'None', - 101 : 'LinearRing', - 1 + wkb25bit: 'Point25D', - 2 + wkb25bit: 'LineString25D', - 3 + wkb25bit: 'Polygon25D', - 4 + wkb25bit: 'MultiPoint25D', - 5 + wkb25bit : 'MultiLineString25D', - 6 + wkb25bit : 'MultiPolygon25D', - 7 + wkb25bit : 'GeometryCollection25D', - } - # Reverse type dictionary, keyed by lower-case of the name. - _str_types = dict([(v.lower(), k) for k, v in _types.items()]) - - def __init__(self, type_input): - "Figures out the correct OGR Type based upon the input." - if isinstance(type_input, OGRGeomType): - num = type_input.num - elif isinstance(type_input, six.string_types): - type_input = type_input.lower() - if type_input == 'geometry': type_input='unknown' - num = self._str_types.get(type_input, None) - if num is None: - raise OGRException('Invalid OGR String Type "%s"' % type_input) - elif isinstance(type_input, int): - if not type_input in self._types: - raise OGRException('Invalid OGR Integer Type: %d' % type_input) - num = type_input - else: - raise TypeError('Invalid OGR input type given.') - - # Setting the OGR geometry type number. - self.num = num - - def __str__(self): - "Returns the value of the name property." - return self.name - - def __eq__(self, other): - """ - Does an equivalence test on the OGR type with the given - other OGRGeomType, the short-hand string, or the integer. - """ - if isinstance(other, OGRGeomType): - return self.num == other.num - elif isinstance(other, six.string_types): - return self.name.lower() == other.lower() - elif isinstance(other, int): - return self.num == other - else: - return False - - def __ne__(self, other): - return not (self == other) - - @property - def name(self): - "Returns a short-hand string form of the OGR Geometry type." - return self._types[self.num] - - @property - def django(self): - "Returns the Django GeometryField for this OGR Type." - s = self.name.replace('25D', '') - if s in ('LinearRing', 'None'): - return None - elif s == 'Unknown': - s = 'Geometry' - return s + 'Field' diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/layer.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/layer.py deleted file mode 100644 index 7f935cd..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/layer.py +++ /dev/null @@ -1,218 +0,0 @@ -# Needed ctypes routines -from ctypes import c_double, byref - -# Other GDAL imports. -from django.contrib.gis.gdal.base import GDALBase -from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope -from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException -from django.contrib.gis.gdal.feature import Feature -from django.contrib.gis.gdal.field import OGRFieldTypes -from django.contrib.gis.gdal.geomtype import OGRGeomType -from django.contrib.gis.gdal.geometries import OGRGeometry -from django.contrib.gis.gdal.srs import SpatialReference - -# GDAL ctypes function prototypes. -from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api, srs as srs_api - -from django.utils.encoding import force_bytes, force_text -from django.utils import six -from django.utils.six.moves import xrange - -# For more information, see the OGR C API source code: -# http://www.gdal.org/ogr/ogr__api_8h.html -# -# The OGR_L_* routines are relevant here. -class Layer(GDALBase): - "A class that wraps an OGR Layer, needs to be instantiated from a DataSource object." - - #### Python 'magic' routines #### - def __init__(self, layer_ptr, ds): - """ - Initializes on an OGR C pointer to the Layer and the `DataSource` object - that owns this layer. The `DataSource` object is required so that a - reference to it is kept with this Layer. This prevents garbage - collection of the `DataSource` while this Layer is still active. - """ - if not layer_ptr: - raise OGRException('Cannot create Layer, invalid pointer given') - self.ptr = layer_ptr - self._ds = ds - self._ldefn = capi.get_layer_defn(self._ptr) - # Does the Layer support random reading? - self._random_read = self.test_capability(b'RandomRead') - - def __getitem__(self, index): - "Gets the Feature at the specified index." - if isinstance(index, six.integer_types): - # An integer index was given -- we cannot do a check based on the - # number of features because the beginning and ending feature IDs - # are not guaranteed to be 0 and len(layer)-1, respectively. - if index < 0: raise OGRIndexError('Negative indices are not allowed on OGR Layers.') - return self._make_feature(index) - elif isinstance(index, slice): - # A slice was given - start, stop, stride = index.indices(self.num_feat) - return [self._make_feature(fid) for fid in xrange(start, stop, stride)] - else: - raise TypeError('Integers and slices may only be used when indexing OGR Layers.') - - def __iter__(self): - "Iterates over each Feature in the Layer." - # ResetReading() must be called before iteration is to begin. - capi.reset_reading(self._ptr) - for i in xrange(self.num_feat): - yield Feature(capi.get_next_feature(self._ptr), self) - - def __len__(self): - "The length is the number of features." - return self.num_feat - - def __str__(self): - "The string name of the layer." - return self.name - - def _make_feature(self, feat_id): - """ - Helper routine for __getitem__ that constructs a Feature from the given - Feature ID. If the OGR Layer does not support random-access reading, - then each feature of the layer will be incremented through until the - a Feature is found matching the given feature ID. - """ - if self._random_read: - # If the Layer supports random reading, return. - try: - return Feature(capi.get_feature(self.ptr, feat_id), self) - except OGRException: - pass - else: - # Random access isn't supported, have to increment through - # each feature until the given feature ID is encountered. - for feat in self: - if feat.fid == feat_id: return feat - # Should have returned a Feature, raise an OGRIndexError. - raise OGRIndexError('Invalid feature id: %s.' % feat_id) - - #### Layer properties #### - @property - def extent(self): - "Returns the extent (an Envelope) of this layer." - env = OGREnvelope() - capi.get_extent(self.ptr, byref(env), 1) - return Envelope(env) - - @property - def name(self): - "Returns the name of this layer in the Data Source." - name = capi.get_fd_name(self._ldefn) - return force_text(name, self._ds.encoding, strings_only=True) - - @property - def num_feat(self, force=1): - "Returns the number of features in the Layer." - return capi.get_feature_count(self.ptr, force) - - @property - def num_fields(self): - "Returns the number of fields in the Layer." - return capi.get_field_count(self._ldefn) - - @property - def geom_type(self): - "Returns the geometry type (OGRGeomType) of the Layer." - return OGRGeomType(capi.get_fd_geom_type(self._ldefn)) - - @property - def srs(self): - "Returns the Spatial Reference used in this Layer." - try: - ptr = capi.get_layer_srs(self.ptr) - return SpatialReference(srs_api.clone_srs(ptr)) - except SRSException: - return None - - @property - def fields(self): - """ - Returns a list of string names corresponding to each of the Fields - available in this Layer. - """ - return [force_text(capi.get_field_name(capi.get_field_defn(self._ldefn, i)), - self._ds.encoding, strings_only=True) - for i in xrange(self.num_fields)] - - @property - def field_types(self): - """ - Returns a list of the types of fields in this Layer. For example, - the list [OFTInteger, OFTReal, OFTString] would be returned for - an OGR layer that had an integer, a floating-point, and string - fields. - """ - return [OGRFieldTypes[capi.get_field_type(capi.get_field_defn(self._ldefn, i))] - for i in xrange(self.num_fields)] - - @property - def field_widths(self): - "Returns a list of the maximum field widths for the features." - return [capi.get_field_width(capi.get_field_defn(self._ldefn, i)) - for i in xrange(self.num_fields)] - - @property - def field_precisions(self): - "Returns the field precisions for the features." - return [capi.get_field_precision(capi.get_field_defn(self._ldefn, i)) - for i in xrange(self.num_fields)] - - def _get_spatial_filter(self): - try: - return OGRGeometry(geom_api.clone_geom(capi.get_spatial_filter(self.ptr))) - except OGRException: - return None - - def _set_spatial_filter(self, filter): - if isinstance(filter, OGRGeometry): - capi.set_spatial_filter(self.ptr, filter.ptr) - elif isinstance(filter, (tuple, list)): - if not len(filter) == 4: - raise ValueError('Spatial filter list/tuple must have 4 elements.') - # Map c_double onto params -- if a bad type is passed in it - # will be caught here. - xmin, ymin, xmax, ymax = map(c_double, filter) - capi.set_spatial_filter_rect(self.ptr, xmin, ymin, xmax, ymax) - elif filter is None: - capi.set_spatial_filter(self.ptr, None) - else: - raise TypeError('Spatial filter must be either an OGRGeometry instance, a 4-tuple, or None.') - - spatial_filter = property(_get_spatial_filter, _set_spatial_filter) - - #### Layer Methods #### - def get_fields(self, field_name): - """ - Returns a list containing the given field name for every Feature - in the Layer. - """ - if not field_name in self.fields: - raise OGRException('invalid field name: %s' % field_name) - return [feat.get(field_name) for feat in self] - - def get_geoms(self, geos=False): - """ - Returns a list containing the OGRGeometry for every Feature in - the Layer. - """ - if geos: - from django.contrib.gis.geos import GEOSGeometry - return [GEOSGeometry(feat.geom.wkb) for feat in self] - else: - return [feat.geom for feat in self] - - def test_capability(self, capability): - """ - Returns a bool indicating whether the this Layer supports the given - capability (a string). Valid capability strings include: - 'RandomRead', 'SequentialWrite', 'RandomWrite', 'FastSpatialFilter', - 'FastFeatureCount', 'FastGetExtent', 'CreateField', 'Transactions', - 'DeleteFeature', and 'FastSetNextByIndex'. - """ - return bool(capi.test_capability(self.ptr, force_bytes(capability))) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/libgdal.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/libgdal.py deleted file mode 100644 index 91f8d61..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/libgdal.py +++ /dev/null @@ -1,109 +0,0 @@ -from __future__ import unicode_literals - -import logging -import os -import re -from ctypes import c_char_p, c_int, CDLL, CFUNCTYPE -from ctypes.util import find_library - -from django.contrib.gis.gdal.error import OGRException -from django.core.exceptions import ImproperlyConfigured - -logger = logging.getLogger('django.contrib.gis') - -# Custom library path set? -try: - from django.conf import settings - lib_path = settings.GDAL_LIBRARY_PATH -except (AttributeError, EnvironmentError, - ImportError, ImproperlyConfigured): - lib_path = None - -if lib_path: - lib_names = None -elif os.name == 'nt': - # Windows NT shared libraries - lib_names = ['gdal19', 'gdal18', 'gdal17', 'gdal16', 'gdal15'] -elif os.name == 'posix': - # *NIX library names. - lib_names = ['gdal', 'GDAL', 'gdal1.9.0', 'gdal1.8.0', 'gdal1.7.0', - 'gdal1.6.0', 'gdal1.5.0'] -else: - raise OGRException('Unsupported OS "%s"' % os.name) - -# Using the ctypes `find_library` utility to find the -# path to the GDAL library from the list of library names. -if lib_names: - for lib_name in lib_names: - lib_path = find_library(lib_name) - if not lib_path is None: break - -if lib_path is None: - raise OGRException('Could not find the GDAL library (tried "%s"). ' - 'Try setting GDAL_LIBRARY_PATH in your settings.' % - '", "'.join(lib_names)) - -# This loads the GDAL/OGR C library -lgdal = CDLL(lib_path) - -# On Windows, the GDAL binaries have some OSR routines exported with -# STDCALL, while others are not. Thus, the library will also need to -# be loaded up as WinDLL for said OSR functions that require the -# different calling convention. -if os.name == 'nt': - from ctypes import WinDLL - lwingdal = WinDLL(lib_path) - -def std_call(func): - """ - Returns the correct STDCALL function for certain OSR routines on Win32 - platforms. - """ - if os.name == 'nt': - return lwingdal[func] - else: - return lgdal[func] - -#### Version-information functions. #### - -# Returns GDAL library version information with the given key. -_version_info = std_call('GDALVersionInfo') -_version_info.argtypes = [c_char_p] -_version_info.restype = c_char_p - -def gdal_version(): - "Returns only the GDAL version number information." - return _version_info(b'RELEASE_NAME') - -def gdal_full_version(): - "Returns the full GDAL version information." - return _version_info('') - -version_regex = re.compile(r'^(?P\d+)\.(?P\d+)(\.(?P\d+))?') -def gdal_version_info(): - ver = gdal_version().decode() - m = version_regex.match(ver) - if not m: raise OGRException('Could not parse GDAL version string "%s"' % ver) - return dict([(key, m.group(key)) for key in ('major', 'minor', 'subminor')]) - -_verinfo = gdal_version_info() -GDAL_MAJOR_VERSION = int(_verinfo['major']) -GDAL_MINOR_VERSION = int(_verinfo['minor']) -GDAL_SUBMINOR_VERSION = _verinfo['subminor'] and int(_verinfo['subminor']) -GDAL_VERSION = (GDAL_MAJOR_VERSION, GDAL_MINOR_VERSION, GDAL_SUBMINOR_VERSION) -del _verinfo - -# Set library error handling so as errors are logged -CPLErrorHandler = CFUNCTYPE(None, c_int, c_int, c_char_p) -def err_handler(error_class, error_number, message): - logger.error('GDAL_ERROR %d: %s' % (error_number, message)) -err_handler = CPLErrorHandler(err_handler) - -def function(name, args, restype): - func = std_call(name) - func.argtypes = args - func.restype = restype - return func - -set_error_handler = function('CPLSetErrorHandler', [CPLErrorHandler], CPLErrorHandler) -set_error_handler(err_handler) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/ds.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/ds.py deleted file mode 100644 index f798069..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/ds.py +++ /dev/null @@ -1,70 +0,0 @@ -""" - This module houses the ctypes function prototypes for OGR DataSource - related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, - OGR_Fld_* routines are relevant here. -""" -from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER -from django.contrib.gis.gdal.envelope import OGREnvelope -from django.contrib.gis.gdal.libgdal import lgdal -from django.contrib.gis.gdal.prototypes.generation import (const_string_output, - double_output, geom_output, int_output, srs_output, void_output, voidptr_output) - -c_int_p = POINTER(c_int) # shortcut type - -### Driver Routines ### -register_all = void_output(lgdal.OGRRegisterAll, [], errcheck=False) -cleanup_all = void_output(lgdal.OGRCleanupAll, [], errcheck=False) -get_driver = voidptr_output(lgdal.OGRGetDriver, [c_int]) -get_driver_by_name = voidptr_output(lgdal.OGRGetDriverByName, [c_char_p]) -get_driver_count = int_output(lgdal.OGRGetDriverCount, []) -get_driver_name = const_string_output(lgdal.OGR_Dr_GetName, [c_void_p], decoding='ascii') - -### DataSource ### -open_ds = voidptr_output(lgdal.OGROpen, [c_char_p, c_int, POINTER(c_void_p)]) -destroy_ds = void_output(lgdal.OGR_DS_Destroy, [c_void_p], errcheck=False) -release_ds = void_output(lgdal.OGRReleaseDataSource, [c_void_p]) -get_ds_name = const_string_output(lgdal.OGR_DS_GetName, [c_void_p]) -get_layer = voidptr_output(lgdal.OGR_DS_GetLayer, [c_void_p, c_int]) -get_layer_by_name = voidptr_output(lgdal.OGR_DS_GetLayerByName, [c_void_p, c_char_p]) -get_layer_count = int_output(lgdal.OGR_DS_GetLayerCount, [c_void_p]) - -### Layer Routines ### -get_extent = void_output(lgdal.OGR_L_GetExtent, [c_void_p, POINTER(OGREnvelope), c_int]) -get_feature = voidptr_output(lgdal.OGR_L_GetFeature, [c_void_p, c_long]) -get_feature_count = int_output(lgdal.OGR_L_GetFeatureCount, [c_void_p, c_int]) -get_layer_defn = voidptr_output(lgdal.OGR_L_GetLayerDefn, [c_void_p]) -get_layer_srs = srs_output(lgdal.OGR_L_GetSpatialRef, [c_void_p]) -get_next_feature = voidptr_output(lgdal.OGR_L_GetNextFeature, [c_void_p]) -reset_reading = void_output(lgdal.OGR_L_ResetReading, [c_void_p], errcheck=False) -test_capability = int_output(lgdal.OGR_L_TestCapability, [c_void_p, c_char_p]) -get_spatial_filter = geom_output(lgdal.OGR_L_GetSpatialFilter, [c_void_p]) -set_spatial_filter = void_output(lgdal.OGR_L_SetSpatialFilter, [c_void_p, c_void_p], errcheck=False) -set_spatial_filter_rect = void_output(lgdal.OGR_L_SetSpatialFilterRect, [c_void_p, c_double, c_double, c_double, c_double], errcheck=False) - -### Feature Definition Routines ### -get_fd_geom_type = int_output(lgdal.OGR_FD_GetGeomType, [c_void_p]) -get_fd_name = const_string_output(lgdal.OGR_FD_GetName, [c_void_p]) -get_feat_name = const_string_output(lgdal.OGR_FD_GetName, [c_void_p]) -get_field_count = int_output(lgdal.OGR_FD_GetFieldCount, [c_void_p]) -get_field_defn = voidptr_output(lgdal.OGR_FD_GetFieldDefn, [c_void_p, c_int]) - -### Feature Routines ### -clone_feature = voidptr_output(lgdal.OGR_F_Clone, [c_void_p]) -destroy_feature = void_output(lgdal.OGR_F_Destroy, [c_void_p], errcheck=False) -feature_equal = int_output(lgdal.OGR_F_Equal, [c_void_p, c_void_p]) -get_feat_geom_ref = geom_output(lgdal.OGR_F_GetGeometryRef, [c_void_p]) -get_feat_field_count = int_output(lgdal.OGR_F_GetFieldCount, [c_void_p]) -get_feat_field_defn = voidptr_output(lgdal.OGR_F_GetFieldDefnRef, [c_void_p, c_int]) -get_fid = int_output(lgdal.OGR_F_GetFID, [c_void_p]) -get_field_as_datetime = int_output(lgdal.OGR_F_GetFieldAsDateTime, [c_void_p, c_int, c_int_p, c_int_p, c_int_p, c_int_p, c_int_p, c_int_p]) -get_field_as_double = double_output(lgdal.OGR_F_GetFieldAsDouble, [c_void_p, c_int]) -get_field_as_integer = int_output(lgdal.OGR_F_GetFieldAsInteger, [c_void_p, c_int]) -get_field_as_string = const_string_output(lgdal.OGR_F_GetFieldAsString, [c_void_p, c_int]) -get_field_index = int_output(lgdal.OGR_F_GetFieldIndex, [c_void_p, c_char_p]) - -### Field Routines ### -get_field_name = const_string_output(lgdal.OGR_Fld_GetNameRef, [c_void_p]) -get_field_precision = int_output(lgdal.OGR_Fld_GetPrecision, [c_void_p]) -get_field_type = int_output(lgdal.OGR_Fld_GetType, [c_void_p]) -get_field_type_name = const_string_output(lgdal.OGR_GetFieldTypeName, [c_int]) -get_field_width = int_output(lgdal.OGR_Fld_GetWidth, [c_void_p]) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/errcheck.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/errcheck.py deleted file mode 100644 index 2d27911..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/errcheck.py +++ /dev/null @@ -1,128 +0,0 @@ -""" - This module houses the error-checking routines used by the GDAL - ctypes prototypes. -""" -from ctypes import c_void_p, string_at -from django.contrib.gis.gdal.error import check_err, OGRException, SRSException -from django.contrib.gis.gdal.libgdal import lgdal -from django.utils import six - -# Helper routines for retrieving pointers and/or values from -# arguments passed in by reference. -def arg_byref(args, offset=-1): - "Returns the pointer argument's by-refernece value." - return args[offset]._obj.value - -def ptr_byref(args, offset=-1): - "Returns the pointer argument passed in by-reference." - return args[offset]._obj - -def check_bool(result, func, cargs): - "Returns the boolean evaluation of the value." - if bool(result): return True - else: return False - -### String checking Routines ### -def check_const_string(result, func, cargs, offset=None): - """ - Similar functionality to `check_string`, but does not free the pointer. - """ - if offset: - check_err(result) - ptr = ptr_byref(cargs, offset) - return ptr.value - else: - return result - -def check_string(result, func, cargs, offset=-1, str_result=False): - """ - Checks the string output returned from the given function, and frees - the string pointer allocated by OGR. The `str_result` keyword - may be used when the result is the string pointer, otherwise - the OGR error code is assumed. The `offset` keyword may be used - to extract the string pointer passed in by-reference at the given - slice offset in the function arguments. - """ - if str_result: - # For routines that return a string. - ptr = result - if not ptr: s = None - else: s = string_at(result) - else: - # Error-code return specified. - check_err(result) - ptr = ptr_byref(cargs, offset) - # Getting the string value - s = ptr.value - # Correctly freeing the allocated memory beind GDAL pointer - # w/the VSIFree routine. - if ptr: lgdal.VSIFree(ptr) - return s - -### DataSource, Layer error-checking ### - -### Envelope checking ### -def check_envelope(result, func, cargs, offset=-1): - "Checks a function that returns an OGR Envelope by reference." - env = ptr_byref(cargs, offset) - return env - -### Geometry error-checking routines ### -def check_geom(result, func, cargs): - "Checks a function that returns a geometry." - # OGR_G_Clone may return an integer, even though the - # restype is set to c_void_p - if isinstance(result, six.integer_types): - result = c_void_p(result) - if not result: - raise OGRException('Invalid geometry pointer returned from "%s".' % func.__name__) - return result - -def check_geom_offset(result, func, cargs, offset=-1): - "Chcks the geometry at the given offset in the C parameter list." - check_err(result) - geom = ptr_byref(cargs, offset=offset) - return check_geom(geom, func, cargs) - -### Spatial Reference error-checking routines ### -def check_srs(result, func, cargs): - if isinstance(result, six.integer_types): - result = c_void_p(result) - if not result: - raise SRSException('Invalid spatial reference pointer returned from "%s".' % func.__name__) - return result - -### Other error-checking routines ### -def check_arg_errcode(result, func, cargs): - """ - The error code is returned in the last argument, by reference. - Check its value with `check_err` before returning the result. - """ - check_err(arg_byref(cargs)) - return result - -def check_errcode(result, func, cargs): - """ - Check the error code returned (c_int). - """ - check_err(result) - return - -def check_pointer(result, func, cargs): - "Makes sure the result pointer is valid." - if isinstance(result, six.integer_types): - result = c_void_p(result) - if bool(result): - return result - else: - raise OGRException('Invalid pointer returned from "%s"' % func.__name__) - -def check_str_arg(result, func, cargs): - """ - This is for the OSRGet[Angular|Linear]Units functions, which - require that the returned string pointer not be freed. This - returns both the double and tring values. - """ - dbl = result - ptr = cargs[-1]._obj - return dbl, ptr.value.decode() diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/generation.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/generation.py deleted file mode 100644 index 577d29b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/generation.py +++ /dev/null @@ -1,125 +0,0 @@ -""" - This module contains functions that generate ctypes prototypes for the - GDAL routines. -""" - -from ctypes import c_char_p, c_double, c_int, c_void_p -from django.contrib.gis.gdal.prototypes.errcheck import ( - check_arg_errcode, check_errcode, check_geom, check_geom_offset, - check_pointer, check_srs, check_str_arg, check_string, check_const_string) - -class gdal_char_p(c_char_p): - pass - -def double_output(func, argtypes, errcheck=False, strarg=False): - "Generates a ctypes function that returns a double value." - func.argtypes = argtypes - func.restype = c_double - if errcheck: func.errcheck = check_arg_errcode - if strarg: func.errcheck = check_str_arg - return func - -def geom_output(func, argtypes, offset=None): - """ - Generates a function that returns a Geometry either by reference - or directly (if the return_geom keyword is set to True). - """ - # Setting the argument types - func.argtypes = argtypes - - if not offset: - # When a geometry pointer is directly returned. - func.restype = c_void_p - func.errcheck = check_geom - else: - # Error code returned, geometry is returned by-reference. - func.restype = c_int - def geomerrcheck(result, func, cargs): - return check_geom_offset(result, func, cargs, offset) - func.errcheck = geomerrcheck - - return func - -def int_output(func, argtypes): - "Generates a ctypes function that returns an integer value." - func.argtypes = argtypes - func.restype = c_int - return func - -def srs_output(func, argtypes): - """ - Generates a ctypes prototype for the given function with - the given C arguments that returns a pointer to an OGR - Spatial Reference System. - """ - func.argtypes = argtypes - func.restype = c_void_p - func.errcheck = check_srs - return func - -def const_string_output(func, argtypes, offset=None, decoding=None): - func.argtypes = argtypes - if offset: - func.restype = c_int - else: - func.restype = c_char_p - - def _check_const(result, func, cargs): - res = check_const_string(result, func, cargs, offset=offset) - if res and decoding: - res = res.decode(decoding) - return res - func.errcheck = _check_const - - return func - -def string_output(func, argtypes, offset=-1, str_result=False, decoding=None): - """ - Generates a ctypes prototype for the given function with the - given argument types that returns a string from a GDAL pointer. - The `const` flag indicates whether the allocated pointer should - be freed via the GDAL library routine VSIFree -- but only applies - only when `str_result` is True. - """ - func.argtypes = argtypes - if str_result: - # Use subclass of c_char_p so the error checking routine - # can free the memory at the pointer's address. - func.restype = gdal_char_p - else: - # Error code is returned - func.restype = c_int - - # Dynamically defining our error-checking function with the - # given offset. - def _check_str(result, func, cargs): - res = check_string(result, func, cargs, - offset=offset, str_result=str_result) - if res and decoding: - res = res.decode(decoding) - return res - func.errcheck = _check_str - return func - -def void_output(func, argtypes, errcheck=True): - """ - For functions that don't only return an error code that needs to - be examined. - """ - if argtypes: func.argtypes = argtypes - if errcheck: - # `errcheck` keyword may be set to False for routines that - # return void, rather than a status code. - func.restype = c_int - func.errcheck = check_errcode - else: - func.restype = None - - return func - -def voidptr_output(func, argtypes): - "For functions that return c_void_p." - func.argtypes = argtypes - func.restype = c_void_p - func.errcheck = check_pointer - return func diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/geom.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/geom.py deleted file mode 100644 index fa0b503..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/geom.py +++ /dev/null @@ -1,98 +0,0 @@ -from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER -from django.contrib.gis.gdal.envelope import OGREnvelope -from django.contrib.gis.gdal.libgdal import lgdal -from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope -from django.contrib.gis.gdal.prototypes.generation import (const_string_output, - double_output, geom_output, int_output, srs_output, string_output, void_output) - -### Generation routines specific to this module ### -def env_func(f, argtypes): - "For getting OGREnvelopes." - f.argtypes = argtypes - f.restype = None - f.errcheck = check_envelope - return f - -def pnt_func(f): - "For accessing point information." - return double_output(f, [c_void_p, c_int]) - -def topology_func(f): - f.argtypes = [c_void_p, c_void_p] - f.restype = c_int - f.errchck = check_bool - return f - -### OGR_G ctypes function prototypes ### - -# GeoJSON routines. -from_json = geom_output(lgdal.OGR_G_CreateGeometryFromJson, [c_char_p]) -to_json = string_output(lgdal.OGR_G_ExportToJson, [c_void_p], str_result=True, decoding='ascii') -to_kml = string_output(lgdal.OGR_G_ExportToKML, [c_void_p, c_char_p], str_result=True, decoding='ascii') - -# GetX, GetY, GetZ all return doubles. -getx = pnt_func(lgdal.OGR_G_GetX) -gety = pnt_func(lgdal.OGR_G_GetY) -getz = pnt_func(lgdal.OGR_G_GetZ) - -# Geometry creation routines. -from_wkb = geom_output(lgdal.OGR_G_CreateFromWkb, [c_char_p, c_void_p, POINTER(c_void_p), c_int], offset=-2) -from_wkt = geom_output(lgdal.OGR_G_CreateFromWkt, [POINTER(c_char_p), c_void_p, POINTER(c_void_p)], offset=-1) -create_geom = geom_output(lgdal.OGR_G_CreateGeometry, [c_int]) -clone_geom = geom_output(lgdal.OGR_G_Clone, [c_void_p]) -get_geom_ref = geom_output(lgdal.OGR_G_GetGeometryRef, [c_void_p, c_int]) -get_boundary = geom_output(lgdal.OGR_G_GetBoundary, [c_void_p]) -geom_convex_hull = geom_output(lgdal.OGR_G_ConvexHull, [c_void_p]) -geom_diff = geom_output(lgdal.OGR_G_Difference, [c_void_p, c_void_p]) -geom_intersection = geom_output(lgdal.OGR_G_Intersection, [c_void_p, c_void_p]) -geom_sym_diff = geom_output(lgdal.OGR_G_SymmetricDifference, [c_void_p, c_void_p]) -geom_union = geom_output(lgdal.OGR_G_Union, [c_void_p, c_void_p]) - -# Geometry modification routines. -add_geom = void_output(lgdal.OGR_G_AddGeometry, [c_void_p, c_void_p]) -import_wkt = void_output(lgdal.OGR_G_ImportFromWkt, [c_void_p, POINTER(c_char_p)]) - -# Destroys a geometry -destroy_geom = void_output(lgdal.OGR_G_DestroyGeometry, [c_void_p], errcheck=False) - -# Geometry export routines. -to_wkb = void_output(lgdal.OGR_G_ExportToWkb, None, errcheck=True) # special handling for WKB. -to_wkt = string_output(lgdal.OGR_G_ExportToWkt, [c_void_p, POINTER(c_char_p)], decoding='ascii') -to_gml = string_output(lgdal.OGR_G_ExportToGML, [c_void_p], str_result=True, decoding='ascii') -get_wkbsize = int_output(lgdal.OGR_G_WkbSize, [c_void_p]) - -# Geometry spatial-reference related routines. -assign_srs = void_output(lgdal.OGR_G_AssignSpatialReference, [c_void_p, c_void_p], errcheck=False) -get_geom_srs = srs_output(lgdal.OGR_G_GetSpatialReference, [c_void_p]) - -# Geometry properties -get_area = double_output(lgdal.OGR_G_GetArea, [c_void_p]) -get_centroid = void_output(lgdal.OGR_G_Centroid, [c_void_p, c_void_p]) -get_dims = int_output(lgdal.OGR_G_GetDimension, [c_void_p]) -get_coord_dim = int_output(lgdal.OGR_G_GetCoordinateDimension, [c_void_p]) -set_coord_dim = void_output(lgdal.OGR_G_SetCoordinateDimension, [c_void_p, c_int], errcheck=False) - -get_geom_count = int_output(lgdal.OGR_G_GetGeometryCount, [c_void_p]) -get_geom_name = const_string_output(lgdal.OGR_G_GetGeometryName, [c_void_p], decoding='ascii') -get_geom_type = int_output(lgdal.OGR_G_GetGeometryType, [c_void_p]) -get_point_count = int_output(lgdal.OGR_G_GetPointCount, [c_void_p]) -get_point = void_output(lgdal.OGR_G_GetPoint, [c_void_p, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double)], errcheck=False) -geom_close_rings = void_output(lgdal.OGR_G_CloseRings, [c_void_p], errcheck=False) - -# Topology routines. -ogr_contains = topology_func(lgdal.OGR_G_Contains) -ogr_crosses = topology_func(lgdal.OGR_G_Crosses) -ogr_disjoint = topology_func(lgdal.OGR_G_Disjoint) -ogr_equals = topology_func(lgdal.OGR_G_Equals) -ogr_intersects = topology_func(lgdal.OGR_G_Intersects) -ogr_overlaps = topology_func(lgdal.OGR_G_Overlaps) -ogr_touches = topology_func(lgdal.OGR_G_Touches) -ogr_within = topology_func(lgdal.OGR_G_Within) - -# Transformation routines. -geom_transform = void_output(lgdal.OGR_G_Transform, [c_void_p, c_void_p]) -geom_transform_to = void_output(lgdal.OGR_G_TransformTo, [c_void_p, c_void_p]) - -# For retrieving the envelope of the geometry. -get_envelope = env_func(lgdal.OGR_G_GetEnvelope, [c_void_p, POINTER(OGREnvelope)]) - diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/srs.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/srs.py deleted file mode 100644 index 58ceb75..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/srs.py +++ /dev/null @@ -1,71 +0,0 @@ -from ctypes import c_char_p, c_int, c_void_p, POINTER -from django.contrib.gis.gdal.libgdal import lgdal, std_call -from django.contrib.gis.gdal.prototypes.generation import (const_string_output, - double_output, int_output, srs_output, string_output, void_output) - -## Shortcut generation for routines with known parameters. -def srs_double(f): - """ - Creates a function prototype for the OSR routines that take - the OSRSpatialReference object and - """ - return double_output(f, [c_void_p, POINTER(c_int)], errcheck=True) - -def units_func(f): - """ - Creates a ctypes function prototype for OSR units functions, e.g., - OSRGetAngularUnits, OSRGetLinearUnits. - """ - return double_output(f, [c_void_p, POINTER(c_char_p)], strarg=True) - -# Creation & destruction. -clone_srs = srs_output(std_call('OSRClone'), [c_void_p]) -new_srs = srs_output(std_call('OSRNewSpatialReference'), [c_char_p]) -release_srs = void_output(lgdal.OSRRelease, [c_void_p], errcheck=False) -destroy_srs = void_output(std_call('OSRDestroySpatialReference'), [c_void_p], errcheck=False) -srs_validate = void_output(lgdal.OSRValidate, [c_void_p]) - -# Getting the semi_major, semi_minor, and flattening functions. -semi_major = srs_double(lgdal.OSRGetSemiMajor) -semi_minor = srs_double(lgdal.OSRGetSemiMinor) -invflattening = srs_double(lgdal.OSRGetInvFlattening) - -# WKT, PROJ, EPSG, XML importation routines. -from_wkt = void_output(lgdal.OSRImportFromWkt, [c_void_p, POINTER(c_char_p)]) -from_proj = void_output(lgdal.OSRImportFromProj4, [c_void_p, c_char_p]) -from_epsg = void_output(std_call('OSRImportFromEPSG'), [c_void_p, c_int]) -from_xml = void_output(lgdal.OSRImportFromXML, [c_void_p, c_char_p]) -from_user_input = void_output(std_call('OSRSetFromUserInput'), [c_void_p, c_char_p]) - -# Morphing to/from ESRI WKT. -morph_to_esri = void_output(lgdal.OSRMorphToESRI, [c_void_p]) -morph_from_esri = void_output(lgdal.OSRMorphFromESRI, [c_void_p]) - -# Identifying the EPSG -identify_epsg = void_output(lgdal.OSRAutoIdentifyEPSG, [c_void_p]) - -# Getting the angular_units, linear_units functions -linear_units = units_func(lgdal.OSRGetLinearUnits) -angular_units = units_func(lgdal.OSRGetAngularUnits) - -# For exporting to WKT, PROJ.4, "Pretty" WKT, and XML. -to_wkt = string_output(std_call('OSRExportToWkt'), [c_void_p, POINTER(c_char_p)], decoding='ascii') -to_proj = string_output(std_call('OSRExportToProj4'), [c_void_p, POINTER(c_char_p)], decoding='ascii') -to_pretty_wkt = string_output(std_call('OSRExportToPrettyWkt'), [c_void_p, POINTER(c_char_p), c_int], offset=-2, decoding='ascii') - -# Memory leak fixed in GDAL 1.5; still exists in 1.4. -to_xml = string_output(lgdal.OSRExportToXML, [c_void_p, POINTER(c_char_p), c_char_p], offset=-2, decoding='ascii') - -# String attribute retrival routines. -get_attr_value = const_string_output(std_call('OSRGetAttrValue'), [c_void_p, c_char_p, c_int], decoding='ascii') -get_auth_name = const_string_output(lgdal.OSRGetAuthorityName, [c_void_p, c_char_p], decoding='ascii') -get_auth_code = const_string_output(lgdal.OSRGetAuthorityCode, [c_void_p, c_char_p], decoding='ascii') - -# SRS Properties -isgeographic = int_output(lgdal.OSRIsGeographic, [c_void_p]) -islocal = int_output(lgdal.OSRIsLocal, [c_void_p]) -isprojected = int_output(lgdal.OSRIsProjected, [c_void_p]) - -# Coordinate transformation -new_ct= srs_output(std_call('OCTNewCoordinateTransformation'), [c_void_p, c_void_p]) -destroy_ct = void_output(std_call('OCTDestroyCoordinateTransformation'), [c_void_p], errcheck=False) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/srs.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/srs.py deleted file mode 100644 index 66a8d4e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/srs.py +++ /dev/null @@ -1,342 +0,0 @@ -""" - The Spatial Reference class, represensents OGR Spatial Reference objects. - - Example: - >>> from django.contrib.gis.gdal import SpatialReference - >>> srs = SpatialReference('WGS84') - >>> print(srs) - GEOGCS["WGS 84", - DATUM["WGS_1984", - SPHEROID["WGS 84",6378137,298.257223563, - AUTHORITY["EPSG","7030"]], - TOWGS84[0,0,0,0,0,0,0], - AUTHORITY["EPSG","6326"]], - PRIMEM["Greenwich",0, - AUTHORITY["EPSG","8901"]], - UNIT["degree",0.01745329251994328, - AUTHORITY["EPSG","9122"]], - AUTHORITY["EPSG","4326"]] - >>> print(srs.proj) - +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs - >>> print(srs.ellipsoid) - (6378137.0, 6356752.3142451793, 298.25722356300003) - >>> print(srs.projected, srs.geographic) - False True - >>> srs.import_epsg(32140) - >>> print(srs.name) - NAD83 / Texas South Central -""" -from ctypes import byref, c_char_p, c_int - -# Getting the error checking routine and exceptions -from django.contrib.gis.gdal.base import GDALBase -from django.contrib.gis.gdal.error import SRSException -from django.contrib.gis.gdal.prototypes import srs as capi - -from django.utils import six -from django.utils.encoding import force_bytes - - -#### Spatial Reference class. #### -class SpatialReference(GDALBase): - """ - A wrapper for the OGRSpatialReference object. According to the GDAL Web site, - the SpatialReference object "provide[s] services to represent coordinate - systems (projections and datums) and to transform between them." - """ - - #### Python 'magic' routines #### - def __init__(self, srs_input=''): - """ - Creates a GDAL OSR Spatial Reference object from the given input. - The input may be string of OGC Well Known Text (WKT), an integer - EPSG code, a PROJ.4 string, and/or a projection "well known" shorthand - string (one of 'WGS84', 'WGS72', 'NAD27', 'NAD83'). - """ - srs_type = 'user' - - if isinstance(srs_input, six.string_types): - # Encoding to ASCII if unicode passed in. - if isinstance(srs_input, six.text_type): - srs_input = srs_input.encode('ascii') - try: - # If SRID is a string, e.g., '4326', then make acceptable - # as user input. - srid = int(srs_input) - srs_input = 'EPSG:%d' % srid - except ValueError: - pass - elif isinstance(srs_input, six.integer_types): - # EPSG integer code was input. - srs_type = 'epsg' - elif isinstance(srs_input, self.ptr_type): - srs = srs_input - srs_type = 'ogr' - else: - raise TypeError('Invalid SRS type "%s"' % srs_type) - - if srs_type == 'ogr': - # Input is already an SRS pointer. - srs = srs_input - else: - # Creating a new SRS pointer, using the string buffer. - buf = c_char_p(b'') - srs = capi.new_srs(buf) - - # If the pointer is NULL, throw an exception. - if not srs: - raise SRSException('Could not create spatial reference from: %s' % srs_input) - else: - self.ptr = srs - - # Importing from either the user input string or an integer SRID. - if srs_type == 'user': - self.import_user_input(srs_input) - elif srs_type == 'epsg': - self.import_epsg(srs_input) - - def __del__(self): - "Destroys this spatial reference." - if self._ptr: capi.release_srs(self._ptr) - - def __getitem__(self, target): - """ - Returns the value of the given string attribute node, None if the node - doesn't exist. Can also take a tuple as a parameter, (target, child), - where child is the index of the attribute in the WKT. For example: - - >>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]') - >>> srs = SpatialReference(wkt) # could also use 'WGS84', or 4326 - >>> print(srs['GEOGCS']) - WGS 84 - >>> print(srs['DATUM']) - WGS_1984 - >>> print(srs['AUTHORITY']) - EPSG - >>> print(srs['AUTHORITY', 1]) # The authority value - 4326 - >>> print(srs['TOWGS84', 4]) # the fourth value in this wkt - 0 - >>> print(srs['UNIT|AUTHORITY']) # For the units authority, have to use the pipe symbole. - EPSG - >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the untis - 9122 - """ - if isinstance(target, tuple): - return self.attr_value(*target) - else: - return self.attr_value(target) - - def __str__(self): - "The string representation uses 'pretty' WKT." - return self.pretty_wkt - - #### SpatialReference Methods #### - def attr_value(self, target, index=0): - """ - The attribute value for the given target node (e.g. 'PROJCS'). The index - keyword specifies an index of the child node to return. - """ - if not isinstance(target, six.string_types) or not isinstance(index, int): - raise TypeError - return capi.get_attr_value(self.ptr, force_bytes(target), index) - - def auth_name(self, target): - "Returns the authority name for the given string target node." - return capi.get_auth_name(self.ptr, force_bytes(target)) - - def auth_code(self, target): - "Returns the authority code for the given string target node." - return capi.get_auth_code(self.ptr, force_bytes(target)) - - def clone(self): - "Returns a clone of this SpatialReference object." - return SpatialReference(capi.clone_srs(self.ptr)) - - def from_esri(self): - "Morphs this SpatialReference from ESRI's format to EPSG." - capi.morph_from_esri(self.ptr) - - def identify_epsg(self): - """ - This method inspects the WKT of this SpatialReference, and will - add EPSG authority nodes where an EPSG identifier is applicable. - """ - capi.identify_epsg(self.ptr) - - def to_esri(self): - "Morphs this SpatialReference to ESRI's format." - capi.morph_to_esri(self.ptr) - - def validate(self): - "Checks to see if the given spatial reference is valid." - capi.srs_validate(self.ptr) - - #### Name & SRID properties #### - @property - def name(self): - "Returns the name of this Spatial Reference." - if self.projected: return self.attr_value('PROJCS') - elif self.geographic: return self.attr_value('GEOGCS') - elif self.local: return self.attr_value('LOCAL_CS') - else: return None - - @property - def srid(self): - "Returns the SRID of top-level authority, or None if undefined." - try: - return int(self.attr_value('AUTHORITY', 1)) - except (TypeError, ValueError): - return None - - #### Unit Properties #### - @property - def linear_name(self): - "Returns the name of the linear units." - units, name = capi.linear_units(self.ptr, byref(c_char_p())) - return name - - @property - def linear_units(self): - "Returns the value of the linear units." - units, name = capi.linear_units(self.ptr, byref(c_char_p())) - return units - - @property - def angular_name(self): - "Returns the name of the angular units." - units, name = capi.angular_units(self.ptr, byref(c_char_p())) - return name - - @property - def angular_units(self): - "Returns the value of the angular units." - units, name = capi.angular_units(self.ptr, byref(c_char_p())) - return units - - @property - def units(self): - """ - Returns a 2-tuple of the units value and the units name, - and will automatically determines whether to return the linear - or angular units. - """ - units, name = None, None - if self.projected or self.local: - units, name = capi.linear_units(self.ptr, byref(c_char_p())) - elif self.geographic: - units, name = capi.angular_units(self.ptr, byref(c_char_p())) - if name is not None: - name.decode() - return (units, name) - - #### Spheroid/Ellipsoid Properties #### - @property - def ellipsoid(self): - """ - Returns a tuple of the ellipsoid parameters: - (semimajor axis, semiminor axis, and inverse flattening) - """ - return (self.semi_major, self.semi_minor, self.inverse_flattening) - - @property - def semi_major(self): - "Returns the Semi Major Axis for this Spatial Reference." - return capi.semi_major(self.ptr, byref(c_int())) - - @property - def semi_minor(self): - "Returns the Semi Minor Axis for this Spatial Reference." - return capi.semi_minor(self.ptr, byref(c_int())) - - @property - def inverse_flattening(self): - "Returns the Inverse Flattening for this Spatial Reference." - return capi.invflattening(self.ptr, byref(c_int())) - - #### Boolean Properties #### - @property - def geographic(self): - """ - Returns True if this SpatialReference is geographic - (root node is GEOGCS). - """ - return bool(capi.isgeographic(self.ptr)) - - @property - def local(self): - "Returns True if this SpatialReference is local (root node is LOCAL_CS)." - return bool(capi.islocal(self.ptr)) - - @property - def projected(self): - """ - Returns True if this SpatialReference is a projected coordinate system - (root node is PROJCS). - """ - return bool(capi.isprojected(self.ptr)) - - #### Import Routines ##### - def import_epsg(self, epsg): - "Imports the Spatial Reference from the EPSG code (an integer)." - capi.from_epsg(self.ptr, epsg) - - def import_proj(self, proj): - "Imports the Spatial Reference from a PROJ.4 string." - capi.from_proj(self.ptr, proj) - - def import_user_input(self, user_input): - "Imports the Spatial Reference from the given user input string." - capi.from_user_input(self.ptr, force_bytes(user_input)) - - def import_wkt(self, wkt): - "Imports the Spatial Reference from OGC WKT (string)" - capi.from_wkt(self.ptr, byref(c_char_p(wkt))) - - def import_xml(self, xml): - "Imports the Spatial Reference from an XML string." - capi.from_xml(self.ptr, xml) - - #### Export Properties #### - @property - def wkt(self): - "Returns the WKT representation of this Spatial Reference." - return capi.to_wkt(self.ptr, byref(c_char_p())) - - @property - def pretty_wkt(self, simplify=0): - "Returns the 'pretty' representation of the WKT." - return capi.to_pretty_wkt(self.ptr, byref(c_char_p()), simplify) - - @property - def proj(self): - "Returns the PROJ.4 representation for this Spatial Reference." - return capi.to_proj(self.ptr, byref(c_char_p())) - - @property - def proj4(self): - "Alias for proj()." - return self.proj - - @property - def xml(self, dialect=''): - "Returns the XML representation of this Spatial Reference." - return capi.to_xml(self.ptr, byref(c_char_p()), dialect) - -class CoordTransform(GDALBase): - "The coordinate system transformation object." - - def __init__(self, source, target): - "Initializes on a source and target SpatialReference objects." - if not isinstance(source, SpatialReference) or not isinstance(target, SpatialReference): - raise TypeError('source and target must be of type SpatialReference') - self.ptr = capi.new_ct(source._ptr, target._ptr) - self._srs1_name = source.name - self._srs2_name = target.name - - def __del__(self): - "Deletes this Coordinate Transformation object." - if self._ptr: capi.destroy_ct(self._ptr) - - def __str__(self): - return 'Transform from "%s" to "%s"' % (self._srs1_name, self._srs2_name) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_driver.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_driver.py deleted file mode 100644 index c27302d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_driver.py +++ /dev/null @@ -1,39 +0,0 @@ -from django.contrib.gis.gdal import HAS_GDAL -from django.utils import unittest -from django.utils.unittest import skipUnless - -if HAS_GDAL: - from django.contrib.gis.gdal import Driver, OGRException - - -valid_drivers = ('ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN', - 'Memory', 'CSV', 'GML', 'KML') - -invalid_drivers = ('Foo baz', 'clucka', 'ESRI Shp') - -aliases = {'eSrI' : 'ESRI Shapefile', - 'TigER/linE' : 'TIGER', - 'SHAPE' : 'ESRI Shapefile', - 'sHp' : 'ESRI Shapefile', - } - - -@skipUnless(HAS_GDAL, "GDAL is required") -class DriverTest(unittest.TestCase): - - def test01_valid_driver(self): - "Testing valid OGR Data Source Drivers." - for d in valid_drivers: - dr = Driver(d) - self.assertEqual(d, str(dr)) - - def test02_invalid_driver(self): - "Testing invalid OGR Data Source Drivers." - for i in invalid_drivers: - self.assertRaises(OGRException, Driver, i) - - def test03_aliases(self): - "Testing driver aliases." - for alias, full_name in aliases.items(): - dr = Driver(alias) - self.assertEqual(full_name, str(dr)) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_ds.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_ds.py deleted file mode 100644 index 3664f05..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_ds.py +++ /dev/null @@ -1,244 +0,0 @@ -import os - -from django.contrib.gis.gdal import HAS_GDAL -from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA -from django.utils import unittest -from django.utils.unittest import skipUnless - -if HAS_GDAL: - from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION - from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString - - # List of acceptable data sources. - ds_list = ( - TestDS('test_point', nfeat=5, nfld=3, geom='POINT', gtype=1, driver='ESRI Shapefile', - fields={'dbl' : OFTReal, 'int' : OFTInteger, 'str' : OFTString,}, - extent=(-1.35011,0.166623,-0.524093,0.824508), # Got extent from QGIS - srs_wkt='GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]', - field_values={'dbl' : [float(i) for i in range(1, 6)], 'int' : list(range(1, 6)), 'str' : [str(i) for i in range(1, 6)]}, - fids=range(5)), - TestDS('test_vrt', ext='vrt', nfeat=3, nfld=3, geom='POINT', gtype='Point25D', driver='VRT', - fields={'POINT_X' : OFTString, 'POINT_Y' : OFTString, 'NUM' : OFTString}, # VRT uses CSV, which all types are OFTString. - extent=(1.0, 2.0, 100.0, 523.5), # Min/Max from CSV - field_values={'POINT_X' : ['1.0', '5.0', '100.0'], 'POINT_Y' : ['2.0', '23.0', '523.5'], 'NUM' : ['5', '17', '23']}, - fids=range(1,4)), - TestDS('test_poly', nfeat=3, nfld=3, geom='POLYGON', gtype=3, - driver='ESRI Shapefile', - fields={'float' : OFTReal, 'int' : OFTInteger, 'str' : OFTString,}, - extent=(-1.01513,-0.558245,0.161876,0.839637), # Got extent from QGIS - srs_wkt='GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]'), - ) - -bad_ds = (TestDS('foo'),) - - -@skipUnless(HAS_GDAL, "GDAL is required") -class DataSourceTest(unittest.TestCase): - - def test01_valid_shp(self): - "Testing valid SHP Data Source files." - - for source in ds_list: - # Loading up the data source - ds = DataSource(source.ds) - - # Making sure the layer count is what's expected (only 1 layer in a SHP file) - self.assertEqual(1, len(ds)) - - # Making sure GetName works - self.assertEqual(source.ds, ds.name) - - # Making sure the driver name matches up - self.assertEqual(source.driver, str(ds.driver)) - - # Making sure indexing works - try: - ds[len(ds)] - except OGRIndexError: - pass - else: - self.fail('Expected an IndexError!') - - def test02_invalid_shp(self): - "Testing invalid SHP files for the Data Source." - for source in bad_ds: - self.assertRaises(OGRException, DataSource, source.ds) - - def test03a_layers(self): - "Testing Data Source Layers." - for source in ds_list: - ds = DataSource(source.ds) - - # Incrementing through each layer, this tests DataSource.__iter__ - for layer in ds: - # Making sure we get the number of features we expect - self.assertEqual(len(layer), source.nfeat) - - # Making sure we get the number of fields we expect - self.assertEqual(source.nfld, layer.num_fields) - self.assertEqual(source.nfld, len(layer.fields)) - - # Testing the layer's extent (an Envelope), and it's properties - if source.driver == 'VRT' and (GDAL_VERSION >= (1, 7, 0) and GDAL_VERSION < (1, 7, 3)): - # There's a known GDAL regression with retrieving the extent - # of a VRT layer in versions 1.7.0-1.7.2: - # http://trac.osgeo.org/gdal/ticket/3783 - pass - else: - self.assertEqual(True, isinstance(layer.extent, Envelope)) - self.assertAlmostEqual(source.extent[0], layer.extent.min_x, 5) - self.assertAlmostEqual(source.extent[1], layer.extent.min_y, 5) - self.assertAlmostEqual(source.extent[2], layer.extent.max_x, 5) - self.assertAlmostEqual(source.extent[3], layer.extent.max_y, 5) - - # Now checking the field names. - flds = layer.fields - for f in flds: self.assertEqual(True, f in source.fields) - - # Negative FIDs are not allowed. - self.assertRaises(OGRIndexError, layer.__getitem__, -1) - self.assertRaises(OGRIndexError, layer.__getitem__, 50000) - - if hasattr(source, 'field_values'): - fld_names = source.field_values.keys() - - # Testing `Layer.get_fields` (which uses Layer.__iter__) - for fld_name in fld_names: - self.assertEqual(source.field_values[fld_name], layer.get_fields(fld_name)) - - # Testing `Layer.__getitem__`. - for i, fid in enumerate(source.fids): - feat = layer[fid] - self.assertEqual(fid, feat.fid) - # Maybe this should be in the test below, but we might as well test - # the feature values here while in this loop. - for fld_name in fld_names: - self.assertEqual(source.field_values[fld_name][i], feat.get(fld_name)) - - def test03b_layer_slice(self): - "Test indexing and slicing on Layers." - # Using the first data-source because the same slice - # can be used for both the layer and the control values. - source = ds_list[0] - ds = DataSource(source.ds) - - sl = slice(1, 3) - feats = ds[0][sl] - - for fld_name in ds[0].fields: - test_vals = [feat.get(fld_name) for feat in feats] - control_vals = source.field_values[fld_name][sl] - self.assertEqual(control_vals, test_vals) - - def test03c_layer_references(self): - """ - Ensure OGR objects keep references to the objects they belong to. - """ - source = ds_list[0] - - # See ticket #9448. - def get_layer(): - # This DataSource object is not accessible outside this - # scope. However, a reference should still be kept alive - # on the `Layer` returned. - ds = DataSource(source.ds) - return ds[0] - - # Making sure we can call OGR routines on the Layer returned. - lyr = get_layer() - self.assertEqual(source.nfeat, len(lyr)) - self.assertEqual(source.gtype, lyr.geom_type.num) - - # Same issue for Feature/Field objects, see #18640 - self.assertEqual(str(lyr[0]['str']), "1") - - def test04_features(self): - "Testing Data Source Features." - for source in ds_list: - ds = DataSource(source.ds) - - # Incrementing through each layer - for layer in ds: - # Incrementing through each feature in the layer - for feat in layer: - # Making sure the number of fields, and the geometry type - # are what's expected. - self.assertEqual(source.nfld, len(list(feat))) - self.assertEqual(source.gtype, feat.geom_type) - - # Making sure the fields match to an appropriate OFT type. - for k, v in source.fields.items(): - # Making sure we get the proper OGR Field instance, using - # a string value index for the feature. - self.assertEqual(True, isinstance(feat[k], v)) - - # Testing Feature.__iter__ - for fld in feat: - self.assertEqual(True, fld.name in source.fields.keys()) - - def test05_geometries(self): - "Testing Geometries from Data Source Features." - for source in ds_list: - ds = DataSource(source.ds) - - # Incrementing through each layer and feature. - for layer in ds: - for feat in layer: - g = feat.geom - - # Making sure we get the right Geometry name & type - self.assertEqual(source.geom, g.geom_name) - self.assertEqual(source.gtype, g.geom_type) - - # Making sure the SpatialReference is as expected. - if hasattr(source, 'srs_wkt'): - self.assertEqual( - source.srs_wkt, - # Depending on lib versions, WGS_84 might be WGS_1984 - g.srs.wkt.replace('SPHEROID["WGS_84"', 'SPHEROID["WGS_1984"') - ) - - def test06_spatial_filter(self): - "Testing the Layer.spatial_filter property." - ds = DataSource(get_ds_file('cities', 'shp')) - lyr = ds[0] - - # When not set, it should be None. - self.assertEqual(None, lyr.spatial_filter) - - # Must be set a/an OGRGeometry or 4-tuple. - self.assertRaises(TypeError, lyr._set_spatial_filter, 'foo') - - # Setting the spatial filter with a tuple/list with the extent of - # a buffer centering around Pueblo. - self.assertRaises(ValueError, lyr._set_spatial_filter, list(range(5))) - filter_extent = (-105.609252, 37.255001, -103.609252, 39.255001) - lyr.spatial_filter = (-105.609252, 37.255001, -103.609252, 39.255001) - self.assertEqual(OGRGeometry.from_bbox(filter_extent), lyr.spatial_filter) - feats = [feat for feat in lyr] - self.assertEqual(1, len(feats)) - self.assertEqual('Pueblo', feats[0].get('Name')) - - # Setting the spatial filter with an OGRGeometry for buffer centering - # around Houston. - filter_geom = OGRGeometry('POLYGON((-96.363151 28.763374,-94.363151 28.763374,-94.363151 30.763374,-96.363151 30.763374,-96.363151 28.763374))') - lyr.spatial_filter = filter_geom - self.assertEqual(filter_geom, lyr.spatial_filter) - feats = [feat for feat in lyr] - self.assertEqual(1, len(feats)) - self.assertEqual('Houston', feats[0].get('Name')) - - # Clearing the spatial filter by setting it to None. Now - # should indicate that there are 3 features in the Layer. - lyr.spatial_filter = None - self.assertEqual(3, len(lyr)) - - def test07_integer_overflow(self): - "Testing that OFTReal fields, treated as OFTInteger, do not overflow." - # Using *.dbf from Census 2010 TIGER Shapefile for Texas, - # which has land area ('ALAND10') stored in a Real field - # with no precision. - ds = DataSource(os.path.join(TEST_DATA, 'texas.dbf')) - feat = ds[0][0] - # Reference value obtained using `ogrinfo`. - self.assertEqual(676586997978, feat.get('ALAND10')) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_envelope.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_envelope.py deleted file mode 100644 index 7518dc6..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_envelope.py +++ /dev/null @@ -1,93 +0,0 @@ -from django.contrib.gis.gdal import HAS_GDAL -from django.utils import unittest -from django.utils.unittest import skipUnless - -if HAS_GDAL: - from django.contrib.gis.gdal import Envelope, OGRException - - -class TestPoint(object): - def __init__(self, x, y): - self.x = x - self.y = y - - -@skipUnless(HAS_GDAL, "GDAL is required") -class EnvelopeTest(unittest.TestCase): - - def setUp(self): - self.e = Envelope(0, 0, 5, 5) - - def test01_init(self): - "Testing Envelope initilization." - e1 = Envelope((0, 0, 5, 5)) - e2 = Envelope(0, 0, 5, 5) - e3 = Envelope(0, '0', '5', 5) # Thanks to ww for this - e4 = Envelope(e1._envelope) - self.assertRaises(OGRException, Envelope, (5, 5, 0, 0)) - self.assertRaises(OGRException, Envelope, 5, 5, 0, 0) - self.assertRaises(OGRException, Envelope, (0, 0, 5, 5, 3)) - self.assertRaises(OGRException, Envelope, ()) - self.assertRaises(ValueError, Envelope, 0, 'a', 5, 5) - self.assertRaises(TypeError, Envelope, 'foo') - self.assertRaises(OGRException, Envelope, (1, 1, 0, 0)) - try: - Envelope(0, 0, 0, 0) - except OGRException: - self.fail("shouldn't raise an exception for min_x == max_x or min_y == max_y") - - def test02_properties(self): - "Testing Envelope properties." - e = Envelope(0, 0, 2, 3) - self.assertEqual(0, e.min_x) - self.assertEqual(0, e.min_y) - self.assertEqual(2, e.max_x) - self.assertEqual(3, e.max_y) - self.assertEqual((0, 0), e.ll) - self.assertEqual((2, 3), e.ur) - self.assertEqual((0, 0, 2, 3), e.tuple) - self.assertEqual('POLYGON((0.0 0.0,0.0 3.0,2.0 3.0,2.0 0.0,0.0 0.0))', e.wkt) - self.assertEqual('(0.0, 0.0, 2.0, 3.0)', str(e)) - - def test03_equivalence(self): - "Testing Envelope equivalence." - e1 = Envelope(0.523, 0.217, 253.23, 523.69) - e2 = Envelope((0.523, 0.217, 253.23, 523.69)) - self.assertEqual(e1, e2) - self.assertEqual((0.523, 0.217, 253.23, 523.69), e1) - - def test04_expand_to_include_pt_2_params(self): - "Testing Envelope expand_to_include -- point as two parameters." - self.e.expand_to_include(2, 6) - self.assertEqual((0, 0, 5, 6), self.e) - self.e.expand_to_include(-1, -1) - self.assertEqual((-1, -1, 5, 6), self.e) - - def test05_expand_to_include_pt_2_tuple(self): - "Testing Envelope expand_to_include -- point as a single 2-tuple parameter." - self.e.expand_to_include((10, 10)) - self.assertEqual((0, 0, 10, 10), self.e) - self.e.expand_to_include((-10, -10)) - self.assertEqual((-10, -10, 10, 10), self.e) - - def test06_expand_to_include_extent_4_params(self): - "Testing Envelope expand_to_include -- extent as 4 parameters." - self.e.expand_to_include(-1, 1, 3, 7) - self.assertEqual((-1, 0, 5, 7), self.e) - - def test06_expand_to_include_extent_4_tuple(self): - "Testing Envelope expand_to_include -- extent as a single 4-tuple parameter." - self.e.expand_to_include((-1, 1, 3, 7)) - self.assertEqual((-1, 0, 5, 7), self.e) - - def test07_expand_to_include_envelope(self): - "Testing Envelope expand_to_include with Envelope as parameter." - self.e.expand_to_include(Envelope(-1, 1, 3, 7)) - self.assertEqual((-1, 0, 5, 7), self.e) - - def test08_expand_to_include_point(self): - "Testing Envelope expand_to_include with Point as parameter." - self.e.expand_to_include(TestPoint(-1, 1)) - self.assertEqual((-1, 0, 5, 5), self.e) - self.e.expand_to_include(TestPoint(10, 10)) - self.assertEqual((-1, 0, 10, 10), self.e) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_geom.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_geom.py deleted file mode 100644 index c048d2b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_geom.py +++ /dev/null @@ -1,485 +0,0 @@ -import json -from binascii import b2a_hex -try: - from django.utils.six.moves import cPickle as pickle -except ImportError: - import pickle - -from django.contrib.gis.gdal import HAS_GDAL -from django.contrib.gis.geometry.test_data import TestDataMixin -from django.utils.six.moves import xrange -from django.utils import unittest -from django.utils.unittest import skipUnless - -if HAS_GDAL: - from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType, - OGRException, OGRIndexError, SpatialReference, CoordTransform, - GDAL_VERSION) - - -@skipUnless(HAS_GDAL, "GDAL is required") -class OGRGeomTest(unittest.TestCase, TestDataMixin): - "This tests the OGR Geometry." - - def test00a_geomtype(self): - "Testing OGRGeomType object." - - # OGRGeomType should initialize on all these inputs. - try: - g = OGRGeomType(1) - g = OGRGeomType(7) - g = OGRGeomType('point') - g = OGRGeomType('GeometrycollectioN') - g = OGRGeomType('LINearrING') - g = OGRGeomType('Unknown') - except: - self.fail('Could not create an OGRGeomType object!') - - # Should throw TypeError on this input - self.assertRaises(OGRException, OGRGeomType, 23) - self.assertRaises(OGRException, OGRGeomType, 'fooD') - self.assertRaises(OGRException, OGRGeomType, 9) - - # Equivalence can take strings, ints, and other OGRGeomTypes - self.assertEqual(True, OGRGeomType(1) == OGRGeomType(1)) - self.assertEqual(True, OGRGeomType(7) == 'GeometryCollection') - self.assertEqual(True, OGRGeomType('point') == 'POINT') - self.assertEqual(False, OGRGeomType('point') == 2) - self.assertEqual(True, OGRGeomType('unknown') == 0) - self.assertEqual(True, OGRGeomType(6) == 'MULtiPolyGON') - self.assertEqual(False, OGRGeomType(1) != OGRGeomType('point')) - self.assertEqual(True, OGRGeomType('POINT') != OGRGeomType(6)) - - # Testing the Django field name equivalent property. - self.assertEqual('PointField', OGRGeomType('Point').django) - self.assertEqual('GeometryField', OGRGeomType('Unknown').django) - self.assertEqual(None, OGRGeomType('none').django) - - # 'Geometry' initialization implies an unknown geometry type. - gt = OGRGeomType('Geometry') - self.assertEqual(0, gt.num) - self.assertEqual('Unknown', gt.name) - - def test00b_geomtype_25d(self): - "Testing OGRGeomType object with 25D types." - wkb25bit = OGRGeomType.wkb25bit - self.assertTrue(OGRGeomType(wkb25bit + 1) == 'Point25D') - self.assertTrue(OGRGeomType('MultiLineString25D') == (5 + wkb25bit)) - self.assertEqual('GeometryCollectionField', OGRGeomType('GeometryCollection25D').django) - - def test01a_wkt(self): - "Testing WKT output." - for g in self.geometries.wkt_out: - geom = OGRGeometry(g.wkt) - self.assertEqual(g.wkt, geom.wkt) - - def test01a_ewkt(self): - "Testing EWKT input/output." - for ewkt_val in ('POINT (1 2 3)', 'LINEARRING (0 0,1 1,2 1,0 0)'): - # First with ewkt output when no SRID in EWKT - self.assertEqual(ewkt_val, OGRGeometry(ewkt_val).ewkt) - # No test consumption with an SRID specified. - ewkt_val = 'SRID=4326;%s' % ewkt_val - geom = OGRGeometry(ewkt_val) - self.assertEqual(ewkt_val, geom.ewkt) - self.assertEqual(4326, geom.srs.srid) - - def test01b_gml(self): - "Testing GML output." - for g in self.geometries.wkt_out: - geom = OGRGeometry(g.wkt) - exp_gml = g.gml - if GDAL_VERSION >= (1, 8): - # In GDAL 1.8, the non-conformant GML tag was - # replaced with . - exp_gml = exp_gml.replace('GeometryCollection', 'MultiGeometry') - self.assertEqual(exp_gml, geom.gml) - - def test01c_hex(self): - "Testing HEX input/output." - for g in self.geometries.hex_wkt: - geom1 = OGRGeometry(g.wkt) - self.assertEqual(g.hex.encode(), geom1.hex) - # Constructing w/HEX - geom2 = OGRGeometry(g.hex) - self.assertEqual(geom1, geom2) - - def test01d_wkb(self): - "Testing WKB input/output." - for g in self.geometries.hex_wkt: - geom1 = OGRGeometry(g.wkt) - wkb = geom1.wkb - self.assertEqual(b2a_hex(wkb).upper(), g.hex.encode()) - # Constructing w/WKB. - geom2 = OGRGeometry(wkb) - self.assertEqual(geom1, geom2) - - def test01e_json(self): - "Testing GeoJSON input/output." - for g in self.geometries.json_geoms: - geom = OGRGeometry(g.wkt) - if not hasattr(g, 'not_equal'): - # Loading jsons to prevent decimal differences - self.assertEqual(json.loads(g.json), json.loads(geom.json)) - self.assertEqual(json.loads(g.json), json.loads(geom.geojson)) - self.assertEqual(OGRGeometry(g.wkt), OGRGeometry(geom.json)) - - def test02_points(self): - "Testing Point objects." - - prev = OGRGeometry('POINT(0 0)') - for p in self.geometries.points: - if not hasattr(p, 'z'): # No 3D - pnt = OGRGeometry(p.wkt) - self.assertEqual(1, pnt.geom_type) - self.assertEqual('POINT', pnt.geom_name) - self.assertEqual(p.x, pnt.x) - self.assertEqual(p.y, pnt.y) - self.assertEqual((p.x, p.y), pnt.tuple) - - def test03_multipoints(self): - "Testing MultiPoint objects." - for mp in self.geometries.multipoints: - mgeom1 = OGRGeometry(mp.wkt) # First one from WKT - self.assertEqual(4, mgeom1.geom_type) - self.assertEqual('MULTIPOINT', mgeom1.geom_name) - mgeom2 = OGRGeometry('MULTIPOINT') # Creating empty multipoint - mgeom3 = OGRGeometry('MULTIPOINT') - for g in mgeom1: - mgeom2.add(g) # adding each point from the multipoints - mgeom3.add(g.wkt) # should take WKT as well - self.assertEqual(mgeom1, mgeom2) # they should equal - self.assertEqual(mgeom1, mgeom3) - self.assertEqual(mp.coords, mgeom2.coords) - self.assertEqual(mp.n_p, mgeom2.point_count) - - def test04_linestring(self): - "Testing LineString objects." - prev = OGRGeometry('POINT(0 0)') - for ls in self.geometries.linestrings: - linestr = OGRGeometry(ls.wkt) - self.assertEqual(2, linestr.geom_type) - self.assertEqual('LINESTRING', linestr.geom_name) - self.assertEqual(ls.n_p, linestr.point_count) - self.assertEqual(ls.coords, linestr.tuple) - self.assertEqual(True, linestr == OGRGeometry(ls.wkt)) - self.assertEqual(True, linestr != prev) - self.assertRaises(OGRIndexError, linestr.__getitem__, len(linestr)) - prev = linestr - - # Testing the x, y properties. - x = [tmpx for tmpx, tmpy in ls.coords] - y = [tmpy for tmpx, tmpy in ls.coords] - self.assertEqual(x, linestr.x) - self.assertEqual(y, linestr.y) - - def test05_multilinestring(self): - "Testing MultiLineString objects." - prev = OGRGeometry('POINT(0 0)') - for mls in self.geometries.multilinestrings: - mlinestr = OGRGeometry(mls.wkt) - self.assertEqual(5, mlinestr.geom_type) - self.assertEqual('MULTILINESTRING', mlinestr.geom_name) - self.assertEqual(mls.n_p, mlinestr.point_count) - self.assertEqual(mls.coords, mlinestr.tuple) - self.assertEqual(True, mlinestr == OGRGeometry(mls.wkt)) - self.assertEqual(True, mlinestr != prev) - prev = mlinestr - for ls in mlinestr: - self.assertEqual(2, ls.geom_type) - self.assertEqual('LINESTRING', ls.geom_name) - self.assertRaises(OGRIndexError, mlinestr.__getitem__, len(mlinestr)) - - def test06_linearring(self): - "Testing LinearRing objects." - prev = OGRGeometry('POINT(0 0)') - for rr in self.geometries.linearrings: - lr = OGRGeometry(rr.wkt) - #self.assertEqual(101, lr.geom_type.num) - self.assertEqual('LINEARRING', lr.geom_name) - self.assertEqual(rr.n_p, len(lr)) - self.assertEqual(True, lr == OGRGeometry(rr.wkt)) - self.assertEqual(True, lr != prev) - prev = lr - - def test07a_polygons(self): - "Testing Polygon objects." - - # Testing `from_bbox` class method - bbox = (-180,-90,180,90) - p = OGRGeometry.from_bbox( bbox ) - self.assertEqual(bbox, p.extent) - - prev = OGRGeometry('POINT(0 0)') - for p in self.geometries.polygons: - poly = OGRGeometry(p.wkt) - self.assertEqual(3, poly.geom_type) - self.assertEqual('POLYGON', poly.geom_name) - self.assertEqual(p.n_p, poly.point_count) - self.assertEqual(p.n_i + 1, len(poly)) - - # Testing area & centroid. - self.assertAlmostEqual(p.area, poly.area, 9) - x, y = poly.centroid.tuple - self.assertAlmostEqual(p.centroid[0], x, 9) - self.assertAlmostEqual(p.centroid[1], y, 9) - - # Testing equivalence - self.assertEqual(True, poly == OGRGeometry(p.wkt)) - self.assertEqual(True, poly != prev) - - if p.ext_ring_cs: - ring = poly[0] - self.assertEqual(p.ext_ring_cs, ring.tuple) - self.assertEqual(p.ext_ring_cs, poly[0].tuple) - self.assertEqual(len(p.ext_ring_cs), ring.point_count) - - for r in poly: - self.assertEqual('LINEARRING', r.geom_name) - - def test07b_closepolygons(self): - "Testing closing Polygon objects." - # Both rings in this geometry are not closed. - poly = OGRGeometry('POLYGON((0 0, 5 0, 5 5, 0 5), (1 1, 2 1, 2 2, 2 1))') - self.assertEqual(8, poly.point_count) - with self.assertRaises(OGRException): - _ = poly.centroid - - poly.close_rings() - self.assertEqual(10, poly.point_count) # Two closing points should've been added - self.assertEqual(OGRGeometry('POINT(2.5 2.5)'), poly.centroid) - - def test08_multipolygons(self): - "Testing MultiPolygon objects." - prev = OGRGeometry('POINT(0 0)') - for mp in self.geometries.multipolygons: - mpoly = OGRGeometry(mp.wkt) - self.assertEqual(6, mpoly.geom_type) - self.assertEqual('MULTIPOLYGON', mpoly.geom_name) - if mp.valid: - self.assertEqual(mp.n_p, mpoly.point_count) - self.assertEqual(mp.num_geom, len(mpoly)) - self.assertRaises(OGRIndexError, mpoly.__getitem__, len(mpoly)) - for p in mpoly: - self.assertEqual('POLYGON', p.geom_name) - self.assertEqual(3, p.geom_type) - self.assertEqual(mpoly.wkt, OGRGeometry(mp.wkt).wkt) - - def test09a_srs(self): - "Testing OGR Geometries with Spatial Reference objects." - for mp in self.geometries.multipolygons: - # Creating a geometry w/spatial reference - sr = SpatialReference('WGS84') - mpoly = OGRGeometry(mp.wkt, sr) - self.assertEqual(sr.wkt, mpoly.srs.wkt) - - # Ensuring that SRS is propagated to clones. - klone = mpoly.clone() - self.assertEqual(sr.wkt, klone.srs.wkt) - - # Ensuring all children geometries (polygons and their rings) all - # return the assigned spatial reference as well. - for poly in mpoly: - self.assertEqual(sr.wkt, poly.srs.wkt) - for ring in poly: - self.assertEqual(sr.wkt, ring.srs.wkt) - - # Ensuring SRS propagate in topological ops. - a = OGRGeometry(self.geometries.topology_geoms[0].wkt_a, sr) - b = OGRGeometry(self.geometries.topology_geoms[0].wkt_b, sr) - diff = a.difference(b) - union = a.union(b) - self.assertEqual(sr.wkt, diff.srs.wkt) - self.assertEqual(sr.srid, union.srs.srid) - - # Instantiating w/an integer SRID - mpoly = OGRGeometry(mp.wkt, 4326) - self.assertEqual(4326, mpoly.srid) - mpoly.srs = SpatialReference(4269) - self.assertEqual(4269, mpoly.srid) - self.assertEqual('NAD83', mpoly.srs.name) - - # Incrementing through the multipolyogn after the spatial reference - # has been re-assigned. - for poly in mpoly: - self.assertEqual(mpoly.srs.wkt, poly.srs.wkt) - poly.srs = 32140 - for ring in poly: - # Changing each ring in the polygon - self.assertEqual(32140, ring.srs.srid) - self.assertEqual('NAD83 / Texas South Central', ring.srs.name) - ring.srs = str(SpatialReference(4326)) # back to WGS84 - self.assertEqual(4326, ring.srs.srid) - - # Using the `srid` property. - ring.srid = 4322 - self.assertEqual('WGS 72', ring.srs.name) - self.assertEqual(4322, ring.srid) - - def test09b_srs_transform(self): - "Testing transform()." - orig = OGRGeometry('POINT (-104.609 38.255)', 4326) - trans = OGRGeometry('POINT (992385.4472045 481455.4944650)', 2774) - - # Using an srid, a SpatialReference object, and a CoordTransform object - # or transformations. - t1, t2, t3 = orig.clone(), orig.clone(), orig.clone() - t1.transform(trans.srid) - t2.transform(SpatialReference('EPSG:2774')) - ct = CoordTransform(SpatialReference('WGS84'), SpatialReference(2774)) - t3.transform(ct) - - # Testing use of the `clone` keyword. - k1 = orig.clone() - k2 = k1.transform(trans.srid, clone=True) - self.assertEqual(k1, orig) - self.assertNotEqual(k1, k2) - - prec = 3 - for p in (t1, t2, t3, k2): - self.assertAlmostEqual(trans.x, p.x, prec) - self.assertAlmostEqual(trans.y, p.y, prec) - - def test09c_transform_dim(self): - "Testing coordinate dimension is the same on transformed geometries." - ls_orig = OGRGeometry('LINESTRING(-104.609 38.255)', 4326) - ls_trans = OGRGeometry('LINESTRING(992385.4472045 481455.4944650)', 2774) - - prec = 3 - ls_orig.transform(ls_trans.srs) - # Making sure the coordinate dimension is still 2D. - self.assertEqual(2, ls_orig.coord_dim) - self.assertAlmostEqual(ls_trans.x[0], ls_orig.x[0], prec) - self.assertAlmostEqual(ls_trans.y[0], ls_orig.y[0], prec) - - def test10_difference(self): - "Testing difference()." - for i in xrange(len(self.geometries.topology_geoms)): - a = OGRGeometry(self.geometries.topology_geoms[i].wkt_a) - b = OGRGeometry(self.geometries.topology_geoms[i].wkt_b) - d1 = OGRGeometry(self.geometries.diff_geoms[i].wkt) - d2 = a.difference(b) - self.assertEqual(d1, d2) - self.assertEqual(d1, a - b) # __sub__ is difference operator - a -= b # testing __isub__ - self.assertEqual(d1, a) - - def test11_intersection(self): - "Testing intersects() and intersection()." - for i in xrange(len(self.geometries.topology_geoms)): - a = OGRGeometry(self.geometries.topology_geoms[i].wkt_a) - b = OGRGeometry(self.geometries.topology_geoms[i].wkt_b) - i1 = OGRGeometry(self.geometries.intersect_geoms[i].wkt) - self.assertEqual(True, a.intersects(b)) - i2 = a.intersection(b) - self.assertEqual(i1, i2) - self.assertEqual(i1, a & b) # __and__ is intersection operator - a &= b # testing __iand__ - self.assertEqual(i1, a) - - def test12_symdifference(self): - "Testing sym_difference()." - for i in xrange(len(self.geometries.topology_geoms)): - a = OGRGeometry(self.geometries.topology_geoms[i].wkt_a) - b = OGRGeometry(self.geometries.topology_geoms[i].wkt_b) - d1 = OGRGeometry(self.geometries.sdiff_geoms[i].wkt) - d2 = a.sym_difference(b) - self.assertEqual(d1, d2) - self.assertEqual(d1, a ^ b) # __xor__ is symmetric difference operator - a ^= b # testing __ixor__ - self.assertEqual(d1, a) - - def test13_union(self): - "Testing union()." - for i in xrange(len(self.geometries.topology_geoms)): - a = OGRGeometry(self.geometries.topology_geoms[i].wkt_a) - b = OGRGeometry(self.geometries.topology_geoms[i].wkt_b) - u1 = OGRGeometry(self.geometries.union_geoms[i].wkt) - u2 = a.union(b) - self.assertEqual(u1, u2) - self.assertEqual(u1, a | b) # __or__ is union operator - a |= b # testing __ior__ - self.assertEqual(u1, a) - - def test14_add(self): - "Testing GeometryCollection.add()." - # Can't insert a Point into a MultiPolygon. - mp = OGRGeometry('MultiPolygon') - pnt = OGRGeometry('POINT(5 23)') - self.assertRaises(OGRException, mp.add, pnt) - - # GeometryCollection.add may take an OGRGeometry (if another collection - # of the same type all child geoms will be added individually) or WKT. - for mp in self.geometries.multipolygons: - mpoly = OGRGeometry(mp.wkt) - mp1 = OGRGeometry('MultiPolygon') - mp2 = OGRGeometry('MultiPolygon') - mp3 = OGRGeometry('MultiPolygon') - - for poly in mpoly: - mp1.add(poly) # Adding a geometry at a time - mp2.add(poly.wkt) # Adding WKT - mp3.add(mpoly) # Adding a MultiPolygon's entire contents at once. - for tmp in (mp1, mp2, mp3): self.assertEqual(mpoly, tmp) - - def test15_extent(self): - "Testing `extent` property." - # The xmin, ymin, xmax, ymax of the MultiPoint should be returned. - mp = OGRGeometry('MULTIPOINT(5 23, 0 0, 10 50)') - self.assertEqual((0.0, 0.0, 10.0, 50.0), mp.extent) - # Testing on the 'real world' Polygon. - poly = OGRGeometry(self.geometries.polygons[3].wkt) - ring = poly.shell - x, y = ring.x, ring.y - xmin, ymin = min(x), min(y) - xmax, ymax = max(x), max(y) - self.assertEqual((xmin, ymin, xmax, ymax), poly.extent) - - def test16_25D(self): - "Testing 2.5D geometries." - pnt_25d = OGRGeometry('POINT(1 2 3)') - self.assertEqual('Point25D', pnt_25d.geom_type.name) - self.assertEqual(3.0, pnt_25d.z) - self.assertEqual(3, pnt_25d.coord_dim) - ls_25d = OGRGeometry('LINESTRING(1 1 1,2 2 2,3 3 3)') - self.assertEqual('LineString25D', ls_25d.geom_type.name) - self.assertEqual([1.0, 2.0, 3.0], ls_25d.z) - self.assertEqual(3, ls_25d.coord_dim) - - def test17_pickle(self): - "Testing pickle support." - g1 = OGRGeometry('LINESTRING(1 1 1,2 2 2,3 3 3)', 'WGS84') - g2 = pickle.loads(pickle.dumps(g1)) - self.assertEqual(g1, g2) - self.assertEqual(4326, g2.srs.srid) - self.assertEqual(g1.srs.wkt, g2.srs.wkt) - - def test18_ogrgeometry_transform_workaround(self): - "Testing coordinate dimensions on geometries after transformation." - # A bug in GDAL versions prior to 1.7 changes the coordinate - # dimension of a geometry after it has been transformed. - # This test ensures that the bug workarounds employed within - # `OGRGeometry.transform` indeed work. - wkt_2d = "MULTILINESTRING ((0 0,1 1,2 2))" - wkt_3d = "MULTILINESTRING ((0 0 0,1 1 1,2 2 2))" - srid = 4326 - - # For both the 2D and 3D MultiLineString, ensure _both_ the dimension - # of the collection and the component LineString have the expected - # coordinate dimension after transform. - geom = OGRGeometry(wkt_2d, srid) - geom.transform(srid) - self.assertEqual(2, geom.coord_dim) - self.assertEqual(2, geom[0].coord_dim) - self.assertEqual(wkt_2d, geom.wkt) - - geom = OGRGeometry(wkt_3d, srid) - geom.transform(srid) - self.assertEqual(3, geom.coord_dim) - self.assertEqual(3, geom[0].coord_dim) - self.assertEqual(wkt_3d, geom.wkt) - - def test19_equivalence_regression(self): - "Testing equivalence methods with non-OGRGeometry instances." - self.assertNotEqual(None, OGRGeometry('POINT(0 0)')) - self.assertEqual(False, OGRGeometry('LINESTRING(0 0, 1 1)') == 3) diff --git a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_srs.py b/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_srs.py deleted file mode 100644 index 363b597..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_srs.py +++ /dev/null @@ -1,163 +0,0 @@ -from django.contrib.gis.gdal import HAS_GDAL -from django.utils import unittest -from django.utils.unittest import skipUnless - -if HAS_GDAL: - from django.contrib.gis.gdal import SpatialReference, CoordTransform, OGRException, SRSException - - -class TestSRS: - def __init__(self, wkt, **kwargs): - self.wkt = wkt - for key, value in kwargs.items(): - setattr(self, key, value) - -# Some Spatial Reference examples -srlist = (TestSRS('GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]', - proj='+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ', - epsg=4326, projected=False, geographic=True, local=False, - lin_name='unknown', ang_name='degree', lin_units=1.0, ang_units=0.0174532925199, - auth={'GEOGCS' : ('EPSG', '4326'), 'spheroid' : ('EPSG', '7030')}, - attr=(('DATUM', 'WGS_1984'), (('SPHEROID', 1), '6378137'),('primem|authority', 'EPSG'),), - ), - TestSRS('PROJCS["NAD83 / Texas South Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",30.28333333333333],PARAMETER["standard_parallel_2",28.38333333333333],PARAMETER["latitude_of_origin",27.83333333333333],PARAMETER["central_meridian",-99],PARAMETER["false_easting",600000],PARAMETER["false_northing",4000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32140"]]', - proj=None, epsg=32140, projected=True, geographic=False, local=False, - lin_name='metre', ang_name='degree', lin_units=1.0, ang_units=0.0174532925199, - auth={'PROJCS' : ('EPSG', '32140'), 'spheroid' : ('EPSG', '7019'), 'unit' : ('EPSG', '9001'),}, - attr=(('DATUM', 'North_American_Datum_1983'),(('SPHEROID', 2), '298.257222101'),('PROJECTION','Lambert_Conformal_Conic_2SP'),), - ), - TestSRS('PROJCS["NAD_1983_StatePlane_Texas_South_Central_FIPS_4204_Feet",GEOGCS["GCS_North_American_1983",DATUM["North_American_Datum_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["False_Easting",1968500.0],PARAMETER["False_Northing",13123333.33333333],PARAMETER["Central_Meridian",-99.0],PARAMETER["Standard_Parallel_1",28.38333333333333],PARAMETER["Standard_Parallel_2",30.28333333333334],PARAMETER["Latitude_Of_Origin",27.83333333333333],UNIT["Foot_US",0.3048006096012192]]', - proj=None, epsg=None, projected=True, geographic=False, local=False, - lin_name='Foot_US', ang_name='Degree', lin_units=0.3048006096012192, ang_units=0.0174532925199, - auth={'PROJCS' : (None, None),}, - attr=(('PROJCS|GeOgCs|spheroid', 'GRS_1980'),(('projcs', 9), 'UNIT'), (('projcs', 11), None),), - ), - # This is really ESRI format, not WKT -- but the import should work the same - TestSRS('LOCAL_CS["Non-Earth (Meter)",LOCAL_DATUM["Local Datum",0],UNIT["Meter",1.0],AXIS["X",EAST],AXIS["Y",NORTH]]', - esri=True, proj=None, epsg=None, projected=False, geographic=False, local=True, - lin_name='Meter', ang_name='degree', lin_units=1.0, ang_units=0.0174532925199, - attr=(('LOCAL_DATUM', 'Local Datum'), ('unit', 'Meter')), - ), - ) - -# Well-Known Names -well_known = (TestSRS('GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]', wk='WGS84', name='WGS 84', attrs=(('GEOGCS|AUTHORITY', 1, '4326'), ('SPHEROID', 'WGS 84'))), - TestSRS('GEOGCS["WGS 72",DATUM["WGS_1972",SPHEROID["WGS 72",6378135,298.26,AUTHORITY["EPSG","7043"]],AUTHORITY["EPSG","6322"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4322"]]', wk='WGS72', name='WGS 72', attrs=(('GEOGCS|AUTHORITY', 1, '4322'), ('SPHEROID', 'WGS 72'))), - TestSRS('GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.9786982138982,AUTHORITY["EPSG","7008"]],AUTHORITY["EPSG","6267"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4267"]]', wk='NAD27', name='NAD27', attrs=(('GEOGCS|AUTHORITY', 1, '4267'), ('SPHEROID', 'Clarke 1866'))), - TestSRS('GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]]', wk='NAD83', name='NAD83', attrs=(('GEOGCS|AUTHORITY', 1, '4269'), ('SPHEROID', 'GRS 1980'))), - TestSRS('PROJCS["NZGD49 / Karamea Circuit",GEOGCS["NZGD49",DATUM["New_Zealand_Geodetic_Datum_1949",SPHEROID["International 1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUTHORITY["EPSG","6272"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4272"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-41.28991152777778],PARAMETER["central_meridian",172.1090281944444],PARAMETER["scale_factor",1],PARAMETER["false_easting",300000],PARAMETER["false_northing",700000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","27216"]]', wk='EPSG:27216', name='NZGD49 / Karamea Circuit', attrs=(('PROJECTION','Transverse_Mercator'), ('SPHEROID', 'International 1924'))), - ) - -bad_srlist = ('Foobar', 'OOJCS["NAD83 / Texas South Central",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",30.28333333333333],PARAMETER["standard_parallel_2",28.38333333333333],PARAMETER["latitude_of_origin",27.83333333333333],PARAMETER["central_meridian",-99],PARAMETER["false_easting",600000],PARAMETER["false_northing",4000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32140"]]',) - - -@skipUnless(HAS_GDAL, "GDAL is required") -class SpatialRefTest(unittest.TestCase): - - def test01_wkt(self): - "Testing initialization on valid OGC WKT." - for s in srlist: - srs = SpatialReference(s.wkt) - - def test02_bad_wkt(self): - "Testing initialization on invalid WKT." - for bad in bad_srlist: - try: - srs = SpatialReference(bad) - srs.validate() - except (SRSException, OGRException): - pass - else: - self.fail('Should not have initialized on bad WKT "%s"!') - - def test03_get_wkt(self): - "Testing getting the WKT." - for s in srlist: - srs = SpatialReference(s.wkt) - self.assertEqual(s.wkt, srs.wkt) - - def test04_proj(self): - "Test PROJ.4 import and export." - for s in srlist: - if s.proj: - srs1 = SpatialReference(s.wkt) - srs2 = SpatialReference(s.proj) - self.assertEqual(srs1.proj, srs2.proj) - - def test05_epsg(self): - "Test EPSG import." - for s in srlist: - if s.epsg: - srs1 = SpatialReference(s.wkt) - srs2 = SpatialReference(s.epsg) - srs3 = SpatialReference(str(s.epsg)) - srs4 = SpatialReference('EPSG:%d' % s.epsg) - for srs in (srs1, srs2, srs3, srs4): - for attr, expected in s.attr: - self.assertEqual(expected, srs[attr]) - - def test07_boolean_props(self): - "Testing the boolean properties." - for s in srlist: - srs = SpatialReference(s.wkt) - self.assertEqual(s.projected, srs.projected) - self.assertEqual(s.geographic, srs.geographic) - - def test08_angular_linear(self): - "Testing the linear and angular units routines." - for s in srlist: - srs = SpatialReference(s.wkt) - self.assertEqual(s.ang_name, srs.angular_name) - self.assertEqual(s.lin_name, srs.linear_name) - self.assertAlmostEqual(s.ang_units, srs.angular_units, 9) - self.assertAlmostEqual(s.lin_units, srs.linear_units, 9) - - def test09_authority(self): - "Testing the authority name & code routines." - for s in srlist: - if hasattr(s, 'auth'): - srs = SpatialReference(s.wkt) - for target, tup in s.auth.items(): - self.assertEqual(tup[0], srs.auth_name(target)) - self.assertEqual(tup[1], srs.auth_code(target)) - - def test10_attributes(self): - "Testing the attribute retrieval routines." - for s in srlist: - srs = SpatialReference(s.wkt) - for tup in s.attr: - att = tup[0] # Attribute to test - exp = tup[1] # Expected result - self.assertEqual(exp, srs[att]) - - def test11_wellknown(self): - "Testing Well Known Names of Spatial References." - for s in well_known: - srs = SpatialReference(s.wk) - self.assertEqual(s.name, srs.name) - for tup in s.attrs: - if len(tup) == 2: - key = tup[0] - exp = tup[1] - elif len(tup) == 3: - key = tup[:2] - exp = tup[2] - self.assertEqual(srs[key], exp) - - def test12_coordtransform(self): - "Testing initialization of a CoordTransform." - target = SpatialReference('WGS84') - for s in srlist: - if s.proj: - ct = CoordTransform(SpatialReference(s.wkt), target) - - def test13_attr_value(self): - "Testing the attr_value() method." - s1 = SpatialReference('WGS84') - self.assertRaises(TypeError, s1.__getitem__, 0) - self.assertRaises(TypeError, s1.__getitem__, ('GEOGCS', 'foo')) - self.assertEqual('WGS 84', s1['GEOGCS']) - self.assertEqual('WGS_1984', s1['DATUM']) - self.assertEqual('EPSG', s1['AUTHORITY']) - self.assertEqual(4326, int(s1['AUTHORITY', 1])) - self.assertEqual(None, s1['FOOBAR']) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geoip/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/geoip/__init__.py deleted file mode 100644 index 8b519a2..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geoip/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -""" - This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R) - C API (http://www.maxmind.com/app/c). This is an alternative to the GPL - licensed Python GeoIP interface provided by MaxMind. - - GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts. - - For IP-based geolocation, this module requires the GeoLite Country and City - datasets, in binary format (CSV will not work!). The datasets may be - downloaded from MaxMind at http://www.maxmind.com/download/geoip/database/. - Grab GeoIP.dat.gz and GeoLiteCity.dat.gz, and unzip them in the directory - corresponding to settings.GEOIP_PATH. -""" -from __future__ import absolute_import - -try: - from .base import GeoIP, GeoIPException - HAS_GEOIP = True -except: - HAS_GEOIP = False diff --git a/lib/python2.7/site-packages/django/contrib/gis/geoip/base.py b/lib/python2.7/site-packages/django/contrib/gis/geoip/base.py deleted file mode 100644 index d4793a2..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geoip/base.py +++ /dev/null @@ -1,265 +0,0 @@ -import os -import re -from ctypes import c_char_p - -from django.core.validators import ipv4_re -from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS -from django.contrib.gis.geoip.prototypes import ( - GeoIPRecord, GeoIPTag, GeoIP_open, GeoIP_delete, GeoIP_database_info, - GeoIP_lib_version, GeoIP_record_by_addr, GeoIP_record_by_name, - GeoIP_country_code_by_addr, GeoIP_country_code_by_name, - GeoIP_country_name_by_addr, GeoIP_country_name_by_name) - -from django.utils import six -from django.utils.encoding import force_bytes - -# Regular expressions for recognizing the GeoIP free database editions. -free_regex = re.compile(r'^GEO-\d{3}FREE') -lite_regex = re.compile(r'^GEO-\d{3}LITE') - -#### GeoIP classes #### -class GeoIPException(Exception): pass - -class GeoIP(object): - # The flags for GeoIP memory caching. - # GEOIP_STANDARD - read database from filesystem, uses least memory. - # - # GEOIP_MEMORY_CACHE - load database into memory, faster performance - # but uses more memory - # - # GEOIP_CHECK_CACHE - check for updated database. If database has been - # updated, reload filehandle and/or memory cache. This option - # is not thread safe. - # - # GEOIP_INDEX_CACHE - just cache the most frequently accessed index - # portion of the database, resulting in faster lookups than - # GEOIP_STANDARD, but less memory usage than GEOIP_MEMORY_CACHE - - # useful for larger databases such as GeoIP Organization and - # GeoIP City. Note, for GeoIP Country, Region and Netspeed - # databases, GEOIP_INDEX_CACHE is equivalent to GEOIP_MEMORY_CACHE - # - # GEOIP_MMAP_CACHE - load database into mmap shared memory ( not available - # on Windows). - GEOIP_STANDARD = 0 - GEOIP_MEMORY_CACHE = 1 - GEOIP_CHECK_CACHE = 2 - GEOIP_INDEX_CACHE = 4 - GEOIP_MMAP_CACHE = 8 - cache_options = dict((opt, None) for opt in (0, 1, 2, 4, 8)) - - # Paths to the city & country binary databases. - _city_file = '' - _country_file = '' - - # Initially, pointers to GeoIP file references are NULL. - _city = None - _country = None - - def __init__(self, path=None, cache=0, country=None, city=None): - """ - Initializes the GeoIP object, no parameters are required to use default - settings. Keyword arguments may be passed in to customize the locations - of the GeoIP data sets. - - * path: Base directory to where GeoIP data is located or the full path - to where the city or country data files (*.dat) are located. - Assumes that both the city and country data sets are located in - this directory; overrides the GEOIP_PATH settings attribute. - - * cache: The cache settings when opening up the GeoIP datasets, - and may be an integer in (0, 1, 2, 4, 8) corresponding to - the GEOIP_STANDARD, GEOIP_MEMORY_CACHE, GEOIP_CHECK_CACHE, - GEOIP_INDEX_CACHE, and GEOIP_MMAP_CACHE, `GeoIPOptions` C API - settings, respectively. Defaults to 0, meaning that the data is read - from the disk. - - * country: The name of the GeoIP country data file. Defaults to - 'GeoIP.dat'; overrides the GEOIP_COUNTRY settings attribute. - - * city: The name of the GeoIP city data file. Defaults to - 'GeoLiteCity.dat'; overrides the GEOIP_CITY settings attribute. - """ - # Checking the given cache option. - if cache in self.cache_options: - self._cache = cache - else: - raise GeoIPException('Invalid GeoIP caching option: %s' % cache) - - # Getting the GeoIP data path. - if not path: - path = GEOIP_SETTINGS.get('GEOIP_PATH', None) - if not path: raise GeoIPException('GeoIP path must be provided via parameter or the GEOIP_PATH setting.') - if not isinstance(path, six.string_types): - raise TypeError('Invalid path type: %s' % type(path).__name__) - - if os.path.isdir(path): - # Constructing the GeoIP database filenames using the settings - # dictionary. If the database files for the GeoLite country - # and/or city datasets exist, then try and open them. - country_db = os.path.join(path, country or GEOIP_SETTINGS.get('GEOIP_COUNTRY', 'GeoIP.dat')) - if os.path.isfile(country_db): - self._country = GeoIP_open(force_bytes(country_db), cache) - self._country_file = country_db - - city_db = os.path.join(path, city or GEOIP_SETTINGS.get('GEOIP_CITY', 'GeoLiteCity.dat')) - if os.path.isfile(city_db): - self._city = GeoIP_open(force_bytes(city_db), cache) - self._city_file = city_db - elif os.path.isfile(path): - # Otherwise, some detective work will be needed to figure - # out whether the given database path is for the GeoIP country - # or city databases. - ptr = GeoIP_open(force_bytes(path), cache) - info = GeoIP_database_info(ptr) - if lite_regex.match(info): - # GeoLite City database detected. - self._city = ptr - self._city_file = path - elif free_regex.match(info): - # GeoIP Country database detected. - self._country = ptr - self._country_file = path - else: - raise GeoIPException('Unable to recognize database edition: %s' % info) - else: - raise GeoIPException('GeoIP path must be a valid file or directory.') - - def __del__(self): - # Cleaning any GeoIP file handles lying around. - if GeoIP_delete is None: - return - if self._country: GeoIP_delete(self._country) - if self._city: GeoIP_delete(self._city) - - def _check_query(self, query, country=False, city=False, city_or_country=False): - "Helper routine for checking the query and database availability." - # Making sure a string was passed in for the query. - if not isinstance(query, six.string_types): - raise TypeError('GeoIP query must be a string, not type %s' % type(query).__name__) - - # Extra checks for the existence of country and city databases. - if city_or_country and not (self._country or self._city): - raise GeoIPException('Invalid GeoIP country and city data files.') - elif country and not self._country: - raise GeoIPException('Invalid GeoIP country data file: %s' % self._country_file) - elif city and not self._city: - raise GeoIPException('Invalid GeoIP city data file: %s' % self._city_file) - - # Return the query string back to the caller. GeoIP only takes bytestrings. - return force_bytes(query) - - def city(self, query): - """ - Returns a dictionary of city information for the given IP address or - Fully Qualified Domain Name (FQDN). Some information in the dictionary - may be undefined (None). - """ - enc_query = self._check_query(query, city=True) - if ipv4_re.match(query): - # If an IP address was passed in - return GeoIP_record_by_addr(self._city, c_char_p(enc_query)) - else: - # If a FQDN was passed in. - return GeoIP_record_by_name(self._city, c_char_p(enc_query)) - - def country_code(self, query): - "Returns the country code for the given IP Address or FQDN." - enc_query = self._check_query(query, city_or_country=True) - if self._country: - if ipv4_re.match(query): - return GeoIP_country_code_by_addr(self._country, enc_query) - else: - return GeoIP_country_code_by_name(self._country, enc_query) - else: - return self.city(query)['country_code'] - - def country_name(self, query): - "Returns the country name for the given IP Address or FQDN." - enc_query = self._check_query(query, city_or_country=True) - if self._country: - if ipv4_re.match(query): - return GeoIP_country_name_by_addr(self._country, enc_query) - else: - return GeoIP_country_name_by_name(self._country, enc_query) - else: - return self.city(query)['country_name'] - - def country(self, query): - """ - Returns a dictonary with with the country code and name when given an - IP address or a Fully Qualified Domain Name (FQDN). For example, both - '24.124.1.80' and 'djangoproject.com' are valid parameters. - """ - # Returning the country code and name - return {'country_code' : self.country_code(query), - 'country_name' : self.country_name(query), - } - - #### Coordinate retrieval routines #### - def coords(self, query, ordering=('longitude', 'latitude')): - cdict = self.city(query) - if cdict is None: return None - else: return tuple(cdict[o] for o in ordering) - - def lon_lat(self, query): - "Returns a tuple of the (longitude, latitude) for the given query." - return self.coords(query) - - def lat_lon(self, query): - "Returns a tuple of the (latitude, longitude) for the given query." - return self.coords(query, ('latitude', 'longitude')) - - def geos(self, query): - "Returns a GEOS Point object for the given query." - ll = self.lon_lat(query) - if ll: - from django.contrib.gis.geos import Point - return Point(ll, srid=4326) - else: - return None - - #### GeoIP Database Information Routines #### - @property - def country_info(self): - "Returns information about the GeoIP country database." - if self._country is None: - ci = 'No GeoIP Country data in "%s"' % self._country_file - else: - ci = GeoIP_database_info(self._country) - return ci - - @property - def city_info(self): - "Retuns information about the GeoIP city database." - if self._city is None: - ci = 'No GeoIP City data in "%s"' % self._city_file - else: - ci = GeoIP_database_info(self._city) - return ci - - @property - def info(self): - "Returns information about the GeoIP library and databases in use." - info = '' - if GeoIP_lib_version: - info += 'GeoIP Library:\n\t%s\n' % GeoIP_lib_version() - return info + 'Country:\n\t%s\nCity:\n\t%s' % (self.country_info, self.city_info) - - #### Methods for compatibility w/the GeoIP-Python API. #### - @classmethod - def open(cls, full_path, cache): - return GeoIP(full_path, cache) - - def _rec_by_arg(self, arg): - if self._city: - return self.city(arg) - else: - return self.country(arg) - region_by_addr = city - region_by_name = city - record_by_addr = _rec_by_arg - record_by_name = _rec_by_arg - country_code_by_addr = country_code - country_code_by_name = country_code - country_name_by_addr = country_name - country_name_by_name = country_name diff --git a/lib/python2.7/site-packages/django/contrib/gis/geoip/libgeoip.py b/lib/python2.7/site-packages/django/contrib/gis/geoip/libgeoip.py deleted file mode 100644 index e9e7cd7..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geoip/libgeoip.py +++ /dev/null @@ -1,31 +0,0 @@ -import os -from ctypes import CDLL -from ctypes.util import find_library -from django.conf import settings - -# Creating the settings dictionary with any settings, if needed. -GEOIP_SETTINGS = dict((key, getattr(settings, key)) - for key in ('GEOIP_PATH', 'GEOIP_LIBRARY_PATH', 'GEOIP_COUNTRY', 'GEOIP_CITY') - if hasattr(settings, key)) -lib_path = GEOIP_SETTINGS.get('GEOIP_LIBRARY_PATH', None) - -# The shared library for the GeoIP C API. May be downloaded -# from http://www.maxmind.com/download/geoip/api/c/ -if lib_path: - lib_name = None -else: - # TODO: Is this really the library name for Windows? - lib_name = 'GeoIP' - -# Getting the path to the GeoIP library. -if lib_name: lib_path = find_library(lib_name) -if lib_path is None: raise RuntimeError('Could not find the GeoIP library (tried "%s"). ' - 'Try setting GEOIP_LIBRARY_PATH in your settings.' % lib_name) -lgeoip = CDLL(lib_path) - -# Getting the C `free` for the platform. -if os.name == 'nt': - libc = CDLL('msvcrt') -else: - libc = CDLL(None) -free = libc.free diff --git a/lib/python2.7/site-packages/django/contrib/gis/geoip/prototypes.py b/lib/python2.7/site-packages/django/contrib/gis/geoip/prototypes.py deleted file mode 100644 index a5db5e7..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geoip/prototypes.py +++ /dev/null @@ -1,115 +0,0 @@ -from ctypes import c_char_p, c_float, c_int, string_at, Structure, POINTER -from django.contrib.gis.geoip.libgeoip import lgeoip, free - -#### GeoIP C Structure definitions #### - -class GeoIPRecord(Structure): - _fields_ = [('country_code', c_char_p), - ('country_code3', c_char_p), - ('country_name', c_char_p), - ('region', c_char_p), - ('city', c_char_p), - ('postal_code', c_char_p), - ('latitude', c_float), - ('longitude', c_float), - # TODO: In 1.4.6 this changed from `int dma_code;` to - # `union {int metro_code; int dma_code;};`. Change - # to a `ctypes.Union` in to accomodate in future when - # pre-1.4.6 versions are no longer distributed. - ('dma_code', c_int), - ('area_code', c_int), - ('charset', c_int), - ('continent_code', c_char_p), - ] -geoip_char_fields = [name for name, ctype in GeoIPRecord._fields_ if ctype is c_char_p] -GEOIP_DEFAULT_ENCODING = 'iso-8859-1' -geoip_encodings = { 0: 'iso-8859-1', - 1: 'utf8', - } - -class GeoIPTag(Structure): pass - -RECTYPE = POINTER(GeoIPRecord) -DBTYPE = POINTER(GeoIPTag) - -#### ctypes function prototypes #### - -# GeoIP_lib_version appeared in version 1.4.7. -if hasattr(lgeoip, 'GeoIP_lib_version'): - GeoIP_lib_version = lgeoip.GeoIP_lib_version - GeoIP_lib_version.argtypes = None - GeoIP_lib_version.restype = c_char_p -else: - GeoIP_lib_version = None - -# For freeing memory allocated within a record -GeoIPRecord_delete = lgeoip.GeoIPRecord_delete -GeoIPRecord_delete.argtypes = [RECTYPE] -GeoIPRecord_delete.restype = None - -# For retrieving records by name or address. -def check_record(result, func, cargs): - if bool(result): - # Checking the pointer to the C structure, if valid pull out elements - # into a dicionary. - rec = result.contents - record = dict((fld, getattr(rec, fld)) for fld, ctype in rec._fields_) - - # Now converting the strings to unicode using the proper encoding. - encoding = geoip_encodings[record['charset']] - for char_field in geoip_char_fields: - if record[char_field]: - record[char_field] = record[char_field].decode(encoding) - - # Free the memory allocated for the struct & return. - GeoIPRecord_delete(result) - return record - else: - return None - -def record_output(func): - func.argtypes = [DBTYPE, c_char_p] - func.restype = RECTYPE - func.errcheck = check_record - return func -GeoIP_record_by_addr = record_output(lgeoip.GeoIP_record_by_addr) -GeoIP_record_by_name = record_output(lgeoip.GeoIP_record_by_name) - - -# For opening & closing GeoIP database files. -GeoIP_open = lgeoip.GeoIP_open -GeoIP_open.restype = DBTYPE -GeoIP_delete = lgeoip.GeoIP_delete -GeoIP_delete.argtypes = [DBTYPE] -GeoIP_delete.restype = None - -# This is so the string pointer can be freed within Python. -class geoip_char_p(c_char_p): - pass - -def check_string(result, func, cargs): - if result: - s = string_at(result) - free(result) - else: - s = '' - return s.decode(GEOIP_DEFAULT_ENCODING) - -GeoIP_database_info = lgeoip.GeoIP_database_info -GeoIP_database_info.restype = geoip_char_p -GeoIP_database_info.errcheck = check_string - -# String output routines. -def string_output(func): - def _err_check(result, func, cargs): - if result: - return result.decode(GEOIP_DEFAULT_ENCODING) - return result - func.restype = c_char_p - func.errcheck = _err_check - return func - -GeoIP_country_code_by_addr = string_output(lgeoip.GeoIP_country_code_by_addr) -GeoIP_country_code_by_name = string_output(lgeoip.GeoIP_country_code_by_name) -GeoIP_country_name_by_addr = string_output(lgeoip.GeoIP_country_name_by_addr) -GeoIP_country_name_by_name = string_output(lgeoip.GeoIP_country_name_by_name) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geoip/tests.py b/lib/python2.7/site-packages/django/contrib/gis/geoip/tests.py deleted file mode 100644 index 0a99a97..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geoip/tests.py +++ /dev/null @@ -1,122 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import os -from django.conf import settings -from django.contrib.gis.geos import HAS_GEOS -from django.contrib.gis.geoip import HAS_GEOIP -from django.utils import unittest -from django.utils.unittest import skipUnless - -from django.utils import six - -if HAS_GEOIP: - from . import GeoIP, GeoIPException - -if HAS_GEOS: - from ..geos import GEOSGeometry - - -# Note: Requires use of both the GeoIP country and city datasets. -# The GEOIP_DATA path should be the only setting set (the directory -# should contain links or the actual database files 'GeoIP.dat' and -# 'GeoLiteCity.dat'. - - -@skipUnless(HAS_GEOIP and getattr(settings, "GEOIP_PATH", None), - "GeoIP is required along with the GEOIP_PATH setting.") -class GeoIPTest(unittest.TestCase): - - def test01_init(self): - "Testing GeoIP initialization." - g1 = GeoIP() # Everything inferred from GeoIP path - path = settings.GEOIP_PATH - g2 = GeoIP(path, 0) # Passing in data path explicitly. - g3 = GeoIP.open(path, 0) # MaxMind Python API syntax. - - for g in (g1, g2, g3): - self.assertEqual(True, bool(g._country)) - self.assertEqual(True, bool(g._city)) - - # Only passing in the location of one database. - city = os.path.join(path, 'GeoLiteCity.dat') - cntry = os.path.join(path, 'GeoIP.dat') - g4 = GeoIP(city, country='') - self.assertEqual(None, g4._country) - g5 = GeoIP(cntry, city='') - self.assertEqual(None, g5._city) - - # Improper parameters. - bad_params = (23, 'foo', 15.23) - for bad in bad_params: - self.assertRaises(GeoIPException, GeoIP, cache=bad) - if isinstance(bad, six.string_types): - e = GeoIPException - else: - e = TypeError - self.assertRaises(e, GeoIP, bad, 0) - - def test02_bad_query(self): - "Testing GeoIP query parameter checking." - cntry_g = GeoIP(city='') - # No city database available, these calls should fail. - self.assertRaises(GeoIPException, cntry_g.city, 'google.com') - self.assertRaises(GeoIPException, cntry_g.coords, 'yahoo.com') - - # Non-string query should raise TypeError - self.assertRaises(TypeError, cntry_g.country_code, 17) - self.assertRaises(TypeError, cntry_g.country_name, GeoIP) - - def test03_country(self): - "Testing GeoIP country querying methods." - g = GeoIP(city='') - - fqdn = 'www.google.com' - addr = '12.215.42.19' - - for query in (fqdn, addr): - for func in (g.country_code, g.country_code_by_addr, g.country_code_by_name): - self.assertEqual('US', func(query)) - for func in (g.country_name, g.country_name_by_addr, g.country_name_by_name): - self.assertEqual('United States', func(query)) - self.assertEqual({'country_code' : 'US', 'country_name' : 'United States'}, - g.country(query)) - - @skipUnless(HAS_GEOS, "Geos is required") - def test04_city(self): - "Testing GeoIP city querying methods." - g = GeoIP(country='') - - addr = '128.249.1.1' - fqdn = 'tmc.edu' - for query in (fqdn, addr): - # Country queries should still work. - for func in (g.country_code, g.country_code_by_addr, g.country_code_by_name): - self.assertEqual('US', func(query)) - for func in (g.country_name, g.country_name_by_addr, g.country_name_by_name): - self.assertEqual('United States', func(query)) - self.assertEqual({'country_code' : 'US', 'country_name' : 'United States'}, - g.country(query)) - - # City information dictionary. - d = g.city(query) - self.assertEqual('USA', d['country_code3']) - self.assertEqual('Houston', d['city']) - self.assertEqual('TX', d['region']) - self.assertEqual(713, d['area_code']) - geom = g.geos(query) - self.assertTrue(isinstance(geom, GEOSGeometry)) - lon, lat = (-95.4010, 29.7079) - lat_lon = g.lat_lon(query) - lat_lon = (lat_lon[1], lat_lon[0]) - for tup in (geom.tuple, g.coords(query), g.lon_lat(query), lat_lon): - self.assertAlmostEqual(lon, tup[0], 4) - self.assertAlmostEqual(lat, tup[1], 4) - - def test05_unicode_response(self): - "Testing that GeoIP strings are properly encoded, see #16553." - g = GeoIP() - d = g.city("www.osnabrueck.de") - self.assertEqual('Osnabrück', d['city']) - d = g.country('200.7.49.81') - self.assertEqual('Curaçao', d['country_name']) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geometry/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/geometry/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/__init__.py deleted file mode 100644 index 52fa0de..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -from django.conf import settings -from django.core.exceptions import ImproperlyConfigured -from django.utils.importlib import import_module - -geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos') - -try: - module = import_module('django.contrib.gis.geometry.backend.%s' % geom_backend) -except ImportError: - try: - module = import_module(geom_backend) - except ImportError: - raise ImproperlyConfigured('Could not import user-defined GEOMETRY_BACKEND ' - '"%s".' % geom_backend) - -try: - Geometry = module.Geometry - GeometryException = module.GeometryException -except AttributeError: - raise ImproperlyConfigured('Cannot import Geometry from the "%s" ' - 'geometry backend.' % geom_backend) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/geos.py b/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/geos.py deleted file mode 100644 index cdc40ed..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/geos.py +++ /dev/null @@ -1,2 +0,0 @@ -from django.contrib.gis.geos import ( - GEOSGeometry as Geometry, GEOSException as GeometryException) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geometry/regex.py b/lib/python2.7/site-packages/django/contrib/gis/geometry/regex.py deleted file mode 100644 index 22d16cb..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geometry/regex.py +++ /dev/null @@ -1,12 +0,0 @@ -import re - -# Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure -# to prevent potentially malicious input from reaching the underlying C -# library. Not a substitute for good Web security programming practices. -hex_regex = re.compile(r'^[0-9A-F]+$', re.I) -wkt_regex = re.compile(r'^(SRID=(?P\-?\d+);)?' - r'(?P' - r'(?PPOINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)' - r'[ACEGIMLONPSRUTYZ\d,\.\-\(\) ]+)$', - re.I) -json_regex = re.compile(r'^(\s+)?\{[\s\w,\[\]\{\}\-\."\':]+\}(\s+)?$') diff --git a/lib/python2.7/site-packages/django/contrib/gis/geometry/test_data.py b/lib/python2.7/site-packages/django/contrib/gis/geometry/test_data.py deleted file mode 100644 index e13e858..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geometry/test_data.py +++ /dev/null @@ -1,106 +0,0 @@ -""" -This module has the mock object definitions used to hold reference geometry -for the GEOS and GDAL tests. -""" -import json -import os - -from django.contrib import gis -from django.utils import six -from django.utils._os import upath - - -# This global used to store reference geometry data. -GEOMETRIES = None - -# Path where reference test data is located. -TEST_DATA = os.path.join(os.path.dirname(upath(gis.__file__)), 'tests', 'data') - - -def tuplize(seq): - "Turn all nested sequences to tuples in given sequence." - if isinstance(seq, (list, tuple)): - return tuple([tuplize(i) for i in seq]) - return seq - - -def strconvert(d): - "Converts all keys in dictionary to str type." - return dict([(str(k), v) for k, v in six.iteritems(d)]) - - -def get_ds_file(name, ext): - return os.path.join(TEST_DATA, - name, - name + '.%s' % ext - ) - - -class TestObj(object): - """ - Base testing object, turns keyword args into attributes. - """ - def __init__(self, **kwargs): - for key, value in kwargs.items(): - setattr(self, key, value) - - -class TestDS(TestObj): - """ - Object for testing GDAL data sources. - """ - def __init__(self, name, **kwargs): - # Shapefile is default extension, unless specified otherwise. - ext = kwargs.pop('ext', 'shp') - self.ds = get_ds_file(name, ext) - super(TestDS, self).__init__(**kwargs) - - -class TestGeom(TestObj): - """ - Testing object used for wrapping reference geometry data - in GEOS/GDAL tests. - """ - def __init__(self, **kwargs): - # Converting lists to tuples of certain keyword args - # so coordinate test cases will match (JSON has no - # concept of tuple). - coords = kwargs.pop('coords', None) - if coords: - self.coords = tuplize(coords) - - centroid = kwargs.pop('centroid', None) - if centroid: - self.centroid = tuple(centroid) - - ext_ring_cs = kwargs.pop('ext_ring_cs', None) - if ext_ring_cs: - ext_ring_cs = tuplize(ext_ring_cs) - self.ext_ring_cs = ext_ring_cs - - super(TestGeom, self).__init__(**kwargs) - - -class TestGeomSet(object): - """ - Each attribute of this object is a list of `TestGeom` instances. - """ - def __init__(self, **kwargs): - for key, value in kwargs.items(): - setattr(self, key, [TestGeom(**strconvert(kw)) for kw in value]) - - -class TestDataMixin(object): - """ - Mixin used for GEOS/GDAL test cases that defines a `geometries` - property, which returns and/or loads the reference geometry data. - """ - @property - def geometries(self): - global GEOMETRIES - if GEOMETRIES is None: - # Load up the test geometry data from fixture into global. - with open(os.path.join(TEST_DATA, 'geometries.json')) as f: - geometries = json.load(f) - GEOMETRIES = TestGeomSet(**strconvert(geometries)) - return GEOMETRIES diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/geos/__init__.py deleted file mode 100644 index 945f561..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -""" -The GeoDjango GEOS module. Please consult the GeoDjango documentation -for more details: - http://geodjango.org/docs/geos.html -""" -try: - from .libgeos import geos_version, geos_version_info, GEOS_PREPARE - HAS_GEOS = True -except ImportError: - HAS_GEOS = False - -if HAS_GEOS: - from .geometry import GEOSGeometry, wkt_regex, hex_regex - from .point import Point - from .linestring import LineString, LinearRing - from .polygon import Polygon - from .collections import GeometryCollection, MultiPoint, MultiLineString, MultiPolygon - from .error import GEOSException, GEOSIndexError - from .io import WKTReader, WKTWriter, WKBReader, WKBWriter - from .factory import fromfile, fromstr diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/base.py b/lib/python2.7/site-packages/django/contrib/gis/geos/base.py deleted file mode 100644 index fd2693e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/base.py +++ /dev/null @@ -1,51 +0,0 @@ -from ctypes import c_void_p - -from django.contrib.gis.geos.error import GEOSException - -# Trying to import GDAL libraries, if available. Have to place in -# try/except since this package may be used outside GeoDjango. -try: - from django.contrib.gis import gdal -except ImportError: - # A 'dummy' gdal module. - class GDALInfo(object): - HAS_GDAL = False - gdal = GDALInfo() - -# NumPy supported? -try: - import numpy -except ImportError: - numpy = False - -class GEOSBase(object): - """ - Base object for GEOS objects that has a pointer access property - that controls access to the underlying C pointer. - """ - # Initially the pointer is NULL. - _ptr = None - - # Default allowed pointer type. - ptr_type = c_void_p - - # Pointer access property. - def _get_ptr(self): - # Raise an exception if the pointer isn't valid don't - # want to be passing NULL pointers to routines -- - # that's very bad. - if self._ptr: return self._ptr - else: raise GEOSException('NULL GEOS %s pointer encountered.' % self.__class__.__name__) - - def _set_ptr(self, ptr): - # Only allow the pointer to be set with pointers of the - # compatible type or None (NULL). - if ptr is None or isinstance(ptr, self.ptr_type): - self._ptr = ptr - else: - raise TypeError('Incompatible pointer type') - - # Property for controlling access to the GEOS object pointers. Using - # this raises an exception when the pointer is NULL, thus preventing - # the C library from attempting to access an invalid memory location. - ptr = property(_get_ptr, _set_ptr) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/collections.py b/lib/python2.7/site-packages/django/contrib/gis/geos/collections.py deleted file mode 100644 index 2b62bce..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/collections.py +++ /dev/null @@ -1,124 +0,0 @@ -""" - This module houses the Geometry Collection objects: - GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon -""" -from ctypes import c_int, c_uint, byref -from django.contrib.gis.geos.error import GEOSException -from django.contrib.gis.geos.geometry import GEOSGeometry -from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOS_PREPARE -from django.contrib.gis.geos.linestring import LineString, LinearRing -from django.contrib.gis.geos.point import Point -from django.contrib.gis.geos.polygon import Polygon -from django.contrib.gis.geos import prototypes as capi -from django.utils.six.moves import xrange - -class GeometryCollection(GEOSGeometry): - _typeid = 7 - - def __init__(self, *args, **kwargs): - "Initializes a Geometry Collection from a sequence of Geometry objects." - - # Checking the arguments - if not args: - raise TypeError('Must provide at least one Geometry to initialize %s.' % self.__class__.__name__) - - if len(args) == 1: - # If only one geometry provided or a list of geometries is provided - # in the first argument. - if isinstance(args[0], (tuple, list)): - init_geoms = args[0] - else: - init_geoms = args - else: - init_geoms = args - - # Ensuring that only the permitted geometries are allowed in this collection - # this is moved to list mixin super class - self._check_allowed(init_geoms) - - # Creating the geometry pointer array. - collection = self._create_collection(len(init_geoms), iter(init_geoms)) - super(GeometryCollection, self).__init__(collection, **kwargs) - - def __iter__(self): - "Iterates over each Geometry in the Collection." - for i in xrange(len(self)): - yield self[i] - - def __len__(self): - "Returns the number of geometries in this Collection." - return self.num_geom - - ### Methods for compatibility with ListMixin ### - def _create_collection(self, length, items): - # Creating the geometry pointer array. - geoms = get_pointer_arr(length) - for i, g in enumerate(items): - # this is a little sloppy, but makes life easier - # allow GEOSGeometry types (python wrappers) or pointer types - geoms[i] = capi.geom_clone(getattr(g, 'ptr', g)) - - return capi.create_collection(c_int(self._typeid), byref(geoms), c_uint(length)) - - def _get_single_internal(self, index): - return capi.get_geomn(self.ptr, index) - - def _get_single_external(self, index): - "Returns the Geometry from this Collection at the given index (0-based)." - # Checking the index and returning the corresponding GEOS geometry. - return GEOSGeometry(capi.geom_clone(self._get_single_internal(index)), srid=self.srid) - - def _set_list(self, length, items): - "Create a new collection, and destroy the contents of the previous pointer." - prev_ptr = self.ptr - srid = self.srid - self.ptr = self._create_collection(length, items) - if srid: self.srid = srid - capi.destroy_geom(prev_ptr) - - _set_single = GEOSGeometry._set_single_rebuild - _assign_extended_slice = GEOSGeometry._assign_extended_slice_rebuild - - @property - def kml(self): - "Returns the KML for this Geometry Collection." - return '%s' % ''.join([g.kml for g in self]) - - @property - def tuple(self): - "Returns a tuple of all the coordinates in this Geometry Collection" - return tuple([g.tuple for g in self]) - coords = tuple - -# MultiPoint, MultiLineString, and MultiPolygon class definitions. -class MultiPoint(GeometryCollection): - _allowed = Point - _typeid = 4 - -class MultiLineString(GeometryCollection): - _allowed = (LineString, LinearRing) - _typeid = 5 - - @property - def merged(self): - """ - Returns a LineString representing the line merge of this - MultiLineString. - """ - return self._topology(capi.geos_linemerge(self.ptr)) - -class MultiPolygon(GeometryCollection): - _allowed = Polygon - _typeid = 6 - - @property - def cascaded_union(self): - "Returns a cascaded union of this MultiPolygon." - if GEOS_PREPARE: - return GEOSGeometry(capi.geos_cascaded_union(self.ptr), self.srid) - else: - raise GEOSException('The cascaded union operation requires GEOS 3.1+.') - -# Setting the allowed types here since GeometryCollection is defined before -# its subclasses. -GeometryCollection._allowed = (Point, LineString, LinearRing, Polygon, MultiPoint, MultiLineString, MultiPolygon) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/coordseq.py b/lib/python2.7/site-packages/django/contrib/gis/geos/coordseq.py deleted file mode 100644 index acf34f7..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/coordseq.py +++ /dev/null @@ -1,157 +0,0 @@ -""" - This module houses the GEOSCoordSeq object, which is used internally - by GEOSGeometry to house the actual coordinates of the Point, - LineString, and LinearRing geometries. -""" -from ctypes import c_double, c_uint, byref -from django.contrib.gis.geos.base import GEOSBase, numpy -from django.contrib.gis.geos.error import GEOSException, GEOSIndexError -from django.contrib.gis.geos.libgeos import CS_PTR -from django.contrib.gis.geos import prototypes as capi -from django.utils.six.moves import xrange - -class GEOSCoordSeq(GEOSBase): - "The internal representation of a list of coordinates inside a Geometry." - - ptr_type = CS_PTR - - #### Python 'magic' routines #### - def __init__(self, ptr, z=False): - "Initializes from a GEOS pointer." - if not isinstance(ptr, CS_PTR): - raise TypeError('Coordinate sequence should initialize with a CS_PTR.') - self._ptr = ptr - self._z = z - - def __iter__(self): - "Iterates over each point in the coordinate sequence." - for i in xrange(self.size): - yield self[i] - - def __len__(self): - "Returns the number of points in the coordinate sequence." - return int(self.size) - - def __str__(self): - "Returns the string representation of the coordinate sequence." - return str(self.tuple) - - def __getitem__(self, index): - "Returns the coordinate sequence value at the given index." - coords = [self.getX(index), self.getY(index)] - if self.dims == 3 and self._z: - coords.append(self.getZ(index)) - return tuple(coords) - - def __setitem__(self, index, value): - "Sets the coordinate sequence value at the given index." - # Checking the input value - if isinstance(value, (list, tuple)): - pass - elif numpy and isinstance(value, numpy.ndarray): - pass - else: - raise TypeError('Must set coordinate with a sequence (list, tuple, or numpy array).') - # Checking the dims of the input - if self.dims == 3 and self._z: - n_args = 3 - set_3d = True - else: - n_args = 2 - set_3d = False - if len(value) != n_args: - raise TypeError('Dimension of value does not match.') - # Setting the X, Y, Z - self.setX(index, value[0]) - self.setY(index, value[1]) - if set_3d: self.setZ(index, value[2]) - - #### Internal Routines #### - def _checkindex(self, index): - "Checks the given index." - sz = self.size - if (sz < 1) or (index < 0) or (index >= sz): - raise GEOSIndexError('invalid GEOS Geometry index: %s' % str(index)) - - def _checkdim(self, dim): - "Checks the given dimension." - if dim < 0 or dim > 2: - raise GEOSException('invalid ordinate dimension "%d"' % dim) - - #### Ordinate getting and setting routines #### - def getOrdinate(self, dimension, index): - "Returns the value for the given dimension and index." - self._checkindex(index) - self._checkdim(dimension) - return capi.cs_getordinate(self.ptr, index, dimension, byref(c_double())) - - def setOrdinate(self, dimension, index, value): - "Sets the value for the given dimension and index." - self._checkindex(index) - self._checkdim(dimension) - capi.cs_setordinate(self.ptr, index, dimension, value) - - def getX(self, index): - "Get the X value at the index." - return self.getOrdinate(0, index) - - def setX(self, index, value): - "Set X with the value at the given index." - self.setOrdinate(0, index, value) - - def getY(self, index): - "Get the Y value at the given index." - return self.getOrdinate(1, index) - - def setY(self, index, value): - "Set Y with the value at the given index." - self.setOrdinate(1, index, value) - - def getZ(self, index): - "Get Z with the value at the given index." - return self.getOrdinate(2, index) - - def setZ(self, index, value): - "Set Z with the value at the given index." - self.setOrdinate(2, index, value) - - ### Dimensions ### - @property - def size(self): - "Returns the size of this coordinate sequence." - return capi.cs_getsize(self.ptr, byref(c_uint())) - - @property - def dims(self): - "Returns the dimensions of this coordinate sequence." - return capi.cs_getdims(self.ptr, byref(c_uint())) - - @property - def hasz(self): - """ - Returns whether this coordinate sequence is 3D. This property value is - inherited from the parent Geometry. - """ - return self._z - - ### Other Methods ### - def clone(self): - "Clones this coordinate sequence." - return GEOSCoordSeq(capi.cs_clone(self.ptr), self.hasz) - - @property - def kml(self): - "Returns the KML representation for the coordinates." - # Getting the substitution string depending on whether the coordinates have - # a Z dimension. - if self.hasz: substr = '%s,%s,%s ' - else: substr = '%s,%s,0 ' - return '%s' % \ - ''.join([substr % self[i] for i in xrange(len(self))]).strip() - - @property - def tuple(self): - "Returns a tuple version of this coordinate sequence." - n = self.size - if n == 1: return self[0] - else: return tuple([self[i] for i in xrange(n)]) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/error.py b/lib/python2.7/site-packages/django/contrib/gis/geos/error.py deleted file mode 100644 index 46bdfe6..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/error.py +++ /dev/null @@ -1,20 +0,0 @@ -""" - This module houses the GEOS exceptions, specifically, GEOSException and - GEOSGeometryIndexError. -""" - -class GEOSException(Exception): - "The base GEOS exception, indicates a GEOS-related error." - pass - -class GEOSIndexError(GEOSException, KeyError): - """ - This exception is raised when an invalid index is encountered, and has - the 'silent_variable_feature' attribute set to true. This ensures that - django's templates proceed to use the next lookup type gracefully when - an Exception is raised. Fixes ticket #4740. - """ - # "If, during the method lookup, a method raises an exception, the exception - # will be propagated, unless the exception has an attribute - # `silent_variable_failure` whose value is True." -- Django template docs. - silent_variable_failure = True diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/factory.py b/lib/python2.7/site-packages/django/contrib/gis/geos/factory.py deleted file mode 100644 index 2e5fa4f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/factory.py +++ /dev/null @@ -1,35 +0,0 @@ -from django.contrib.gis import memoryview -from django.contrib.gis.geos.geometry import GEOSGeometry, wkt_regex, hex_regex - -from django.utils import six - - -def fromfile(file_h): - """ - Given a string file name, returns a GEOSGeometry. The file may contain WKB, - WKT, or HEX. - """ - # If given a file name, get a real handle. - if isinstance(file_h, six.string_types): - with open(file_h, 'rb') as file_h: - buf = file_h.read() - else: - buf = file_h.read() - - # If we get WKB need to wrap in memoryview(), so run through regexes. - if isinstance(buf, bytes): - try: - decoded = buf.decode() - if wkt_regex.match(decoded) or hex_regex.match(decoded): - return GEOSGeometry(decoded) - except UnicodeDecodeError: - pass - else: - return GEOSGeometry(buf) - - return GEOSGeometry(memoryview(buf)) - - -def fromstr(string, **kwargs): - "Given a string value, returns a GEOSGeometry object." - return GEOSGeometry(string, **kwargs) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py b/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py deleted file mode 100644 index b088ec2..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py +++ /dev/null @@ -1,715 +0,0 @@ -""" - This module contains the 'base' GEOSGeometry object -- all GEOS Geometries - inherit from this object. -""" -from __future__ import unicode_literals - -# Python, ctypes and types dependencies. -from ctypes import addressof, byref, c_double - -from django.contrib.gis import memoryview -# super-class for mutable list behavior -from django.contrib.gis.geos.mutable_list import ListMixin - -from django.contrib.gis.gdal.error import SRSException - -# GEOS-related dependencies. -from django.contrib.gis.geos.base import GEOSBase, gdal -from django.contrib.gis.geos.coordseq import GEOSCoordSeq -from django.contrib.gis.geos.error import GEOSException, GEOSIndexError -from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOS_PREPARE -from django.contrib.gis.geos.mutable_list import ListMixin - -# All other functions in this module come from the ctypes -# prototypes module -- which handles all interaction with -# the underlying GEOS library. -from django.contrib.gis.geos import prototypes as capi - -# These functions provide access to a thread-local instance -# of their corresponding GEOS I/O class. -from django.contrib.gis.geos.prototypes.io import wkt_r, wkt_w, wkb_r, wkb_w, ewkb_w - -# For recognizing geometry input. -from django.contrib.gis.geometry.regex import hex_regex, wkt_regex, json_regex - -from django.utils import six -from django.utils.encoding import force_bytes, force_text - - -class GEOSGeometry(GEOSBase, ListMixin): - "A class that, generally, encapsulates a GEOS geometry." - - # Raise GEOSIndexError instead of plain IndexError - # (see ticket #4740 and GEOSIndexError docstring) - _IndexError = GEOSIndexError - - ptr_type = GEOM_PTR - - #### Python 'magic' routines #### - def __init__(self, geo_input, srid=None): - """ - The base constructor for GEOS geometry objects, and may take the - following inputs: - - * strings: - - WKT - - HEXEWKB (a PostGIS-specific canonical form) - - GeoJSON (requires GDAL) - * buffer: - - WKB - - The `srid` keyword is used to specify the Source Reference Identifier - (SRID) number for this Geometry. If not set, the SRID will be None. - """ - if isinstance(geo_input, bytes): - geo_input = force_text(geo_input) - if isinstance(geo_input, six.string_types): - wkt_m = wkt_regex.match(geo_input) - if wkt_m: - # Handling WKT input. - if wkt_m.group('srid'): srid = int(wkt_m.group('srid')) - g = wkt_r().read(force_bytes(wkt_m.group('wkt'))) - elif hex_regex.match(geo_input): - # Handling HEXEWKB input. - g = wkb_r().read(force_bytes(geo_input)) - elif gdal.HAS_GDAL and json_regex.match(geo_input): - # Handling GeoJSON input. - g = wkb_r().read(gdal.OGRGeometry(geo_input).wkb) - else: - raise ValueError('String or unicode input unrecognized as WKT EWKT, and HEXEWKB.') - elif isinstance(geo_input, GEOM_PTR): - # When the input is a pointer to a geomtry (GEOM_PTR). - g = geo_input - elif isinstance(geo_input, memoryview): - # When the input is a buffer (WKB). - g = wkb_r().read(geo_input) - elif isinstance(geo_input, GEOSGeometry): - g = capi.geom_clone(geo_input.ptr) - else: - # Invalid geometry type. - raise TypeError('Improper geometry input type: %s' % str(type(geo_input))) - - if bool(g): - # Setting the pointer object with a valid pointer. - self.ptr = g - else: - raise GEOSException('Could not initialize GEOS Geometry with given input.') - - # Post-initialization setup. - self._post_init(srid) - - def _post_init(self, srid): - "Helper routine for performing post-initialization setup." - # Setting the SRID, if given. - if srid and isinstance(srid, int): self.srid = srid - - # Setting the class type (e.g., Point, Polygon, etc.) - self.__class__ = GEOS_CLASSES[self.geom_typeid] - - # Setting the coordinate sequence for the geometry (will be None on - # geometries that do not have coordinate sequences) - self._set_cs() - - def __del__(self): - """ - Destroys this Geometry; in other words, frees the memory used by the - GEOS C++ object. - """ - if self._ptr: capi.destroy_geom(self._ptr) - - def __copy__(self): - """ - Returns a clone because the copy of a GEOSGeometry may contain an - invalid pointer location if the original is garbage collected. - """ - return self.clone() - - def __deepcopy__(self, memodict): - """ - The `deepcopy` routine is used by the `Node` class of django.utils.tree; - thus, the protocol routine needs to be implemented to return correct - copies (clones) of these GEOS objects, which use C pointers. - """ - return self.clone() - - def __str__(self): - "WKT is used for the string representation." - return self.wkt - - def __repr__(self): - "Short-hand representation because WKT may be very large." - return '<%s object at %s>' % (self.geom_type, hex(addressof(self.ptr))) - - # Pickling support - def __getstate__(self): - # The pickled state is simply a tuple of the WKB (in string form) - # and the SRID. - return bytes(self.wkb), self.srid - - def __setstate__(self, state): - # Instantiating from the tuple state that was pickled. - wkb, srid = state - ptr = wkb_r().read(memoryview(wkb)) - if not ptr: raise GEOSException('Invalid Geometry loaded from pickled state.') - self.ptr = ptr - self._post_init(srid) - - # Comparison operators - def __eq__(self, other): - """ - Equivalence testing, a Geometry may be compared with another Geometry - or a WKT representation. - """ - if isinstance(other, six.string_types): - return self.wkt == other - elif isinstance(other, GEOSGeometry): - return self.equals_exact(other) - else: - return False - - def __ne__(self, other): - "The not equals operator." - return not (self == other) - - ### Geometry set-like operations ### - # Thanks to Sean Gillies for inspiration: - # http://lists.gispython.org/pipermail/community/2007-July/001034.html - # g = g1 | g2 - def __or__(self, other): - "Returns the union of this Geometry and the other." - return self.union(other) - - # g = g1 & g2 - def __and__(self, other): - "Returns the intersection of this Geometry and the other." - return self.intersection(other) - - # g = g1 - g2 - def __sub__(self, other): - "Return the difference this Geometry and the other." - return self.difference(other) - - # g = g1 ^ g2 - def __xor__(self, other): - "Return the symmetric difference of this Geometry and the other." - return self.sym_difference(other) - - #### Coordinate Sequence Routines #### - @property - def has_cs(self): - "Returns True if this Geometry has a coordinate sequence, False if not." - # Only these geometries are allowed to have coordinate sequences. - if isinstance(self, (Point, LineString, LinearRing)): - return True - else: - return False - - def _set_cs(self): - "Sets the coordinate sequence for this Geometry." - if self.has_cs: - self._cs = GEOSCoordSeq(capi.get_cs(self.ptr), self.hasz) - else: - self._cs = None - - @property - def coord_seq(self): - "Returns a clone of the coordinate sequence for this Geometry." - if self.has_cs: - return self._cs.clone() - - #### Geometry Info #### - @property - def geom_type(self): - "Returns a string representing the Geometry type, e.g. 'Polygon'" - return capi.geos_type(self.ptr).decode() - - @property - def geom_typeid(self): - "Returns an integer representing the Geometry type." - return capi.geos_typeid(self.ptr) - - @property - def num_geom(self): - "Returns the number of geometries in the Geometry." - return capi.get_num_geoms(self.ptr) - - @property - def num_coords(self): - "Returns the number of coordinates in the Geometry." - return capi.get_num_coords(self.ptr) - - @property - def num_points(self): - "Returns the number points, or coordinates, in the Geometry." - return self.num_coords - - @property - def dims(self): - "Returns the dimension of this Geometry (0=point, 1=line, 2=surface)." - return capi.get_dims(self.ptr) - - def normalize(self): - "Converts this Geometry to normal form (or canonical form)." - return capi.geos_normalize(self.ptr) - - #### Unary predicates #### - @property - def empty(self): - """ - Returns a boolean indicating whether the set of points in this Geometry - are empty. - """ - return capi.geos_isempty(self.ptr) - - @property - def hasz(self): - "Returns whether the geometry has a 3D dimension." - return capi.geos_hasz(self.ptr) - - @property - def ring(self): - "Returns whether or not the geometry is a ring." - return capi.geos_isring(self.ptr) - - @property - def simple(self): - "Returns false if the Geometry not simple." - return capi.geos_issimple(self.ptr) - - @property - def valid(self): - "This property tests the validity of this Geometry." - return capi.geos_isvalid(self.ptr) - - @property - def valid_reason(self): - """ - Returns a string containing the reason for any invalidity. - """ - if not GEOS_PREPARE: - raise GEOSException('Upgrade GEOS to 3.1 to get validity reason.') - return capi.geos_isvalidreason(self.ptr).decode() - - #### Binary predicates. #### - def contains(self, other): - "Returns true if other.within(this) returns true." - return capi.geos_contains(self.ptr, other.ptr) - - def crosses(self, other): - """ - Returns true if the DE-9IM intersection matrix for the two Geometries - is T*T****** (for a point and a curve,a point and an area or a line and - an area) 0******** (for two curves). - """ - return capi.geos_crosses(self.ptr, other.ptr) - - def disjoint(self, other): - """ - Returns true if the DE-9IM intersection matrix for the two Geometries - is FF*FF****. - """ - return capi.geos_disjoint(self.ptr, other.ptr) - - def equals(self, other): - """ - Returns true if the DE-9IM intersection matrix for the two Geometries - is T*F**FFF*. - """ - return capi.geos_equals(self.ptr, other.ptr) - - def equals_exact(self, other, tolerance=0): - """ - Returns true if the two Geometries are exactly equal, up to a - specified tolerance. - """ - return capi.geos_equalsexact(self.ptr, other.ptr, float(tolerance)) - - def intersects(self, other): - "Returns true if disjoint returns false." - return capi.geos_intersects(self.ptr, other.ptr) - - def overlaps(self, other): - """ - Returns true if the DE-9IM intersection matrix for the two Geometries - is T*T***T** (for two points or two surfaces) 1*T***T** (for two curves). - """ - return capi.geos_overlaps(self.ptr, other.ptr) - - def relate_pattern(self, other, pattern): - """ - Returns true if the elements in the DE-9IM intersection matrix for the - two Geometries match the elements in pattern. - """ - if not isinstance(pattern, six.string_types) or len(pattern) > 9: - raise GEOSException('invalid intersection matrix pattern') - return capi.geos_relatepattern(self.ptr, other.ptr, force_bytes(pattern)) - - def touches(self, other): - """ - Returns true if the DE-9IM intersection matrix for the two Geometries - is FT*******, F**T***** or F***T****. - """ - return capi.geos_touches(self.ptr, other.ptr) - - def within(self, other): - """ - Returns true if the DE-9IM intersection matrix for the two Geometries - is T*F**F***. - """ - return capi.geos_within(self.ptr, other.ptr) - - #### SRID Routines #### - def get_srid(self): - "Gets the SRID for the geometry, returns None if no SRID is set." - s = capi.geos_get_srid(self.ptr) - if s == 0: return None - else: return s - - def set_srid(self, srid): - "Sets the SRID for the geometry." - capi.geos_set_srid(self.ptr, srid) - srid = property(get_srid, set_srid) - - #### Output Routines #### - @property - def ewkt(self): - """ - Returns the EWKT (WKT + SRID) of the Geometry. Note that Z values - are *not* included in this representation because GEOS does not yet - support serializing them. - """ - if self.get_srid(): return 'SRID=%s;%s' % (self.srid, self.wkt) - else: return self.wkt - - @property - def wkt(self): - "Returns the WKT (Well-Known Text) representation of this Geometry." - return wkt_w(3 if self.hasz else 2).write(self).decode() - - @property - def hex(self): - """ - Returns the WKB of this Geometry in hexadecimal form. Please note - that the SRID is not included in this representation because it is not - a part of the OGC specification (use the `hexewkb` property instead). - """ - # A possible faster, all-python, implementation: - # str(self.wkb).encode('hex') - return wkb_w(3 if self.hasz else 2).write_hex(self) - - @property - def hexewkb(self): - """ - Returns the EWKB of this Geometry in hexadecimal form. This is an - extension of the WKB specification that includes SRID value that are - a part of this geometry. - """ - if self.hasz and not GEOS_PREPARE: - # See: http://trac.osgeo.org/geos/ticket/216 - raise GEOSException('Upgrade GEOS to 3.1 to get valid 3D HEXEWKB.') - return ewkb_w(3 if self.hasz else 2).write_hex(self) - - @property - def json(self): - """ - Returns GeoJSON representation of this Geometry if GDAL is installed. - """ - if gdal.HAS_GDAL: - return self.ogr.json - else: - raise GEOSException('GeoJSON output only supported when GDAL is installed.') - geojson = json - - @property - def wkb(self): - """ - Returns the WKB (Well-Known Binary) representation of this Geometry - as a Python buffer. SRID and Z values are not included, use the - `ewkb` property instead. - """ - return wkb_w(3 if self.hasz else 2).write(self) - - @property - def ewkb(self): - """ - Return the EWKB representation of this Geometry as a Python buffer. - This is an extension of the WKB specification that includes any SRID - value that are a part of this geometry. - """ - if self.hasz and not GEOS_PREPARE: - # See: http://trac.osgeo.org/geos/ticket/216 - raise GEOSException('Upgrade GEOS to 3.1 to get valid 3D EWKB.') - return ewkb_w(3 if self.hasz else 2).write(self) - - @property - def kml(self): - "Returns the KML representation of this Geometry." - gtype = self.geom_type - return '<%s>%s' % (gtype, self.coord_seq.kml, gtype) - - @property - def prepared(self): - """ - Returns a PreparedGeometry corresponding to this geometry -- it is - optimized for the contains, intersects, and covers operations. - """ - if GEOS_PREPARE: - return PreparedGeometry(self) - else: - raise GEOSException('GEOS 3.1+ required for prepared geometry support.') - - #### GDAL-specific output routines #### - @property - def ogr(self): - "Returns the OGR Geometry for this Geometry." - if not gdal.HAS_GDAL: - raise GEOSException('GDAL required to convert to an OGRGeometry.') - if self.srid: - try: - return gdal.OGRGeometry(self.wkb, self.srid) - except SRSException: - pass - return gdal.OGRGeometry(self.wkb) - - @property - def srs(self): - "Returns the OSR SpatialReference for SRID of this Geometry." - if not gdal.HAS_GDAL: - raise GEOSException('GDAL required to return a SpatialReference object.') - if self.srid: - try: - return gdal.SpatialReference(self.srid) - except SRSException: - pass - return None - - @property - def crs(self): - "Alias for `srs` property." - return self.srs - - def transform(self, ct, clone=False): - """ - Requires GDAL. Transforms the geometry according to the given - transformation object, which may be an integer SRID, and WKT or - PROJ.4 string. By default, the geometry is transformed in-place and - nothing is returned. However if the `clone` keyword is set, then this - geometry will not be modified and a transformed clone will be returned - instead. - """ - srid = self.srid - - if ct == srid: - # short-circuit where source & dest SRIDs match - if clone: - return self.clone() - else: - return - - if (srid is None) or (srid < 0): - raise GEOSException("Calling transform() with no SRID set is not supported") - - if not gdal.HAS_GDAL: - raise GEOSException("GDAL library is not available to transform() geometry.") - - # Creating an OGR Geometry, which is then transformed. - g = self.ogr - g.transform(ct) - # Getting a new GEOS pointer - ptr = wkb_r().read(g.wkb) - if clone: - # User wants a cloned transformed geometry returned. - return GEOSGeometry(ptr, srid=g.srid) - if ptr: - # Reassigning pointer, and performing post-initialization setup - # again due to the reassignment. - capi.destroy_geom(self.ptr) - self.ptr = ptr - self._post_init(g.srid) - else: - raise GEOSException('Transformed WKB was invalid.') - - #### Topology Routines #### - def _topology(self, gptr): - "Helper routine to return Geometry from the given pointer." - return GEOSGeometry(gptr, srid=self.srid) - - @property - def boundary(self): - "Returns the boundary as a newly allocated Geometry object." - return self._topology(capi.geos_boundary(self.ptr)) - - def buffer(self, width, quadsegs=8): - """ - Returns a geometry that represents all points whose distance from this - Geometry is less than or equal to distance. Calculations are in the - Spatial Reference System of this Geometry. The optional third parameter sets - the number of segment used to approximate a quarter circle (defaults to 8). - (Text from PostGIS documentation at ch. 6.1.3) - """ - return self._topology(capi.geos_buffer(self.ptr, width, quadsegs)) - - @property - def centroid(self): - """ - The centroid is equal to the centroid of the set of component Geometries - of highest dimension (since the lower-dimension geometries contribute zero - "weight" to the centroid). - """ - return self._topology(capi.geos_centroid(self.ptr)) - - @property - def convex_hull(self): - """ - Returns the smallest convex Polygon that contains all the points - in the Geometry. - """ - return self._topology(capi.geos_convexhull(self.ptr)) - - def difference(self, other): - """ - Returns a Geometry representing the points making up this Geometry - that do not make up other. - """ - return self._topology(capi.geos_difference(self.ptr, other.ptr)) - - @property - def envelope(self): - "Return the envelope for this geometry (a polygon)." - return self._topology(capi.geos_envelope(self.ptr)) - - def interpolate(self, distance): - if not isinstance(self, (LineString, MultiLineString)): - raise TypeError('interpolate only works on LineString and MultiLineString geometries') - if not hasattr(capi, 'geos_interpolate'): - raise NotImplementedError('interpolate requires GEOS 3.2+') - return self._topology(capi.geos_interpolate(self.ptr, distance)) - - def interpolate_normalized(self, distance): - if not isinstance(self, (LineString, MultiLineString)): - raise TypeError('interpolate only works on LineString and MultiLineString geometries') - if not hasattr(capi, 'geos_interpolate_normalized'): - raise NotImplementedError('interpolate_normalized requires GEOS 3.2+') - return self._topology(capi.geos_interpolate_normalized(self.ptr, distance)) - - def intersection(self, other): - "Returns a Geometry representing the points shared by this Geometry and other." - return self._topology(capi.geos_intersection(self.ptr, other.ptr)) - - @property - def point_on_surface(self): - "Computes an interior point of this Geometry." - return self._topology(capi.geos_pointonsurface(self.ptr)) - - def project(self, point): - if not isinstance(point, Point): - raise TypeError('locate_point argument must be a Point') - if not isinstance(self, (LineString, MultiLineString)): - raise TypeError('locate_point only works on LineString and MultiLineString geometries') - if not hasattr(capi, 'geos_project'): - raise NotImplementedError('geos_project requires GEOS 3.2+') - return capi.geos_project(self.ptr, point.ptr) - - def project_normalized(self, point): - if not isinstance(point, Point): - raise TypeError('locate_point argument must be a Point') - if not isinstance(self, (LineString, MultiLineString)): - raise TypeError('locate_point only works on LineString and MultiLineString geometries') - if not hasattr(capi, 'geos_project_normalized'): - raise NotImplementedError('project_normalized requires GEOS 3.2+') - return capi.geos_project_normalized(self.ptr, point.ptr) - - def relate(self, other): - "Returns the DE-9IM intersection matrix for this Geometry and the other." - return capi.geos_relate(self.ptr, other.ptr).decode() - - def simplify(self, tolerance=0.0, preserve_topology=False): - """ - Returns the Geometry, simplified using the Douglas-Peucker algorithm - to the specified tolerance (higher tolerance => less points). If no - tolerance provided, defaults to 0. - - By default, this function does not preserve topology - e.g. polygons can - be split, collapse to lines or disappear holes can be created or - disappear, and lines can cross. By specifying preserve_topology=True, - the result will have the same dimension and number of components as the - input. This is significantly slower. - """ - if preserve_topology: - return self._topology(capi.geos_preservesimplify(self.ptr, tolerance)) - else: - return self._topology(capi.geos_simplify(self.ptr, tolerance)) - - def sym_difference(self, other): - """ - Returns a set combining the points in this Geometry not in other, - and the points in other not in this Geometry. - """ - return self._topology(capi.geos_symdifference(self.ptr, other.ptr)) - - def union(self, other): - "Returns a Geometry representing all the points in this Geometry and other." - return self._topology(capi.geos_union(self.ptr, other.ptr)) - - #### Other Routines #### - @property - def area(self): - "Returns the area of the Geometry." - return capi.geos_area(self.ptr, byref(c_double())) - - def distance(self, other): - """ - Returns the distance between the closest points on this Geometry - and the other. Units will be in those of the coordinate system of - the Geometry. - """ - if not isinstance(other, GEOSGeometry): - raise TypeError('distance() works only on other GEOS Geometries.') - return capi.geos_distance(self.ptr, other.ptr, byref(c_double())) - - @property - def extent(self): - """ - Returns the extent of this geometry as a 4-tuple, consisting of - (xmin, ymin, xmax, ymax). - """ - env = self.envelope - if isinstance(env, Point): - xmin, ymin = env.tuple - xmax, ymax = xmin, ymin - else: - xmin, ymin = env[0][0] - xmax, ymax = env[0][2] - return (xmin, ymin, xmax, ymax) - - @property - def length(self): - """ - Returns the length of this Geometry (e.g., 0 for point, or the - circumfrence of a Polygon). - """ - return capi.geos_length(self.ptr, byref(c_double())) - - def clone(self): - "Clones this Geometry." - return GEOSGeometry(capi.geom_clone(self.ptr), srid=self.srid) - -# Class mapping dictionary. Has to be at the end to avoid import -# conflicts with GEOSGeometry. -from django.contrib.gis.geos.linestring import LineString, LinearRing -from django.contrib.gis.geos.point import Point -from django.contrib.gis.geos.polygon import Polygon -from django.contrib.gis.geos.collections import GeometryCollection, MultiPoint, MultiLineString, MultiPolygon -GEOS_CLASSES = {0 : Point, - 1 : LineString, - 2 : LinearRing, - 3 : Polygon, - 4 : MultiPoint, - 5 : MultiLineString, - 6 : MultiPolygon, - 7 : GeometryCollection, - } - -# If supported, import the PreparedGeometry class. -if GEOS_PREPARE: - from django.contrib.gis.geos.prepared import PreparedGeometry diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/io.py b/lib/python2.7/site-packages/django/contrib/gis/geos/io.py deleted file mode 100644 index 54ba6b4..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/io.py +++ /dev/null @@ -1,20 +0,0 @@ -""" -Module that holds classes for performing I/O operations on GEOS geometry -objects. Specifically, this has Python implementations of WKB/WKT -reader and writer classes. -""" -from django.contrib.gis.geos.geometry import GEOSGeometry -from django.contrib.gis.geos.prototypes.io import _WKTReader, _WKBReader, WKBWriter, WKTWriter - -# Public classes for (WKB|WKT)Reader, which return GEOSGeometry -class WKBReader(_WKBReader): - def read(self, wkb): - "Returns a GEOSGeometry for the given WKB buffer." - return GEOSGeometry(super(WKBReader, self).read(wkb)) - -class WKTReader(_WKTReader): - def read(self, wkt): - "Returns a GEOSGeometry for the given WKT string." - return GEOSGeometry(super(WKTReader, self).read(wkt)) - - diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py b/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py deleted file mode 100644 index 6963b78..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py +++ /dev/null @@ -1,155 +0,0 @@ -""" - This module houses the ctypes initialization procedures, as well - as the notice and error handler function callbacks (get called - when an error occurs in GEOS). - - This module also houses GEOS Pointer utilities, including - get_pointer_arr(), and GEOM_PTR. -""" -import logging -import os -import re -from ctypes import c_char_p, Structure, CDLL, CFUNCTYPE, POINTER -from ctypes.util import find_library - -from django.contrib.gis.geos.error import GEOSException -from django.core.exceptions import ImproperlyConfigured - -logger = logging.getLogger('django.contrib.gis') - -# Custom library path set? -try: - from django.conf import settings - lib_path = settings.GEOS_LIBRARY_PATH -except (AttributeError, EnvironmentError, - ImportError, ImproperlyConfigured): - lib_path = None - -# Setting the appropriate names for the GEOS-C library. -if lib_path: - lib_names = None -elif os.name == 'nt': - # Windows NT libraries - lib_names = ['geos_c', 'libgeos_c-1'] -elif os.name == 'posix': - # *NIX libraries - lib_names = ['geos_c', 'GEOS'] -else: - raise ImportError('Unsupported OS "%s"' % os.name) - -# Using the ctypes `find_library` utility to find the path to the GEOS -# shared library. This is better than manually specifiying each library name -# and extension (e.g., libgeos_c.[so|so.1|dylib].). -if lib_names: - for lib_name in lib_names: - lib_path = find_library(lib_name) - if not lib_path is None: break - -# No GEOS library could be found. -if lib_path is None: - raise ImportError('Could not find the GEOS library (tried "%s"). ' - 'Try setting GEOS_LIBRARY_PATH in your settings.' % - '", "'.join(lib_names)) - -# Getting the GEOS C library. The C interface (CDLL) is used for -# both *NIX and Windows. -# See the GEOS C API source code for more details on the library function calls: -# http://geos.refractions.net/ro/doxygen_docs/html/geos__c_8h-source.html -lgeos = CDLL(lib_path) - -# The notice and error handler C function callback definitions. -# Supposed to mimic the GEOS message handler (C below): -# typedef void (*GEOSMessageHandler)(const char *fmt, ...); -NOTICEFUNC = CFUNCTYPE(None, c_char_p, c_char_p) -def notice_h(fmt, lst): - fmt, lst = fmt.decode(), lst.decode() - try: - warn_msg = fmt % lst - except: - warn_msg = fmt - logger.warning('GEOS_NOTICE: %s\n' % warn_msg) -notice_h = NOTICEFUNC(notice_h) - -ERRORFUNC = CFUNCTYPE(None, c_char_p, c_char_p) -def error_h(fmt, lst): - fmt, lst = fmt.decode(), lst.decode() - try: - err_msg = fmt % lst - except: - err_msg = fmt - logger.error('GEOS_ERROR: %s\n' % err_msg) -error_h = ERRORFUNC(error_h) - -#### GEOS Geometry C data structures, and utility functions. #### - -# Opaque GEOS geometry structures, used for GEOM_PTR and CS_PTR -class GEOSGeom_t(Structure): pass -class GEOSPrepGeom_t(Structure): pass -class GEOSCoordSeq_t(Structure): pass -class GEOSContextHandle_t(Structure): pass - -# Pointers to opaque GEOS geometry structures. -GEOM_PTR = POINTER(GEOSGeom_t) -PREPGEOM_PTR = POINTER(GEOSPrepGeom_t) -CS_PTR = POINTER(GEOSCoordSeq_t) -CONTEXT_PTR = POINTER(GEOSContextHandle_t) - -# Used specifically by the GEOSGeom_createPolygon and GEOSGeom_createCollection -# GEOS routines -def get_pointer_arr(n): - "Gets a ctypes pointer array (of length `n`) for GEOSGeom_t opaque pointer." - GeomArr = GEOM_PTR * n - return GeomArr() - -# Returns the string version of the GEOS library. Have to set the restype -# explicitly to c_char_p to ensure compatibility accross 32 and 64-bit platforms. -geos_version = lgeos.GEOSversion -geos_version.argtypes = None -geos_version.restype = c_char_p - -# Regular expression should be able to parse version strings such as -# '3.0.0rc4-CAPI-1.3.3', '3.0.0-CAPI-1.4.1', '3.4.0dev-CAPI-1.8.0' or '3.4.0dev-CAPI-1.8.0 r0' -version_regex = re.compile( - r'^(?P(?P\d+)\.(?P\d+)\.(?P\d+))' - r'((rc(?P\d+))|dev)?-CAPI-(?P\d+\.\d+\.\d+)( r\d+)?$' -) -def geos_version_info(): - """ - Returns a dictionary containing the various version metadata parsed from - the GEOS version string, including the version number, whether the version - is a release candidate (and what number release candidate), and the C API - version. - """ - ver = geos_version().decode() - m = version_regex.match(ver) - if not m: - raise GEOSException('Could not parse version info string "%s"' % ver) - return dict((key, m.group(key)) for key in ( - 'version', 'release_candidate', 'capi_version', 'major', 'minor', 'subminor')) - -# Version numbers and whether or not prepared geometry support is available. -_verinfo = geos_version_info() -GEOS_MAJOR_VERSION = int(_verinfo['major']) -GEOS_MINOR_VERSION = int(_verinfo['minor']) -GEOS_SUBMINOR_VERSION = int(_verinfo['subminor']) -del _verinfo -GEOS_VERSION = (GEOS_MAJOR_VERSION, GEOS_MINOR_VERSION, GEOS_SUBMINOR_VERSION) -GEOS_PREPARE = GEOS_VERSION >= (3, 1, 0) - -if GEOS_PREPARE: - # Here we set up the prototypes for the initGEOS_r and finishGEOS_r - # routines. These functions aren't actually called until they are - # attached to a GEOS context handle -- this actually occurs in - # geos/prototypes/threadsafe.py. - lgeos.initGEOS_r.restype = CONTEXT_PTR - lgeos.finishGEOS_r.argtypes = [CONTEXT_PTR] -else: - # When thread-safety isn't available, the initGEOS routine must be called - # first. This function takes the notice and error functions, defined - # as Python callbacks above, as parameters. Here is the C code that is - # wrapped: - # extern void GEOS_DLL initGEOS(GEOSMessageHandler notice_function, GEOSMessageHandler error_function); - lgeos.initGEOS(notice_h, error_h) - # Calling finishGEOS() upon exit of the interpreter. - import atexit - atexit.register(lgeos.finishGEOS) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/linestring.py b/lib/python2.7/site-packages/django/contrib/gis/geos/linestring.py deleted file mode 100644 index 4784ea7..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/linestring.py +++ /dev/null @@ -1,153 +0,0 @@ -from django.contrib.gis.geos.base import numpy -from django.contrib.gis.geos.coordseq import GEOSCoordSeq -from django.contrib.gis.geos.error import GEOSException -from django.contrib.gis.geos.geometry import GEOSGeometry -from django.contrib.gis.geos.point import Point -from django.contrib.gis.geos import prototypes as capi -from django.utils.six.moves import xrange - -class LineString(GEOSGeometry): - _init_func = capi.create_linestring - _minlength = 2 - - #### Python 'magic' routines #### - def __init__(self, *args, **kwargs): - """ - Initializes on the given sequence -- may take lists, tuples, NumPy arrays - of X,Y pairs, or Point objects. If Point objects are used, ownership is - _not_ transferred to the LineString object. - - Examples: - ls = LineString((1, 1), (2, 2)) - ls = LineString([(1, 1), (2, 2)]) - ls = LineString(array([(1, 1), (2, 2)])) - ls = LineString(Point(1, 1), Point(2, 2)) - """ - # If only one argument provided, set the coords array appropriately - if len(args) == 1: coords = args[0] - else: coords = args - - if isinstance(coords, (tuple, list)): - # Getting the number of coords and the number of dimensions -- which - # must stay the same, e.g., no LineString((1, 2), (1, 2, 3)). - ncoords = len(coords) - if coords: ndim = len(coords[0]) - else: raise TypeError('Cannot initialize on empty sequence.') - self._checkdim(ndim) - # Incrementing through each of the coordinates and verifying - for i in xrange(1, ncoords): - if not isinstance(coords[i], (tuple, list, Point)): - raise TypeError('each coordinate should be a sequence (list or tuple)') - if len(coords[i]) != ndim: raise TypeError('Dimension mismatch.') - numpy_coords = False - elif numpy and isinstance(coords, numpy.ndarray): - shape = coords.shape # Using numpy's shape. - if len(shape) != 2: raise TypeError('Too many dimensions.') - self._checkdim(shape[1]) - ncoords = shape[0] - ndim = shape[1] - numpy_coords = True - else: - raise TypeError('Invalid initialization input for LineStrings.') - - # Creating a coordinate sequence object because it is easier to - # set the points using GEOSCoordSeq.__setitem__(). - cs = GEOSCoordSeq(capi.create_cs(ncoords, ndim), z=bool(ndim==3)) - - for i in xrange(ncoords): - if numpy_coords: cs[i] = coords[i,:] - elif isinstance(coords[i], Point): cs[i] = coords[i].tuple - else: cs[i] = coords[i] - - # If SRID was passed in with the keyword arguments - srid = kwargs.get('srid', None) - - # Calling the base geometry initialization with the returned pointer - # from the function. - super(LineString, self).__init__(self._init_func(cs.ptr), srid=srid) - - def __iter__(self): - "Allows iteration over this LineString." - for i in xrange(len(self)): - yield self[i] - - def __len__(self): - "Returns the number of points in this LineString." - return len(self._cs) - - def _get_single_external(self, index): - return self._cs[index] - - _get_single_internal = _get_single_external - - def _set_list(self, length, items): - ndim = self._cs.dims # - hasz = self._cs.hasz # I don't understand why these are different - - # create a new coordinate sequence and populate accordingly - cs = GEOSCoordSeq(capi.create_cs(length, ndim), z=hasz) - for i, c in enumerate(items): - cs[i] = c - - ptr = self._init_func(cs.ptr) - if ptr: - capi.destroy_geom(self.ptr) - self.ptr = ptr - self._post_init(self.srid) - else: - # can this happen? - raise GEOSException('Geometry resulting from slice deletion was invalid.') - - def _set_single(self, index, value): - self._checkindex(index) - self._cs[index] = value - - def _checkdim(self, dim): - if dim not in (2, 3): raise TypeError('Dimension mismatch.') - - #### Sequence Properties #### - @property - def tuple(self): - "Returns a tuple version of the geometry from the coordinate sequence." - return self._cs.tuple - coords = tuple - - def _listarr(self, func): - """ - Internal routine that returns a sequence (list) corresponding with - the given function. Will return a numpy array if possible. - """ - lst = [func(i) for i in xrange(len(self))] - if numpy: return numpy.array(lst) # ARRRR! - else: return lst - - @property - def array(self): - "Returns a numpy array for the LineString." - return self._listarr(self._cs.__getitem__) - - @property - def merged(self): - "Returns the line merge of this LineString." - return self._topology(capi.geos_linemerge(self.ptr)) - - @property - def x(self): - "Returns a list or numpy array of the X variable." - return self._listarr(self._cs.getX) - - @property - def y(self): - "Returns a list or numpy array of the Y variable." - return self._listarr(self._cs.getY) - - @property - def z(self): - "Returns a list or numpy array of the Z variable." - if not self.hasz: return None - else: return self._listarr(self._cs.getZ) - -# LinearRings are LineStrings used within Polygons. -class LinearRing(LineString): - _minLength = 4 - _init_func = capi.create_linearring diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/mutable_list.py b/lib/python2.7/site-packages/django/contrib/gis/geos/mutable_list.py deleted file mode 100644 index 0418282..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/mutable_list.py +++ /dev/null @@ -1,328 +0,0 @@ -# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. -# Released under the New BSD license. -""" -This module contains a base type which provides list-style mutations -without specific data storage methods. - -See also http://www.aryehleib.com/MutableLists.html - -Author: Aryeh Leib Taurog. -""" -from django.utils.functional import total_ordering -from django.utils import six -from django.utils.six.moves import xrange - -@total_ordering -class ListMixin(object): - """ - A base class which provides complete list interface. - Derived classes must call ListMixin's __init__() function - and implement the following: - - function _get_single_external(self, i): - Return single item with index i for general use. - The index i will always satisfy 0 <= i < len(self). - - function _get_single_internal(self, i): - Same as above, but for use within the class [Optional] - Note that if _get_single_internal and _get_single_internal return - different types of objects, _set_list must distinguish - between the two and handle each appropriately. - - function _set_list(self, length, items): - Recreate the entire object. - - NOTE: items may be a generator which calls _get_single_internal. - Therefore, it is necessary to cache the values in a temporary: - temp = list(items) - before clobbering the original storage. - - function _set_single(self, i, value): - Set the single item at index i to value [Optional] - If left undefined, all mutations will result in rebuilding - the object using _set_list. - - function __len__(self): - Return the length - - int _minlength: - The minimum legal length [Optional] - - int _maxlength: - The maximum legal length [Optional] - - type or tuple _allowed: - A type or tuple of allowed item types [Optional] - - class _IndexError: - The type of exception to be raise on invalid index [Optional] - """ - - _minlength = 0 - _maxlength = None - _IndexError = IndexError - - ### Python initialization and special list interface methods ### - - def __init__(self, *args, **kwargs): - if not hasattr(self, '_get_single_internal'): - self._get_single_internal = self._get_single_external - - if not hasattr(self, '_set_single'): - self._set_single = self._set_single_rebuild - self._assign_extended_slice = self._assign_extended_slice_rebuild - - super(ListMixin, self).__init__(*args, **kwargs) - - def __getitem__(self, index): - "Get the item(s) at the specified index/slice." - if isinstance(index, slice): - return [self._get_single_external(i) for i in xrange(*index.indices(len(self)))] - else: - index = self._checkindex(index) - return self._get_single_external(index) - - def __delitem__(self, index): - "Delete the item(s) at the specified index/slice." - if not isinstance(index, six.integer_types + (slice,)): - raise TypeError("%s is not a legal index" % index) - - # calculate new length and dimensions - origLen = len(self) - if isinstance(index, six.integer_types): - index = self._checkindex(index) - indexRange = [index] - else: - indexRange = range(*index.indices(origLen)) - - newLen = origLen - len(indexRange) - newItems = ( self._get_single_internal(i) - for i in xrange(origLen) - if i not in indexRange ) - - self._rebuild(newLen, newItems) - - def __setitem__(self, index, val): - "Set the item(s) at the specified index/slice." - if isinstance(index, slice): - self._set_slice(index, val) - else: - index = self._checkindex(index) - self._check_allowed((val,)) - self._set_single(index, val) - - def __iter__(self): - "Iterate over the items in the list" - for i in xrange(len(self)): - yield self[i] - - ### Special methods for arithmetic operations ### - def __add__(self, other): - 'add another list-like object' - return self.__class__(list(self) + list(other)) - - def __radd__(self, other): - 'add to another list-like object' - return other.__class__(list(other) + list(self)) - - def __iadd__(self, other): - 'add another list-like object to self' - self.extend(list(other)) - return self - - def __mul__(self, n): - 'multiply' - return self.__class__(list(self) * n) - - def __rmul__(self, n): - 'multiply' - return self.__class__(list(self) * n) - - def __imul__(self, n): - 'multiply' - if n <= 0: - del self[:] - else: - cache = list(self) - for i in range(n-1): - self.extend(cache) - return self - - def __eq__(self, other): - olen = len(other) - for i in range(olen): - try: - c = self[i] == other[i] - except self._IndexError: - # self must be shorter - return False - if not c: - return False - return len(self) == olen - - def __lt__(self, other): - olen = len(other) - for i in range(olen): - try: - c = self[i] < other[i] - except self._IndexError: - # self must be shorter - return True - if c: - return c - elif other[i] < self[i]: - return False - return len(self) < olen - - ### Public list interface Methods ### - ## Non-mutating ## - def count(self, val): - "Standard list count method" - count = 0 - for i in self: - if val == i: count += 1 - return count - - def index(self, val): - "Standard list index method" - for i in xrange(0, len(self)): - if self[i] == val: return i - raise ValueError('%s not found in object' % str(val)) - - ## Mutating ## - def append(self, val): - "Standard list append method" - self[len(self):] = [val] - - def extend(self, vals): - "Standard list extend method" - self[len(self):] = vals - - def insert(self, index, val): - "Standard list insert method" - if not isinstance(index, six.integer_types): - raise TypeError("%s is not a legal index" % index) - self[index:index] = [val] - - def pop(self, index=-1): - "Standard list pop method" - result = self[index] - del self[index] - return result - - def remove(self, val): - "Standard list remove method" - del self[self.index(val)] - - def reverse(self): - "Standard list reverse method" - self[:] = self[-1::-1] - - def sort(self, cmp=None, key=None, reverse=False): - "Standard list sort method" - if key: - temp = [(key(v),v) for v in self] - temp.sort(key=lambda x: x[0], reverse=reverse) - self[:] = [v[1] for v in temp] - else: - temp = list(self) - if cmp is not None: - temp.sort(cmp=cmp, reverse=reverse) - else: - temp.sort(reverse=reverse) - self[:] = temp - - ### Private routines ### - def _rebuild(self, newLen, newItems): - if newLen < self._minlength: - raise ValueError('Must have at least %d items' % self._minlength) - if self._maxlength is not None and newLen > self._maxlength: - raise ValueError('Cannot have more than %d items' % self._maxlength) - - self._set_list(newLen, newItems) - - def _set_single_rebuild(self, index, value): - self._set_slice(slice(index, index + 1, 1), [value]) - - def _checkindex(self, index, correct=True): - length = len(self) - if 0 <= index < length: - return index - if correct and -length <= index < 0: - return index + length - raise self._IndexError('invalid index: %s' % str(index)) - - def _check_allowed(self, items): - if hasattr(self, '_allowed'): - if False in [isinstance(val, self._allowed) for val in items]: - raise TypeError('Invalid type encountered in the arguments.') - - def _set_slice(self, index, values): - "Assign values to a slice of the object" - try: - iter(values) - except TypeError: - raise TypeError('can only assign an iterable to a slice') - - self._check_allowed(values) - - origLen = len(self) - valueList = list(values) - start, stop, step = index.indices(origLen) - - # CAREFUL: index.step and step are not the same! - # step will never be None - if index.step is None: - self._assign_simple_slice(start, stop, valueList) - else: - self._assign_extended_slice(start, stop, step, valueList) - - def _assign_extended_slice_rebuild(self, start, stop, step, valueList): - 'Assign an extended slice by rebuilding entire list' - indexList = range(start, stop, step) - # extended slice, only allow assigning slice of same size - if len(valueList) != len(indexList): - raise ValueError('attempt to assign sequence of size %d ' - 'to extended slice of size %d' - % (len(valueList), len(indexList))) - - # we're not changing the length of the sequence - newLen = len(self) - newVals = dict(zip(indexList, valueList)) - def newItems(): - for i in xrange(newLen): - if i in newVals: - yield newVals[i] - else: - yield self._get_single_internal(i) - - self._rebuild(newLen, newItems()) - - def _assign_extended_slice(self, start, stop, step, valueList): - 'Assign an extended slice by re-assigning individual items' - indexList = range(start, stop, step) - # extended slice, only allow assigning slice of same size - if len(valueList) != len(indexList): - raise ValueError('attempt to assign sequence of size %d ' - 'to extended slice of size %d' - % (len(valueList), len(indexList))) - - for i, val in zip(indexList, valueList): - self._set_single(i, val) - - def _assign_simple_slice(self, start, stop, valueList): - 'Assign a simple slice; Can assign slice of any length' - origLen = len(self) - stop = max(start, stop) - newLen = origLen - stop + start + len(valueList) - def newItems(): - for i in xrange(origLen + 1): - if i == start: - for val in valueList: - yield val - - if i < origLen: - if i < start or i >= stop: - yield self._get_single_internal(i) - - self._rebuild(newLen, newItems()) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/point.py b/lib/python2.7/site-packages/django/contrib/gis/geos/point.py deleted file mode 100644 index 907347d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/point.py +++ /dev/null @@ -1,137 +0,0 @@ -from ctypes import c_uint -from django.contrib.gis.geos.error import GEOSException -from django.contrib.gis.geos.geometry import GEOSGeometry -from django.contrib.gis.geos import prototypes as capi -from django.utils import six -from django.utils.six.moves import xrange - -class Point(GEOSGeometry): - _minlength = 2 - _maxlength = 3 - - def __init__(self, x, y=None, z=None, srid=None): - """ - The Point object may be initialized with either a tuple, or individual - parameters. - - For Example: - >>> p = Point((5, 23)) # 2D point, passed in as a tuple - >>> p = Point(5, 23, 8) # 3D point, passed in with individual parameters - """ - if isinstance(x, (tuple, list)): - # Here a tuple or list was passed in under the `x` parameter. - ndim = len(x) - coords = x - elif isinstance(x, six.integer_types + (float,)) and isinstance(y, six.integer_types + (float,)): - # Here X, Y, and (optionally) Z were passed in individually, as parameters. - if isinstance(z, six.integer_types + (float,)): - ndim = 3 - coords = [x, y, z] - else: - ndim = 2 - coords = [x, y] - else: - raise TypeError('Invalid parameters given for Point initialization.') - - point = self._create_point(ndim, coords) - - # Initializing using the address returned from the GEOS - # createPoint factory. - super(Point, self).__init__(point, srid=srid) - - def _create_point(self, ndim, coords): - """ - Create a coordinate sequence, set X, Y, [Z], and create point - """ - if ndim < 2 or ndim > 3: - raise TypeError('Invalid point dimension: %s' % str(ndim)) - - cs = capi.create_cs(c_uint(1), c_uint(ndim)) - i = iter(coords) - capi.cs_setx(cs, 0, next(i)) - capi.cs_sety(cs, 0, next(i)) - if ndim == 3: capi.cs_setz(cs, 0, next(i)) - - return capi.create_point(cs) - - def _set_list(self, length, items): - ptr = self._create_point(length, items) - if ptr: - capi.destroy_geom(self.ptr) - self._ptr = ptr - self._set_cs() - else: - # can this happen? - raise GEOSException('Geometry resulting from slice deletion was invalid.') - - def _set_single(self, index, value): - self._cs.setOrdinate(index, 0, value) - - def __iter__(self): - "Allows iteration over coordinates of this Point." - for i in xrange(len(self)): - yield self[i] - - def __len__(self): - "Returns the number of dimensions for this Point (either 0, 2 or 3)." - if self.empty: return 0 - if self.hasz: return 3 - else: return 2 - - def _get_single_external(self, index): - if index == 0: - return self.x - elif index == 1: - return self.y - elif index == 2: - return self.z - - _get_single_internal = _get_single_external - - def get_x(self): - "Returns the X component of the Point." - return self._cs.getOrdinate(0, 0) - - def set_x(self, value): - "Sets the X component of the Point." - self._cs.setOrdinate(0, 0, value) - - def get_y(self): - "Returns the Y component of the Point." - return self._cs.getOrdinate(1, 0) - - def set_y(self, value): - "Sets the Y component of the Point." - self._cs.setOrdinate(1, 0, value) - - def get_z(self): - "Returns the Z component of the Point." - if self.hasz: - return self._cs.getOrdinate(2, 0) - else: - return None - - def set_z(self, value): - "Sets the Z component of the Point." - if self.hasz: - self._cs.setOrdinate(2, 0, value) - else: - raise GEOSException('Cannot set Z on 2D Point.') - - # X, Y, Z properties - x = property(get_x, set_x) - y = property(get_y, set_y) - z = property(get_z, set_z) - - ### Tuple setting and retrieval routines. ### - def get_coords(self): - "Returns a tuple of the point." - return self._cs.tuple - - def set_coords(self, tup): - "Sets the coordinates of the point with the given tuple." - self._cs[0] = tup - - # The tuple and coords properties - tuple = property(get_coords, set_coords) - coords = tuple diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/polygon.py b/lib/python2.7/site-packages/django/contrib/gis/geos/polygon.py deleted file mode 100644 index c50f549..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/polygon.py +++ /dev/null @@ -1,170 +0,0 @@ -from ctypes import c_uint, byref -from django.contrib.gis.geos.geometry import GEOSGeometry -from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR -from django.contrib.gis.geos.linestring import LinearRing -from django.contrib.gis.geos import prototypes as capi -from django.utils import six -from django.utils.six.moves import xrange - -class Polygon(GEOSGeometry): - _minlength = 1 - - def __init__(self, *args, **kwargs): - """ - Initializes on an exterior ring and a sequence of holes (both - instances may be either LinearRing instances, or a tuple/list - that may be constructed into a LinearRing). - - Examples of initialization, where shell, hole1, and hole2 are - valid LinearRing geometries: - >>> poly = Polygon(shell, hole1, hole2) - >>> poly = Polygon(shell, (hole1, hole2)) - - Example where a tuple parameters are used: - >>> poly = Polygon(((0, 0), (0, 10), (10, 10), (0, 10), (0, 0)), - ((4, 4), (4, 6), (6, 6), (6, 4), (4, 4))) - """ - if not args: - raise TypeError('Must provide at least one LinearRing, or a tuple, to initialize a Polygon.') - - # Getting the ext_ring and init_holes parameters from the argument list - ext_ring = args[0] - init_holes = args[1:] - n_holes = len(init_holes) - - # If initialized as Polygon(shell, (LinearRing, LinearRing)) [for backward-compatibility] - if n_holes == 1 and isinstance(init_holes[0], (tuple, list)): - if len(init_holes[0]) == 0: - init_holes = () - n_holes = 0 - elif isinstance(init_holes[0][0], LinearRing): - init_holes = init_holes[0] - n_holes = len(init_holes) - - polygon = self._create_polygon(n_holes + 1, (ext_ring,) + init_holes) - super(Polygon, self).__init__(polygon, **kwargs) - - def __iter__(self): - "Iterates over each ring in the polygon." - for i in xrange(len(self)): - yield self[i] - - def __len__(self): - "Returns the number of rings in this Polygon." - return self.num_interior_rings + 1 - - @classmethod - def from_bbox(cls, bbox): - "Constructs a Polygon from a bounding box (4-tuple)." - x0, y0, x1, y1 = bbox - for z in bbox: - if not isinstance(z, six.integer_types + (float,)): - return GEOSGeometry('POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s))' % - (x0, y0, x0, y1, x1, y1, x1, y0, x0, y0)) - return Polygon(((x0, y0), (x0, y1), (x1, y1), (x1, y0), (x0, y0))) - - ### These routines are needed for list-like operation w/ListMixin ### - def _create_polygon(self, length, items): - # Instantiate LinearRing objects if necessary, but don't clone them yet - # _construct_ring will throw a TypeError if a parameter isn't a valid ring - # If we cloned the pointers here, we wouldn't be able to clean up - # in case of error. - rings = [] - for r in items: - if isinstance(r, GEOM_PTR): - rings.append(r) - else: - rings.append(self._construct_ring(r)) - - shell = self._clone(rings.pop(0)) - - n_holes = length - 1 - if n_holes: - holes = get_pointer_arr(n_holes) - for i, r in enumerate(rings): - holes[i] = self._clone(r) - holes_param = byref(holes) - else: - holes_param = None - - return capi.create_polygon(shell, holes_param, c_uint(n_holes)) - - def _clone(self, g): - if isinstance(g, GEOM_PTR): - return capi.geom_clone(g) - else: - return capi.geom_clone(g.ptr) - - def _construct_ring(self, param, msg='Parameter must be a sequence of LinearRings or objects that can initialize to LinearRings'): - "Helper routine for trying to construct a ring from the given parameter." - if isinstance(param, LinearRing): return param - try: - ring = LinearRing(param) - return ring - except TypeError: - raise TypeError(msg) - - def _set_list(self, length, items): - # Getting the current pointer, replacing with the newly constructed - # geometry, and destroying the old geometry. - prev_ptr = self.ptr - srid = self.srid - self.ptr = self._create_polygon(length, items) - if srid: self.srid = srid - capi.destroy_geom(prev_ptr) - - def _get_single_internal(self, index): - """ - Returns the ring at the specified index. The first index, 0, will - always return the exterior ring. Indices > 0 will return the - interior ring at the given index (e.g., poly[1] and poly[2] would - return the first and second interior ring, respectively). - - CAREFUL: Internal/External are not the same as Interior/Exterior! - _get_single_internal returns a pointer from the existing geometries for use - internally by the object's methods. _get_single_external returns a clone - of the same geometry for use by external code. - """ - if index == 0: - return capi.get_extring(self.ptr) - else: - # Getting the interior ring, have to subtract 1 from the index. - return capi.get_intring(self.ptr, index-1) - - def _get_single_external(self, index): - return GEOSGeometry(capi.geom_clone(self._get_single_internal(index)), srid=self.srid) - - _set_single = GEOSGeometry._set_single_rebuild - _assign_extended_slice = GEOSGeometry._assign_extended_slice_rebuild - - #### Polygon Properties #### - @property - def num_interior_rings(self): - "Returns the number of interior rings." - # Getting the number of rings - return capi.get_nrings(self.ptr) - - def _get_ext_ring(self): - "Gets the exterior ring of the Polygon." - return self[0] - - def _set_ext_ring(self, ring): - "Sets the exterior ring of the Polygon." - self[0] = ring - - # Properties for the exterior ring/shell. - exterior_ring = property(_get_ext_ring, _set_ext_ring) - shell = exterior_ring - - @property - def tuple(self): - "Gets the tuple for each ring in this Polygon." - return tuple([self[i].tuple for i in xrange(len(self))]) - coords = tuple - - @property - def kml(self): - "Returns the KML representation of this Polygon." - inner_kml = ''.join(["%s" % self[i+1].kml - for i in xrange(self.num_interior_rings)]) - return "%s%s" % (self[0].kml, inner_kml) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.py deleted file mode 100644 index ae2548f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prepared.py +++ /dev/null @@ -1,35 +0,0 @@ -from django.contrib.gis.geos.base import GEOSBase -from django.contrib.gis.geos.geometry import GEOSGeometry -from django.contrib.gis.geos.prototypes import prepared as capi - -class PreparedGeometry(GEOSBase): - """ - A geometry that is prepared for performing certain operations. - At the moment this includes the contains covers, and intersects - operations. - """ - ptr_type = capi.PREPGEOM_PTR - - def __init__(self, geom): - # Keeping a reference to the original geometry object to prevent it - # from being garbage collected which could then crash the prepared one - # See #21662 - self._base_geom = geom - if not isinstance(geom, GEOSGeometry): - raise TypeError - self.ptr = capi.geos_prepare(geom.ptr) - - def __del__(self): - if self._ptr: capi.prepared_destroy(self._ptr) - - def contains(self, other): - return capi.prepared_contains(self.ptr, other.ptr) - - def contains_properly(self, other): - return capi.prepared_contains_properly(self.ptr, other.ptr) - - def covers(self, other): - return capi.prepared_covers(self.ptr, other.ptr) - - def intersects(self, other): - return capi.prepared_intersects(self.ptr, other.ptr) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/__init__.py deleted file mode 100644 index 89b96c0..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -""" - This module contains all of the GEOS ctypes function prototypes. Each - prototype handles the interaction between the GEOS library and Python - via ctypes. -""" - -# Coordinate sequence routines. -from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs, - cs_clone, cs_getordinate, cs_setordinate, cs_getx, cs_gety, cs_getz, - cs_setx, cs_sety, cs_setz, cs_getsize, cs_getdims) - -# Geometry routines. -from django.contrib.gis.geos.prototypes.geom import (from_hex, from_wkb, from_wkt, - create_point, create_linestring, create_linearring, create_polygon, create_collection, - destroy_geom, get_extring, get_intring, get_nrings, get_geomn, geom_clone, - geos_normalize, geos_type, geos_typeid, geos_get_srid, geos_set_srid, - get_dims, get_num_coords, get_num_geoms, - to_hex, to_wkb, to_wkt) - -# Miscellaneous routines. -from django.contrib.gis.geos.prototypes.misc import * - -# Predicates -from django.contrib.gis.geos.prototypes.predicates import (geos_hasz, geos_isempty, - geos_isring, geos_issimple, geos_isvalid, geos_contains, geos_crosses, - geos_disjoint, geos_equals, geos_equalsexact, geos_intersects, - geos_intersects, geos_overlaps, geos_relatepattern, geos_touches, geos_within) - -# Topology routines -from django.contrib.gis.geos.prototypes.topology import * diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/coordseq.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/coordseq.py deleted file mode 100644 index 68b9480..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/coordseq.py +++ /dev/null @@ -1,83 +0,0 @@ -from ctypes import c_double, c_int, c_uint, POINTER -from django.contrib.gis.geos.libgeos import GEOM_PTR, CS_PTR -from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSException -from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc - -## Error-checking routines specific to coordinate sequences. ## -def check_cs_ptr(result, func, cargs): - "Error checking on routines that return Geometries." - if not result: - raise GEOSException('Error encountered checking Coordinate Sequence returned from GEOS C function "%s".' % func.__name__) - return result - -def check_cs_op(result, func, cargs): - "Checks the status code of a coordinate sequence operation." - if result == 0: - raise GEOSException('Could not set value on coordinate sequence') - else: - return result - -def check_cs_get(result, func, cargs): - "Checking the coordinate sequence retrieval." - check_cs_op(result, func, cargs) - # Object in by reference, return its value. - return last_arg_byref(cargs) - -## Coordinate sequence prototype generation functions. ## -def cs_int(func): - "For coordinate sequence routines that return an integer." - func.argtypes = [CS_PTR, POINTER(c_uint)] - func.restype = c_int - func.errcheck = check_cs_get - return func - -def cs_operation(func, ordinate=False, get=False): - "For coordinate sequence operations." - if get: - # Get routines get double parameter passed-in by reference. - func.errcheck = check_cs_get - dbl_param = POINTER(c_double) - else: - func.errcheck = check_cs_op - dbl_param = c_double - - if ordinate: - # Get/Set ordinate routines have an extra uint parameter. - func.argtypes = [CS_PTR, c_uint, c_uint, dbl_param] - else: - func.argtypes = [CS_PTR, c_uint, dbl_param] - - func.restype = c_int - return func - -def cs_output(func, argtypes): - "For routines that return a coordinate sequence." - func.argtypes = argtypes - func.restype = CS_PTR - func.errcheck = check_cs_ptr - return func - -## Coordinate Sequence ctypes prototypes ## - -# Coordinate Sequence constructors & cloning. -cs_clone = cs_output(GEOSFunc('GEOSCoordSeq_clone'), [CS_PTR]) -create_cs = cs_output(GEOSFunc('GEOSCoordSeq_create'), [c_uint, c_uint]) -get_cs = cs_output(GEOSFunc('GEOSGeom_getCoordSeq'), [GEOM_PTR]) - -# Getting, setting ordinate -cs_getordinate = cs_operation(GEOSFunc('GEOSCoordSeq_getOrdinate'), ordinate=True, get=True) -cs_setordinate = cs_operation(GEOSFunc('GEOSCoordSeq_setOrdinate'), ordinate=True) - -# For getting, x, y, z -cs_getx = cs_operation(GEOSFunc('GEOSCoordSeq_getX'), get=True) -cs_gety = cs_operation(GEOSFunc('GEOSCoordSeq_getY'), get=True) -cs_getz = cs_operation(GEOSFunc('GEOSCoordSeq_getZ'), get=True) - -# For setting, x, y, z -cs_setx = cs_operation(GEOSFunc('GEOSCoordSeq_setX')) -cs_sety = cs_operation(GEOSFunc('GEOSCoordSeq_setY')) -cs_setz = cs_operation(GEOSFunc('GEOSCoordSeq_setZ')) - -# These routines return size & dimensions. -cs_getsize = cs_int(GEOSFunc('GEOSCoordSeq_getSize')) -cs_getdims = cs_int(GEOSFunc('GEOSCoordSeq_getDimensions')) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/errcheck.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/errcheck.py deleted file mode 100644 index 97fcd21..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/errcheck.py +++ /dev/null @@ -1,95 +0,0 @@ -""" - Error checking functions for GEOS ctypes prototype functions. -""" -import os -from ctypes import c_void_p, string_at, CDLL -from django.contrib.gis.geos.error import GEOSException -from django.contrib.gis.geos.libgeos import GEOS_VERSION -from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc - -# Getting the `free` routine used to free the memory allocated for -# string pointers returned by GEOS. -if GEOS_VERSION >= (3, 1, 1): - # In versions 3.1.1 and above, `GEOSFree` was added to the C API - # because `free` isn't always available on all platforms. - free = GEOSFunc('GEOSFree') - free.argtypes = [c_void_p] - free.restype = None -else: - # Getting the `free` routine from the C library of the platform. - if os.name == 'nt': - # On NT, use the MS C library. - libc = CDLL('msvcrt') - else: - # On POSIX platforms C library is obtained by passing None into `CDLL`. - libc = CDLL(None) - free = libc.free - -### ctypes error checking routines ### -def last_arg_byref(args): - "Returns the last C argument's value by reference." - return args[-1]._obj.value - -def check_dbl(result, func, cargs): - "Checks the status code and returns the double value passed in by reference." - # Checking the status code - if result != 1: return None - # Double passed in by reference, return its value. - return last_arg_byref(cargs) - -def check_geom(result, func, cargs): - "Error checking on routines that return Geometries." - if not result: - raise GEOSException('Error encountered checking Geometry returned from GEOS C function "%s".' % func.__name__) - return result - -def check_minus_one(result, func, cargs): - "Error checking on routines that should not return -1." - if result == -1: - raise GEOSException('Error encountered in GEOS C function "%s".' % func.__name__) - else: - return result - -def check_predicate(result, func, cargs): - "Error checking for unary/binary predicate functions." - val = ord(result) # getting the ordinal from the character - if val == 1: return True - elif val == 0: return False - else: - raise GEOSException('Error encountered on GEOS C predicate function "%s".' % func.__name__) - -def check_sized_string(result, func, cargs): - """ - Error checking for routines that return explicitly sized strings. - - This frees the memory allocated by GEOS at the result pointer. - """ - if not result: - raise GEOSException('Invalid string pointer returned by GEOS C function "%s"' % func.__name__) - # A c_size_t object is passed in by reference for the second - # argument on these routines, and its needed to determine the - # correct size. - s = string_at(result, last_arg_byref(cargs)) - # Freeing the memory allocated within GEOS - free(result) - return s - -def check_string(result, func, cargs): - """ - Error checking for routines that return strings. - - This frees the memory allocated by GEOS at the result pointer. - """ - if not result: raise GEOSException('Error encountered checking string return value in GEOS C function "%s".' % func.__name__) - # Getting the string value at the pointer address. - s = string_at(result) - # Freeing the memory allocated within GEOS - free(result) - return s - -def check_zero(result, func, cargs): - "Error checking on routines that should not return 0." - if result == 0: - raise GEOSException('Error encountered in GEOS C function "%s".' % func.__name__) - else: - return result diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/geom.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/geom.py deleted file mode 100644 index 2683c2e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/geom.py +++ /dev/null @@ -1,119 +0,0 @@ -from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER -from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR -from django.contrib.gis.geos.prototypes.errcheck import ( - check_geom, check_minus_one, check_sized_string, check_string, check_zero) -from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc - -# This is the return type used by binary output (WKB, HEX) routines. -c_uchar_p = POINTER(c_ubyte) - -# We create a simple subclass of c_char_p here because when the response -# type is set to c_char_p, you get a _Python_ string and there's no way -# to access the string's address inside the error checking function. -# In other words, you can't free the memory allocated inside GEOS. Previously, -# the return type would just be omitted and the integer address would be -# used -- but this allows us to be specific in the function definition and -# keeps the reference so it may be free'd. -class geos_char_p(c_char_p): - pass - -### ctypes generation functions ### -def bin_constructor(func): - "Generates a prototype for binary construction (HEX, WKB) GEOS routines." - func.argtypes = [c_char_p, c_size_t] - func.restype = GEOM_PTR - func.errcheck = check_geom - return func - -# HEX & WKB output -def bin_output(func): - "Generates a prototype for the routines that return a sized string." - func.argtypes = [GEOM_PTR, POINTER(c_size_t)] - func.errcheck = check_sized_string - func.restype = c_uchar_p - return func - -def geom_output(func, argtypes): - "For GEOS routines that return a geometry." - if argtypes: func.argtypes = argtypes - func.restype = GEOM_PTR - func.errcheck = check_geom - return func - -def geom_index(func): - "For GEOS routines that return geometries from an index." - return geom_output(func, [GEOM_PTR, c_int]) - -def int_from_geom(func, zero=False): - "Argument is a geometry, return type is an integer." - func.argtypes = [GEOM_PTR] - func.restype = c_int - if zero: - func.errcheck = check_zero - else: - func.errcheck = check_minus_one - return func - -def string_from_geom(func): - "Argument is a Geometry, return type is a string." - func.argtypes = [GEOM_PTR] - func.restype = geos_char_p - func.errcheck = check_string - return func - -### ctypes prototypes ### - -# Deprecated creation routines from WKB, HEX, WKT -from_hex = bin_constructor(GEOSFunc('GEOSGeomFromHEX_buf')) -from_wkb = bin_constructor(GEOSFunc('GEOSGeomFromWKB_buf')) -from_wkt = geom_output(GEOSFunc('GEOSGeomFromWKT'), [c_char_p]) - -# Deprecated output routines -to_hex = bin_output(GEOSFunc('GEOSGeomToHEX_buf')) -to_wkb = bin_output(GEOSFunc('GEOSGeomToWKB_buf')) -to_wkt = string_from_geom(GEOSFunc('GEOSGeomToWKT')) - -# The GEOS geometry type, typeid, num_coordites and number of geometries -geos_normalize = int_from_geom(GEOSFunc('GEOSNormalize')) -geos_type = string_from_geom(GEOSFunc('GEOSGeomType')) -geos_typeid = int_from_geom(GEOSFunc('GEOSGeomTypeId')) -get_dims = int_from_geom(GEOSFunc('GEOSGeom_getDimensions'), zero=True) -get_num_coords = int_from_geom(GEOSFunc('GEOSGetNumCoordinates')) -get_num_geoms = int_from_geom(GEOSFunc('GEOSGetNumGeometries')) - -# Geometry creation factories -create_point = geom_output(GEOSFunc('GEOSGeom_createPoint'), [CS_PTR]) -create_linestring = geom_output(GEOSFunc('GEOSGeom_createLineString'), [CS_PTR]) -create_linearring = geom_output(GEOSFunc('GEOSGeom_createLinearRing'), [CS_PTR]) - -# Polygon and collection creation routines are special and will not -# have their argument types defined. -create_polygon = geom_output(GEOSFunc('GEOSGeom_createPolygon'), None) -create_collection = geom_output(GEOSFunc('GEOSGeom_createCollection'), None) - -# Ring routines -get_extring = geom_output(GEOSFunc('GEOSGetExteriorRing'), [GEOM_PTR]) -get_intring = geom_index(GEOSFunc('GEOSGetInteriorRingN')) -get_nrings = int_from_geom(GEOSFunc('GEOSGetNumInteriorRings')) - -# Collection Routines -get_geomn = geom_index(GEOSFunc('GEOSGetGeometryN')) - -# Cloning -geom_clone = GEOSFunc('GEOSGeom_clone') -geom_clone.argtypes = [GEOM_PTR] -geom_clone.restype = GEOM_PTR - -# Destruction routine. -destroy_geom = GEOSFunc('GEOSGeom_destroy') -destroy_geom.argtypes = [GEOM_PTR] -destroy_geom.restype = None - -# SRID routines -geos_get_srid = GEOSFunc('GEOSGetSRID') -geos_get_srid.argtypes = [GEOM_PTR] -geos_get_srid.restype = c_int - -geos_set_srid = GEOSFunc('GEOSSetSRID') -geos_set_srid.argtypes = [GEOM_PTR, c_int] -geos_set_srid.restype = None diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/io.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/io.py deleted file mode 100644 index 1e80351..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/io.py +++ /dev/null @@ -1,265 +0,0 @@ -import threading -from ctypes import byref, c_char_p, c_int, c_char, c_size_t, Structure, POINTER -from django.contrib.gis import memoryview -from django.contrib.gis.geos.base import GEOSBase -from django.contrib.gis.geos.libgeos import GEOM_PTR -from django.contrib.gis.geos.prototypes.errcheck import check_geom, check_string, check_sized_string -from django.contrib.gis.geos.prototypes.geom import c_uchar_p, geos_char_p -from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc - -from django.utils import six -from django.utils.encoding import force_bytes - -### The WKB/WKT Reader/Writer structures and pointers ### -class WKTReader_st(Structure): pass -class WKTWriter_st(Structure): pass -class WKBReader_st(Structure): pass -class WKBWriter_st(Structure): pass - -WKT_READ_PTR = POINTER(WKTReader_st) -WKT_WRITE_PTR = POINTER(WKTWriter_st) -WKB_READ_PTR = POINTER(WKBReader_st) -WKB_WRITE_PTR = POINTER(WKBReader_st) - -### WKTReader routines ### -wkt_reader_create = GEOSFunc('GEOSWKTReader_create') -wkt_reader_create.restype = WKT_READ_PTR - -wkt_reader_destroy = GEOSFunc('GEOSWKTReader_destroy') -wkt_reader_destroy.argtypes = [WKT_READ_PTR] - -wkt_reader_read = GEOSFunc('GEOSWKTReader_read') -wkt_reader_read.argtypes = [WKT_READ_PTR, c_char_p] -wkt_reader_read.restype = GEOM_PTR -wkt_reader_read.errcheck = check_geom - -### WKTWriter routines ### -wkt_writer_create = GEOSFunc('GEOSWKTWriter_create') -wkt_writer_create.restype = WKT_WRITE_PTR - -wkt_writer_destroy = GEOSFunc('GEOSWKTWriter_destroy') -wkt_writer_destroy.argtypes = [WKT_WRITE_PTR] - -wkt_writer_write = GEOSFunc('GEOSWKTWriter_write') -wkt_writer_write.argtypes = [WKT_WRITE_PTR, GEOM_PTR] -wkt_writer_write.restype = geos_char_p -wkt_writer_write.errcheck = check_string - -try: - wkt_writer_get_outdim = GEOSFunc('GEOSWKTWriter_getOutputDimension') - wkt_writer_get_outdim.argtypes = [WKT_WRITE_PTR] - wkt_writer_get_outdim.restype = c_int - wkt_writer_set_outdim = GEOSFunc('GEOSWKTWriter_setOutputDimension') - wkt_writer_set_outdim.argtypes = [WKT_WRITE_PTR, c_int] -except AttributeError: - # GEOSWKTWriter_get/setOutputDimension has been introduced in GEOS 3.3.0 - # Always return 2 if not available - wkt_writer_get_outdim = lambda ptr: 2 - wkt_writer_set_outdim = lambda ptr, dim: None - -### WKBReader routines ### -wkb_reader_create = GEOSFunc('GEOSWKBReader_create') -wkb_reader_create.restype = WKB_READ_PTR - -wkb_reader_destroy = GEOSFunc('GEOSWKBReader_destroy') -wkb_reader_destroy.argtypes = [WKB_READ_PTR] - -def wkb_read_func(func): - # Although the function definitions take `const unsigned char *` - # as their parameter, we use c_char_p here so the function may - # take Python strings directly as parameters. Inside Python there - # is not a difference between signed and unsigned characters, so - # it is not a problem. - func.argtypes = [WKB_READ_PTR, c_char_p, c_size_t] - func.restype = GEOM_PTR - func.errcheck = check_geom - return func - -wkb_reader_read = wkb_read_func(GEOSFunc('GEOSWKBReader_read')) -wkb_reader_read_hex = wkb_read_func(GEOSFunc('GEOSWKBReader_readHEX')) - -### WKBWriter routines ### -wkb_writer_create = GEOSFunc('GEOSWKBWriter_create') -wkb_writer_create.restype = WKB_WRITE_PTR - -wkb_writer_destroy = GEOSFunc('GEOSWKBWriter_destroy') -wkb_writer_destroy.argtypes = [WKB_WRITE_PTR] - -# WKB Writing prototypes. -def wkb_write_func(func): - func.argtypes = [WKB_WRITE_PTR, GEOM_PTR, POINTER(c_size_t)] - func.restype = c_uchar_p - func.errcheck = check_sized_string - return func - -wkb_writer_write = wkb_write_func(GEOSFunc('GEOSWKBWriter_write')) -wkb_writer_write_hex = wkb_write_func(GEOSFunc('GEOSWKBWriter_writeHEX')) - -# WKBWriter property getter/setter prototypes. -def wkb_writer_get(func, restype=c_int): - func.argtypes = [WKB_WRITE_PTR] - func.restype = restype - return func - -def wkb_writer_set(func, argtype=c_int): - func.argtypes = [WKB_WRITE_PTR, argtype] - return func - -wkb_writer_get_byteorder = wkb_writer_get(GEOSFunc('GEOSWKBWriter_getByteOrder')) -wkb_writer_set_byteorder = wkb_writer_set(GEOSFunc('GEOSWKBWriter_setByteOrder')) -wkb_writer_get_outdim = wkb_writer_get(GEOSFunc('GEOSWKBWriter_getOutputDimension')) -wkb_writer_set_outdim = wkb_writer_set(GEOSFunc('GEOSWKBWriter_setOutputDimension')) -wkb_writer_get_include_srid = wkb_writer_get(GEOSFunc('GEOSWKBWriter_getIncludeSRID'), restype=c_char) -wkb_writer_set_include_srid = wkb_writer_set(GEOSFunc('GEOSWKBWriter_setIncludeSRID'), argtype=c_char) - -### Base I/O Class ### -class IOBase(GEOSBase): - "Base class for GEOS I/O objects." - def __init__(self): - # Getting the pointer with the constructor. - self.ptr = self._constructor() - - def __del__(self): - # Cleaning up with the appropriate destructor. - if self._ptr: self._destructor(self._ptr) - -### Base WKB/WKT Reading and Writing objects ### - -# Non-public WKB/WKT reader classes for internal use because -# their `read` methods return _pointers_ instead of GEOSGeometry -# objects. -class _WKTReader(IOBase): - _constructor = wkt_reader_create - _destructor = wkt_reader_destroy - ptr_type = WKT_READ_PTR - - def read(self, wkt): - if not isinstance(wkt, (bytes, six.string_types)): - raise TypeError - return wkt_reader_read(self.ptr, force_bytes(wkt)) - -class _WKBReader(IOBase): - _constructor = wkb_reader_create - _destructor = wkb_reader_destroy - ptr_type = WKB_READ_PTR - - def read(self, wkb): - "Returns a _pointer_ to C GEOS Geometry object from the given WKB." - if isinstance(wkb, memoryview): - wkb_s = bytes(wkb) - return wkb_reader_read(self.ptr, wkb_s, len(wkb_s)) - elif isinstance(wkb, (bytes, six.string_types)): - return wkb_reader_read_hex(self.ptr, wkb, len(wkb)) - else: - raise TypeError - -### WKB/WKT Writer Classes ### -class WKTWriter(IOBase): - _constructor = wkt_writer_create - _destructor = wkt_writer_destroy - ptr_type = WKT_WRITE_PTR - - def write(self, geom): - "Returns the WKT representation of the given geometry." - return wkt_writer_write(self.ptr, geom.ptr) - - @property - def outdim(self): - return wkt_writer_get_outdim(self.ptr) - - @outdim.setter - def outdim(self, new_dim): - if not new_dim in (2, 3): - raise ValueError('WKT output dimension must be 2 or 3') - wkt_writer_set_outdim(self.ptr, new_dim) - - -class WKBWriter(IOBase): - _constructor = wkb_writer_create - _destructor = wkb_writer_destroy - ptr_type = WKB_WRITE_PTR - - def write(self, geom): - "Returns the WKB representation of the given geometry." - return memoryview(wkb_writer_write(self.ptr, geom.ptr, byref(c_size_t()))) - - def write_hex(self, geom): - "Returns the HEXEWKB representation of the given geometry." - return wkb_writer_write_hex(self.ptr, geom.ptr, byref(c_size_t())) - - ### WKBWriter Properties ### - - # Property for getting/setting the byteorder. - def _get_byteorder(self): - return wkb_writer_get_byteorder(self.ptr) - - def _set_byteorder(self, order): - if not order in (0, 1): raise ValueError('Byte order parameter must be 0 (Big Endian) or 1 (Little Endian).') - wkb_writer_set_byteorder(self.ptr, order) - - byteorder = property(_get_byteorder, _set_byteorder) - - # Property for getting/setting the output dimension. - def _get_outdim(self): - return wkb_writer_get_outdim(self.ptr) - - def _set_outdim(self, new_dim): - if not new_dim in (2, 3): raise ValueError('WKB output dimension must be 2 or 3') - wkb_writer_set_outdim(self.ptr, new_dim) - - outdim = property(_get_outdim, _set_outdim) - - # Property for getting/setting the include srid flag. - def _get_include_srid(self): - return bool(ord(wkb_writer_get_include_srid(self.ptr))) - - def _set_include_srid(self, include): - if bool(include): flag = b'\x01' - else: flag = b'\x00' - wkb_writer_set_include_srid(self.ptr, flag) - - srid = property(_get_include_srid, _set_include_srid) - -# `ThreadLocalIO` object holds instances of the WKT and WKB reader/writer -# objects that are local to the thread. The `GEOSGeometry` internals -# access these instances by calling the module-level functions, defined -# below. -class ThreadLocalIO(threading.local): - wkt_r = None - wkt_w = None - wkb_r = None - wkb_w = None - ewkb_w = None - -thread_context = ThreadLocalIO() - -# These module-level routines return the I/O object that is local to the -# thread. If the I/O object does not exist yet it will be initialized. -def wkt_r(): - if not thread_context.wkt_r: - thread_context.wkt_r = _WKTReader() - return thread_context.wkt_r - -def wkt_w(dim=2): - if not thread_context.wkt_w: - thread_context.wkt_w = WKTWriter() - thread_context.wkt_w.outdim = dim - return thread_context.wkt_w - -def wkb_r(): - if not thread_context.wkb_r: - thread_context.wkb_r = _WKBReader() - return thread_context.wkb_r - -def wkb_w(dim=2): - if not thread_context.wkb_w: - thread_context.wkb_w = WKBWriter() - thread_context.wkb_w.outdim = dim - return thread_context.wkb_w - -def ewkb_w(dim=2): - if not thread_context.ewkb_w: - thread_context.ewkb_w = WKBWriter() - thread_context.ewkb_w.srid = True - thread_context.ewkb_w.outdim = dim - return thread_context.ewkb_w diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/misc.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/misc.py deleted file mode 100644 index 5a9b555..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/misc.py +++ /dev/null @@ -1,40 +0,0 @@ -""" - This module is for the miscellaneous GEOS routines, particularly the - ones that return the area, distance, and length. -""" -from ctypes import c_int, c_double, POINTER -from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOS_PREPARE -from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_string -from django.contrib.gis.geos.prototypes.geom import geos_char_p -from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc -from django.utils.six.moves import xrange - -__all__ = ['geos_area', 'geos_distance', 'geos_length'] - -### ctypes generator function ### -def dbl_from_geom(func, num_geom=1): - """ - Argument is a Geometry, return type is double that is passed - in by reference as the last argument. - """ - argtypes = [GEOM_PTR for i in xrange(num_geom)] - argtypes += [POINTER(c_double)] - func.argtypes = argtypes - func.restype = c_int # Status code returned - func.errcheck = check_dbl - return func - -### ctypes prototypes ### - -# Area, distance, and length prototypes. -geos_area = dbl_from_geom(GEOSFunc('GEOSArea')) -geos_distance = dbl_from_geom(GEOSFunc('GEOSDistance'), num_geom=2) -geos_length = dbl_from_geom(GEOSFunc('GEOSLength')) - -# Validity reason; only in GEOS 3.1+ -if GEOS_PREPARE: - geos_isvalidreason = GEOSFunc('GEOSisValidReason') - geos_isvalidreason.argtypes = [GEOM_PTR] - geos_isvalidreason.restype = geos_char_p - geos_isvalidreason.errcheck = check_string - __all__.append('geos_isvalidreason') diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/predicates.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/predicates.py deleted file mode 100644 index bf69bb1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/predicates.py +++ /dev/null @@ -1,44 +0,0 @@ -""" - This module houses the GEOS ctypes prototype functions for the - unary and binary predicate operations on geometries. -""" -from ctypes import c_char, c_char_p, c_double -from django.contrib.gis.geos.libgeos import GEOM_PTR -from django.contrib.gis.geos.prototypes.errcheck import check_predicate -from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc - -## Binary & unary predicate functions ## -def binary_predicate(func, *args): - "For GEOS binary predicate functions." - argtypes = [GEOM_PTR, GEOM_PTR] - if args: argtypes += args - func.argtypes = argtypes - func.restype = c_char - func.errcheck = check_predicate - return func - -def unary_predicate(func): - "For GEOS unary predicate functions." - func.argtypes = [GEOM_PTR] - func.restype = c_char - func.errcheck = check_predicate - return func - -## Unary Predicates ## -geos_hasz = unary_predicate(GEOSFunc('GEOSHasZ')) -geos_isempty = unary_predicate(GEOSFunc('GEOSisEmpty')) -geos_isring = unary_predicate(GEOSFunc('GEOSisRing')) -geos_issimple = unary_predicate(GEOSFunc('GEOSisSimple')) -geos_isvalid = unary_predicate(GEOSFunc('GEOSisValid')) - -## Binary Predicates ## -geos_contains = binary_predicate(GEOSFunc('GEOSContains')) -geos_crosses = binary_predicate(GEOSFunc('GEOSCrosses')) -geos_disjoint = binary_predicate(GEOSFunc('GEOSDisjoint')) -geos_equals = binary_predicate(GEOSFunc('GEOSEquals')) -geos_equalsexact = binary_predicate(GEOSFunc('GEOSEqualsExact'), c_double) -geos_intersects = binary_predicate(GEOSFunc('GEOSIntersects')) -geos_overlaps = binary_predicate(GEOSFunc('GEOSOverlaps')) -geos_relatepattern = binary_predicate(GEOSFunc('GEOSRelatePattern'), c_char_p) -geos_touches = binary_predicate(GEOSFunc('GEOSTouches')) -geos_within = binary_predicate(GEOSFunc('GEOSWithin')) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/prepared.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/prepared.py deleted file mode 100644 index 7342d7d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/prepared.py +++ /dev/null @@ -1,25 +0,0 @@ -from ctypes import c_char -from django.contrib.gis.geos.libgeos import GEOM_PTR, PREPGEOM_PTR -from django.contrib.gis.geos.prototypes.errcheck import check_predicate -from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc - -# Prepared geometry constructor and destructors. -geos_prepare = GEOSFunc('GEOSPrepare') -geos_prepare.argtypes = [GEOM_PTR] -geos_prepare.restype = PREPGEOM_PTR - -prepared_destroy = GEOSFunc('GEOSPreparedGeom_destroy') -prepared_destroy.argtpes = [PREPGEOM_PTR] -prepared_destroy.restype = None - -# Prepared geometry binary predicate support. -def prepared_predicate(func): - func.argtypes= [PREPGEOM_PTR, GEOM_PTR] - func.restype = c_char - func.errcheck = check_predicate - return func - -prepared_contains = prepared_predicate(GEOSFunc('GEOSPreparedContains')) -prepared_contains_properly = prepared_predicate(GEOSFunc('GEOSPreparedContainsProperly')) -prepared_covers = prepared_predicate(GEOSFunc('GEOSPreparedCovers')) -prepared_intersects = prepared_predicate(GEOSFunc('GEOSPreparedIntersects')) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py deleted file mode 100644 index 2c9d25e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py +++ /dev/null @@ -1,86 +0,0 @@ -import threading -from django.contrib.gis.geos.libgeos import lgeos, notice_h, error_h, CONTEXT_PTR - -class GEOSContextHandle(object): - """ - Python object representing a GEOS context handle. - """ - def __init__(self): - # Initializing the context handler for this thread with - # the notice and error handler. - self.ptr = lgeos.initGEOS_r(notice_h, error_h) - - def __del__(self): - if self.ptr: lgeos.finishGEOS_r(self.ptr) - -# Defining a thread-local object and creating an instance -# to hold a reference to GEOSContextHandle for this thread. -class GEOSContext(threading.local): - handle = None - -thread_context = GEOSContext() - -class GEOSFunc(object): - """ - Class that serves as a wrapper for GEOS C Functions, and will - use thread-safe function variants when available. - """ - def __init__(self, func_name): - try: - # GEOS thread-safe function signatures end with '_r', and - # take an additional context handle parameter. - self.cfunc = getattr(lgeos, func_name + '_r') - self.threaded = True - # Create a reference here to thread_context so it's not - # garbage-collected before an attempt to call this object. - self.thread_context = thread_context - except AttributeError: - # Otherwise, use usual function. - self.cfunc = getattr(lgeos, func_name) - self.threaded = False - - def __call__(self, *args): - if self.threaded: - # If a context handle does not exist for this thread, initialize one. - if not self.thread_context.handle: - self.thread_context.handle = GEOSContextHandle() - # Call the threaded GEOS routine with pointer of the context handle - # as the first argument. - return self.cfunc(self.thread_context.handle.ptr, *args) - else: - return self.cfunc(*args) - - def __str__(self): - return self.cfunc.__name__ - - # argtypes property - def _get_argtypes(self): - return self.cfunc.argtypes - - def _set_argtypes(self, argtypes): - if self.threaded: - new_argtypes = [CONTEXT_PTR] - new_argtypes.extend(argtypes) - self.cfunc.argtypes = new_argtypes - else: - self.cfunc.argtypes = argtypes - - argtypes = property(_get_argtypes, _set_argtypes) - - # restype property - def _get_restype(self): - return self.cfunc.restype - - def _set_restype(self, restype): - self.cfunc.restype = restype - - restype = property(_get_restype, _set_restype) - - # errcheck property - def _get_errcheck(self): - return self.cfunc.errcheck - - def _set_errcheck(self, errcheck): - self.cfunc.errcheck = errcheck - - errcheck = property(_get_errcheck, _set_errcheck) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/topology.py b/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/topology.py deleted file mode 100644 index dfea3e9..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/topology.py +++ /dev/null @@ -1,64 +0,0 @@ -""" - This module houses the GEOS ctypes prototype functions for the - topological operations on geometries. -""" -__all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull', - 'geos_difference', 'geos_envelope', 'geos_intersection', - 'geos_linemerge', 'geos_pointonsurface', 'geos_preservesimplify', - 'geos_simplify', 'geos_symdifference', 'geos_union', 'geos_relate'] - -from ctypes import c_double, c_int -from django.contrib.gis.geos.libgeos import geos_version_info, GEOM_PTR, GEOS_PREPARE -from django.contrib.gis.geos.prototypes.errcheck import check_geom, check_minus_one, check_string -from django.contrib.gis.geos.prototypes.geom import geos_char_p -from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc - -def topology(func, *args, **kwargs): - "For GEOS unary topology functions." - argtypes = [GEOM_PTR] - if args: argtypes += args - func.argtypes = argtypes - func.restype = kwargs.get('restype', GEOM_PTR) - func.errcheck = kwargs.get('errcheck', check_geom) - return func - -### Topology Routines ### -geos_boundary = topology(GEOSFunc('GEOSBoundary')) -geos_buffer = topology(GEOSFunc('GEOSBuffer'), c_double, c_int) -geos_centroid = topology(GEOSFunc('GEOSGetCentroid')) -geos_convexhull = topology(GEOSFunc('GEOSConvexHull')) -geos_difference = topology(GEOSFunc('GEOSDifference'), GEOM_PTR) -geos_envelope = topology(GEOSFunc('GEOSEnvelope')) -geos_intersection = topology(GEOSFunc('GEOSIntersection'), GEOM_PTR) -geos_linemerge = topology(GEOSFunc('GEOSLineMerge')) -geos_pointonsurface = topology(GEOSFunc('GEOSPointOnSurface')) -geos_preservesimplify = topology(GEOSFunc('GEOSTopologyPreserveSimplify'), c_double) -geos_simplify = topology(GEOSFunc('GEOSSimplify'), c_double) -geos_symdifference = topology(GEOSFunc('GEOSSymDifference'), GEOM_PTR) -geos_union = topology(GEOSFunc('GEOSUnion'), GEOM_PTR) - -# GEOSRelate returns a string, not a geometry. -geos_relate = GEOSFunc('GEOSRelate') -geos_relate.argtypes = [GEOM_PTR, GEOM_PTR] -geos_relate.restype = geos_char_p -geos_relate.errcheck = check_string - -# Routines only in GEOS 3.1+ -if GEOS_PREPARE: - geos_cascaded_union = GEOSFunc('GEOSUnionCascaded') - geos_cascaded_union.argtypes = [GEOM_PTR] - geos_cascaded_union.restype = GEOM_PTR - __all__.append('geos_cascaded_union') - -# Linear referencing routines -info = geos_version_info() -if info['version'] >= '3.2.0': - geos_project = topology(GEOSFunc('GEOSProject'), GEOM_PTR, - restype=c_double, errcheck=check_minus_one) - geos_interpolate = topology(GEOSFunc('GEOSInterpolate'), c_double) - - geos_project_normalized = topology(GEOSFunc('GEOSProjectNormalized'), - GEOM_PTR, restype=c_double, errcheck=check_minus_one) - geos_interpolate_normalized = topology(GEOSFunc('GEOSInterpolateNormalized'), c_double) - __all__.extend(['geos_project', 'geos_interpolate', - 'geos_project_normalized', 'geos_interpolate_normalized']) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/tests/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/geos/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos.py b/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos.py deleted file mode 100644 index c8e064b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos.py +++ /dev/null @@ -1,1108 +0,0 @@ -from __future__ import unicode_literals - -import ctypes -import json -import random -from binascii import a2b_hex, b2a_hex -from io import BytesIO - -from django.contrib.gis.gdal import HAS_GDAL - -from django.contrib.gis import memoryview -from django.contrib.gis.geometry.test_data import TestDataMixin - -from django.utils.encoding import force_bytes -from django.utils import six -from django.utils.six.moves import xrange -from django.utils import unittest -from django.utils.unittest import skipUnless - -from .. import HAS_GEOS - -if HAS_GEOS: - from .. import (GEOSException, GEOSIndexError, GEOSGeometry, - GeometryCollection, Point, MultiPoint, Polygon, MultiPolygon, LinearRing, - LineString, MultiLineString, fromfile, fromstr, geos_version_info, - GEOS_PREPARE) - from ..base import gdal, numpy, GEOSBase - - -@skipUnless(HAS_GEOS, "Geos is required.") -class GEOSTest(unittest.TestCase, TestDataMixin): - - @property - def null_srid(self): - """ - Returns the proper null SRID depending on the GEOS version. - See the comments in `test_srid` for more details. - """ - info = geos_version_info() - if info['version'] == '3.0.0' and info['release_candidate']: - return -1 - else: - return None - - def test_base(self): - "Tests out the GEOSBase class." - # Testing out GEOSBase class, which provides a `ptr` property - # that abstracts out access to underlying C pointers. - class FakeGeom1(GEOSBase): - pass - - # This one only accepts pointers to floats - c_float_p = ctypes.POINTER(ctypes.c_float) - class FakeGeom2(GEOSBase): - ptr_type = c_float_p - - # Default ptr_type is `c_void_p`. - fg1 = FakeGeom1() - # Default ptr_type is C float pointer - fg2 = FakeGeom2() - - # These assignments are OK -- None is allowed because - # it's equivalent to the NULL pointer. - fg1.ptr = ctypes.c_void_p() - fg1.ptr = None - fg2.ptr = c_float_p(ctypes.c_float(5.23)) - fg2.ptr = None - - # Because pointers have been set to NULL, an exception should be - # raised when we try to access it. Raising an exception is - # preferrable to a segmentation fault that commonly occurs when - # a C method is given a NULL memory reference. - for fg in (fg1, fg2): - # Equivalent to `fg.ptr` - self.assertRaises(GEOSException, fg._get_ptr) - - # Anything that is either not None or the acceptable pointer type will - # result in a TypeError when trying to assign it to the `ptr` property. - # Thus, memmory addresses (integers) and pointers of the incorrect type - # (in `bad_ptrs`) will not be allowed. - bad_ptrs = (5, ctypes.c_char_p(b'foobar')) - for bad_ptr in bad_ptrs: - # Equivalent to `fg.ptr = bad_ptr` - self.assertRaises(TypeError, fg1._set_ptr, bad_ptr) - self.assertRaises(TypeError, fg2._set_ptr, bad_ptr) - - def test_wkt(self): - "Testing WKT output." - for g in self.geometries.wkt_out: - geom = fromstr(g.wkt) - if geom.hasz and geos_version_info()['version'] >= '3.3.0': - self.assertEqual(g.ewkt, geom.wkt) - - def test_hex(self): - "Testing HEX output." - for g in self.geometries.hex_wkt: - geom = fromstr(g.wkt) - self.assertEqual(g.hex, geom.hex.decode()) - - def test_hexewkb(self): - "Testing (HEX)EWKB output." - # For testing HEX(EWKB). - ogc_hex = b'01010000000000000000000000000000000000F03F' - ogc_hex_3d = b'01010000800000000000000000000000000000F03F0000000000000040' - # `SELECT ST_AsHEXEWKB(ST_GeomFromText('POINT(0 1)', 4326));` - hexewkb_2d = b'0101000020E61000000000000000000000000000000000F03F' - # `SELECT ST_AsHEXEWKB(ST_GeomFromEWKT('SRID=4326;POINT(0 1 2)'));` - hexewkb_3d = b'01010000A0E61000000000000000000000000000000000F03F0000000000000040' - - pnt_2d = Point(0, 1, srid=4326) - pnt_3d = Point(0, 1, 2, srid=4326) - - # OGC-compliant HEX will not have SRID value. - self.assertEqual(ogc_hex, pnt_2d.hex) - self.assertEqual(ogc_hex_3d, pnt_3d.hex) - - # HEXEWKB should be appropriate for its dimension -- have to use an - # a WKBWriter w/dimension set accordingly, else GEOS will insert - # garbage into 3D coordinate if there is none. Also, GEOS has a - # a bug in versions prior to 3.1 that puts the X coordinate in - # place of Z; an exception should be raised on those versions. - self.assertEqual(hexewkb_2d, pnt_2d.hexewkb) - if GEOS_PREPARE: - self.assertEqual(hexewkb_3d, pnt_3d.hexewkb) - self.assertEqual(True, GEOSGeometry(hexewkb_3d).hasz) - else: - try: - hexewkb = pnt_3d.hexewkb - except GEOSException: - pass - else: - self.fail('Should have raised GEOSException.') - - # Same for EWKB. - self.assertEqual(memoryview(a2b_hex(hexewkb_2d)), pnt_2d.ewkb) - if GEOS_PREPARE: - self.assertEqual(memoryview(a2b_hex(hexewkb_3d)), pnt_3d.ewkb) - else: - try: - ewkb = pnt_3d.ewkb - except GEOSException: - pass - else: - self.fail('Should have raised GEOSException') - - # Redundant sanity check. - self.assertEqual(4326, GEOSGeometry(hexewkb_2d).srid) - - def test_kml(self): - "Testing KML output." - for tg in self.geometries.wkt_out: - geom = fromstr(tg.wkt) - kml = getattr(tg, 'kml', False) - if kml: self.assertEqual(kml, geom.kml) - - def test_errors(self): - "Testing the Error handlers." - # string-based - for err in self.geometries.errors: - with self.assertRaises((GEOSException, ValueError)): - _ = fromstr(err.wkt) - - # Bad WKB - self.assertRaises(GEOSException, GEOSGeometry, memoryview(b'0')) - - class NotAGeometry(object): - pass - - # Some other object - self.assertRaises(TypeError, GEOSGeometry, NotAGeometry()) - # None - self.assertRaises(TypeError, GEOSGeometry, None) - - def test_wkb(self): - "Testing WKB output." - for g in self.geometries.hex_wkt: - geom = fromstr(g.wkt) - wkb = geom.wkb - self.assertEqual(b2a_hex(wkb).decode().upper(), g.hex) - - def test_create_hex(self): - "Testing creation from HEX." - for g in self.geometries.hex_wkt: - geom_h = GEOSGeometry(g.hex) - # we need to do this so decimal places get normalised - geom_t = fromstr(g.wkt) - self.assertEqual(geom_t.wkt, geom_h.wkt) - - def test_create_wkb(self): - "Testing creation from WKB." - for g in self.geometries.hex_wkt: - wkb = memoryview(a2b_hex(g.hex.encode())) - geom_h = GEOSGeometry(wkb) - # we need to do this so decimal places get normalised - geom_t = fromstr(g.wkt) - self.assertEqual(geom_t.wkt, geom_h.wkt) - - def test_ewkt(self): - "Testing EWKT." - srids = (-1, 32140) - for srid in srids: - for p in self.geometries.polygons: - ewkt = 'SRID=%d;%s' % (srid, p.wkt) - poly = fromstr(ewkt) - self.assertEqual(srid, poly.srid) - self.assertEqual(srid, poly.shell.srid) - self.assertEqual(srid, fromstr(poly.ewkt).srid) # Checking export - - @skipUnless(HAS_GDAL, "GDAL is required.") - def test_json(self): - "Testing GeoJSON input/output (via GDAL)." - for g in self.geometries.json_geoms: - geom = GEOSGeometry(g.wkt) - if not hasattr(g, 'not_equal'): - # Loading jsons to prevent decimal differences - self.assertEqual(json.loads(g.json), json.loads(geom.json)) - self.assertEqual(json.loads(g.json), json.loads(geom.geojson)) - self.assertEqual(GEOSGeometry(g.wkt), GEOSGeometry(geom.json)) - - def test_fromfile(self): - "Testing the fromfile() factory." - ref_pnt = GEOSGeometry('POINT(5 23)') - - wkt_f = BytesIO() - wkt_f.write(force_bytes(ref_pnt.wkt)) - wkb_f = BytesIO() - wkb_f.write(bytes(ref_pnt.wkb)) - - # Other tests use `fromfile()` on string filenames so those - # aren't tested here. - for fh in (wkt_f, wkb_f): - fh.seek(0) - pnt = fromfile(fh) - self.assertEqual(ref_pnt, pnt) - - def test_eq(self): - "Testing equivalence." - p = fromstr('POINT(5 23)') - self.assertEqual(p, p.wkt) - self.assertNotEqual(p, 'foo') - ls = fromstr('LINESTRING(0 0, 1 1, 5 5)') - self.assertEqual(ls, ls.wkt) - self.assertNotEqual(p, 'bar') - # Error shouldn't be raise on equivalence testing with - # an invalid type. - for g in (p, ls): - self.assertNotEqual(g, None) - self.assertNotEqual(g, {'foo' : 'bar'}) - self.assertNotEqual(g, False) - - def test_points(self): - "Testing Point objects." - prev = fromstr('POINT(0 0)') - for p in self.geometries.points: - # Creating the point from the WKT - pnt = fromstr(p.wkt) - self.assertEqual(pnt.geom_type, 'Point') - self.assertEqual(pnt.geom_typeid, 0) - self.assertEqual(p.x, pnt.x) - self.assertEqual(p.y, pnt.y) - self.assertEqual(True, pnt == fromstr(p.wkt)) - self.assertEqual(False, pnt == prev) - - # Making sure that the point's X, Y components are what we expect - self.assertAlmostEqual(p.x, pnt.tuple[0], 9) - self.assertAlmostEqual(p.y, pnt.tuple[1], 9) - - # Testing the third dimension, and getting the tuple arguments - if hasattr(p, 'z'): - self.assertEqual(True, pnt.hasz) - self.assertEqual(p.z, pnt.z) - self.assertEqual(p.z, pnt.tuple[2], 9) - tup_args = (p.x, p.y, p.z) - set_tup1 = (2.71, 3.14, 5.23) - set_tup2 = (5.23, 2.71, 3.14) - else: - self.assertEqual(False, pnt.hasz) - self.assertEqual(None, pnt.z) - tup_args = (p.x, p.y) - set_tup1 = (2.71, 3.14) - set_tup2 = (3.14, 2.71) - - # Centroid operation on point should be point itself - self.assertEqual(p.centroid, pnt.centroid.tuple) - - # Now testing the different constructors - pnt2 = Point(tup_args) # e.g., Point((1, 2)) - pnt3 = Point(*tup_args) # e.g., Point(1, 2) - self.assertEqual(True, pnt == pnt2) - self.assertEqual(True, pnt == pnt3) - - # Now testing setting the x and y - pnt.y = 3.14 - pnt.x = 2.71 - self.assertEqual(3.14, pnt.y) - self.assertEqual(2.71, pnt.x) - - # Setting via the tuple/coords property - pnt.tuple = set_tup1 - self.assertEqual(set_tup1, pnt.tuple) - pnt.coords = set_tup2 - self.assertEqual(set_tup2, pnt.coords) - - prev = pnt # setting the previous geometry - - def test_multipoints(self): - "Testing MultiPoint objects." - for mp in self.geometries.multipoints: - mpnt = fromstr(mp.wkt) - self.assertEqual(mpnt.geom_type, 'MultiPoint') - self.assertEqual(mpnt.geom_typeid, 4) - - self.assertAlmostEqual(mp.centroid[0], mpnt.centroid.tuple[0], 9) - self.assertAlmostEqual(mp.centroid[1], mpnt.centroid.tuple[1], 9) - - self.assertRaises(GEOSIndexError, mpnt.__getitem__, len(mpnt)) - self.assertEqual(mp.centroid, mpnt.centroid.tuple) - self.assertEqual(mp.coords, tuple(m.tuple for m in mpnt)) - for p in mpnt: - self.assertEqual(p.geom_type, 'Point') - self.assertEqual(p.geom_typeid, 0) - self.assertEqual(p.empty, False) - self.assertEqual(p.valid, True) - - def test_linestring(self): - "Testing LineString objects." - prev = fromstr('POINT(0 0)') - for l in self.geometries.linestrings: - ls = fromstr(l.wkt) - self.assertEqual(ls.geom_type, 'LineString') - self.assertEqual(ls.geom_typeid, 1) - self.assertEqual(ls.empty, False) - self.assertEqual(ls.ring, False) - if hasattr(l, 'centroid'): - self.assertEqual(l.centroid, ls.centroid.tuple) - if hasattr(l, 'tup'): - self.assertEqual(l.tup, ls.tuple) - - self.assertEqual(True, ls == fromstr(l.wkt)) - self.assertEqual(False, ls == prev) - self.assertRaises(GEOSIndexError, ls.__getitem__, len(ls)) - prev = ls - - # Creating a LineString from a tuple, list, and numpy array - self.assertEqual(ls, LineString(ls.tuple)) # tuple - self.assertEqual(ls, LineString(*ls.tuple)) # as individual arguments - self.assertEqual(ls, LineString([list(tup) for tup in ls.tuple])) # as list - self.assertEqual(ls.wkt, LineString(*tuple(Point(tup) for tup in ls.tuple)).wkt) # Point individual arguments - if numpy: self.assertEqual(ls, LineString(numpy.array(ls.tuple))) # as numpy array - - def test_multilinestring(self): - "Testing MultiLineString objects." - prev = fromstr('POINT(0 0)') - for l in self.geometries.multilinestrings: - ml = fromstr(l.wkt) - self.assertEqual(ml.geom_type, 'MultiLineString') - self.assertEqual(ml.geom_typeid, 5) - - self.assertAlmostEqual(l.centroid[0], ml.centroid.x, 9) - self.assertAlmostEqual(l.centroid[1], ml.centroid.y, 9) - - self.assertEqual(True, ml == fromstr(l.wkt)) - self.assertEqual(False, ml == prev) - prev = ml - - for ls in ml: - self.assertEqual(ls.geom_type, 'LineString') - self.assertEqual(ls.geom_typeid, 1) - self.assertEqual(ls.empty, False) - - self.assertRaises(GEOSIndexError, ml.__getitem__, len(ml)) - self.assertEqual(ml.wkt, MultiLineString(*tuple(s.clone() for s in ml)).wkt) - self.assertEqual(ml, MultiLineString(*tuple(LineString(s.tuple) for s in ml))) - - def test_linearring(self): - "Testing LinearRing objects." - for rr in self.geometries.linearrings: - lr = fromstr(rr.wkt) - self.assertEqual(lr.geom_type, 'LinearRing') - self.assertEqual(lr.geom_typeid, 2) - self.assertEqual(rr.n_p, len(lr)) - self.assertEqual(True, lr.valid) - self.assertEqual(False, lr.empty) - - # Creating a LinearRing from a tuple, list, and numpy array - self.assertEqual(lr, LinearRing(lr.tuple)) - self.assertEqual(lr, LinearRing(*lr.tuple)) - self.assertEqual(lr, LinearRing([list(tup) for tup in lr.tuple])) - if numpy: self.assertEqual(lr, LinearRing(numpy.array(lr.tuple))) - - def test_polygons_from_bbox(self): - "Testing `from_bbox` class method." - bbox = (-180, -90, 180, 90) - p = Polygon.from_bbox(bbox) - self.assertEqual(bbox, p.extent) - - # Testing numerical precision - x = 3.14159265358979323 - bbox = (0, 0, 1, x) - p = Polygon.from_bbox(bbox) - y = p.extent[-1] - self.assertEqual(format(x, '.13f'), format(y, '.13f')) - - def test_polygons(self): - "Testing Polygon objects." - - prev = fromstr('POINT(0 0)') - for p in self.geometries.polygons: - # Creating the Polygon, testing its properties. - poly = fromstr(p.wkt) - self.assertEqual(poly.geom_type, 'Polygon') - self.assertEqual(poly.geom_typeid, 3) - self.assertEqual(poly.empty, False) - self.assertEqual(poly.ring, False) - self.assertEqual(p.n_i, poly.num_interior_rings) - self.assertEqual(p.n_i + 1, len(poly)) # Testing __len__ - self.assertEqual(p.n_p, poly.num_points) - - # Area & Centroid - self.assertAlmostEqual(p.area, poly.area, 9) - self.assertAlmostEqual(p.centroid[0], poly.centroid.tuple[0], 9) - self.assertAlmostEqual(p.centroid[1], poly.centroid.tuple[1], 9) - - # Testing the geometry equivalence - self.assertEqual(True, poly == fromstr(p.wkt)) - self.assertEqual(False, poly == prev) # Should not be equal to previous geometry - self.assertEqual(True, poly != prev) - - # Testing the exterior ring - ring = poly.exterior_ring - self.assertEqual(ring.geom_type, 'LinearRing') - self.assertEqual(ring.geom_typeid, 2) - if p.ext_ring_cs: - self.assertEqual(p.ext_ring_cs, ring.tuple) - self.assertEqual(p.ext_ring_cs, poly[0].tuple) # Testing __getitem__ - - # Testing __getitem__ and __setitem__ on invalid indices - self.assertRaises(GEOSIndexError, poly.__getitem__, len(poly)) - self.assertRaises(GEOSIndexError, poly.__setitem__, len(poly), False) - self.assertRaises(GEOSIndexError, poly.__getitem__, -1 * len(poly) - 1) - - # Testing __iter__ - for r in poly: - self.assertEqual(r.geom_type, 'LinearRing') - self.assertEqual(r.geom_typeid, 2) - - # Testing polygon construction. - self.assertRaises(TypeError, Polygon, 0, [1, 2, 3]) - self.assertRaises(TypeError, Polygon, 'foo') - - # Polygon(shell, (hole1, ... holeN)) - rings = tuple(r for r in poly) - self.assertEqual(poly, Polygon(rings[0], rings[1:])) - - # Polygon(shell_tuple, hole_tuple1, ... , hole_tupleN) - ring_tuples = tuple(r.tuple for r in poly) - self.assertEqual(poly, Polygon(*ring_tuples)) - - # Constructing with tuples of LinearRings. - self.assertEqual(poly.wkt, Polygon(*tuple(r for r in poly)).wkt) - self.assertEqual(poly.wkt, Polygon(*tuple(LinearRing(r.tuple) for r in poly)).wkt) - - def test_polygon_comparison(self): - p1 = Polygon(((0, 0), (0, 1), (1, 1), (1, 0), (0, 0))) - p2 = Polygon(((0, 0), (0, 1), (1, 0), (0, 0))) - self.assertTrue(p1 > p2) - self.assertFalse(p1 < p2) - self.assertFalse(p2 > p1) - self.assertTrue(p2 < p1) - - p3 = Polygon(((0, 0), (0, 1), (1, 1), (2, 0), (0, 0))) - p4 = Polygon(((0, 0), (0, 1), (2, 2), (1, 0), (0, 0))) - self.assertFalse(p4 < p3) - self.assertTrue(p3 < p4) - self.assertTrue(p4 > p3) - self.assertFalse(p3 > p4) - - def test_multipolygons(self): - "Testing MultiPolygon objects." - prev = fromstr('POINT (0 0)') - for mp in self.geometries.multipolygons: - mpoly = fromstr(mp.wkt) - self.assertEqual(mpoly.geom_type, 'MultiPolygon') - self.assertEqual(mpoly.geom_typeid, 6) - self.assertEqual(mp.valid, mpoly.valid) - - if mp.valid: - self.assertEqual(mp.num_geom, mpoly.num_geom) - self.assertEqual(mp.n_p, mpoly.num_coords) - self.assertEqual(mp.num_geom, len(mpoly)) - self.assertRaises(GEOSIndexError, mpoly.__getitem__, len(mpoly)) - for p in mpoly: - self.assertEqual(p.geom_type, 'Polygon') - self.assertEqual(p.geom_typeid, 3) - self.assertEqual(p.valid, True) - self.assertEqual(mpoly.wkt, MultiPolygon(*tuple(poly.clone() for poly in mpoly)).wkt) - - def test_memory_hijinks(self): - "Testing Geometry __del__() on rings and polygons." - #### Memory issues with rings and polygons - - # These tests are needed to ensure sanity with writable geometries. - - # Getting a polygon with interior rings, and pulling out the interior rings - poly = fromstr(self.geometries.polygons[1].wkt) - ring1 = poly[0] - ring2 = poly[1] - - # These deletes should be 'harmless' since they are done on child geometries - del ring1 - del ring2 - ring1 = poly[0] - ring2 = poly[1] - - # Deleting the polygon - del poly - - # Access to these rings is OK since they are clones. - s1, s2 = str(ring1), str(ring2) - - def test_coord_seq(self): - "Testing Coordinate Sequence objects." - for p in self.geometries.polygons: - if p.ext_ring_cs: - # Constructing the polygon and getting the coordinate sequence - poly = fromstr(p.wkt) - cs = poly.exterior_ring.coord_seq - - self.assertEqual(p.ext_ring_cs, cs.tuple) # done in the Polygon test too. - self.assertEqual(len(p.ext_ring_cs), len(cs)) # Making sure __len__ works - - # Checks __getitem__ and __setitem__ - for i in xrange(len(p.ext_ring_cs)): - c1 = p.ext_ring_cs[i] # Expected value - c2 = cs[i] # Value from coordseq - self.assertEqual(c1, c2) - - # Constructing the test value to set the coordinate sequence with - if len(c1) == 2: tset = (5, 23) - else: tset = (5, 23, 8) - cs[i] = tset - - # Making sure every set point matches what we expect - for j in range(len(tset)): - cs[i] = tset - self.assertEqual(tset[j], cs[i][j]) - - def test_relate_pattern(self): - "Testing relate() and relate_pattern()." - g = fromstr('POINT (0 0)') - self.assertRaises(GEOSException, g.relate_pattern, 0, 'invalid pattern, yo') - for rg in self.geometries.relate_geoms: - a = fromstr(rg.wkt_a) - b = fromstr(rg.wkt_b) - self.assertEqual(rg.result, a.relate_pattern(b, rg.pattern)) - self.assertEqual(rg.pattern, a.relate(b)) - - def test_intersection(self): - "Testing intersects() and intersection()." - for i in xrange(len(self.geometries.topology_geoms)): - a = fromstr(self.geometries.topology_geoms[i].wkt_a) - b = fromstr(self.geometries.topology_geoms[i].wkt_b) - i1 = fromstr(self.geometries.intersect_geoms[i].wkt) - self.assertEqual(True, a.intersects(b)) - i2 = a.intersection(b) - self.assertEqual(i1, i2) - self.assertEqual(i1, a & b) # __and__ is intersection operator - a &= b # testing __iand__ - self.assertEqual(i1, a) - - def test_union(self): - "Testing union()." - for i in xrange(len(self.geometries.topology_geoms)): - a = fromstr(self.geometries.topology_geoms[i].wkt_a) - b = fromstr(self.geometries.topology_geoms[i].wkt_b) - u1 = fromstr(self.geometries.union_geoms[i].wkt) - u2 = a.union(b) - self.assertEqual(u1, u2) - self.assertEqual(u1, a | b) # __or__ is union operator - a |= b # testing __ior__ - self.assertEqual(u1, a) - - def test_difference(self): - "Testing difference()." - for i in xrange(len(self.geometries.topology_geoms)): - a = fromstr(self.geometries.topology_geoms[i].wkt_a) - b = fromstr(self.geometries.topology_geoms[i].wkt_b) - d1 = fromstr(self.geometries.diff_geoms[i].wkt) - d2 = a.difference(b) - self.assertEqual(d1, d2) - self.assertEqual(d1, a - b) # __sub__ is difference operator - a -= b # testing __isub__ - self.assertEqual(d1, a) - - def test_symdifference(self): - "Testing sym_difference()." - for i in xrange(len(self.geometries.topology_geoms)): - a = fromstr(self.geometries.topology_geoms[i].wkt_a) - b = fromstr(self.geometries.topology_geoms[i].wkt_b) - d1 = fromstr(self.geometries.sdiff_geoms[i].wkt) - d2 = a.sym_difference(b) - self.assertEqual(d1, d2) - self.assertEqual(d1, a ^ b) # __xor__ is symmetric difference operator - a ^= b # testing __ixor__ - self.assertEqual(d1, a) - - def test_buffer(self): - "Testing buffer()." - for bg in self.geometries.buffer_geoms: - g = fromstr(bg.wkt) - - # The buffer we expect - exp_buf = fromstr(bg.buffer_wkt) - quadsegs = bg.quadsegs - width = bg.width - - # Can't use a floating-point for the number of quadsegs. - self.assertRaises(ctypes.ArgumentError, g.buffer, width, float(quadsegs)) - - # Constructing our buffer - buf = g.buffer(width, quadsegs) - self.assertEqual(exp_buf.num_coords, buf.num_coords) - self.assertEqual(len(exp_buf), len(buf)) - - # Now assuring that each point in the buffer is almost equal - for j in xrange(len(exp_buf)): - exp_ring = exp_buf[j] - buf_ring = buf[j] - self.assertEqual(len(exp_ring), len(buf_ring)) - for k in xrange(len(exp_ring)): - # Asserting the X, Y of each point are almost equal (due to floating point imprecision) - self.assertAlmostEqual(exp_ring[k][0], buf_ring[k][0], 9) - self.assertAlmostEqual(exp_ring[k][1], buf_ring[k][1], 9) - - def test_srid(self): - "Testing the SRID property and keyword." - # Testing SRID keyword on Point - pnt = Point(5, 23, srid=4326) - self.assertEqual(4326, pnt.srid) - pnt.srid = 3084 - self.assertEqual(3084, pnt.srid) - self.assertRaises(ctypes.ArgumentError, pnt.set_srid, '4326') - - # Testing SRID keyword on fromstr(), and on Polygon rings. - poly = fromstr(self.geometries.polygons[1].wkt, srid=4269) - self.assertEqual(4269, poly.srid) - for ring in poly: self.assertEqual(4269, ring.srid) - poly.srid = 4326 - self.assertEqual(4326, poly.shell.srid) - - # Testing SRID keyword on GeometryCollection - gc = GeometryCollection(Point(5, 23), LineString((0, 0), (1.5, 1.5), (3, 3)), srid=32021) - self.assertEqual(32021, gc.srid) - for i in range(len(gc)): self.assertEqual(32021, gc[i].srid) - - # GEOS may get the SRID from HEXEWKB - # 'POINT(5 23)' at SRID=4326 in hex form -- obtained from PostGIS - # using `SELECT GeomFromText('POINT (5 23)', 4326);`. - hex = '0101000020E610000000000000000014400000000000003740' - p1 = fromstr(hex) - self.assertEqual(4326, p1.srid) - - # In GEOS 3.0.0rc1-4 when the EWKB and/or HEXEWKB is exported, - # the SRID information is lost and set to -1 -- this is not a - # problem on the 3.0.0 version (another reason to upgrade). - exp_srid = self.null_srid - - p2 = fromstr(p1.hex) - self.assertEqual(exp_srid, p2.srid) - p3 = fromstr(p1.hex, srid=-1) # -1 is intended. - self.assertEqual(-1, p3.srid) - - @skipUnless(HAS_GDAL, "GDAL is required.") - def test_custom_srid(self): - """ Test with a srid unknown from GDAL """ - pnt = Point(111200, 220900, srid=999999) - self.assertTrue(pnt.ewkt.startswith("SRID=999999;POINT (111200.0")) - self.assertIsInstance(pnt.ogr, gdal.OGRGeometry) - self.assertIsNone(pnt.srs) - - # Test conversion from custom to a known srid - c2w = gdal.CoordTransform( - gdal.SpatialReference('+proj=mill +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R_A +ellps=WGS84 +datum=WGS84 +units=m +no_defs'), - gdal.SpatialReference(4326)) - new_pnt = pnt.transform(c2w, clone=True) - self.assertEqual(new_pnt.srid, 4326) - self.assertAlmostEqual(new_pnt.x, 1, 3) - self.assertAlmostEqual(new_pnt.y, 2, 3) - - def test_mutable_geometries(self): - "Testing the mutability of Polygons and Geometry Collections." - ### Testing the mutability of Polygons ### - for p in self.geometries.polygons: - poly = fromstr(p.wkt) - - # Should only be able to use __setitem__ with LinearRing geometries. - self.assertRaises(TypeError, poly.__setitem__, 0, LineString((1, 1), (2, 2))) - - # Constructing the new shell by adding 500 to every point in the old shell. - shell_tup = poly.shell.tuple - new_coords = [] - for point in shell_tup: new_coords.append((point[0] + 500., point[1] + 500.)) - new_shell = LinearRing(*tuple(new_coords)) - - # Assigning polygon's exterior ring w/the new shell - poly.exterior_ring = new_shell - s = str(new_shell) # new shell is still accessible - self.assertEqual(poly.exterior_ring, new_shell) - self.assertEqual(poly[0], new_shell) - - ### Testing the mutability of Geometry Collections - for tg in self.geometries.multipoints: - mp = fromstr(tg.wkt) - for i in range(len(mp)): - # Creating a random point. - pnt = mp[i] - new = Point(random.randint(21, 100), random.randint(21, 100)) - # Testing the assignment - mp[i] = new - s = str(new) # what was used for the assignment is still accessible - self.assertEqual(mp[i], new) - self.assertEqual(mp[i].wkt, new.wkt) - self.assertNotEqual(pnt, mp[i]) - - # MultiPolygons involve much more memory management because each - # Polygon w/in the collection has its own rings. - for tg in self.geometries.multipolygons: - mpoly = fromstr(tg.wkt) - for i in xrange(len(mpoly)): - poly = mpoly[i] - old_poly = mpoly[i] - # Offsetting the each ring in the polygon by 500. - for j in xrange(len(poly)): - r = poly[j] - for k in xrange(len(r)): r[k] = (r[k][0] + 500., r[k][1] + 500.) - poly[j] = r - - self.assertNotEqual(mpoly[i], poly) - # Testing the assignment - mpoly[i] = poly - s = str(poly) # Still accessible - self.assertEqual(mpoly[i], poly) - self.assertNotEqual(mpoly[i], old_poly) - - # Extreme (!!) __setitem__ -- no longer works, have to detect - # in the first object that __setitem__ is called in the subsequent - # objects -- maybe mpoly[0, 0, 0] = (3.14, 2.71)? - #mpoly[0][0][0] = (3.14, 2.71) - #self.assertEqual((3.14, 2.71), mpoly[0][0][0]) - # Doing it more slowly.. - #self.assertEqual((3.14, 2.71), mpoly[0].shell[0]) - #del mpoly - - def test_threed(self): - "Testing three-dimensional geometries." - # Testing a 3D Point - pnt = Point(2, 3, 8) - self.assertEqual((2.,3.,8.), pnt.coords) - self.assertRaises(TypeError, pnt.set_coords, (1.,2.)) - pnt.coords = (1.,2.,3.) - self.assertEqual((1.,2.,3.), pnt.coords) - - # Testing a 3D LineString - ls = LineString((2., 3., 8.), (50., 250., -117.)) - self.assertEqual(((2.,3.,8.), (50.,250.,-117.)), ls.tuple) - self.assertRaises(TypeError, ls.__setitem__, 0, (1.,2.)) - ls[0] = (1.,2.,3.) - self.assertEqual((1.,2.,3.), ls[0]) - - def test_distance(self): - "Testing the distance() function." - # Distance to self should be 0. - pnt = Point(0, 0) - self.assertEqual(0.0, pnt.distance(Point(0, 0))) - - # Distance should be 1 - self.assertEqual(1.0, pnt.distance(Point(0, 1))) - - # Distance should be ~ sqrt(2) - self.assertAlmostEqual(1.41421356237, pnt.distance(Point(1, 1)), 11) - - # Distances are from the closest vertex in each geometry -- - # should be 3 (distance from (2, 2) to (5, 2)). - ls1 = LineString((0, 0), (1, 1), (2, 2)) - ls2 = LineString((5, 2), (6, 1), (7, 0)) - self.assertEqual(3, ls1.distance(ls2)) - - def test_length(self): - "Testing the length property." - # Points have 0 length. - pnt = Point(0, 0) - self.assertEqual(0.0, pnt.length) - - # Should be ~ sqrt(2) - ls = LineString((0, 0), (1, 1)) - self.assertAlmostEqual(1.41421356237, ls.length, 11) - - # Should be circumfrence of Polygon - poly = Polygon(LinearRing((0, 0), (0, 1), (1, 1), (1, 0), (0, 0))) - self.assertEqual(4.0, poly.length) - - # Should be sum of each element's length in collection. - mpoly = MultiPolygon(poly.clone(), poly) - self.assertEqual(8.0, mpoly.length) - - def test_emptyCollections(self): - "Testing empty geometries and collections." - gc1 = GeometryCollection([]) - gc2 = fromstr('GEOMETRYCOLLECTION EMPTY') - pnt = fromstr('POINT EMPTY') - ls = fromstr('LINESTRING EMPTY') - poly = fromstr('POLYGON EMPTY') - mls = fromstr('MULTILINESTRING EMPTY') - mpoly1 = fromstr('MULTIPOLYGON EMPTY') - mpoly2 = MultiPolygon(()) - - for g in [gc1, gc2, pnt, ls, poly, mls, mpoly1, mpoly2]: - self.assertEqual(True, g.empty) - - # Testing len() and num_geom. - if isinstance(g, Polygon): - self.assertEqual(1, len(g)) # Has one empty linear ring - self.assertEqual(1, g.num_geom) - self.assertEqual(0, len(g[0])) - elif isinstance(g, (Point, LineString)): - self.assertEqual(1, g.num_geom) - self.assertEqual(0, len(g)) - else: - self.assertEqual(0, g.num_geom) - self.assertEqual(0, len(g)) - - # Testing __getitem__ (doesn't work on Point or Polygon) - if isinstance(g, Point): - self.assertRaises(GEOSIndexError, g.get_x) - elif isinstance(g, Polygon): - lr = g.shell - self.assertEqual('LINEARRING EMPTY', lr.wkt) - self.assertEqual(0, len(lr)) - self.assertEqual(True, lr.empty) - self.assertRaises(GEOSIndexError, lr.__getitem__, 0) - else: - self.assertRaises(GEOSIndexError, g.__getitem__, 0) - - def test_collections_of_collections(self): - "Testing GeometryCollection handling of other collections." - # Creating a GeometryCollection WKT string composed of other - # collections and polygons. - coll = [mp.wkt for mp in self.geometries.multipolygons if mp.valid] - coll.extend([mls.wkt for mls in self.geometries.multilinestrings]) - coll.extend([p.wkt for p in self.geometries.polygons]) - coll.extend([mp.wkt for mp in self.geometries.multipoints]) - gc_wkt = 'GEOMETRYCOLLECTION(%s)' % ','.join(coll) - - # Should construct ok from WKT - gc1 = GEOSGeometry(gc_wkt) - - # Should also construct ok from individual geometry arguments. - gc2 = GeometryCollection(*tuple(g for g in gc1)) - - # And, they should be equal. - self.assertEqual(gc1, gc2) - - @skipUnless(HAS_GDAL, "GDAL is required.") - def test_gdal(self): - "Testing `ogr` and `srs` properties." - g1 = fromstr('POINT(5 23)') - self.assertIsInstance(g1.ogr, gdal.OGRGeometry) - self.assertIsNone(g1.srs) - - if GEOS_PREPARE: - g1_3d = fromstr('POINT(5 23 8)') - self.assertIsInstance(g1_3d.ogr, gdal.OGRGeometry) - self.assertEqual(g1_3d.ogr.z, 8) - - g2 = fromstr('LINESTRING(0 0, 5 5, 23 23)', srid=4326) - self.assertIsInstance(g2.ogr, gdal.OGRGeometry) - self.assertIsInstance(g2.srs, gdal.SpatialReference) - self.assertEqual(g2.hex, g2.ogr.hex) - self.assertEqual('WGS 84', g2.srs.name) - - def test_copy(self): - "Testing use with the Python `copy` module." - import copy - poly = GEOSGeometry('POLYGON((0 0, 0 23, 23 23, 23 0, 0 0), (5 5, 5 10, 10 10, 10 5, 5 5))') - cpy1 = copy.copy(poly) - cpy2 = copy.deepcopy(poly) - self.assertNotEqual(poly._ptr, cpy1._ptr) - self.assertNotEqual(poly._ptr, cpy2._ptr) - - @skipUnless(HAS_GDAL, "GDAL is required to transform geometries") - def test_transform(self): - "Testing `transform` method." - orig = GEOSGeometry('POINT (-104.609 38.255)', 4326) - trans = GEOSGeometry('POINT (992385.4472045 481455.4944650)', 2774) - - # Using a srid, a SpatialReference object, and a CoordTransform object - # for transformations. - t1, t2, t3 = orig.clone(), orig.clone(), orig.clone() - t1.transform(trans.srid) - t2.transform(gdal.SpatialReference('EPSG:2774')) - ct = gdal.CoordTransform(gdal.SpatialReference('WGS84'), gdal.SpatialReference(2774)) - t3.transform(ct) - - # Testing use of the `clone` keyword. - k1 = orig.clone() - k2 = k1.transform(trans.srid, clone=True) - self.assertEqual(k1, orig) - self.assertNotEqual(k1, k2) - - prec = 3 - for p in (t1, t2, t3, k2): - self.assertAlmostEqual(trans.x, p.x, prec) - self.assertAlmostEqual(trans.y, p.y, prec) - - @skipUnless(HAS_GDAL, "GDAL is required to transform geometries") - def test_transform_3d(self): - p3d = GEOSGeometry('POINT (5 23 100)', 4326) - p3d.transform(2774) - if GEOS_PREPARE: - self.assertEqual(p3d.z, 100) - else: - self.assertIsNone(p3d.z) - - @skipUnless(HAS_GDAL, "GDAL is required.") - def test_transform_noop(self): - """ Testing `transform` method (SRID match) """ - # transform() should no-op if source & dest SRIDs match, - # regardless of whether GDAL is available. - if gdal.HAS_GDAL: - g = GEOSGeometry('POINT (-104.609 38.255)', 4326) - gt = g.tuple - g.transform(4326) - self.assertEqual(g.tuple, gt) - self.assertEqual(g.srid, 4326) - - g = GEOSGeometry('POINT (-104.609 38.255)', 4326) - g1 = g.transform(4326, clone=True) - self.assertEqual(g1.tuple, g.tuple) - self.assertEqual(g1.srid, 4326) - self.assertTrue(g1 is not g, "Clone didn't happen") - - old_has_gdal = gdal.HAS_GDAL - try: - gdal.HAS_GDAL = False - - g = GEOSGeometry('POINT (-104.609 38.255)', 4326) - gt = g.tuple - g.transform(4326) - self.assertEqual(g.tuple, gt) - self.assertEqual(g.srid, 4326) - - g = GEOSGeometry('POINT (-104.609 38.255)', 4326) - g1 = g.transform(4326, clone=True) - self.assertEqual(g1.tuple, g.tuple) - self.assertEqual(g1.srid, 4326) - self.assertTrue(g1 is not g, "Clone didn't happen") - finally: - gdal.HAS_GDAL = old_has_gdal - - def test_transform_nosrid(self): - """ Testing `transform` method (no SRID or negative SRID) """ - - g = GEOSGeometry('POINT (-104.609 38.255)', srid=None) - self.assertRaises(GEOSException, g.transform, 2774) - - g = GEOSGeometry('POINT (-104.609 38.255)', srid=None) - self.assertRaises(GEOSException, g.transform, 2774, clone=True) - - g = GEOSGeometry('POINT (-104.609 38.255)', srid=-1) - self.assertRaises(GEOSException, g.transform, 2774) - - g = GEOSGeometry('POINT (-104.609 38.255)', srid=-1) - self.assertRaises(GEOSException, g.transform, 2774, clone=True) - - @skipUnless(HAS_GDAL, "GDAL is required.") - def test_transform_nogdal(self): - """ Testing `transform` method (GDAL not available) """ - old_has_gdal = gdal.HAS_GDAL - try: - gdal.HAS_GDAL = False - - g = GEOSGeometry('POINT (-104.609 38.255)', 4326) - self.assertRaises(GEOSException, g.transform, 2774) - - g = GEOSGeometry('POINT (-104.609 38.255)', 4326) - self.assertRaises(GEOSException, g.transform, 2774, clone=True) - finally: - gdal.HAS_GDAL = old_has_gdal - - def test_extent(self): - "Testing `extent` method." - # The xmin, ymin, xmax, ymax of the MultiPoint should be returned. - mp = MultiPoint(Point(5, 23), Point(0, 0), Point(10, 50)) - self.assertEqual((0.0, 0.0, 10.0, 50.0), mp.extent) - pnt = Point(5.23, 17.8) - # Extent of points is just the point itself repeated. - self.assertEqual((5.23, 17.8, 5.23, 17.8), pnt.extent) - # Testing on the 'real world' Polygon. - poly = fromstr(self.geometries.polygons[3].wkt) - ring = poly.shell - x, y = ring.x, ring.y - xmin, ymin = min(x), min(y) - xmax, ymax = max(x), max(y) - self.assertEqual((xmin, ymin, xmax, ymax), poly.extent) - - def test_pickle(self): - "Testing pickling and unpickling support." - # Using both pickle and cPickle -- just 'cause. - from django.utils.six.moves import cPickle - import pickle - - # Creating a list of test geometries for pickling, - # and setting the SRID on some of them. - def get_geoms(lst, srid=None): - return [GEOSGeometry(tg.wkt, srid) for tg in lst] - tgeoms = get_geoms(self.geometries.points) - tgeoms.extend(get_geoms(self.geometries.multilinestrings, 4326)) - tgeoms.extend(get_geoms(self.geometries.polygons, 3084)) - tgeoms.extend(get_geoms(self.geometries.multipolygons, 900913)) - - # The SRID won't be exported in GEOS 3.0 release candidates. - no_srid = self.null_srid == -1 - for geom in tgeoms: - s1, s2 = cPickle.dumps(geom), pickle.dumps(geom) - g1, g2 = cPickle.loads(s1), pickle.loads(s2) - for tmpg in (g1, g2): - self.assertEqual(geom, tmpg) - if not no_srid: self.assertEqual(geom.srid, tmpg.srid) - - @skipUnless(HAS_GEOS and GEOS_PREPARE, "geos >= 3.1.0 is required") - def test_prepared(self): - "Testing PreparedGeometry support." - # Creating a simple multipolygon and getting a prepared version. - mpoly = GEOSGeometry('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))') - prep = mpoly.prepared - - # A set of test points. - pnts = [Point(5, 5), Point(7.5, 7.5), Point(2.5, 7.5)] - covers = [True, True, False] # No `covers` op for regular GEOS geoms. - for pnt, c in zip(pnts, covers): - # Results should be the same (but faster) - self.assertEqual(mpoly.contains(pnt), prep.contains(pnt)) - self.assertEqual(mpoly.intersects(pnt), prep.intersects(pnt)) - self.assertEqual(c, prep.covers(pnt)) - - # Original geometry deletion should not crash the prepared one (#21662) - del mpoly - self.assertTrue(prep.covers(Point(5, 5))) - - def test_line_merge(self): - "Testing line merge support" - ref_geoms = (fromstr('LINESTRING(1 1, 1 1, 3 3)'), - fromstr('MULTILINESTRING((1 1, 3 3), (3 3, 4 2))'), - ) - ref_merged = (fromstr('LINESTRING(1 1, 3 3)'), - fromstr('LINESTRING (1 1, 3 3, 4 2)'), - ) - for geom, merged in zip(ref_geoms, ref_merged): - self.assertEqual(merged, geom.merged) - - @skipUnless(HAS_GEOS and GEOS_PREPARE, "geos >= 3.1.0 is required") - def test_valid_reason(self): - "Testing IsValidReason support" - - g = GEOSGeometry("POINT(0 0)") - self.assertTrue(g.valid) - self.assertIsInstance(g.valid_reason, six.string_types) - self.assertEqual(g.valid_reason, "Valid Geometry") - - g = GEOSGeometry("LINESTRING(0 0, 0 0)") - - self.assertFalse(g.valid) - self.assertIsInstance(g.valid_reason, six.string_types) - self.assertTrue(g.valid_reason.startswith("Too few points in geometry component")) - - @skipUnless(HAS_GEOS and geos_version_info()['version'] >= '3.2.0', "geos >= 3.2.0 is required") - def test_linearref(self): - "Testing linear referencing" - - ls = fromstr('LINESTRING(0 0, 0 10, 10 10, 10 0)') - mls = fromstr('MULTILINESTRING((0 0, 0 10), (10 0, 10 10))') - - self.assertEqual(ls.project(Point(0, 20)), 10.0) - self.assertEqual(ls.project(Point(7, 6)), 24) - self.assertEqual(ls.project_normalized(Point(0, 20)), 1.0/3) - - self.assertEqual(ls.interpolate(10), Point(0, 10)) - self.assertEqual(ls.interpolate(24), Point(10, 6)) - self.assertEqual(ls.interpolate_normalized(1.0/3), Point(0, 10)) - - self.assertEqual(mls.project(Point(0, 20)), 10) - self.assertEqual(mls.project(Point(7, 6)), 16) - - self.assertEqual(mls.interpolate(9), Point(0, 9)) - self.assertEqual(mls.interpolate(17), Point(10, 7)) - - def test_geos_version(self): - """Testing the GEOS version regular expression.""" - from django.contrib.gis.geos.libgeos import version_regex - versions = [('3.0.0rc4-CAPI-1.3.3', '3.0.0', '1.3.3'), - ('3.0.0-CAPI-1.4.1', '3.0.0', '1.4.1'), - ('3.4.0dev-CAPI-1.8.0', '3.4.0', '1.8.0'), - ('3.4.0dev-CAPI-1.8.0 r0', '3.4.0', '1.8.0')] - for v_init, v_geos, v_capi in versions: - m = version_regex.match(v_init) - self.assertTrue(m, msg="Unable to parse the version string '%s'" % v_init) - self.assertEqual(m.group('version'), v_geos) - self.assertEqual(m.group('capi_version'), v_capi) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos_mutation.py b/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos_mutation.py deleted file mode 100644 index 40b708a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_geos_mutation.py +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. -# Modified from original contribution by Aryeh Leib Taurog, which was -# released under the New BSD license. - -from django.utils import unittest -from django.utils.unittest import skipUnless - -from .. import HAS_GEOS - -if HAS_GEOS: - from .. import * - from ..error import GEOSIndexError - - -def getItem(o,i): return o[i] -def delItem(o,i): del o[i] -def setItem(o,i,v): o[i] = v - -if HAS_GEOS: - def api_get_distance(x): return x.distance(Point(-200,-200)) - -def api_get_buffer(x): return x.buffer(10) -def api_get_geom_typeid(x): return x.geom_typeid -def api_get_num_coords(x): return x.num_coords -def api_get_centroid(x): return x.centroid -def api_get_empty(x): return x.empty -def api_get_valid(x): return x.valid -def api_get_simple(x): return x.simple -def api_get_ring(x): return x.ring -def api_get_boundary(x): return x.boundary -def api_get_convex_hull(x): return x.convex_hull -def api_get_extent(x): return x.extent -def api_get_area(x): return x.area -def api_get_length(x): return x.length - -geos_function_tests = [ val for name, val in vars().items() - if hasattr(val, '__call__') - and name.startswith('api_get_') ] - - -@skipUnless(HAS_GEOS, "Geos is required.") -class GEOSMutationTest(unittest.TestCase): - """ - Tests Pythonic Mutability of Python GEOS geometry wrappers - get/set/delitem on a slice, normal list methods - """ - - def test00_GEOSIndexException(self): - 'Testing Geometry GEOSIndexError' - p = Point(1,2) - for i in range(-2,2): p._checkindex(i) - self.assertRaises(GEOSIndexError, p._checkindex, 2) - self.assertRaises(GEOSIndexError, p._checkindex, -3) - - def test01_PointMutations(self): - 'Testing Point mutations' - for p in (Point(1,2,3), fromstr('POINT (1 2 3)')): - self.assertEqual(p._get_single_external(1), 2.0, 'Point _get_single_external') - - # _set_single - p._set_single(0,100) - self.assertEqual(p.coords, (100.0,2.0,3.0), 'Point _set_single') - - # _set_list - p._set_list(2,(50,3141)) - self.assertEqual(p.coords, (50.0,3141.0), 'Point _set_list') - - def test02_PointExceptions(self): - 'Testing Point exceptions' - self.assertRaises(TypeError, Point, range(1)) - self.assertRaises(TypeError, Point, range(4)) - - def test03_PointApi(self): - 'Testing Point API' - q = Point(4,5,3) - for p in (Point(1,2,3), fromstr('POINT (1 2 3)')): - p[0:2] = [4,5] - for f in geos_function_tests: - self.assertEqual(f(q), f(p), 'Point ' + f.__name__) - - def test04_LineStringMutations(self): - 'Testing LineString mutations' - for ls in (LineString((1,0),(4,1),(6,-1)), - fromstr('LINESTRING (1 0,4 1,6 -1)')): - self.assertEqual(ls._get_single_external(1), (4.0,1.0), 'LineString _get_single_external') - - # _set_single - ls._set_single(0,(-50,25)) - self.assertEqual(ls.coords, ((-50.0,25.0),(4.0,1.0),(6.0,-1.0)), 'LineString _set_single') - - # _set_list - ls._set_list(2, ((-50.0,25.0),(6.0,-1.0))) - self.assertEqual(ls.coords, ((-50.0,25.0),(6.0,-1.0)), 'LineString _set_list') - - lsa = LineString(ls.coords) - for f in geos_function_tests: - self.assertEqual(f(lsa), f(ls), 'LineString ' + f.__name__) - - def test05_Polygon(self): - 'Testing Polygon mutations' - for pg in (Polygon(((1,0),(4,1),(6,-1),(8,10),(1,0)), - ((5,4),(6,4),(6,3),(5,4))), - fromstr('POLYGON ((1 0,4 1,6 -1,8 10,1 0),(5 4,6 4,6 3,5 4))')): - self.assertEqual(pg._get_single_external(0), - LinearRing((1,0),(4,1),(6,-1),(8,10),(1,0)), - 'Polygon _get_single_external(0)') - self.assertEqual(pg._get_single_external(1), - LinearRing((5,4),(6,4),(6,3),(5,4)), - 'Polygon _get_single_external(1)') - - # _set_list - pg._set_list(2, (((1,2),(10,0),(12,9),(-1,15),(1,2)), - ((4,2),(5,2),(5,3),(4,2)))) - self.assertEqual(pg.coords, - (((1.0,2.0),(10.0,0.0),(12.0,9.0),(-1.0,15.0),(1.0,2.0)), - ((4.0,2.0),(5.0,2.0),(5.0,3.0),(4.0,2.0))), - 'Polygon _set_list') - - lsa = Polygon(*pg.coords) - for f in geos_function_tests: - self.assertEqual(f(lsa), f(pg), 'Polygon ' + f.__name__) - - def test06_Collection(self): - 'Testing Collection mutations' - for mp in (MultiPoint(*map(Point,((3,4),(-1,2),(5,-4),(2,8)))), - fromstr('MULTIPOINT (3 4,-1 2,5 -4,2 8)')): - self.assertEqual(mp._get_single_external(2), Point(5,-4), 'Collection _get_single_external') - - mp._set_list(3, map(Point,((5,5),(3,-2),(8,1)))) - self.assertEqual(mp.coords, ((5.0,5.0),(3.0,-2.0),(8.0,1.0)), 'Collection _set_list') - - lsa = MultiPoint(*map(Point,((5,5),(3,-2),(8,1)))) - for f in geos_function_tests: - self.assertEqual(f(lsa), f(mp), 'MultiPoint ' + f.__name__) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_io.py b/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_io.py deleted file mode 100644 index 34eeaf9..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_io.py +++ /dev/null @@ -1,116 +0,0 @@ -from __future__ import unicode_literals - -import binascii -import unittest - -from django.contrib.gis import memoryview -from django.utils.unittest import skipUnless - -from ..import HAS_GEOS - -if HAS_GEOS: - from .. import GEOSGeometry, WKTReader, WKTWriter, WKBReader, WKBWriter, geos_version_info - - -@skipUnless(HAS_GEOS, "Geos is required.") -class GEOSIOTest(unittest.TestCase): - - def test01_wktreader(self): - # Creating a WKTReader instance - wkt_r = WKTReader() - wkt = 'POINT (5 23)' - - # read() should return a GEOSGeometry - ref = GEOSGeometry(wkt) - g1 = wkt_r.read(wkt.encode()) - g2 = wkt_r.read(wkt) - - for geom in (g1, g2): - self.assertEqual(ref, geom) - - # Should only accept six.string_types objects. - self.assertRaises(TypeError, wkt_r.read, 1) - self.assertRaises(TypeError, wkt_r.read, memoryview(b'foo')) - - def test02_wktwriter(self): - # Creating a WKTWriter instance, testing its ptr property. - wkt_w = WKTWriter() - self.assertRaises(TypeError, wkt_w._set_ptr, WKTReader.ptr_type()) - - ref = GEOSGeometry('POINT (5 23)') - ref_wkt = 'POINT (5.0000000000000000 23.0000000000000000)' - self.assertEqual(ref_wkt, wkt_w.write(ref).decode()) - - def test03_wkbreader(self): - # Creating a WKBReader instance - wkb_r = WKBReader() - - hex = b'000000000140140000000000004037000000000000' - wkb = memoryview(binascii.a2b_hex(hex)) - ref = GEOSGeometry(hex) - - # read() should return a GEOSGeometry on either a hex string or - # a WKB buffer. - g1 = wkb_r.read(wkb) - g2 = wkb_r.read(hex) - for geom in (g1, g2): - self.assertEqual(ref, geom) - - bad_input = (1, 5.23, None, False) - for bad_wkb in bad_input: - self.assertRaises(TypeError, wkb_r.read, bad_wkb) - - def test04_wkbwriter(self): - wkb_w = WKBWriter() - - # Representations of 'POINT (5 23)' in hex -- one normal and - # the other with the byte order changed. - g = GEOSGeometry('POINT (5 23)') - hex1 = b'010100000000000000000014400000000000003740' - wkb1 = memoryview(binascii.a2b_hex(hex1)) - hex2 = b'000000000140140000000000004037000000000000' - wkb2 = memoryview(binascii.a2b_hex(hex2)) - - self.assertEqual(hex1, wkb_w.write_hex(g)) - self.assertEqual(wkb1, wkb_w.write(g)) - - # Ensuring bad byteorders are not accepted. - for bad_byteorder in (-1, 2, 523, 'foo', None): - # Equivalent of `wkb_w.byteorder = bad_byteorder` - self.assertRaises(ValueError, wkb_w._set_byteorder, bad_byteorder) - - # Setting the byteorder to 0 (for Big Endian) - wkb_w.byteorder = 0 - self.assertEqual(hex2, wkb_w.write_hex(g)) - self.assertEqual(wkb2, wkb_w.write(g)) - - # Back to Little Endian - wkb_w.byteorder = 1 - - # Now, trying out the 3D and SRID flags. - g = GEOSGeometry('POINT (5 23 17)') - g.srid = 4326 - - hex3d = b'0101000080000000000000144000000000000037400000000000003140' - wkb3d = memoryview(binascii.a2b_hex(hex3d)) - hex3d_srid = b'01010000A0E6100000000000000000144000000000000037400000000000003140' - wkb3d_srid = memoryview(binascii.a2b_hex(hex3d_srid)) - - # Ensuring bad output dimensions are not accepted - for bad_outdim in (-1, 0, 1, 4, 423, 'foo', None): - # Equivalent of `wkb_w.outdim = bad_outdim` - self.assertRaises(ValueError, wkb_w._set_outdim, bad_outdim) - - # These tests will fail on 3.0.0 because of a bug that was fixed in 3.1: - # http://trac.osgeo.org/geos/ticket/216 - if not geos_version_info()['version'].startswith('3.0.'): - # Now setting the output dimensions to be 3 - wkb_w.outdim = 3 - - self.assertEqual(hex3d, wkb_w.write_hex(g)) - self.assertEqual(wkb3d, wkb_w.write(g)) - - # Telling the WKBWriter to include the srid in the representation. - wkb_w.srid = True - self.assertEqual(hex3d_srid, wkb_w.write_hex(g)) - self.assertEqual(wkb3d_srid, wkb_w.write(g)) diff --git a/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_mutable_list.py b/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_mutable_list.py deleted file mode 100644 index a4a56f2..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_mutable_list.py +++ /dev/null @@ -1,397 +0,0 @@ -# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com -# All rights reserved. -# -# Modified from original contribution by Aryeh Leib Taurog, which was -# released under the New BSD license. -from django.contrib.gis.geos.mutable_list import ListMixin -from django.utils import six -from django.utils import unittest - - -class UserListA(ListMixin): - _mytype = tuple - def __init__(self, i_list, *args, **kwargs): - self._list = self._mytype(i_list) - super(UserListA, self).__init__(*args, **kwargs) - - def __len__(self): return len(self._list) - - def __str__(self): return str(self._list) - - def __repr__(self): return repr(self._list) - - def _set_list(self, length, items): - # this would work: - # self._list = self._mytype(items) - # but then we wouldn't be testing length parameter - itemList = ['x'] * length - for i, v in enumerate(items): - itemList[i] = v - - self._list = self._mytype(itemList) - - def _get_single_external(self, index): - return self._list[index] - -class UserListB(UserListA): - _mytype = list - - def _set_single(self, index, value): - self._list[index] = value - -def nextRange(length): - nextRange.start += 100 - return range(nextRange.start, nextRange.start + length) - -nextRange.start = 0 - -class ListMixinTest(unittest.TestCase): - """ - Tests base class ListMixin by comparing a list clone which is - a ListMixin subclass with a real Python list. - """ - limit = 3 - listType = UserListA - - def lists_of_len(self, length=None): - if length is None: length = self.limit - pl = list(range(length)) - return pl, self.listType(pl) - - def limits_plus(self, b): - return range(-self.limit - b, self.limit + b) - - def step_range(self): - return list(range(-1 - self.limit, 0)) + list(range(1, 1 + self.limit)) - - def test01_getslice(self): - 'Slice retrieval' - pl, ul = self.lists_of_len() - for i in self.limits_plus(1): - self.assertEqual(pl[i:], ul[i:], 'slice [%d:]' % (i)) - self.assertEqual(pl[:i], ul[:i], 'slice [:%d]' % (i)) - - for j in self.limits_plus(1): - self.assertEqual(pl[i:j], ul[i:j], 'slice [%d:%d]' % (i,j)) - for k in self.step_range(): - self.assertEqual(pl[i:j:k], ul[i:j:k], 'slice [%d:%d:%d]' % (i,j,k)) - - for k in self.step_range(): - self.assertEqual(pl[i::k], ul[i::k], 'slice [%d::%d]' % (i,k)) - self.assertEqual(pl[:i:k], ul[:i:k], 'slice [:%d:%d]' % (i,k)) - - for k in self.step_range(): - self.assertEqual(pl[::k], ul[::k], 'slice [::%d]' % (k)) - - def test02_setslice(self): - 'Slice assignment' - def setfcn(x,i,j,k,L): x[i:j:k] = range(L) - pl, ul = self.lists_of_len() - for slen in range(self.limit + 1): - ssl = nextRange(slen) - ul[:] = ssl - pl[:] = ssl - self.assertEqual(pl, ul[:], 'set slice [:]') - - for i in self.limits_plus(1): - ssl = nextRange(slen) - ul[i:] = ssl - pl[i:] = ssl - self.assertEqual(pl, ul[:], 'set slice [%d:]' % (i)) - - ssl = nextRange(slen) - ul[:i] = ssl - pl[:i] = ssl - self.assertEqual(pl, ul[:], 'set slice [:%d]' % (i)) - - for j in self.limits_plus(1): - ssl = nextRange(slen) - ul[i:j] = ssl - pl[i:j] = ssl - self.assertEqual(pl, ul[:], 'set slice [%d:%d]' % (i, j)) - - for k in self.step_range(): - ssl = nextRange( len(ul[i:j:k]) ) - ul[i:j:k] = ssl - pl[i:j:k] = ssl - self.assertEqual(pl, ul[:], 'set slice [%d:%d:%d]' % (i, j, k)) - - sliceLen = len(ul[i:j:k]) - self.assertRaises(ValueError, setfcn, ul, i, j, k, sliceLen + 1) - if sliceLen > 2: - self.assertRaises(ValueError, setfcn, ul, i, j, k, sliceLen - 1) - - for k in self.step_range(): - ssl = nextRange( len(ul[i::k]) ) - ul[i::k] = ssl - pl[i::k] = ssl - self.assertEqual(pl, ul[:], 'set slice [%d::%d]' % (i, k)) - - ssl = nextRange( len(ul[:i:k]) ) - ul[:i:k] = ssl - pl[:i:k] = ssl - self.assertEqual(pl, ul[:], 'set slice [:%d:%d]' % (i, k)) - - for k in self.step_range(): - ssl = nextRange(len(ul[::k])) - ul[::k] = ssl - pl[::k] = ssl - self.assertEqual(pl, ul[:], 'set slice [::%d]' % (k)) - - - def test03_delslice(self): - 'Delete slice' - for Len in range(self.limit): - pl, ul = self.lists_of_len(Len) - del pl[:] - del ul[:] - self.assertEqual(pl[:], ul[:], 'del slice [:]') - for i in range(-Len - 1, Len + 1): - pl, ul = self.lists_of_len(Len) - del pl[i:] - del ul[i:] - self.assertEqual(pl[:], ul[:], 'del slice [%d:]' % (i)) - pl, ul = self.lists_of_len(Len) - del pl[:i] - del ul[:i] - self.assertEqual(pl[:], ul[:], 'del slice [:%d]' % (i)) - for j in range(-Len - 1, Len + 1): - pl, ul = self.lists_of_len(Len) - del pl[i:j] - del ul[i:j] - self.assertEqual(pl[:], ul[:], 'del slice [%d:%d]' % (i,j)) - for k in list(range(-Len - 1, 0)) + list(range(1, Len)): - pl, ul = self.lists_of_len(Len) - del pl[i:j:k] - del ul[i:j:k] - self.assertEqual(pl[:], ul[:], 'del slice [%d:%d:%d]' % (i,j,k)) - - for k in list(range(-Len - 1, 0)) + list(range(1, Len)): - pl, ul = self.lists_of_len(Len) - del pl[:i:k] - del ul[:i:k] - self.assertEqual(pl[:], ul[:], 'del slice [:%d:%d]' % (i,k)) - - pl, ul = self.lists_of_len(Len) - del pl[i::k] - del ul[i::k] - self.assertEqual(pl[:], ul[:], 'del slice [%d::%d]' % (i,k)) - - for k in list(range(-Len - 1, 0)) + list(range(1, Len)): - pl, ul = self.lists_of_len(Len) - del pl[::k] - del ul[::k] - self.assertEqual(pl[:], ul[:], 'del slice [::%d]' % (k)) - - def test04_get_set_del_single(self): - 'Get/set/delete single item' - pl, ul = self.lists_of_len() - for i in self.limits_plus(0): - self.assertEqual(pl[i], ul[i], 'get single item [%d]' % i) - - for i in self.limits_plus(0): - pl, ul = self.lists_of_len() - pl[i] = 100 - ul[i] = 100 - self.assertEqual(pl[:], ul[:], 'set single item [%d]' % i) - - for i in self.limits_plus(0): - pl, ul = self.lists_of_len() - del pl[i] - del ul[i] - self.assertEqual(pl[:], ul[:], 'del single item [%d]' % i) - - def test05_out_of_range_exceptions(self): - 'Out of range exceptions' - def setfcn(x, i): x[i] = 20 - def getfcn(x, i): return x[i] - def delfcn(x, i): del x[i] - pl, ul = self.lists_of_len() - for i in (-1 - self.limit, self.limit): - self.assertRaises(IndexError, setfcn, ul, i) # 'set index %d' % i) - self.assertRaises(IndexError, getfcn, ul, i) # 'get index %d' % i) - self.assertRaises(IndexError, delfcn, ul, i) # 'del index %d' % i) - - def test06_list_methods(self): - 'List methods' - pl, ul = self.lists_of_len() - pl.append(40) - ul.append(40) - self.assertEqual(pl[:], ul[:], 'append') - - pl.extend(range(50,55)) - ul.extend(range(50,55)) - self.assertEqual(pl[:], ul[:], 'extend') - - pl.reverse() - ul.reverse() - self.assertEqual(pl[:], ul[:], 'reverse') - - for i in self.limits_plus(1): - pl, ul = self.lists_of_len() - pl.insert(i,50) - ul.insert(i,50) - self.assertEqual(pl[:], ul[:], 'insert at %d' % i) - - for i in self.limits_plus(0): - pl, ul = self.lists_of_len() - self.assertEqual(pl.pop(i), ul.pop(i), 'popped value at %d' % i) - self.assertEqual(pl[:], ul[:], 'after pop at %d' % i) - - pl, ul = self.lists_of_len() - self.assertEqual(pl.pop(), ul.pop(i), 'popped value') - self.assertEqual(pl[:], ul[:], 'after pop') - - pl, ul = self.lists_of_len() - def popfcn(x, i): x.pop(i) - self.assertRaises(IndexError, popfcn, ul, self.limit) - self.assertRaises(IndexError, popfcn, ul, -1 - self.limit) - - pl, ul = self.lists_of_len() - for val in range(self.limit): - self.assertEqual(pl.index(val), ul.index(val), 'index of %d' % val) - - for val in self.limits_plus(2): - self.assertEqual(pl.count(val), ul.count(val), 'count %d' % val) - - for val in range(self.limit): - pl, ul = self.lists_of_len() - pl.remove(val) - ul.remove(val) - self.assertEqual(pl[:], ul[:], 'after remove val %d' % val) - - def indexfcn(x, v): return x.index(v) - def removefcn(x, v): return x.remove(v) - self.assertRaises(ValueError, indexfcn, ul, 40) - self.assertRaises(ValueError, removefcn, ul, 40) - - def test07_allowed_types(self): - 'Type-restricted list' - pl, ul = self.lists_of_len() - ul._allowed = six.integer_types - ul[1] = 50 - ul[:2] = [60, 70, 80] - def setfcn(x, i, v): x[i] = v - self.assertRaises(TypeError, setfcn, ul, 2, 'hello') - self.assertRaises(TypeError, setfcn, ul, slice(0,3,2), ('hello','goodbye')) - - def test08_min_length(self): - 'Length limits' - pl, ul = self.lists_of_len() - ul._minlength = 1 - def delfcn(x,i): del x[:i] - def setfcn(x,i): x[:i] = [] - for i in range(self.limit - ul._minlength + 1, self.limit + 1): - self.assertRaises(ValueError, delfcn, ul, i) - self.assertRaises(ValueError, setfcn, ul, i) - del ul[:ul._minlength] - - ul._maxlength = 4 - for i in range(0, ul._maxlength - len(ul)): - ul.append(i) - self.assertRaises(ValueError, ul.append, 10) - - def test09_iterable_check(self): - 'Error on assigning non-iterable to slice' - pl, ul = self.lists_of_len(self.limit + 1) - def setfcn(x, i, v): x[i] = v - self.assertRaises(TypeError, setfcn, ul, slice(0,3,2), 2) - - def test10_checkindex(self): - 'Index check' - pl, ul = self.lists_of_len() - for i in self.limits_plus(0): - if i < 0: - self.assertEqual(ul._checkindex(i), i + self.limit, '_checkindex(neg index)') - else: - self.assertEqual(ul._checkindex(i), i, '_checkindex(pos index)') - - for i in (-self.limit - 1, self.limit): - self.assertRaises(IndexError, ul._checkindex, i) - - ul._IndexError = TypeError - self.assertRaises(TypeError, ul._checkindex, -self.limit - 1) - - def test_11_sorting(self): - 'Sorting' - pl, ul = self.lists_of_len() - pl.insert(0, pl.pop()) - ul.insert(0, ul.pop()) - pl.sort() - ul.sort() - self.assertEqual(pl[:], ul[:], 'sort') - mid = pl[len(pl) // 2] - pl.sort(key=lambda x: (mid-x)**2) - ul.sort(key=lambda x: (mid-x)**2) - self.assertEqual(pl[:], ul[:], 'sort w/ key') - - pl.insert(0, pl.pop()) - ul.insert(0, ul.pop()) - pl.sort(reverse=True) - ul.sort(reverse=True) - self.assertEqual(pl[:], ul[:], 'sort w/ reverse') - mid = pl[len(pl) // 2] - pl.sort(key=lambda x: (mid-x)**2) - ul.sort(key=lambda x: (mid-x)**2) - self.assertEqual(pl[:], ul[:], 'sort w/ key') - - def test_12_arithmetic(self): - 'Arithmetic' - pl, ul = self.lists_of_len() - al = list(range(10,14)) - self.assertEqual(list(pl + al), list(ul + al), 'add') - self.assertEqual(type(ul), type(ul + al), 'type of add result') - self.assertEqual(list(al + pl), list(al + ul), 'radd') - self.assertEqual(type(al), type(al + ul), 'type of radd result') - objid = id(ul) - pl += al - ul += al - self.assertEqual(pl[:], ul[:], 'in-place add') - self.assertEqual(objid, id(ul), 'in-place add id') - - for n in (-1,0,1,3): - pl, ul = self.lists_of_len() - self.assertEqual(list(pl * n), list(ul * n), 'mul by %d' % n) - self.assertEqual(type(ul), type(ul * n), 'type of mul by %d result' % n) - self.assertEqual(list(n * pl), list(n * ul), 'rmul by %d' % n) - self.assertEqual(type(ul), type(n * ul), 'type of rmul by %d result' % n) - objid = id(ul) - pl *= n - ul *= n - self.assertEqual(pl[:], ul[:], 'in-place mul by %d' % n) - self.assertEqual(objid, id(ul), 'in-place mul by %d id' % n) - - pl, ul = self.lists_of_len() - self.assertEqual(pl, ul, 'cmp for equal') - self.assertFalse(ul == pl + [2], 'cmp for not equal') - self.assertTrue(pl >= ul, 'cmp for gte self') - self.assertTrue(pl <= ul, 'cmp for lte self') - self.assertTrue(ul >= pl, 'cmp for self gte') - self.assertTrue(ul <= pl, 'cmp for self lte') - - self.assertTrue(pl + [5] > ul, 'cmp') - self.assertTrue(pl + [5] >= ul, 'cmp') - self.assertTrue(pl < ul + [2], 'cmp') - self.assertTrue(pl <= ul + [2], 'cmp') - self.assertTrue(ul + [5] > pl, 'cmp') - self.assertTrue(ul + [5] >= pl, 'cmp') - self.assertTrue(ul < pl + [2], 'cmp') - self.assertTrue(ul <= pl + [2], 'cmp') - - # Also works with a custom IndexError - ul_longer = ul + [2] - ul_longer._IndexError = TypeError - ul._IndexError = TypeError - self.assertFalse(ul_longer == pl) - self.assertFalse(ul == ul_longer) - self.assertTrue(ul_longer > ul) - - pl[1] = 20 - self.assertTrue(pl > ul, 'cmp for gt self') - self.assertTrue(ul < pl, 'cmp for self lt') - pl[1] = -20 - self.assertTrue(pl < ul, 'cmp for lt self') - self.assertTrue(pl < ul, 'cmp for lt self') - -class ListMixinTestSingle(ListMixinTest): - listType = UserListB diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ar/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ar/LC_MESSAGES/django.mo deleted file mode 100644 index f210eff..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ar/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ar/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ar/LC_MESSAGES/django.po deleted file mode 100644 index d02c771..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ar/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# dado_eyad , 2013 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-10-28 09:52+0000\n" -"Last-Translator: dado_eyad \n" -"Language-Team: Arabic (http://www.transifex.com/projects/p/django/language/" -"ar/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ar\n" -"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " -"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "حقل GIS الأساسي -- مُرتبط بنوع مواصفات OpenGIS الهندسية." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "نقطة إحداثية" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "سطر تسلسل أحرف" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "مُضلّع إحداثي" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "نقاط إحداثية" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "تسلسل أحرف متعدد الأسطر" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "مجموعة مُضلعات إحداثية" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "مجموعة إحداثية" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "لم تُدخل أي أحداثيات." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "الإحداثيات غير صحيحة." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "نوع الإحداثيات غير صحيح." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "حدث خطأ أثناء تحويل geometry إلى حقل SRID." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "لا يوجد خريطة موقع للقسم: %r " - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "الصفحة %s فارغة" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "لا يوجد صفحة بالإسم '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/az/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/az/LC_MESSAGES/django.mo deleted file mode 100644 index 5a8ed32..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/az/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/az/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/az/LC_MESSAGES/django.po deleted file mode 100644 index 3544e66..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/az/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Ali Ismayilov , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Azerbaijani (http://www.transifex.com/projects/p/django/" -"language/az/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: az\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Əsas GIS sahəsi OpenGIS Müəyyənləşdirmə Həndəsəsi tipinə uyğunlaşdırılır." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Nöqtə" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Xətt" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poliqon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Nöqtələr" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Xətlər" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Poliqonlar" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Fiqurlar çoxluğu" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Həndəsi qiyməti verilməyib." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Həndəsi qiyməti düzgün deyil." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Həndəsi tipi düzgün deyil." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Fiquru vərəqənin fiqur sahəsinin SRID qiymətinə çevirərkən xəta baş verdi." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/be/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/be/LC_MESSAGES/django.mo deleted file mode 100644 index 3ace6d6..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/be/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/be/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/be/LC_MESSAGES/django.po deleted file mode 100644 index 08c8a49..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/be/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Belarusian (http://www.transifex.com/projects/p/django/" -"language/be/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: be\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Няма запісаных стужак." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Біркі «%r» няма ў запісаных." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Галоўнае поле ҐІС — адлюстроўвае ґеамэтрычныя віды паводле спэцыфікацыі " -"«OpenGIS»." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Пункт" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Ломаная" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Шматкутнік" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Набор пунктаў" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Набор ломаных" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Набор шматкутнікаў" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Набор ґеамэтрычных аб’ектаў" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Не пазначылі значэньне ґеамэтрыі." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Хібнае значэньне ґеамэтрыі." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Хібны від ґеамэтрыі." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Не ўдалося ператварыць ґеамэтрыю ў SRID." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Разьдзел «%r» ня мае мапы пляцоўкі." - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Бачына «%s» парожняя" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Бачына «%s» не існуе" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/bg/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/bg/LC_MESSAGES/django.mo deleted file mode 100644 index 18f5f77..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/bg/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/bg/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/bg/LC_MESSAGES/django.po deleted file mode 100644 index dfa1f93..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/bg/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Georgi Kostadinov , 2012 -# Todor Lube , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Bulgarian (http://www.transifex.com/projects/p/django/" -"language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Няма регистрирани фийда." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Слъгът %r не е регистриран." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Основно ГИС поле - карти за спецификация от OpenGIS геометричен тип." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Точка" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Линеен елемент" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Полигон" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Комплексна-точка" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Комплексен-линеен елемент" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Комплексен полигон" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Геометрична колекция" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Няма предоставена геометрична стойност." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Невалидна геометрична стойност." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Невалиден геометричен тип." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Възникна грешка при трансформиране на геометрията на SRID от полето " -"геометрия." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Не съществува 'sitemap' на тази секция: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Страница %s е празна" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Няма страница '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/bn/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/bn/LC_MESSAGES/django.mo deleted file mode 100644 index c605fb9..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/bn/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/bn/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/bn/LC_MESSAGES/django.po deleted file mode 100644 index 75bab75..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/bn/LC_MESSAGES/django.po +++ /dev/null @@ -1,92 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Bengali (http://www.transifex.com/projects/p/django/language/" -"bn/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bn\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "কোন জ্যামিতিক মান দেয়া হয়নি।" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "জ্যামিতিক মানটি বৈধ নয়।" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "জ্যামিতিক নমুনাটি বৈধ নয়।" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/br/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/br/LC_MESSAGES/django.mo deleted file mode 100644 index 4d31fd9..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/br/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/br/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/br/LC_MESSAGES/django.po deleted file mode 100644 index 31293d4..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/br/LC_MESSAGES/django.po +++ /dev/null @@ -1,92 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Fulup , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Breton (http://www.transifex.com/projects/p/django/language/" -"br/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: br\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Pajenn %s goullo" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Pajenn '%s' ebet" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/bs/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/bs/LC_MESSAGES/django.mo deleted file mode 100644 index 172b0dd..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/bs/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/bs/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/bs/LC_MESSAGES/django.po deleted file mode 100644 index 6903b9f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/bs/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Bosnian (http://www.transifex.com/projects/p/django/language/" -"bs/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bs\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Osnovno GIS polje -- mapiran je za OpenGIS Specification Geometry tip polja." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Tačka" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linijska nit" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poligon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-point" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Višelinijska nit" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi poligon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometrijska kolekcija" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Niste zadali parametre za geometriju." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Neispravan parametar za geometriju." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Nepostojeći tip geometrije." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Došlo je do greške tokom pretvaranje geometrije u SRID geometrijskom polja " -"obrazca." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ca/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ca/LC_MESSAGES/django.mo deleted file mode 100644 index 354072d..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ca/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ca/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ca/LC_MESSAGES/django.po deleted file mode 100644 index 6f4b4f6..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ca/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Antoni Aloy , 2012 -# Carles Barrobés , 2012 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:54+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Catalan (http://www.transifex.com/projects/p/django/language/" -"ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "No s'han registrat canal de contingut" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "L'slug %r no està registrat" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"El camp GIS base -- correspon al tipus 'Geometry' de l'especificació OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punt" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Cadena de línies" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polígon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-punt" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Cadena de multi-línies" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi polígon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Col·leció de geometria" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "No s'ha indicat cap valor de geometria." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valor de geometria invàlid." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tipus de geometria invàlid." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"S'ha produït un error en transformar la geometria al SRID del camp de " -"geometria del formulari." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "No hi ha un mapa del lloc disponible per a la secció: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Pàgina %s buida" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "No hi ha cap pàgina '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/cs/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/cs/LC_MESSAGES/django.mo deleted file mode 100644 index 1d36711..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/cs/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/cs/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/cs/LC_MESSAGES/django.po deleted file mode 100644 index 92d0a61..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/cs/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Vlada Macek , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Czech (http://www.transifex.com/projects/p/django/language/" -"cs/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: cs\n" -"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Žádné dávky nejsou registrované." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Identifikátor %r není registrován." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Základní GIS pole -- mapováno na typ Geometry podle specifikace OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Bod" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Úsek čáry" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Mnohonásobný bod" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Mnohonásobný úsek čáry" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Mnohonásobný polygon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Kolekce geometrií" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Hodnota geometrie nezadána." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Neplatná hodnota geometrie." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Neplatný typ geometrie." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Nastala chyba při transformaci geometrie na identifikátor SRID geometrického " -"formulářového pole." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Mapa webu není definovaná pro sekci: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Stránka %s je prázdná" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Není stránka '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/cy/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/cy/LC_MESSAGES/django.mo deleted file mode 100644 index 377df3d..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/cy/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/cy/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/cy/LC_MESSAGES/django.po deleted file mode 100644 index b29153a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/cy/LC_MESSAGES/django.po +++ /dev/null @@ -1,92 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Django\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-10-15 10:56+0200\n" -"PO-Revision-Date: 2011-01-19 16:52+0000\n" -"Last-Translator: Django team\n" -"Language-Team: Welsh (http://www.transifex.com/projects/p/django/language/" -"cy/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: cy\n" -"Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != " -"11) ? 2 : 3;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:271 -msgid "Point" -msgstr "" - -#: db/models/fields.py:275 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:279 -msgid "Polygon" -msgstr "" - -#: db/models/fields.py:283 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:287 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:291 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:295 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:19 -msgid "No geometry value provided." -msgstr "" - -#: forms/fields.py:20 -msgid "Invalid geometry value." -msgstr "" - -#: forms/fields.py:21 -msgid "Invalid geometry type." -msgstr "" - -#: forms/fields.py:22 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/da/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/da/LC_MESSAGES/django.mo deleted file mode 100644 index bd87e6a..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/da/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/da/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/da/LC_MESSAGES/django.po deleted file mode 100644 index 9b76a4d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/da/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Erik Wognsen , 2012 -# Finn Gruwier, 2011 -# Jannis Leidel , 2011 -# Kristian Øllegaard , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Danish (http://www.transifex.com/projects/p/django/language/" -"da/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: da\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Ingen feeds registrerede." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "\"Slug\" %r er ikke registreret." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Det grundlæggende GIS-felt - kæder til OpenGIS Specification geometritype." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punkt" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linjesegment" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multipunkt" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multilinjesegment" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multipolygon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometrisamling" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Ingen værdi givet for geometri." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Ugyldig geometriværdi." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Ugyldig gemometritype." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Der opstod en fejl ved transformation af geometrien til formularfeltets SRID" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Intet sitemap tilgængelig for sektion: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Siden %s er tom" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Ingen side hedder '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/de/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/de/LC_MESSAGES/django.mo deleted file mode 100644 index 31c5747..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/de/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/de/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/de/LC_MESSAGES/django.po deleted file mode 100644 index 60111f1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/de/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# André Hagenbruch , 2012 -# Jannis Leidel , 2011-2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-06-14 15:07+0000\n" -"Last-Translator: Jannis Leidel \n" -"Language-Team: German (http://www.transifex.com/projects/p/django/language/" -"de/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: de\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Keine Feeds registriert." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Kürzel %r nicht registriert." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Das Basis-GIS-Feld, das dem OpenGIS-Geometrie-Typ entspricht." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punkt" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linienzug" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Mehrere Punkte" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Mehrere Linienzüge" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Mehrere Polygone" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Sammlung geometrischer Objekte" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Kein geometrischer Wert gegeben." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Ungültiger geometrischer Wert." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Ungültiger geometrischer Typ." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Ein Fehler ist beim Umwandeln der Geometrie-Werte in die SRID des Geometrie-" -"Formularfeldes aufgetreten." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Für den Abschnit %r ist keine Sitemap vorhanden" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Seite %s ist leer" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Seite '%s' existiert nicht" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/el/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/el/LC_MESSAGES/django.mo deleted file mode 100644 index c02e2c2..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/el/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/el/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/el/LC_MESSAGES/django.po deleted file mode 100644 index ba1907c..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/el/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Dimitris Glezos , 2011 -# Kostas Papadimitriou , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Greek (http://www.transifex.com/projects/p/django/language/" -"el/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: el\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Δεν υπάρχουν εγγεγραμμένες ροές ειδήσεων." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Το βασικό πεδίο GIS - αντιστοιχεί στον τύπο γεωμετρίας των προδιαγραφών " -"OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Σημείο" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Γραμμή string" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Πολύγωνο" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Πολλαπλό σημείο" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multi-line string" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Πολλαπλό πολύγωνο" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Συλλογή γεωμετριών" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Δε δόθηκε τιμή γεωμετρίας." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Άκυρα τιμή γεωμετρίας." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Άκυρος τύπος γεωμετρίας." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Παρουσιάστηκε σφάλμα κατά τη μετατροπή της γεωμετρίας στο SRID του πεδίου " -"της φόρμας γεωμετρίας." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/en/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/en/LC_MESSAGES/django.mo deleted file mode 100644 index 08a7b68..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/en/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/en/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/en/LC_MESSAGES/django.po deleted file mode 100644 index 6c8d7ec..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/en/LC_MESSAGES/django.po +++ /dev/null @@ -1,88 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -msgid "" -msgstr "" -"Project-Id-Version: Django\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2010-05-13 15:35+0200\n" -"Last-Translator: Django team\n" -"Language-Team: English \n" -"Language: en\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/en_GB/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/en_GB/LC_MESSAGES/django.mo deleted file mode 100644 index a7c876f..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/en_GB/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/en_GB/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/en_GB/LC_MESSAGES/django.po deleted file mode 100644 index d6df0dc..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/en_GB/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# jon_atkinson , 2011 -# Ross Poulton , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: English (United Kingdom) (http://www.transifex.com/projects/p/" -"django/language/en_GB/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: en_GB\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "No feeds are registered." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r isn't registered." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "The base GIS field -- maps to the OpenGIS Specification Geometry type." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Point" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Line string" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-point" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multi-line string" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi polygon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometry collection" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "No geometry value provided." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Invalid geometry value." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Invalid geometry type." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "No sitemap available for section: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Page %s empty" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "No page '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/eo/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/eo/LC_MESSAGES/django.mo deleted file mode 100644 index d356af5..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/eo/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/eo/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/eo/LC_MESSAGES/django.po deleted file mode 100644 index f489c0d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/eo/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Baptiste , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Esperanto (http://www.transifex.com/projects/p/django/" -"language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Neniu fluo estas registrita." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Ĵetonvorto %r ne estas registrita." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "La baza GISa kampo -- mapas al la MalfermaGIS Specifa Geometria tipo." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punkto" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Liniŝnuro" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Plurangulo" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multpunkto" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multlinia ŝnuro" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multplurangulo" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometriaro" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Neniu geometria valoro provizas." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Malvalida geometria valoro." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Malvalida geometria tipo." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Eraro okazis dum transformi la geometrion al la SRID de la geometria forma " -"kampo." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Neniu paĝaro-mapo disponebla por sekcio:%r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Paĝo %s malplena" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Neniu paĝo '%s' trovita" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/es/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/es/LC_MESSAGES/django.mo deleted file mode 100644 index 65713a4..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/es/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/es/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/es/LC_MESSAGES/django.po deleted file mode 100644 index 0396c3d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/es/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Antoni Aloy , 2012 -# Jannis Leidel , 2011 -# Marc Garcia , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Spanish (http://www.transifex.com/projects/p/django/language/" -"es/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: es\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "No se han registrado canales de contenido." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "El slug %r no está registrado." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"El campo GIS base -- apunta al tipo de especificación geométrica de OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punto" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Cadena de línea" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polígono" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Punto múltiple" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Cadena de línea múltiple" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Polígono múltiple" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Colección de \"Geometry\"" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "No se indico ningún valor de geometría." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valor de geometría inválido." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tipo de geometría inválido." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Ocurrió un error al transformar la geometria al SRID de la geometria del " -"campo de formulario." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "No hay sitemap disponible para la sección: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "La página %s está vacía" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "No hay página '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/es_AR/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/es_AR/LC_MESSAGES/django.mo deleted file mode 100644 index 42f1add..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/es_AR/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/es_AR/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/es_AR/LC_MESSAGES/django.po deleted file mode 100644 index 9153961..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/es_AR/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Ramiro Morales , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Spanish (Argentina) (http://www.transifex.com/projects/p/" -"django/language/es_AR/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: es_AR\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "No se han registrado feeds" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "El slug %r no ha sido registrado" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"El campo GIS base -- corresponde al tipo Geometry de la especificación " -"OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punto" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Secuencia de líneas" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polígono" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-punto" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Cadena multi-línea" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi polígono" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Colección de Geometry's" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "No se ha proporcionado un valor de geometría." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valor de geometría no válido." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tipo de geometría no válido." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Ha ocurrido un error mientras se transformaba la geometría al SRID del campo " -"de formulario de la misma." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "No hay un sitemap disponible para la sección: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "La página %s está vacía" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "No existe la página '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/es_MX/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/es_MX/LC_MESSAGES/django.mo deleted file mode 100644 index c26a2aa..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/es_MX/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/es_MX/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/es_MX/LC_MESSAGES/django.po deleted file mode 100644 index 8471135..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/es_MX/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Abraham Estrada , 2011-2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Spanish (Mexico) (http://www.transifex.com/projects/p/django/" -"language/es_MX/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: es_MX\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "No hay feeds registrados." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "El slug %r no está registrado." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"El campo GIS base -- corresponde al tipo Geometry de la especificación " -"OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punto" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Secuencia de líneas" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polígono" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-punto" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Cadena multi-línea" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi polígonos" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Colección de geometrías" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "No se ha proporcionado un valor de geometría." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valor de geometría no válido." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tipo de geometría no válido." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Ha ocurrido un error mientras se transformaba la geometría al SRID del campo " -"de formulario de la misma." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "No hay mapa del sitio disponible para esta sección: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Página %s vacía" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "No hay página '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/et/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/et/LC_MESSAGES/django.mo deleted file mode 100644 index 8c1f137..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/et/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/et/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/et/LC_MESSAGES/django.po deleted file mode 100644 index 374519f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/et/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# eallik , 2011 -# Jannis Leidel , 2011 -# madisvain , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Estonian (http://www.transifex.com/projects/p/django/language/" -"et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Baas GIS väli -- ühildub OpenGIS Spetsifikatsiooni Geomeetria tüübiga." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punkt" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polügon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-punkt" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Mitmerealine string" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi-polügon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geomeetriakogum" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Geomeetriline väärtus puudub." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Vigane geomeetriline väärtus." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Vigane geomeetriline tüüp." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Geomeetria teisendamisel geomeetria vormivälja SRID-ks tekkis viga." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/eu/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/eu/LC_MESSAGES/django.mo deleted file mode 100644 index 702b98e..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/eu/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/eu/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/eu/LC_MESSAGES/django.po deleted file mode 100644 index 49593d1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/eu/LC_MESSAGES/django.po +++ /dev/null @@ -1,93 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Aitzol Naberan , 2011-2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Basque (http://www.transifex.com/projects/p/django/language/" -"eu/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eu\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Ez dago jariorik erregistratuta." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "%r sluga ez dago erregistratuta." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Oinarrizko GIS eremua -- OpenGIS zehaztapeneko Geomtry motarentzat mapak" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Puntua" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Lerro string-a" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poligonoa" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Puntu anitz" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Lerro anitz sting-a" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi poligonoa" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometria bilduma" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Ez fa geometria baliorik eman." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Geometria balio okera." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Geometria mota okerra." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Errore bat gertatu da geometria bere form eremuaren SRIDra biurtzean." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "%r atalarentzat ez dago sitemap-ik" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "%s orria hutsik dago" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "'%s' orririk ez" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/fa/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/fa/LC_MESSAGES/django.mo deleted file mode 100644 index 8551527..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/fa/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/fa/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/fa/LC_MESSAGES/django.po deleted file mode 100644 index 96c65d0..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/fa/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Ali Nikneshan , 2012 -# Alireza Savand , 2013 -# Jannis Leidel , 2011 -# Saeed , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Persian (http://www.transifex.com/projects/p/django/language/" -"fa/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: fa\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "هیچ کدام از فید ها ثبت شده است." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r ثبت نشده" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "فیلد GIS پایه -- نقشه‌ها برای مشخصه‌های هندسی OpenGIS" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "نقطه" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "رشته خط" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "چندضلعی" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "چند نقطه ای" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "چند خط رشته" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "چندین چند ضلعی " - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "مجموعه هندسی" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "مقدار جغرافیایی‌ای مقرر نشده است." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "مقدار جغرافیایی نامعتبر" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "نوعِ جغرافیایی نامعتبر" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "مشکلی در هنگام انتقال مختصات هندسی از فیلد به SRID رخ داد." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "هیچ سایت مپی برای قسمت %r موجود نیست" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "صفحه %s خالی است." - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "صفحه '%s' یافت نشد" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/fi/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/fi/LC_MESSAGES/django.mo deleted file mode 100644 index 3513d73..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/fi/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/fi/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/fi/LC_MESSAGES/django.po deleted file mode 100644 index 4a681a8..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/fi/LC_MESSAGES/django.po +++ /dev/null @@ -1,93 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Antti Kaihola , 2011 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Finnish (http://www.transifex.com/projects/p/django/language/" -"fi/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: fi\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "GIS-peruskenttä – vastaa OpenGIS-määrittelyn geometriatyyppiä." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Piste" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Murtoviiva" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygoni" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Monipiste" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Monimurtoviiva" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Monipolygoni" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometriakokoelma" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Geometria-arvoa ei annettu." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Virheellinen geometria-arvo." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Virheellinen geometriatyyppi." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Kentän SRID-muunnoksessa tapahtui virhe." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/fr/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/fr/LC_MESSAGES/django.mo deleted file mode 100644 index 70ec1ab..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/fr/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/fr/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/fr/LC_MESSAGES/django.po deleted file mode 100644 index d7ad0c7..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/fr/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# claudep , 2012 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: French (http://www.transifex.com/projects/p/django/language/" -"fr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: fr\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Aucun flux enregistré." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Le slug %r n'est pas enregistré." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Le champ GIS -- convertit dans le type de spécification géométrique " -"d'OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Point" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Chaîne de segment" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygone" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multipoint" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Chaîne multisegment" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multipolygone" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Collection géométrique" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Acune valeur géométrique fournie." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valeur géométrique non valide." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Type de géométrie non valide." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Une erreur est survenue lors de la transformation de l'objet géométrique " -"dans le SRID du champ de formulaire géométrique." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Aucun plan de site disponible pour la section %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Page %s vide" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Aucune page « %s »" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/fy_NL/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/fy_NL/LC_MESSAGES/django.mo deleted file mode 100644 index 3fb851a..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/fy_NL/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/fy_NL/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/fy_NL/LC_MESSAGES/django.po deleted file mode 100644 index 86bc66b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/fy_NL/LC_MESSAGES/django.po +++ /dev/null @@ -1,89 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -msgid "" -msgstr "" -"Project-Id-Version: Django\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-23 02:39+0100\n" -"PO-Revision-Date: 2011-03-15 15:48+0000\n" -"Last-Translator: Django team\n" -"Language-Team: English \n" -"Language: fy_NL\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" - -#: views.py:7 -msgid "No feeds are registered." -msgstr "" - -#: views.py:17 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:50 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:17 -msgid "No geometry value provided." -msgstr "" - -#: forms/fields.py:18 -msgid "Invalid geometry value." -msgstr "" - -#: forms/fields.py:19 -msgid "Invalid geometry type." -msgstr "" - -#: forms/fields.py:20 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:44 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:58 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ga/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ga/LC_MESSAGES/django.mo deleted file mode 100644 index 465a791..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ga/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ga/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ga/LC_MESSAGES/django.po deleted file mode 100644 index c234a0d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ga/LC_MESSAGES/django.po +++ /dev/null @@ -1,98 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Michael Thornhill , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Irish (http://www.transifex.com/projects/p/django/language/" -"ga/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ga\n" -"Plural-Forms: nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : " -"4);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Níl fothaí cláraithe." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Níl slug %r cláraithe." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"GIS an bonn réimse - léarscáileanna chun an Sonraíocht OpenGIS cineál " -"Céimseata." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Pointe" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Líne teaghrán" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polagán" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Il-phointe" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Il-líne teaghrán" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Il polagán" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Céimseata bhailiú" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Ní soláthair méid geoiméadracht" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Méid geoiméadracht neamhbhailí" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tíopa geoiméadracht neamhbhailí" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Tharla earráid ag claochlú an geoiméadracht go dtí SRID an réimse fhoirm " -"geoiméadracht." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Níl léarscáil an tSuoímh ar fáil le haghaidh roinn: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Leathanach %s folamh" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Níl leathanach '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/gl/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/gl/LC_MESSAGES/django.mo deleted file mode 100644 index fae9fa5..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/gl/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/gl/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/gl/LC_MESSAGES/django.po deleted file mode 100644 index 71a4c95..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/gl/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# fasouto , 2011 -# fonso , 2013 -# Leandro Regueiro , 2013 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-09-07 11:47+0000\n" -"Last-Translator: Leandro Regueiro \n" -"Language-Team: Galician (http://www.transifex.com/projects/p/django/language/" -"gl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gl\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Non hai feeds rexistradas." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "A url curta %r non está rexistrada." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"O campo GIS base -- correspóndese co tipo Geometry da especificación OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punto" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Secuencia de liñas" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polígono" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Punto múltiple" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Cadea multi-liña" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi polígono" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Colección de xeometrías" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Non se proporcionou un valor de xeometría." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valor xeométrico non válido." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tipo xeométrico non válido." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Atopouse un erro mentras se trasnformaba a xeometría ó SRID do campo " -"xeométrico do formulario." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Non hai un mapa do sitio dispoñíbel para a sección: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "A páxina %s baleira" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Non existe a páxina '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/he/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/he/LC_MESSAGES/django.mo deleted file mode 100644 index 7452fe4..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/he/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/he/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/he/LC_MESSAGES/django.po deleted file mode 100644 index 046d91a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/he/LC_MESSAGES/django.po +++ /dev/null @@ -1,93 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Meir Kriheli , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Hebrew (http://www.transifex.com/projects/p/django/language/" -"he/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: he\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "לא נרשמו פידים." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r אינו רשום." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "שדה ה־GIS הבסיסי -- ממופה לטיפוס OpenGIS Specification Geometry." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "נקודה" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "מחרוזת קו" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "פוליגון" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "מרובה־נקודות" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "מחרוזת קו מרובת שורות" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "פוליגון מרובה" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "אוסף גיאומטרי" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "לא סופק ערך גיאומטרי." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "ערך גאומטרי שגוי." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "סוג גיאומטרי שגוי." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "הייתה בעיה עם השינוי של הצורה לסוג של השדה." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "אין sitemap זמין עבור מדור: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "עמוד %s ריק" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "עמוד '%s' אינו קיים" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/hi/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/hi/LC_MESSAGES/django.mo deleted file mode 100644 index 5840114..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/hi/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/hi/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/hi/LC_MESSAGES/django.po deleted file mode 100644 index 39ceaf6..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/hi/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Chandan kumar , 2012 -# Sandeep Satavlekar , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Hindi (http://www.transifex.com/projects/p/django/language/" -"hi/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: hi\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "कोई फ़ीड पंजीकृत नहीं हैं." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "स्लग %r पंजीकृत नहीं है." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "आधारभूत GIS फ़ील्ड OpenGIS विशिष्टता ज्यामिति के प्ररूप हैं ." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "बिंदु" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "पंक्ति शृंखला" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "बहुभुज" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "बहु बिंदु" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "बहु - पंक्ति शृंखला" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "बहु बहुभुज" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "ज्यामिति संग्रह" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "कोई ज्यामिति मूल्य प्रदान नहीं की है." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "अवैध ज्यामिति मूल्य." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "अवैध ज्यामिति प्रकार" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"ज्यामिति को ज्यामिति प्रपत्र फ़ील्ड के SRID में परिवर्तित करते वक़्त एक ग़लती हो गयी ." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "अनुभाग के लिए कोई साइटमैप उपलब्ध नहीं: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "पृष्ठ %s खाली" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "कोई पृष्ठ '%s' नहीं " diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/hr/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/hr/LC_MESSAGES/django.mo deleted file mode 100644 index 757cef7..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/hr/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/hr/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/hr/LC_MESSAGES/django.po deleted file mode 100644 index 161ae5f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/hr/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# berislavlopac , 2012 -# Davor Lučić , 2012 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Croatian (http://www.transifex.com/projects/p/django/language/" -"hr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: hr\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Nema registriranih izvora." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r nije registriran." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Osnovno GIS polje -- mapira OpenGIS Specification Geometry tip." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Točka" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linija (Line string)" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poligon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Više točaka" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Više linija (Line string)" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Više poligona" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometrijska kolekcija" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Geometrijska vrijednost nije priložena." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Neispravna geometrijska vrijednost." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Neispravan geometrijski tip." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Došlo je do greške pri transformaciji geometrije na SRID geometrijskog polja " -"forme." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Ne postoji mapa za odjeljak: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Stranica %s je prazna" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Stranica '%s' ne postoji" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/hu/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/hu/LC_MESSAGES/django.mo deleted file mode 100644 index 0ddda60..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/hu/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/hu/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/hu/LC_MESSAGES/django.po deleted file mode 100644 index ab09c4b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/hu/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Kristóf Gruber <>, 2012 -# Szilveszter Farkas , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Hungarian (http://www.transifex.com/projects/p/django/" -"language/hu/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: hu\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Nincs regisztrált feed." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "%r slug nincs regisztrálva." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Az alap GIS mező -- az OpenGIS specifikáció geometria típusának megfelelően" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Pont" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Vonallánc" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poligon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-pont" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Többes vonallánc" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi-poligon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometria gyűjtemény" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Geometriai adat nem került megadásra." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Érvénytelen geometriai érték." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Érvénytelen geometriai típus." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Hiba történt a geometriai transzformáció során." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "%r szekcióhoz nincsen oldaltérkép" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "'%s' oldal üres" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "'%s' oldal nem létezik" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ia/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ia/LC_MESSAGES/django.mo deleted file mode 100644 index e751729..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ia/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ia/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ia/LC_MESSAGES/django.po deleted file mode 100644 index c5111f8..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ia/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Martijn Dekker , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Interlingua (http://www.transifex.com/projects/p/django/" -"language/ia/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ia\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Nulle syndication es registrate." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Le denotation %r non es registrate." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Le campo GIS de base. Corresponde al typo geometric del specification " -"OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Puncto" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Texto de linea" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygono" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Plure punctos" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Texto con plure lineas" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Plure polygonos" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Collection geometric" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Nulle valor geometric fornite." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valor geometric invalide." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Typo geometric invalide." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Un error occurreva durante le transformation del geometria al SRID del campo " -"del formulario geometric." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Nulle mappa de sito disponibile pro le section: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Le pagina '%s' es vacue" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Le pagina '%s' non existe" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/id/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/id/LC_MESSAGES/django.mo deleted file mode 100644 index fed1c0e..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/id/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/id/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/id/LC_MESSAGES/django.po deleted file mode 100644 index d37f86e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/id/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# rodin , 2011-2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Indonesian (http://www.transifex.com/projects/p/django/" -"language/id/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: id\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Tidak ada umpan terdaftar." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r tidak terdaftar." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Bidang dasar GIS disesuaikan berdasarkan OpenGIS Specification Geometry." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Point" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Line string" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-point" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multi-line string" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi polygon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometry collection" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Nilai geometri tidak disediakan." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Nilai geometri salah." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tipe geometri salah." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Galat terjadi saat mentransformasi geometri ke SRID bidang formulir geometri." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Tidak ada peta situs tersedia untuk bagian: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Laman %s kosong" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Tidak ada laman '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/is/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/is/LC_MESSAGES/django.mo deleted file mode 100644 index 16445de..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/is/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/is/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/is/LC_MESSAGES/django.po deleted file mode 100644 index 1038518..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/is/LC_MESSAGES/django.po +++ /dev/null @@ -1,93 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Hafsteinn Einarsson , 2011-2012 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Icelandic (http://www.transifex.com/projects/p/django/" -"language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Engir listar (feeds) eru skráðir" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slögg %r er ekki skráður" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Grunn GIS reitur -- varpast í OpenGIS rúmgerð." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punktur" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Lína" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Marghyrningur" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Punktar" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Línur" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Marghyrningar" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Rúmsafn" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Ekkert rúmgildi gefið." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Ógild rúmeining" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Ógild rúmmálsgerð." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Villa kom upp við að varpa rúmgildi í SRID reitsins." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Ekkert veftré tiltækt fyrir: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Síða %s tóm" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Engin síða %s" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.mo deleted file mode 100644 index 0e5fe80..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.po deleted file mode 100644 index 00c578d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Nicola Larosa , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Italian (http://www.transifex.com/projects/p/django/language/" -"it/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: it\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Non ci sono feed registrati." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Lo slug %r non è registrato." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Il campo base GIS -- corrisponde al tipo Geometry delle specifiche OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punto" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Stringa linea" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poligono" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multipunto" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Stringa multilinea" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi poligono" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Raccolta Geometry" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Nessun valore geometrico fornito." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valore geometrico non valido." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tipo geometrico non valido." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Si è verificato un errore durante la trasformazione della geometria nello " -"SRID del campo geometria della form." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Nessun sitemap disponibile per la sezione: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Pagina %s vuota" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Nessuna pagina '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ja/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ja/LC_MESSAGES/django.mo deleted file mode 100644 index fe5b508..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ja/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ja/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ja/LC_MESSAGES/django.po deleted file mode 100644 index 525e377..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ja/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Shinya Okano , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Japanese (http://www.transifex.com/projects/p/django/language/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "フィードが登録されていません。" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "スラグ %r は登録されていません。" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "GIS基底フィールドです -- OpenGIS で決められた地形タイプに対応" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "点" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "線" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "ポリゴン" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "複数の点" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "複数の線" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "複数のポリゴン" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "地形の集合" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "geometry値がありません。" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "geometry値が不正です" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "geometryタイプが不正です。" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"geometry を geometry フォームフィールドの SRID に変換しようとしてエラーが起き" -"ました。" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "このセクションで利用可能なサイトマップはありません: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "ページ %s は空です" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "ページ '%s' は存在しません" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ka/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ka/LC_MESSAGES/django.mo deleted file mode 100644 index d39bb7f..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ka/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ka/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ka/LC_MESSAGES/django.po deleted file mode 100644 index 676bb3d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ka/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# André Bouatchidzé , 2013 -# David Avsajanishvili , 2011 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Georgian (http://www.transifex.com/projects/p/django/language/" -"ka/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ka\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "არცერთი ფიდი არ არის რეგისტრირებული." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "სლაგი %r არ არის რეგისტრირებული." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "GIS-ის ბაზური ველი -- შეესაბამება OpenGIS სპეციფიკაციის Geometry ტიპს." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "წერტილი" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "ხაზის მასივი" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "მრავალკუთხედი" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "წერტილების სიმრავლე" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "ხაზების სიმრავლის მასივი" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "მრავალკუთხედების სიმრავლე" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "გეომეტრიული კოლექცია" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "გეომეტრიის მნიშვნელობა მოცემული არ არის." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "გეომეტრიის მნიშვნელობა არასწორია." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "გეომეტრიის ტიპი არასწორია." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "ველიდან გეომეტრიის SRID-ში გადაყვანისას მოხდა შეცდომა." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "არ არსებობს საიტის რუკა სექციისთვის: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "გვერდი %s ცარიელია" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "გვერდი '%s' არ არსებობს" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/kk/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/kk/LC_MESSAGES/django.mo deleted file mode 100644 index 5739646..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/kk/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/kk/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/kk/LC_MESSAGES/django.po deleted file mode 100644 index 505a777..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/kk/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# yun_man_ger , 2011 -# Zhazira , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Kazakh (http://www.transifex.com/projects/p/django/language/" -"kk/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: kk\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Негізгі GIS алаңы - OpenGIS спецификация бойынша геометриялық түрлерін " -"белгілейді." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Нүкте" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Сынық" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Көпбұрыш" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Нүкте жинағы" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Сынықтар жинағы" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Көпбұрыш жинағы" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Геометриялық объект жинағы" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Геметрия мәні берілген жоқ" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Геометрия мәні дұрыс емес" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Геометрия түрі дұрыс емес" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Геометрияны SRID-ге өзгерту кезінде қате шықты." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/km/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/km/LC_MESSAGES/django.mo deleted file mode 100644 index 192134f..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/km/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/km/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/km/LC_MESSAGES/django.po deleted file mode 100644 index 753dae6..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/km/LC_MESSAGES/django.po +++ /dev/null @@ -1,89 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -msgid "" -msgstr "" -"Project-Id-Version: Django\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-23 02:39+0100\n" -"PO-Revision-Date: 2011-03-15 15:48+0000\n" -"Last-Translator: Django team\n" -"Language-Team: English \n" -"Language: km\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0\n" - -#: views.py:7 -msgid "No feeds are registered." -msgstr "" - -#: views.py:17 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:50 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:17 -msgid "No geometry value provided." -msgstr "" - -#: forms/fields.py:18 -msgid "Invalid geometry value." -msgstr "" - -#: forms/fields.py:19 -msgid "Invalid geometry type." -msgstr "" - -#: forms/fields.py:20 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:44 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:58 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/kn/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/kn/LC_MESSAGES/django.mo deleted file mode 100644 index 69ad9e1..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/kn/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/kn/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/kn/LC_MESSAGES/django.po deleted file mode 100644 index f5bb345..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/kn/LC_MESSAGES/django.po +++ /dev/null @@ -1,91 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Django\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-10-15 10:56+0200\n" -"PO-Revision-Date: 2011-01-19 16:52+0000\n" -"Last-Translator: Django team\n" -"Language-Team: Kannada (http://www.transifex.com/projects/p/django/language/" -"kn/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: kn\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:271 -msgid "Point" -msgstr "" - -#: db/models/fields.py:275 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:279 -msgid "Polygon" -msgstr "" - -#: db/models/fields.py:283 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:287 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:291 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:295 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:19 -msgid "No geometry value provided." -msgstr "" - -#: forms/fields.py:20 -msgid "Invalid geometry value." -msgstr "" - -#: forms/fields.py:21 -msgid "Invalid geometry type." -msgstr "" - -#: forms/fields.py:22 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ko/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ko/LC_MESSAGES/django.mo deleted file mode 100644 index 39d7e81..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ko/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ko/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ko/LC_MESSAGES/django.po deleted file mode 100644 index e7f2ab2..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ko/LC_MESSAGES/django.po +++ /dev/null @@ -1,93 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jaehong Kim , 2011 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Korean (http://www.transifex.com/projects/p/django/language/" -"ko/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ko\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "기본 GIS 필드. OpenGIS Specification의 Geometry type으로 매핑됩니다." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "위치" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "한줄 문자열" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "다각형" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "복수위치" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "여러줄 문자열" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "복수 다각형" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "지리적 위치 모음" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Geometry 값이 없습니다." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Geometry 값이 부적절합니다." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Geometry 형식이 부적절합니다." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Geometry를 geometry 필드의 SRID로 변환하는 도중 오류가 발생하였습니다." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/lt/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/lt/LC_MESSAGES/django.mo deleted file mode 100644 index c62968a..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/lt/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/lt/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/lt/LC_MESSAGES/django.po deleted file mode 100644 index d969c36..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/lt/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Kostas , 2011 -# lauris , 2011 -# Simonas Kazlauskas , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Lithuanian (http://www.transifex.com/projects/p/django/" -"language/lt/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: lt\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" -"%100<10 || n%100>=20) ? 1 : 2);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Nėra užregistruotų srautų." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Adresas %r neregistruotas." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Bazinis GIS laukas - atvaizduoja OpenGIS Specification Geometry tipą" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Taškas" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Atkarpa" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Daugiakampis" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Taškų aibė" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Atkarpų aibė" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Daugiakampių aibė" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometrinė kolekcija" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Nenurodyta geometrinė reikšmė" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Netinkama geometrinė reikšmė" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Netinkamas geometrinis tipas" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Įvyko klaida pertvarkant geometrijos lauko SRID geometriją." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Nėra %r skyriaus svetainės medžio" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Puslapis %s tuščias" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Nėra '%s' puslapio" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/lv/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/lv/LC_MESSAGES/django.mo deleted file mode 100644 index e3273e6..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/lv/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/lv/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/lv/LC_MESSAGES/django.po deleted file mode 100644 index 8b8f31f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/lv/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Latvian (http://www.transifex.com/projects/p/django/language/" -"lv/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: lv\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " -"2);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Bāzes ĢIS lauks -- atbilst OpenGIS specifikācijas Geometry tipam." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punkts" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Līniju virkne" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Daudzstūris" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Vairāki punkti" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Vairāku rindu virkne" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Vairāki daudzstūri" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Ģeometrijas kolekcija" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Nav norādīta ģeometrijas vērtība." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Nekorekta ģeometrijas vērtība." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Nekorekts ģeometrijas tips." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Sastapta kļūda, pārveidojot ģeometriju uz ģeometriskās formas lauka SRID." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/mk/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/mk/LC_MESSAGES/django.mo deleted file mode 100644 index e0fe02c..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/mk/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/mk/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/mk/LC_MESSAGES/django.po deleted file mode 100644 index c8f42a5..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/mk/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# vvangelovski , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Macedonian (http://www.transifex.com/projects/p/django/" -"language/mk/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: mk\n" -"Plural-Forms: nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Нема регистрирани фидови." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Краткото име %r не е регистрирано" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Базичното GIS поле -- соодветствува на геометриски тип од OpenGIS " -"спецификацијата." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Точка" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Линиска нишка" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Полигон" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Повеќе точки" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Повеќе-линиска нишка" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Повеќе полигони" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Колекција од геометриски објекти" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Не е внесена геометриска вредност." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Невалидна геометриска вредност." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Невалиден геометриски тип." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Се појави грешка при трансформација на геометриската вредност во SRID од " -"геометриското поле" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Нема достапна мапа на сијтот за секцијата: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Страницата %s е празна" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Нема страница '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ml/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ml/LC_MESSAGES/django.mo deleted file mode 100644 index 02cb934..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ml/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ml/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ml/LC_MESSAGES/django.po deleted file mode 100644 index 8b15eb8..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ml/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Rajeesh Nair , 2011-2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Malayalam (http://www.transifex.com/projects/p/django/" -"language/ml/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ml\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr " ഫീഡുകളൊന്നും രജിസ്റ്റര്‍ ചെയ്തിട്ടില്ല." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "%r എന്ന സ്ലഗ് രജിസ്റ്റര്‍ ചെയ്തിട്ടില്ല." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"അടിസ്ഥാന ജി.ഐ.എസ് കളം (ഫീല്‍ഡ്) -- ഓപ്പണ്‍ ജി.ഐ.എസ് നിര്‍ദേശിച്ച തരം ജ്യാമിതീയ രൂപത്തെ " -"സൂചിപ്പിക്കാന്‍" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "ബിന്ദു" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "രേഖാ സ്ട്രിങ്ങ്" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "ബഹുഭുജം" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "ബഹുബിന്ദു" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "ബഹു രേഖാ സ്ട്രിങ്ങ്" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "ബഹു ബഹുഭുജം" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "ജ്യാമിതി ശേഖരം" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "ജ്യാമിതീയ മൂല്യമൊന്നും തന്നിട്ടില്ല." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "തെറ്റായ ജ്യാമിതീയ മൂല്യം." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "തെറ്റായ തരം ജ്യാമിതി." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"ജ്യാമിതീയ രൂപത്തെ ജ്യാമിതി കളത്തിന്റെ SRID-ലേക്കു മാറ്റുമ്പോള്‍ എന്തോ തകരാറു സംഭവിച്ചിട്ടുണ്ട്." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "%r എന്ന വിഭാഗത്തിനു സൈറ്റ്മാപ്പൊന്നും ലഭ്യമല്ല." - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "പേജ് %s കാലിയാണ്" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "'%s' എന്ന പേജില്ല." diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/mn/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/mn/LC_MESSAGES/django.mo deleted file mode 100644 index 7fa1bfa..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/mn/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/mn/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/mn/LC_MESSAGES/django.po deleted file mode 100644 index 11a0309..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/mn/LC_MESSAGES/django.po +++ /dev/null @@ -1,99 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jacara , 2011 -# Jannis Leidel , 2011 -# Анхбаяр Анхаа , 2011-2012 -# Баясгалан Цэвлээ , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Mongolian (http://www.transifex.com/projects/p/django/" -"language/mn/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: mn\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Бүртгэгдсэн feeds байхгүй байна." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "%r слаг бүгтгэгдээгүй байна" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Үндсэн GIS талбар -- OpenGIS газрын зургын Геометрын дүрсны онцгой төрөлтэй " -"байна." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Цэг" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Тэмдэгт мөр" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Олон өнцөгт" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Олон цэг" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Олон мөр бүхий тэмтэгт мөр" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Олон өнцөгтийн олонлог" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Дүрсний цуглуулга" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Дүрс оруулаагүй байна." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Буруу дүрс байна." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Дүрсийн төрөл буруу байна." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"An error occurred when transforming the geometry to the SRID дүрсний форм " -"талбарын SRID утгыг хөрвүүлэхэд алдаа гарлаа." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Энэ хэсэгт Sitemap алга: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "%s хуудас хоосон" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "'%s' хуудас байхгүй" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/nb/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/nb/LC_MESSAGES/django.mo deleted file mode 100644 index 41a8521..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/nb/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/nb/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/nb/LC_MESSAGES/django.po deleted file mode 100644 index c00c4a5..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/nb/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# jonklo , 2011-2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Norwegian Bokmål (http://www.transifex.com/projects/p/django/" -"language/nb/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: nb\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Ingen feeds er registrert." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r er ikke registrert." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "GIS-basefeltet - tilordnes til OpenGIS Specification Geometry-typen." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punkt" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linje-string" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multipunkt" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multilinje-string" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi-polygon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometri-samling" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Ingen geometriverdi oppgitt." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Ugyldig geometriverdi" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Ugyldig geometritype" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"En feil oppstod ved transformering av geometrien til SRID fra geometrifeltet." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Ingen sitemap tilgjengelig for seksjon: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Side %s tom" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Ingen side '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ne/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ne/LC_MESSAGES/django.mo deleted file mode 100644 index fd997b7..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ne/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ne/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ne/LC_MESSAGES/django.po deleted file mode 100644 index 5fcca3b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ne/LC_MESSAGES/django.po +++ /dev/null @@ -1,92 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Sagar Chalise , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Nepali (http://www.transifex.com/projects/p/django/language/" -"ne/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ne\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "बिन्दु" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "बहुभुज" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "ज्यामिति संकलन" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "ज्यामिति मान उपलब्ध छैन ।" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "उनुपयुक्त ज्यामिति मान" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "उनुपयुक्त ज्यामिति प्रकार" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/nl/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/nl/LC_MESSAGES/django.mo deleted file mode 100644 index cc67419..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/nl/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/nl/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/nl/LC_MESSAGES/django.po deleted file mode 100644 index b4d080b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/nl/LC_MESSAGES/django.po +++ /dev/null @@ -1,99 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Blue , 2011 -# Harro van der Klauw , 2012 -# Jannis Leidel , 2011 -# Jeffrey Gelens , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Dutch (http://www.transifex.com/projects/p/django/language/" -"nl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: nl\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Er zijn geen feeds geregistreerd" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r is niet geregistreerd." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Het basis GIS veld -- corresponderend met het OpenGIS Specificatie " -"Geometrisch type" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punt" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Lijn string" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygoon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-punt" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multi-lijn string" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi-polygoon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometrie collectie" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Geen geometrische waarde opgegeven." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Ongeldige geometrie waarde." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Ongeldig geometrie type." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Er is een fout opgetreden bij het omvormen van de geometrie naar de SRID van " -"het geometrie veld." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Geen sitemap beschikbaar voor sectie: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Pagina %s leeg" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Geen pagina '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/nn/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/nn/LC_MESSAGES/django.mo deleted file mode 100644 index 2f8a3c5..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/nn/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/nn/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/nn/LC_MESSAGES/django.po deleted file mode 100644 index e9b3587..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/nn/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Norwegian Nynorsk (http://www.transifex.com/projects/p/django/" -"language/nn/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: nn\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punkt" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linjestreng" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Fleirpunkt" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Fleirlinje-streng" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi-polygon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometrisamling" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Ingen geometriverdi oppgjeve." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Ugyldig geometriverdi" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Ugyldig geometritype" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Det oppstod ein feil ved transformering av geometrien til SRID frå " -"geometrifeltet." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/os/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/os/LC_MESSAGES/django.mo deleted file mode 100644 index bd01fd7..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/os/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/os/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/os/LC_MESSAGES/django.po deleted file mode 100644 index dc7004a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/os/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Soslan Khubulov , 2013 -# Soslan Khubulov , 2013 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-05-09 05:30+0000\n" -"Last-Translator: Soslan Khubulov \n" -"Language-Team: Ossetic (http://www.transifex.com/projects/p/django/language/" -"os/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: os\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Ницы лӕсӕн уыд регистрацигонд." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Слаг %r регистрацигонд нӕу." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Бындурон GIS бӕрц -- ӕндавы OpenGIS бӕрӕг геометрион хуызӕм." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Стъӕлф" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Хаахы рӕнхъ" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Бирӕкъуымон" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Бирӕ-стъӕлф" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Бирӕ-хаххы рӕнхъ" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Бирӕ бирӕкъуымон" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Геометриты ӕмбырд" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Геометрийы бӕрц амынд нӕу." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Геометрийы бӕрц раст нӕу." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Геометрийы хуыз раст нӕу." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Рӕдыд ӕрцыд SRID геометри формӕйы бынаты геометримӕ ивд куы цыдис, уӕд." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Ацы хайӕн сайтмап нӕй: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Фарс %s афтид у" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Фарс '%s' нӕй" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/pa/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/pa/LC_MESSAGES/django.mo deleted file mode 100644 index 51de451..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/pa/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/pa/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/pa/LC_MESSAGES/django.po deleted file mode 100644 index 4492c6f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/pa/LC_MESSAGES/django.po +++ /dev/null @@ -1,93 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# A S Alam , 2013 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-06-23 14:15+0000\n" -"Last-Translator: A S Alam \n" -"Language-Team: Panjabi (Punjabi) (http://www.transifex.com/projects/p/django/" -"language/pa/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: pa\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "ਕੋਈ ਫੀਡ ਰਜਿਸਟਰ ਨਹੀਂ ਹੈ।" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "ਪੁਆਇੰਟ" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "ਲਾਈਨ ਸਤਰ" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "ਬਹੁਭੁਜ" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "ਕਈ-ਪੁਆਇੰਟ" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "ਮਲਟੀ ਬਹੁ-ਭੁਜ" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "ਜੁਮੈਟਰੀ ਭੰਡਾਰ" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "ਕੋਈ ਜੁਮੈਟਰੀ ਮੁੱਲ ਨਹੀਂ ਦਿੱਤਾ ਗਿਆ।" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "ਗਲਤ ਜੁਮੈਟਰੀ ਮੁੱਲ।" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "ਗਲਤ ਜੁਮੈਟਰੀ ਕਿਸਮ।" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "ਪੇਜ਼ %s ਖਾਲੀ ਹੈ" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "ਪੇਜ਼ '%s' ਨਹੀਂ ਹੈ" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/pl/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/pl/LC_MESSAGES/django.mo deleted file mode 100644 index b8feae0..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/pl/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/pl/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/pl/LC_MESSAGES/django.po deleted file mode 100644 index 3123196..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/pl/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# angularcircle, 2012 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Polish (http://www.transifex.com/projects/p/django/language/" -"pl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: pl\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Kanał informacyjny (RSS/ATOM) nie został zarejestrowany." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug '%r' nie został zarejestrowany." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Podstawowe pole GIS - odpowiada typowi Geometry w specyfikacji OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punkt" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Ścieżka" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Wielokąt" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Zbiór punktów" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Zbiór ścieżek" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Zbiór wielokątów" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Zbiór geometrii" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Brak wartości geometrii." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Błędna wartość geometrii." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Błędny typ geometrii." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Wystąpił błąd podczas przekształcania geometrii do SRID pola formularza " -"geometrii." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Mapa strony dla sekcji '%r' nie jest dostępna" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Strona '%s' jest pusta" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Brak strony '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/pt/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/pt/LC_MESSAGES/django.mo deleted file mode 100644 index b7d7867..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/pt/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/pt/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/pt/LC_MESSAGES/django.po deleted file mode 100644 index 43b10b8..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/pt/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Nuno Mariz , 2011-2012 -# Paulo Köch , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-10-31 16:28+0000\n" -"Last-Translator: Nuno Mariz \n" -"Language-Team: Portuguese (http://www.transifex.com/projects/p/django/" -"language/pt/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: pt\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Nenhum feed está registado." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "O slug %r não está registado." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "O campo GIS base -- mapeado para o tipo especificado no OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Ponto" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linha" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polígono" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-ponto" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multi-linha" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi-polígono" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Coleção geométrica" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Não foi submetido nenhum valor do tipo geometria." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valor inválido de geometria." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tipo inválido de geometria." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Ocorreu um erro na transformação da geometria para o SRID da geometria do " -"campo do formulário." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Nenhum sitemap disponível para secção: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Página %s vazia" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Nenhuma página '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.mo deleted file mode 100644 index a3af5b7..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.po deleted file mode 100644 index e248a25..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Eduardo Carvalho , 2011 -# Guilherme Gondim , 2012 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" -"django/language/pt_BR/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Nenhum feed foi registrado." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "O slug %r não foi registrado." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"O campo GIS base -- mapeia para o tipo Especificação de Geometria OpenGIS" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Ponto" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linha string" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polígono" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multiponto" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multilinha string" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multipolígono" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Coleção geométrica" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Nenhum valor geométrico fornecido." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valor geométrico inválido." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tipo geométrico inválido." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Ocorreu um erro ao transformar a geometria para o SRID do campo de " -"formulário de geometria." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Nenhum sitemap disponível para a seção: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Página %s vazia" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Nenhuma página '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ro/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ro/LC_MESSAGES/django.mo deleted file mode 100644 index 8e7c7d1..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ro/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ro/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ro/LC_MESSAGES/django.po deleted file mode 100644 index f62a4b4..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ro/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Daniel Ursache-Dogariu , 2011 -# Denis Darii , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Romanian (http://www.transifex.com/projects/p/django/language/" -"ro/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ro\n" -"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" -"2:1));\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Câmpul GIS de bază -- mapat către tipul OpenGIS Specification Geometry." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punct" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Șir linii" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poligon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-punct" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Șir multi-linie" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi poligon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Colecție geometrie" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Nicio valoare geometrică furnizată." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Valoare geometrică nevalidă." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Tip geometric nevalid." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"A avut loc o eroare la transformarea geometriei în SRID-ul câmpului " -"geometric al formularului." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ru/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ru/LC_MESSAGES/django.mo deleted file mode 100644 index 72631a1..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ru/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ru/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ru/LC_MESSAGES/django.po deleted file mode 100644 index 7e707e9..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ru/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Eugene MechanisM , 2012 -# Jannis Leidel , 2011 -# Алексей Борискин , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Russian (http://www.transifex.com/projects/p/django/language/" -"ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Нет зарегистрированных фидов." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Слаг %r не зарегистрирован." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Базовое ГИС-поле. Его потомки отражают конкретные геометрические типы по " -"спецификации OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Точка" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Ломаная" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Многоугольник" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Набор точек" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Набор ломаных" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Набор многоугольников" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Набор геометрических объектов" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Не указано значение геометрии." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Неверное значение геометрии." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Неверный тип геометрии." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Произошла ошибка во время преобразования геометрии в SRID." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Нет карты сайта для секции: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Страница %s пустая" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Нет страницы '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sk/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/sk/LC_MESSAGES/django.mo deleted file mode 100644 index 14cb6dd..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/sk/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sk/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/sk/LC_MESSAGES/django.po deleted file mode 100644 index 1ed5d58..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/sk/LC_MESSAGES/django.po +++ /dev/null @@ -1,93 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Juraj Bubniak , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Slovak (http://www.transifex.com/projects/p/django/language/" -"sk/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: sk\n" -"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Žiadne kanály nie sú registrované." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Identifikátor %r nie je registrovaný." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Základné GIS pole -- mapuje na typ OpenGIS Specification Geometry" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Bod" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Čiara" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygón" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Viacero bodov" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Viacero čiar" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Viacero polygónov" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Goemetrická kolekcia" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Nie je zadaná žiadna geometrická hodnota." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Chybná geometrická hodnota." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Chybný geometrický typ." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Nastala chyba pri prevode geometrie do SRID z formulárového poľa." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Žiadna mapa stránok nie je dostupná pre sekciu: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Stránka %s je prázdna" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Žiadna stránka '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sl/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/sl/LC_MESSAGES/django.mo deleted file mode 100644 index 4db4e0a..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/sl/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sl/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/sl/LC_MESSAGES/django.po deleted file mode 100644 index afce95e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/sl/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# zejn , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Slovenian (http://www.transifex.com/projects/p/django/" -"language/sl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" -"%100==4 ? 2 : 3);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Ni vpisanih virov." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Okrajšava %r ni vpisana." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Osnovno polje GIS -- se preslika v vrsto Geometry po določilih OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Točka" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Črtni niz" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Mnogokotnik" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Več-točkovi predmet" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Več črtni niz" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Večkratni mnogokotnikov" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Zbirka likov" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Ni navdene geometrijske vrednosti." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Neveljavna geometrijska vrednost." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Neveljavna vrsta geometrije." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Med pretvarjanjem geometrijskega zapisa v SRID geometrijskega polja je " -"prišlo do napake." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Za odsek %r ni zemljevida strani." - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Stran %s je prazna" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Ni strani '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sq/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/sq/LC_MESSAGES/django.mo deleted file mode 100644 index f61db69..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/sq/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sq/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/sq/LC_MESSAGES/django.po deleted file mode 100644 index 0dc81bd..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/sq/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Besnik , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Albanian (http://www.transifex.com/projects/p/django/language/" -"sq/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: sq\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Nuk ka prurje të regjistruara." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Identifikuesi %r nuk është i regjistruar." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Fusha bazë GIS -- skiconi sipas llojit Gjeometri me Specifikime OpenGIS." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Pikë" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Varg vije" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Shumëkëndësh" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-pika" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Varg multi-vijë" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi shumëkëndësh" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Përmbledhje gjeometrie" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Nuk u dha vlerë gjeometrie." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Vlerë e pavlefshme gjeometrie." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Lloj i pavlefshëm gjeometrie." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Ndodhi një gabim gjatë shndërrimit të gjeometrisë në fushë SRID formulari " -"gjeometrie." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Nuk ka të passhme hartë site-i për ndarjen: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Faqe %s e zbrazët" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Nuk ka faqe '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sr/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/sr/LC_MESSAGES/django.mo deleted file mode 100644 index a9c9807..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/sr/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sr/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/sr/LC_MESSAGES/django.po deleted file mode 100644 index 6e897d5..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/sr/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Janos Guljas , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Serbian (http://www.transifex.com/projects/p/django/language/" -"sr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: sr\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Нема регистрованих фидова." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Слаг „%r“ није регистрован." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Основно „GIS“ поље које мапира тип геометрије по „OpenGIS“ спецификацији." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Тачка" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Линија" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Полигон" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Више тачака" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Више линија" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Више полигона" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Колекција геопметријских облика" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Нисте задали параметре за геометрију." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Неисправан параметар за геометрију." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Непостојећи тип геометрије." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Грешка се десила током трансформације геометрије на „SRID“ тип поља." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Нема сајт мапа за секцију: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Страница %s је празна" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Страница „%s“ не постоји" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.mo deleted file mode 100644 index 62d9d81..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.po deleted file mode 100644 index fe259d1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.po +++ /dev/null @@ -1,95 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Janos Guljas , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Serbian (Latin) (http://www.transifex.com/projects/p/django/" -"language/sr@latin/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: sr@latin\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Nema registrovanih fidova." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slag „%r“ nije registrovan." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Osnovno „GIS“ polje koje mapira tip geometrije po „OpenGIS“ specifikaciji." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Tačka" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linija" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poligon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Više tačaka" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Više linija" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Više poligona" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Kolekcija geopmetrijskih oblika" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Niste zadali parametre za geometriju." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Neispravan parametar za geometriju." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Nepostojeći tip geometrije." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Greška se desila tokom transformacije geometrije na „SRID“ tip polja." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Nema sajt mapa za sekciju: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Stranica %s je prazna" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Stranica „%s“ ne postoji" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sv/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/sv/LC_MESSAGES/django.mo deleted file mode 100644 index cdb6197..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/sv/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sv/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/sv/LC_MESSAGES/django.po deleted file mode 100644 index ca3cfff..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/sv/LC_MESSAGES/django.po +++ /dev/null @@ -1,93 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Andreas Pelme , 2011-2012 -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Swedish (http://www.transifex.com/projects/p/django/language/" -"sv/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: sv\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Inga flöden är registrerade." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slugen %r är inte registrerad." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "Grundläggande GIS-fält -- motsvarar ett OpenGIS-geometrifält." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Punkt" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Linjesegment" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multipunkt" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multilinjesegment" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multipolygon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometrisamling" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Inget geometriskt värde angivet." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Ogiltigt geometrivärde." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Ogiltig geometrityp" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Ett fel uppstod under transformering till SRID:t hos formulärsfältet." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Ingen sitemap finns tillgänglig för sektionen: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Sidan %s tom" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Ingen sida '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sw/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/sw/LC_MESSAGES/django.mo deleted file mode 100644 index 0625761..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/sw/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/sw/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/sw/LC_MESSAGES/django.po deleted file mode 100644 index c6710ef..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/sw/LC_MESSAGES/django.po +++ /dev/null @@ -1,93 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Swahili (http://www.transifex.com/projects/p/django/language/" -"sw/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: sw\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slagi %r haijasajiliwa" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Nukta" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poligoni" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Nukta-mbalimbali" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Poligoni mbalimbali" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Mkusanyiko wa jiometri" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Hakuna thamani ya jiometri iliyotolewa" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Thamani batili ya jiometri." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Aina batili ya jiometri." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Makosa yametokea wakati wa kubadilisha jiometri kuwa SRID ya sehemu ya fomu " -"ya jiometri." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Hakuna ramani ya tovuti kipengele %r inayopatikana" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Ukurasa mtupu %s" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Ukurasa '%s' haupo" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ta/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ta/LC_MESSAGES/django.mo deleted file mode 100644 index 9cd19ef..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ta/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ta/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ta/LC_MESSAGES/django.po deleted file mode 100644 index 5f878b1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ta/LC_MESSAGES/django.po +++ /dev/null @@ -1,91 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Django\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-10-15 10:56+0200\n" -"PO-Revision-Date: 2011-01-19 16:52+0000\n" -"Last-Translator: Django team\n" -"Language-Team: Tamil (http://www.transifex.com/projects/p/django/language/" -"ta/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ta\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:271 -msgid "Point" -msgstr "" - -#: db/models/fields.py:275 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:279 -msgid "Polygon" -msgstr "" - -#: db/models/fields.py:283 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:287 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:291 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:295 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:19 -msgid "No geometry value provided." -msgstr "" - -#: forms/fields.py:20 -msgid "Invalid geometry value." -msgstr "" - -#: forms/fields.py:21 -msgid "Invalid geometry type." -msgstr "" - -#: forms/fields.py:22 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/te/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/te/LC_MESSAGES/django.mo deleted file mode 100644 index fe16076..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/te/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/te/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/te/LC_MESSAGES/django.po deleted file mode 100644 index 30a291d..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/te/LC_MESSAGES/django.po +++ /dev/null @@ -1,92 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Telugu (http://www.transifex.com/projects/p/django/language/" -"te/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: te\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "క్షెత్రగనిత మూల్యము ఇవ్వలెదు." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "సరికాని క్షేత్రగణిత మూల్యము." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "సరికాని క్షేత్రగణిత రకం." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/th/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/th/LC_MESSAGES/django.mo deleted file mode 100644 index c7d179e..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/th/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/th/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/th/LC_MESSAGES/django.po deleted file mode 100644 index 837f9c9..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/th/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Kowit Charoenratchatabhan , 2012 -# Vichai Vongvorakul , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Thai (http://www.transifex.com/projects/p/django/language/" -"th/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: th\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "ไม่มีฟีดที่ลงทะเบียน" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r ไม่ได้ลงทะเบียน" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "เขตข้อมูล GIS ฐาน -- แผนที่ไปยังประเภท OpenGIS เรขาคณิตจำเพาะ" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "จุด" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "สายสตริง" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "รูปหลายเหลี่ยม" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "หลาย ๆ จุด" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "สตริงหลายบรรทัด" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "รูปหลายเหลี่ยมหลายรูป" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "คอลเลกชันรูปทรงเรขาคณิต" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "ไม่พบข้อมูลพิกัด" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "ค่าพิกัดผิดพลาด " - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "ขนิดข้อมูลพิกัดผิดพลาด" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "ข้อผิดพลาดที่เกิดขึ้นเมื่อการเปลี่ยนรูปทรงเรขาคณิตที่ SRID ของเขตข้อมูลฟอร์มเรขาคณิต" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "ไม่มีแผนผังไซต์บริการสำหรับส่วน: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "หน้า %s ที่ว่างเปล่า" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "ไม่มีหน้า '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/tr/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/tr/LC_MESSAGES/django.mo deleted file mode 100644 index 714895f..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/tr/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/tr/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/tr/LC_MESSAGES/django.po deleted file mode 100644 index 0031f3c..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/tr/LC_MESSAGES/django.po +++ /dev/null @@ -1,97 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Murat Çorlu , 2012 -# Murat Sahin , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Turkish (http://www.transifex.com/projects/p/django/language/" -"tr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: tr\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Hiçbir besleme kayıtlı değildir." - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r kayıtlı değildir." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Taban GIS alanı -- OpenGIS Spesifikasyonu Geometri türüne eşleşmektedir." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Nokta" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Satır dizisi" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Poligon" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Çok noktalı" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Çok satırlı metin" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Çoklu poligon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometri kolleksiyonu" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Hiçbir geometri değeri verilmemiştir." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Geçersiz geometri değeri." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Geçersiz geometri türü." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"Geometri verisi geometri form alanının SRID değerine dönüştürülürken hata " -"oluştu." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "%r bölümü için bir site haritası mevcut değil" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "%s sayfası boş" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "'%s' adında sayfa yok" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/tt/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/tt/LC_MESSAGES/django.mo deleted file mode 100644 index be379ad..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/tt/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/tt/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/tt/LC_MESSAGES/django.po deleted file mode 100644 index 96a5aa5..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/tt/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Azat Khasanshin , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Tatar (http://www.transifex.com/projects/p/django/language/" -"tt/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: tt\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Төп ГИС-кыр. Аның токымы OpenGIS спецификациясе буенча геометрик тибларны " -"күрсәтә." - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Нокта" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Сынык сызык" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Күппочмак" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Нокта җыелмасы" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Сынык сызыклар җыелмасы" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Күппочмаклар җыелмасы" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Геометрик объектлар җыелмасы" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Геометрик кыйммәт күрсәтелмәгән." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Дөрес булмаган геометрик кыйммәт." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Дөрес булмаган геометрик тип." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Геометриядән SRIDгә үзгәртү вакытында хата килеп чыкты." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/uk/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/uk/LC_MESSAGES/django.mo deleted file mode 100644 index 0013f4a..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/uk/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/uk/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/uk/LC_MESSAGES/django.po deleted file mode 100644 index 126512b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/uk/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Jannis Leidel , 2011 -# Roman Kozlovskiy , 2012 -# Sergey Lysach , 2011 -# Андрей Костенко , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:57+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Ukrainian (http://www.transifex.com/projects/p/django/" -"language/uk/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: uk\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Точка" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Багатокутник" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Не задано геометрічне значення." - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Невірне геометричне значення." - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Невірний геометричний тип." - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Помилка при перетворенні геометрії до SRID геометричного поля форми." - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Немає карти сайту для розділу: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Сторінка %s порожня" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Немає сторінки '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ur/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/ur/LC_MESSAGES/django.mo deleted file mode 100644 index dfbc355..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/ur/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/ur/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/ur/LC_MESSAGES/django.po deleted file mode 100644 index 754fb69..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/ur/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Mansoorulhaq Mansoor , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Urdu (http://www.transifex.com/projects/p/django/language/" -"ur/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ur\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "بنیادی GIS خانہ -- مخصوص OpenGIS جیومیٹری کی قسم سے منسلک ھے۔" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "نقطہ" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "لائن سٹرنگ" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "پولی گان" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "کثیر النقاط" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "متعدد لائنوں والا سٹرنگ" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "ملٹی پولی گان" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "جیومیٹری کا ذخیرہ" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "کوئی جیومیٹری ویلیو مھیا نھیں کی گئی۔" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "غلط جیومیٹری ویلیو۔" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "غلط جیومیٹری ٹائپ" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "" -"جیومیٹری کو جیومیٹری کے فارم کے SRID خانے میں تبدیل کرتے ھوئےکوئی خرابی واقع " -"ھو گئی ھے۔" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/vi/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/vi/LC_MESSAGES/django.mo deleted file mode 100644 index be55515..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/vi/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/vi/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/vi/LC_MESSAGES/django.po deleted file mode 100644 index b60c89a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/vi/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Lê Thanh , 2013 -# Tran , 2011 -# Tran Van , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-05-11 02:24+0000\n" -"Last-Translator: Lê Thanh \n" -"Language-Team: Vietnamese (http://www.transifex.com/projects/p/django/" -"language/vi/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: vi\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "Không có feed nào được đăng kí" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r không được đăng kí" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "" -"Trường GIS cơ bản -- ánh xạ đến kiểu đặc tả hình học của OpenGIS ( OpenGIS " -"Specification Geometry)" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Điểm" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Đường" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Đa giác" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Đa điểm" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multi-line string" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi polygon" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Kiểu hình học" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "Không có giá trị geometry" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "Giá trị geometry không hợp lệ" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "Kiểu geometry không hợp lệ" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "Có lỗi khi chuyển đổi hình học từ SRID của trường geometry" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "Không có sitemap cho mục: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "Trang %s trống" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "Không có trang '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/zh_CN/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index 86415ce..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/zh_CN/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/zh_CN/LC_MESSAGES/django.po deleted file mode 100644 index 33d0728..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/zh_CN/LC_MESSAGES/django.po +++ /dev/null @@ -1,96 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# Daniel Duan , 2011 -# Jannis Leidel , 2011 -# Lei Yang , 2011 -# Lele Long , 2011 -# Kevin Shi , 2012 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:56+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Chinese (China) (http://www.transifex.com/projects/p/django/" -"language/zh_CN/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "没有已注册的源。" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "Slug %r 没有注册." - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "基本地理信息系统域 - 映射于 OpenGIS 规范几何类型。" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "点" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "行字串" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "多边形" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "多点" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "多行字符串" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "多个多边形" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "几何集合" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "未提供几何信息。" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "无效几何信息。" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "无效几何类型。" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "几何形状的SRID字段发生试图转换错误ました。" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "没有站点地图可用的部分: %r" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "页面 %s 为空" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "无页面 '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/zh_TW/LC_MESSAGES/django.mo b/lib/python2.7/site-packages/django/contrib/gis/locale/zh_TW/LC_MESSAGES/django.mo deleted file mode 100644 index a4e1c73..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/locale/zh_TW/LC_MESSAGES/django.mo and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/locale/zh_TW/LC_MESSAGES/django.po b/lib/python2.7/site-packages/django/contrib/gis/locale/zh_TW/LC_MESSAGES/django.po deleted file mode 100644 index d9e6931..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/locale/zh_TW/LC_MESSAGES/django.po +++ /dev/null @@ -1,94 +0,0 @@ -# This file is distributed under the same license as the Django package. -# -# Translators: -# ilay , 2012 -# Jannis Leidel , 2011 -# quantum9876 , 2011 -msgid "" -msgstr "" -"Project-Id-Version: django-core\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-02 16:18+0200\n" -"PO-Revision-Date: 2013-04-24 18:55+0000\n" -"Last-Translator: claudep \n" -"Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/django/" -"language/zh_TW/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: zh_TW\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: views.py:9 -msgid "No feeds are registered." -msgstr "沒有已註冊的 feed。" - -#: views.py:19 -#, python-format -msgid "Slug %r isn't registered." -msgstr "嵌入式語法 %r 尚未註冊。" - -#: db/models/fields.py:51 -msgid "The base GIS field -- maps to the OpenGIS Specification Geometry type." -msgstr "將基本的 GIS 平面以OpenGIS Specification Geometry type對應。" - -#: db/models/fields.py:270 -msgid "Point" -msgstr "Point 類別" - -#: db/models/fields.py:274 -msgid "Line string" -msgstr "Line string 類別" - -#: db/models/fields.py:278 -msgid "Polygon" -msgstr "Polygon 類別" - -#: db/models/fields.py:282 -msgid "Multi-point" -msgstr "Multi-point 類別" - -#: db/models/fields.py:286 -msgid "Multi-line string" -msgstr "Multi-line string 類別" - -#: db/models/fields.py:290 -msgid "Multi polygon" -msgstr "Multi polygon 類別" - -#: db/models/fields.py:294 -msgid "Geometry collection" -msgstr "Geometry collection (幾何型別之叢集) 類別" - -#: forms/fields.py:23 -msgid "No geometry value provided." -msgstr "沒有幾何資訊。" - -#: forms/fields.py:24 -msgid "Invalid geometry value." -msgstr "無效的幾何參數。" - -#: forms/fields.py:25 -msgid "Invalid geometry type." -msgstr "無效的幾何類型。" - -#: forms/fields.py:26 -msgid "" -"An error occurred when transforming the geometry to the SRID of the geometry " -"form field." -msgstr "當把目前地理資訊-GIS,轉成空間參考識別碼-SRID時發生錯誤。" - -#: sitemaps/views.py:46 -#, python-format -msgid "No sitemap available for section: %r" -msgstr "區域 %r 無可用的網站地圖" - -#: sitemaps/views.py:60 -#, python-format -msgid "Page %s empty" -msgstr "頁面 %s 為空" - -#: sitemaps/views.py:62 -#, python-format -msgid "No page '%s'" -msgstr "無此頁面 '%s'" diff --git a/lib/python2.7/site-packages/django/contrib/gis/management/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/management/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/management/commands/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/management/commands/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/management/commands/inspectdb.py b/lib/python2.7/site-packages/django/contrib/gis/management/commands/inspectdb.py deleted file mode 100644 index bbf40e1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/management/commands/inspectdb.py +++ /dev/null @@ -1,29 +0,0 @@ -from django.core.management.commands.inspectdb import Command as InspectDBCommand - -class Command(InspectDBCommand): - db_module = 'django.contrib.gis.db' - gis_tables = {} - - def get_field_type(self, connection, table_name, row): - field_type, field_params, field_notes = super(Command, self).get_field_type(connection, table_name, row) - if field_type == 'GeometryField': - geo_col = row[0] - # Getting a more specific field type and any additional parameters - # from the `get_geometry_type` routine for the spatial backend. - field_type, geo_params = connection.introspection.get_geometry_type(table_name, geo_col) - field_params.update(geo_params) - # Adding the table name and column to the `gis_tables` dictionary, this - # allows us to track which tables need a GeoManager. - if table_name in self.gis_tables: - self.gis_tables[table_name].append(geo_col) - else: - self.gis_tables[table_name] = [geo_col] - return field_type, field_params, field_notes - - def get_meta(self, table_name): - meta_lines = super(Command, self).get_meta(table_name) - if table_name in self.gis_tables: - # If the table is a geographic one, then we need make - # GeoManager the default manager for the model. - meta_lines.insert(0, ' objects = models.GeoManager()') - return meta_lines diff --git a/lib/python2.7/site-packages/django/contrib/gis/management/commands/ogrinspect.py b/lib/python2.7/site-packages/django/contrib/gis/management/commands/ogrinspect.py deleted file mode 100644 index 2a29fe6..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/management/commands/ogrinspect.py +++ /dev/null @@ -1,118 +0,0 @@ -from optparse import make_option -from django.contrib.gis import gdal -from django.core.management.base import LabelCommand, CommandError - -def layer_option(option, opt, value, parser): - """ - Callback for `make_option` for the `ogrinspect` `layer_key` - keyword option which may be an integer or a string. - """ - try: - dest = int(value) - except ValueError: - dest = value - setattr(parser.values, option.dest, dest) - -def list_option(option, opt, value, parser): - """ - Callback for `make_option` for `ogrinspect` keywords that require - a string list. If the string is 'True'/'true' then the option - value will be a boolean instead. - """ - if value.lower() == 'true': - dest = True - else: - dest = [s for s in value.split(',')] - setattr(parser.values, option.dest, dest) - -class Command(LabelCommand): - help = ('Inspects the given OGR-compatible data source (e.g., a shapefile) and outputs\n' - 'a GeoDjango model with the given model name. For example:\n' - ' ./manage.py ogrinspect zipcode.shp Zipcode') - args = '[data_source] [model_name]' - - option_list = LabelCommand.option_list + ( - make_option('--blank', dest='blank', type='string', action='callback', - callback=list_option, default=False, - help='Use a comma separated list of OGR field names to add ' - 'the `blank=True` option to the field definition. Set with' - '`true` to apply to all applicable fields.'), - make_option('--decimal', dest='decimal', type='string', action='callback', - callback=list_option, default=False, - help='Use a comma separated list of OGR float fields to ' - 'generate `DecimalField` instead of the default ' - '`FloatField`. Set to `true` to apply to all OGR float fields.'), - make_option('--geom-name', dest='geom_name', type='string', default='geom', - help='Specifies the model name for the Geometry Field ' - '(defaults to `geom`)'), - make_option('--layer', dest='layer_key', type='string', action='callback', - callback=layer_option, default=0, - help='The key for specifying which layer in the OGR data ' - 'source to use. Defaults to 0 (the first layer). May be ' - 'an integer or a string identifier for the layer.'), - make_option('--multi-geom', action='store_true', dest='multi_geom', default=False, - help='Treat the geometry in the data source as a geometry collection.'), - make_option('--name-field', dest='name_field', - help='Specifies a field name to return for the `__unicode__`/`__str__` function.'), - make_option('--no-imports', action='store_false', dest='imports', default=True, - help='Do not include `from django.contrib.gis.db import models` ' - 'statement.'), - make_option('--null', dest='null', type='string', action='callback', - callback=list_option, default=False, - help='Use a comma separated list of OGR field names to add ' - 'the `null=True` option to the field definition. Set with' - '`true` to apply to all applicable fields.'), - make_option('--srid', dest='srid', - help='The SRID to use for the Geometry Field. If it can be ' - 'determined, the SRID of the data source is used.'), - make_option('--mapping', action='store_true', dest='mapping', - help='Generate mapping dictionary for use with `LayerMapping`.') - ) - - requires_model_validation = False - - def handle(self, *args, **options): - try: - data_source, model_name = args - except ValueError: - raise CommandError('Invalid arguments, must provide: %s' % self.args) - - if not gdal.HAS_GDAL: - raise CommandError('GDAL is required to inspect geospatial data sources.') - - # Removing options with `None` values. - options = dict([(k, v) for k, v in options.items() if not v is None]) - - # Getting the OGR DataSource from the string parameter. - try: - ds = gdal.DataSource(data_source) - except gdal.OGRException as msg: - raise CommandError(msg) - - # Whether the user wants to generate the LayerMapping dictionary as well. - show_mapping = options.pop('mapping', False) - - # Getting rid of settings that `_ogrinspect` doesn't like. - verbosity = options.pop('verbosity', False) - settings = options.pop('settings', False) - - # Returning the output of ogrinspect with the given arguments - # and options. - from django.contrib.gis.utils.ogrinspect import _ogrinspect, mapping - output = [s for s in _ogrinspect(ds, model_name, **options)] - if show_mapping: - # Constructing the keyword arguments for `mapping`, and - # calling it on the data source. - kwargs = {'geom_name' : options['geom_name'], - 'layer_key' : options['layer_key'], - 'multi_geom' : options['multi_geom'], - } - mapping_dict = mapping(ds, **kwargs) - # This extra legwork is so that the dictionary definition comes - # out in the same order as the fields in the model definition. - rev_mapping = dict([(v, k) for k, v in mapping_dict.items()]) - output.extend(['', '# Auto-generated `LayerMapping` dictionary for %s model' % model_name, - '%s_mapping = {' % model_name.lower()]) - output.extend([" '%s' : '%s'," % (rev_mapping[ogr_fld], ogr_fld) for ogr_fld in ds[options['layer_key']].fields]) - output.extend([" '%s' : '%s'," % (options['geom_name'], mapping_dict[options['geom_name']]), '}']) - return '\n'.join(output) + '\n' diff --git a/lib/python2.7/site-packages/django/contrib/gis/maps/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/maps/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/maps/google/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/maps/google/__init__.py deleted file mode 100644 index 9be689c..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/maps/google/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -""" - This module houses the GoogleMap object, used for generating - the needed javascript to embed Google Maps in a Web page. - - Google(R) is a registered trademark of Google, Inc. of Mountain View, California. - - Example: - - * In the view: - return render_to_response('template.html', {'google' : GoogleMap(key="abcdefg")}) - - * In the template: - - - {{ google.xhtml }} - - Google Maps via GeoDjango - {{ google.style }} - {{ google.scripts }} - - {{ google.body }} -
- - - - Note: If you want to be more explicit in your templates, the following are - equivalent: - {{ google.body }} => "" - {{ google.xhtml }} => "" - {{ google.style }} => "" - - Explanation: - - The `xhtml` property provides the correct XML namespace needed for - Google Maps to operate in IE using XHTML. Google Maps on IE uses - VML to draw polylines. Returns, by default: - - - - The `style` property provides the correct style tag for the CSS - properties required by Google Maps on IE: - - - - The `scripts` property provides the necessary ', - self.api_url, self.key) - - @property - def js(self): - "Returns only the generated Google Maps JavaScript (no tags required with Google Maps JavaScript." - return format_html('{0}\n ', - self.api_script, mark_safe(self.js)) - - @property - def style(self): - "Returns additional CSS styling needed for Google Maps on IE." - return format_html('', self.vml_css) - - @property - def xhtml(self): - "Returns XHTML information needed for IE VML overlays." - return format_html('', self.xmlns) - - @property - def icons(self): - "Returns a sequence of GIcon objects in this map." - return set([marker.icon for marker in self.markers if marker.icon]) - -class GoogleMapSet(GoogleMap): - - def __init__(self, *args, **kwargs): - """ - A class for generating sets of Google Maps that will be shown on the - same page together. - - Example: - gmapset = GoogleMapSet( GoogleMap( ... ), GoogleMap( ... ) ) - gmapset = GoogleMapSet( [ gmap1, gmap2] ) - """ - # The `google-multi.js` template is used instead of `google-single.js` - # by default. - template = kwargs.pop('template', 'gis/google/google-multi.js') - - # This is the template used to generate the GMap load JavaScript for - # each map in the set. - self.map_template = kwargs.pop('map_template', 'gis/google/google-single.js') - - # Running GoogleMap.__init__(), and resetting the template - # value with default obtained above. - super(GoogleMapSet, self).__init__(**kwargs) - self.template = template - - # If a tuple/list passed in as first element of args, then assume - if isinstance(args[0], (tuple, list)): - self.maps = args[0] - else: - self.maps = args - - # Generating DOM ids for each of the maps in the set. - self.dom_ids = ['map%d' % i for i in xrange(len(self.maps))] - - def load_map_js(self): - """ - Returns JavaScript containing all of the loading routines for each - map in this set. - """ - result = [] - for dom_id, gmap in zip(self.dom_ids, self.maps): - # Backup copies the GoogleMap DOM id and template attributes. - # They are overridden on each GoogleMap instance in the set so - # that only the loading JavaScript (and not the header variables) - # is used with the generated DOM ids. - tmp = (gmap.template, gmap.dom_id) - gmap.template = self.map_template - gmap.dom_id = dom_id - result.append(gmap.js) - # Restoring the backup values. - gmap.template, gmap.dom_id = tmp - return mark_safe(''.join(result)) - - def render(self): - """ - Generates the JavaScript for the collection of Google Maps in - this set. - """ - params = {'js_module' : self.js_module, - 'dom_ids' : self.dom_ids, - 'load_map_js' : self.load_map_js(), - 'icons' : self.icons, - } - params.update(self.extra_context) - return render_to_string(self.template, params) - - @property - def onload(self): - "Returns the `onload` HTML attribute." - # Overloaded to use the `load` function defined in the - # `google-multi.js`, which calls the load routines for - # each one of the individual maps in the set. - return mark_safe('onload="%s.load()"' % self.js_module) - - @property - def icons(self): - "Returns a sequence of all icons in each map of the set." - icons = set() - for map in self.maps: icons |= map.icons - return icons diff --git a/lib/python2.7/site-packages/django/contrib/gis/maps/google/overlays.py b/lib/python2.7/site-packages/django/contrib/gis/maps/google/overlays.py deleted file mode 100644 index b82d967..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/maps/google/overlays.py +++ /dev/null @@ -1,311 +0,0 @@ -from django.contrib.gis.geos import fromstr, Point, LineString, LinearRing, Polygon -from django.utils.functional import total_ordering -from django.utils.safestring import mark_safe -from django.utils import six -from django.utils.encoding import python_2_unicode_compatible - - -@python_2_unicode_compatible -class GEvent(object): - """ - A Python wrapper for the Google GEvent object. - - Events can be attached to any object derived from GOverlayBase with the - add_event() call. - - For more information please see the Google Maps API Reference: - http://code.google.com/apis/maps/documentation/reference.html#GEvent - - Example: - - from django.shortcuts import render_to_response - from django.contrib.gis.maps.google import GoogleMap, GEvent, GPolyline - - def sample_request(request): - polyline = GPolyline('LINESTRING(101 26, 112 26, 102 31)') - event = GEvent('click', - 'function() { location.href = "http://www.google.com"}') - polyline.add_event(event) - return render_to_response('mytemplate.html', - {'google' : GoogleMap(polylines=[polyline])}) - """ - - def __init__(self, event, action): - """ - Initializes a GEvent object. - - Parameters: - - event: - string for the event, such as 'click'. The event must be a valid - event for the object in the Google Maps API. - There is no validation of the event type within Django. - - action: - string containing a Javascript function, such as - 'function() { location.href = "newurl";}' - The string must be a valid Javascript function. Again there is no - validation fo the function within Django. - """ - self.event = event - self.action = action - - def __str__(self): - "Returns the parameter part of a GEvent." - return mark_safe('"%s", %s' %(self.event, self.action)) - -@python_2_unicode_compatible -class GOverlayBase(object): - def __init__(self): - self.events = [] - - def latlng_from_coords(self, coords): - "Generates a JavaScript array of GLatLng objects for the given coordinates." - return '[%s]' % ','.join(['new GLatLng(%s,%s)' % (y, x) for x, y in coords]) - - def add_event(self, event): - "Attaches a GEvent to the overlay object." - self.events.append(event) - - def __str__(self): - "The string representation is the JavaScript API call." - return mark_safe('%s(%s)' % (self.__class__.__name__, self.js_params)) - -class GPolygon(GOverlayBase): - """ - A Python wrapper for the Google GPolygon object. For more information - please see the Google Maps API Reference: - http://code.google.com/apis/maps/documentation/reference.html#GPolygon - """ - def __init__(self, poly, - stroke_color='#0000ff', stroke_weight=2, stroke_opacity=1, - fill_color='#0000ff', fill_opacity=0.4): - """ - The GPolygon object initializes on a GEOS Polygon or a parameter that - may be instantiated into GEOS Polygon. Please note that this will not - depict a Polygon's internal rings. - - Keyword Options: - - stroke_color: - The color of the polygon outline. Defaults to '#0000ff' (blue). - - stroke_weight: - The width of the polygon outline, in pixels. Defaults to 2. - - stroke_opacity: - The opacity of the polygon outline, between 0 and 1. Defaults to 1. - - fill_color: - The color of the polygon fill. Defaults to '#0000ff' (blue). - - fill_opacity: - The opacity of the polygon fill. Defaults to 0.4. - """ - if isinstance(poly, six.string_types): poly = fromstr(poly) - if isinstance(poly, (tuple, list)): poly = Polygon(poly) - if not isinstance(poly, Polygon): - raise TypeError('GPolygon may only initialize on GEOS Polygons.') - - # Getting the envelope of the input polygon (used for automatically - # determining the zoom level). - self.envelope = poly.envelope - - # Translating the coordinates into a JavaScript array of - # Google `GLatLng` objects. - self.points = self.latlng_from_coords(poly.shell.coords) - - # Stroke settings. - self.stroke_color, self.stroke_opacity, self.stroke_weight = stroke_color, stroke_opacity, stroke_weight - - # Fill settings. - self.fill_color, self.fill_opacity = fill_color, fill_opacity - - super(GPolygon, self).__init__() - - @property - def js_params(self): - return '%s, "%s", %s, %s, "%s", %s' % (self.points, self.stroke_color, self.stroke_weight, self.stroke_opacity, - self.fill_color, self.fill_opacity) - -class GPolyline(GOverlayBase): - """ - A Python wrapper for the Google GPolyline object. For more information - please see the Google Maps API Reference: - http://code.google.com/apis/maps/documentation/reference.html#GPolyline - """ - def __init__(self, geom, color='#0000ff', weight=2, opacity=1): - """ - The GPolyline object may be initialized on GEOS LineStirng, LinearRing, - and Polygon objects (internal rings not supported) or a parameter that - may instantiated into one of the above geometries. - - Keyword Options: - - color: - The color to use for the polyline. Defaults to '#0000ff' (blue). - - weight: - The width of the polyline, in pixels. Defaults to 2. - - opacity: - The opacity of the polyline, between 0 and 1. Defaults to 1. - """ - # If a GEOS geometry isn't passed in, try to contsruct one. - if isinstance(geom, six.string_types): geom = fromstr(geom) - if isinstance(geom, (tuple, list)): geom = Polygon(geom) - # Generating the lat/lng coordinate pairs. - if isinstance(geom, (LineString, LinearRing)): - self.latlngs = self.latlng_from_coords(geom.coords) - elif isinstance(geom, Polygon): - self.latlngs = self.latlng_from_coords(geom.shell.coords) - else: - raise TypeError('GPolyline may only initialize on GEOS LineString, LinearRing, and/or Polygon geometries.') - - # Getting the envelope for automatic zoom determination. - self.envelope = geom.envelope - self.color, self.weight, self.opacity = color, weight, opacity - super(GPolyline, self).__init__() - - @property - def js_params(self): - return '%s, "%s", %s, %s' % (self.latlngs, self.color, self.weight, self.opacity) - - -@total_ordering -class GIcon(object): - """ - Creates a GIcon object to pass into a Gmarker object. - - The keyword arguments map to instance attributes of the same name. These, - in turn, correspond to a subset of the attributes of the official GIcon - javascript object: - - http://code.google.com/apis/maps/documentation/reference.html#GIcon - - Because a Google map often uses several different icons, a name field has - been added to the required arguments. - - Required Arguments: - varname: - A string which will become the basis for the js variable name of - the marker, for this reason, your code should assign a unique - name for each GIcon you instantiate, otherwise there will be - name space collisions in your javascript. - - Keyword Options: - image: - The url of the image to be used as the icon on the map defaults - to 'G_DEFAULT_ICON' - - iconsize: - a tuple representing the pixel size of the foreground (not the - shadow) image of the icon, in the format: (width, height) ex.: - - GIcon('fast_food', - image="/media/icon/star.png", - iconsize=(15,10)) - - Would indicate your custom icon was 15px wide and 10px height. - - shadow: - the url of the image of the icon's shadow - - shadowsize: - a tuple representing the pixel size of the shadow image, format is - the same as ``iconsize`` - - iconanchor: - a tuple representing the pixel coordinate relative to the top left - corner of the icon image at which this icon is anchored to the map. - In (x, y) format. x increases to the right in the Google Maps - coordinate system and y increases downwards in the Google Maps - coordinate system.) - - infowindowanchor: - The pixel coordinate relative to the top left corner of the icon - image at which the info window is anchored to this icon. - - """ - def __init__(self, varname, image=None, iconsize=None, - shadow=None, shadowsize=None, iconanchor=None, - infowindowanchor=None): - self.varname = varname - self.image = image - self.iconsize = iconsize - self.shadow = shadow - self.shadowsize = shadowsize - self.iconanchor = iconanchor - self.infowindowanchor = infowindowanchor - - def __eq__(self, other): - return self.varname == other.varname - - def __lt__(self, other): - return self.varname < other.varname - - def __hash__(self): - # XOR with hash of GIcon type so that hash('varname') won't - # equal hash(GIcon('varname')). - return hash(self.__class__) ^ hash(self.varname) - -class GMarker(GOverlayBase): - """ - A Python wrapper for the Google GMarker object. For more information - please see the Google Maps API Reference: - http://code.google.com/apis/maps/documentation/reference.html#GMarker - - Example: - - from django.shortcuts import render_to_response - from django.contrib.gis.maps.google.overlays import GMarker, GEvent - - def sample_request(request): - marker = GMarker('POINT(101 26)') - event = GEvent('click', - 'function() { location.href = "http://www.google.com"}') - marker.add_event(event) - return render_to_response('mytemplate.html', - {'google' : GoogleMap(markers=[marker])}) - """ - def __init__(self, geom, title=None, draggable=False, icon=None): - """ - The GMarker object may initialize on GEOS Points or a parameter - that may be instantiated into a GEOS point. Keyword options map to - GMarkerOptions -- so far only the title option is supported. - - Keyword Options: - title: - Title option for GMarker, will be displayed as a tooltip. - - draggable: - Draggable option for GMarker, disabled by default. - """ - # If a GEOS geometry isn't passed in, try to construct one. - if isinstance(geom, six.string_types): geom = fromstr(geom) - if isinstance(geom, (tuple, list)): geom = Point(geom) - if isinstance(geom, Point): - self.latlng = self.latlng_from_coords(geom.coords) - else: - raise TypeError('GMarker may only initialize on GEOS Point geometry.') - # Getting the envelope for automatic zoom determination. - self.envelope = geom.envelope - # TODO: Add support for more GMarkerOptions - self.title = title - self.draggable = draggable - self.icon = icon - super(GMarker, self).__init__() - - def latlng_from_coords(self, coords): - return 'new GLatLng(%s,%s)' %(coords[1], coords[0]) - - def options(self): - result = [] - if self.title: result.append('title: "%s"' % self.title) - if self.icon: result.append('icon: %s' % self.icon.varname) - if self.draggable: result.append('draggable: true') - return '{%s}' % ','.join(result) - - @property - def js_params(self): - return '%s, %s' % (self.latlng, self.options()) diff --git a/lib/python2.7/site-packages/django/contrib/gis/maps/google/zoom.py b/lib/python2.7/site-packages/django/contrib/gis/maps/google/zoom.py deleted file mode 100644 index c93cf4e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/maps/google/zoom.py +++ /dev/null @@ -1,162 +0,0 @@ -from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point -from django.contrib.gis.maps.google.gmap import GoogleMapException -from django.utils.six.moves import xrange -from math import pi, sin, log, exp, atan - -# Constants used for degree to radian conversion, and vice-versa. -DTOR = pi / 180. -RTOD = 180. / pi - -class GoogleZoom(object): - """ - GoogleZoom is a utility for performing operations related to the zoom - levels on Google Maps. - - This class is inspired by the OpenStreetMap Mapnik tile generation routine - `generate_tiles.py`, and the article "How Big Is the World" (Hack #16) in - "Google Maps Hacks" by Rich Gibson and Schuyler Erle. - - `generate_tiles.py` may be found at: - http://trac.openstreetmap.org/browser/applications/rendering/mapnik/generate_tiles.py - - "Google Maps Hacks" may be found at http://safari.oreilly.com/0596101619 - """ - - def __init__(self, num_zoom=19, tilesize=256): - "Initializes the Google Zoom object." - # Google's tilesize is 256x256, square tiles are assumed. - self._tilesize = tilesize - - # The number of zoom levels - self._nzoom = num_zoom - - # Initializing arrays to hold the parameters for each one of the - # zoom levels. - self._degpp = [] # Degrees per pixel - self._radpp = [] # Radians per pixel - self._npix = [] # 1/2 the number of pixels for a tile at the given zoom level - - # Incrementing through the zoom levels and populating the parameter arrays. - z = tilesize # The number of pixels per zoom level. - for i in xrange(num_zoom): - # Getting the degrees and radians per pixel, and the 1/2 the number of - # for every zoom level. - self._degpp.append(z / 360.) # degrees per pixel - self._radpp.append(z / (2 * pi)) # radians per pixel - self._npix.append(z / 2) # number of pixels to center of tile - - # Multiplying `z` by 2 for the next iteration. - z *= 2 - - def __len__(self): - "Returns the number of zoom levels." - return self._nzoom - - def get_lon_lat(self, lonlat): - "Unpacks longitude, latitude from GEOS Points and 2-tuples." - if isinstance(lonlat, Point): - lon, lat = lonlat.coords - else: - lon, lat = lonlat - return lon, lat - - def lonlat_to_pixel(self, lonlat, zoom): - "Converts a longitude, latitude coordinate pair for the given zoom level." - # Setting up, unpacking the longitude, latitude values and getting the - # number of pixels for the given zoom level. - lon, lat = self.get_lon_lat(lonlat) - npix = self._npix[zoom] - - # Calculating the pixel x coordinate by multiplying the longitude value - # with with the number of degrees/pixel at the given zoom level. - px_x = round(npix + (lon * self._degpp[zoom])) - - # Creating the factor, and ensuring that 1 or -1 is not passed in as the - # base to the logarithm. Here's why: - # if fac = -1, we'll get log(0) which is undefined; - # if fac = 1, our logarithm base will be divided by 0, also undefined. - fac = min(max(sin(DTOR * lat), -0.9999), 0.9999) - - # Calculating the pixel y coordinate. - px_y = round(npix + (0.5 * log((1 + fac)/(1 - fac)) * (-1.0 * self._radpp[zoom]))) - - # Returning the pixel x, y to the caller of the function. - return (px_x, px_y) - - def pixel_to_lonlat(self, px, zoom): - "Converts a pixel to a longitude, latitude pair at the given zoom level." - if len(px) != 2: - raise TypeError('Pixel should be a sequence of two elements.') - - # Getting the number of pixels for the given zoom level. - npix = self._npix[zoom] - - # Calculating the longitude value, using the degrees per pixel. - lon = (px[0] - npix) / self._degpp[zoom] - - # Calculating the latitude value. - lat = RTOD * ( 2 * atan(exp((px[1] - npix)/ (-1.0 * self._radpp[zoom]))) - 0.5 * pi) - - # Returning the longitude, latitude coordinate pair. - return (lon, lat) - - def tile(self, lonlat, zoom): - """ - Returns a Polygon corresponding to the region represented by a fictional - Google Tile for the given longitude/latitude pair and zoom level. This - tile is used to determine the size of a tile at the given point. - """ - # The given lonlat is the center of the tile. - delta = self._tilesize / 2 - - # Getting the pixel coordinates corresponding to the - # the longitude/latitude. - px = self.lonlat_to_pixel(lonlat, zoom) - - # Getting the lower-left and upper-right lat/lon coordinates - # for the bounding box of the tile. - ll = self.pixel_to_lonlat((px[0]-delta, px[1]-delta), zoom) - ur = self.pixel_to_lonlat((px[0]+delta, px[1]+delta), zoom) - - # Constructing the Polygon, representing the tile and returning. - return Polygon(LinearRing(ll, (ll[0], ur[1]), ur, (ur[0], ll[1]), ll), srid=4326) - - def get_zoom(self, geom): - "Returns the optimal Zoom level for the given geometry." - # Checking the input type. - if not isinstance(geom, GEOSGeometry) or geom.srid != 4326: - raise TypeError('get_zoom() expects a GEOS Geometry with an SRID of 4326.') - - # Getting the envelope for the geometry, and its associated width, height - # and centroid. - env = geom.envelope - env_w, env_h = self.get_width_height(env.extent) - center = env.centroid - - for z in xrange(self._nzoom): - # Getting the tile at the zoom level. - tile_w, tile_h = self.get_width_height(self.tile(center, z).extent) - - # When we span more than one tile, this is an approximately good - # zoom level. - if (env_w > tile_w) or (env_h > tile_h): - if z == 0: - raise GoogleMapException('Geometry width and height should not exceed that of the Earth.') - return z-1 - - # Otherwise, we've zoomed in to the max. - return self._nzoom-1 - - def get_width_height(self, extent): - """ - Returns the width and height for the given extent. - """ - # Getting the lower-left, upper-left, and upper-right - # coordinates from the extent. - ll = Point(extent[:2]) - ul = Point(extent[0], extent[3]) - ur = Point(extent[2:]) - # Calculating the width and height. - height = ll.distance(ul) - width = ul.distance(ur) - return width, height diff --git a/lib/python2.7/site-packages/django/contrib/gis/maps/openlayers/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/maps/openlayers/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/measure.py b/lib/python2.7/site-packages/django/contrib/gis/measure.py deleted file mode 100644 index e2e6b6b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/measure.py +++ /dev/null @@ -1,330 +0,0 @@ -# Copyright (c) 2007, Robert Coup -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 3. Neither the name of Distance nor the names of its contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -""" -Distance and Area objects to allow for sensible and convienient calculation -and conversions. - -Authors: Robert Coup, Justin Bronn, Riccardo Di Virgilio - -Inspired by GeoPy (http://exogen.case.edu/projects/geopy/) -and Geoff Biggs' PhD work on dimensioned units for robotics. -""" -__all__ = ['A', 'Area', 'D', 'Distance'] -from decimal import Decimal - -from django.utils.functional import total_ordering -from django.utils import six - -NUMERIC_TYPES = six.integer_types + (float, Decimal) -AREA_PREFIX = "sq_" - -def pretty_name(obj): - return obj.__name__ if obj.__class__ == type else obj.__class__.__name__ - - -@total_ordering -class MeasureBase(object): - STANDARD_UNIT = None - ALIAS = {} - UNITS = {} - LALIAS = {} - - def __init__(self, default_unit=None, **kwargs): - value, self._default_unit = self.default_units(kwargs) - setattr(self, self.STANDARD_UNIT, value) - if default_unit and isinstance(default_unit, six.string_types): - self._default_unit = default_unit - - def _get_standard(self): - return getattr(self, self.STANDARD_UNIT) - - def _set_standard(self, value): - setattr(self, self.STANDARD_UNIT, value) - - standard = property(_get_standard, _set_standard) - - def __getattr__(self, name): - if name in self.UNITS: - return self.standard / self.UNITS[name] - else: - raise AttributeError('Unknown unit type: %s' % name) - - def __repr__(self): - return '%s(%s=%s)' % (pretty_name(self), self._default_unit, - getattr(self, self._default_unit)) - - def __str__(self): - return '%s %s' % (getattr(self, self._default_unit), self._default_unit) - - # **** Comparison methods **** - - def __eq__(self, other): - if isinstance(other, self.__class__): - return self.standard == other.standard - else: - return NotImplemented - - def __lt__(self, other): - if isinstance(other, self.__class__): - return self.standard < other.standard - else: - return NotImplemented - - # **** Operators methods **** - - def __add__(self, other): - if isinstance(other, self.__class__): - return self.__class__(default_unit=self._default_unit, - **{self.STANDARD_UNIT: (self.standard + other.standard)}) - else: - raise TypeError('%(class)s must be added with %(class)s' % {"class":pretty_name(self)}) - - def __iadd__(self, other): - if isinstance(other, self.__class__): - self.standard += other.standard - return self - else: - raise TypeError('%(class)s must be added with %(class)s' % {"class":pretty_name(self)}) - - def __sub__(self, other): - if isinstance(other, self.__class__): - return self.__class__(default_unit=self._default_unit, - **{self.STANDARD_UNIT: (self.standard - other.standard)}) - else: - raise TypeError('%(class)s must be subtracted from %(class)s' % {"class":pretty_name(self)}) - - def __isub__(self, other): - if isinstance(other, self.__class__): - self.standard -= other.standard - return self - else: - raise TypeError('%(class)s must be subtracted from %(class)s' % {"class":pretty_name(self)}) - - def __mul__(self, other): - if isinstance(other, NUMERIC_TYPES): - return self.__class__(default_unit=self._default_unit, - **{self.STANDARD_UNIT: (self.standard * other)}) - else: - raise TypeError('%(class)s must be multiplied with number' % {"class":pretty_name(self)}) - - def __imul__(self, other): - if isinstance(other, NUMERIC_TYPES): - self.standard *= float(other) - return self - else: - raise TypeError('%(class)s must be multiplied with number' % {"class":pretty_name(self)}) - - def __rmul__(self, other): - return self * other - - def __truediv__(self, other): - if isinstance(other, self.__class__): - return self.standard / other.standard - if isinstance(other, NUMERIC_TYPES): - return self.__class__(default_unit=self._default_unit, - **{self.STANDARD_UNIT: (self.standard / other)}) - else: - raise TypeError('%(class)s must be divided with number or %(class)s' % {"class":pretty_name(self)}) - - def __div__(self, other): # Python 2 compatibility - return type(self).__truediv__(self, other) - - def __itruediv__(self, other): - if isinstance(other, NUMERIC_TYPES): - self.standard /= float(other) - return self - else: - raise TypeError('%(class)s must be divided with number' % {"class":pretty_name(self)}) - - def __idiv__(self, other): # Python 2 compatibility - return type(self).__itruediv__(self, other) - - def __bool__(self): - return bool(self.standard) - - def __nonzero__(self): # Python 2 compatibility - return type(self).__bool__(self) - - def default_units(self, kwargs): - """ - Return the unit value and the default units specified - from the given keyword arguments dictionary. - """ - val = 0.0 - default_unit = self.STANDARD_UNIT - for unit, value in six.iteritems(kwargs): - if not isinstance(value, float): value = float(value) - if unit in self.UNITS: - val += self.UNITS[unit] * value - default_unit = unit - elif unit in self.ALIAS: - u = self.ALIAS[unit] - val += self.UNITS[u] * value - default_unit = u - else: - lower = unit.lower() - if lower in self.UNITS: - val += self.UNITS[lower] * value - default_unit = lower - elif lower in self.LALIAS: - u = self.LALIAS[lower] - val += self.UNITS[u] * value - default_unit = u - else: - raise AttributeError('Unknown unit type: %s' % unit) - return val, default_unit - - @classmethod - def unit_attname(cls, unit_str): - """ - Retrieves the unit attribute name for the given unit string. - For example, if the given unit string is 'metre', 'm' would be returned. - An exception is raised if an attribute cannot be found. - """ - lower = unit_str.lower() - if unit_str in cls.UNITS: - return unit_str - elif lower in cls.UNITS: - return lower - elif lower in cls.LALIAS: - return cls.LALIAS[lower] - else: - raise Exception('Could not find a unit keyword associated with "%s"' % unit_str) - -class Distance(MeasureBase): - STANDARD_UNIT = "m" - UNITS = { - 'chain' : 20.1168, - 'chain_benoit' : 20.116782, - 'chain_sears' : 20.1167645, - 'british_chain_benoit' : 20.1167824944, - 'british_chain_sears' : 20.1167651216, - 'british_chain_sears_truncated' : 20.116756, - 'cm' : 0.01, - 'british_ft' : 0.304799471539, - 'british_yd' : 0.914398414616, - 'clarke_ft' : 0.3047972654, - 'clarke_link' : 0.201166195164, - 'fathom' : 1.8288, - 'ft': 0.3048, - 'german_m' : 1.0000135965, - 'gold_coast_ft' : 0.304799710181508, - 'indian_yd' : 0.914398530744, - 'inch' : 0.0254, - 'km': 1000.0, - 'link' : 0.201168, - 'link_benoit' : 0.20116782, - 'link_sears' : 0.20116765, - 'm': 1.0, - 'mi': 1609.344, - 'mm' : 0.001, - 'nm': 1852.0, - 'nm_uk' : 1853.184, - 'rod' : 5.0292, - 'sears_yd' : 0.91439841, - 'survey_ft' : 0.304800609601, - 'um' : 0.000001, - 'yd': 0.9144, - } - - # Unit aliases for `UNIT` terms encountered in Spatial Reference WKT. - ALIAS = { - 'centimeter' : 'cm', - 'foot' : 'ft', - 'inches' : 'inch', - 'kilometer' : 'km', - 'kilometre' : 'km', - 'meter' : 'm', - 'metre' : 'm', - 'micrometer' : 'um', - 'micrometre' : 'um', - 'millimeter' : 'mm', - 'millimetre' : 'mm', - 'mile' : 'mi', - 'yard' : 'yd', - 'British chain (Benoit 1895 B)' : 'british_chain_benoit', - 'British chain (Sears 1922)' : 'british_chain_sears', - 'British chain (Sears 1922 truncated)' : 'british_chain_sears_truncated', - 'British foot (Sears 1922)' : 'british_ft', - 'British foot' : 'british_ft', - 'British yard (Sears 1922)' : 'british_yd', - 'British yard' : 'british_yd', - "Clarke's Foot" : 'clarke_ft', - "Clarke's link" : 'clarke_link', - 'Chain (Benoit)' : 'chain_benoit', - 'Chain (Sears)' : 'chain_sears', - 'Foot (International)' : 'ft', - 'German legal metre' : 'german_m', - 'Gold Coast foot' : 'gold_coast_ft', - 'Indian yard' : 'indian_yd', - 'Link (Benoit)': 'link_benoit', - 'Link (Sears)': 'link_sears', - 'Nautical Mile' : 'nm', - 'Nautical Mile (UK)' : 'nm_uk', - 'US survey foot' : 'survey_ft', - 'U.S. Foot' : 'survey_ft', - 'Yard (Indian)' : 'indian_yd', - 'Yard (Sears)' : 'sears_yd' - } - LALIAS = dict([(k.lower(), v) for k, v in ALIAS.items()]) - - def __mul__(self, other): - if isinstance(other, self.__class__): - return Area(default_unit=AREA_PREFIX + self._default_unit, - **{AREA_PREFIX + self.STANDARD_UNIT: (self.standard * other.standard)}) - elif isinstance(other, NUMERIC_TYPES): - return self.__class__(default_unit=self._default_unit, - **{self.STANDARD_UNIT: (self.standard * other)}) - else: - raise TypeError('%(distance)s must be multiplied with number or %(distance)s' % { - "distance" : pretty_name(self.__class__), - }) - - -class Area(MeasureBase): - STANDARD_UNIT = AREA_PREFIX + Distance.STANDARD_UNIT - # Getting the square units values and the alias dictionary. - UNITS = dict([('%s%s' % (AREA_PREFIX, k), v ** 2) for k, v in Distance.UNITS.items()]) - ALIAS = dict([(k, '%s%s' % (AREA_PREFIX, v)) for k, v in Distance.ALIAS.items()]) - LALIAS = dict([(k.lower(), v) for k, v in ALIAS.items()]) - - def __truediv__(self, other): - if isinstance(other, NUMERIC_TYPES): - return self.__class__(default_unit=self._default_unit, - **{self.STANDARD_UNIT: (self.standard / other)}) - else: - raise TypeError('%(class)s must be divided by a number' % {"class":pretty_name(self)}) - - def __div__(self, other): # Python 2 compatibility - return type(self).__truediv__(self, other) - - -# Shortcuts -D = Distance -A = Area diff --git a/lib/python2.7/site-packages/django/contrib/gis/models.py b/lib/python2.7/site-packages/django/contrib/gis/models.py deleted file mode 100644 index e379e82..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/models.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.db import connection - -if (hasattr(connection.ops, 'spatial_version') and - not connection.ops.mysql): - # Getting the `SpatialRefSys` and `GeometryColumns` - # models for the default spatial backend. These - # aliases are provided for backwards-compatibility. - SpatialRefSys = connection.ops.spatial_ref_sys() - GeometryColumns = connection.ops.geometry_columns() diff --git a/lib/python2.7/site-packages/django/contrib/gis/shortcuts.py b/lib/python2.7/site-packages/django/contrib/gis/shortcuts.py deleted file mode 100644 index 16b0fdf..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/shortcuts.py +++ /dev/null @@ -1,33 +0,0 @@ -import zipfile -from io import BytesIO - -from django.conf import settings -from django.http import HttpResponse -from django.template import loader - -def compress_kml(kml): - "Returns compressed KMZ from the given KML string." - kmz = BytesIO() - zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED) - zf.writestr('doc.kml', kml.encode(settings.DEFAULT_CHARSET)) - zf.close() - kmz.seek(0) - return kmz.read() - -def render_to_kml(*args, **kwargs): - "Renders the response as KML (using the correct MIME type)." - return HttpResponse(loader.render_to_string(*args, **kwargs), - content_type='application/vnd.google-earth.kml+xml') - -def render_to_kmz(*args, **kwargs): - """ - Compresses the KML content and returns as KMZ (using the correct - MIME type). - """ - return HttpResponse(compress_kml(loader.render_to_string(*args, **kwargs)), - content_type='application/vnd.google-earth.kmz') - -def render_to_text(*args, **kwargs): - "Renders the response using the MIME type for plain text." - return HttpResponse(loader.render_to_string(*args, **kwargs), - content_type='text/plain') diff --git a/lib/python2.7/site-packages/django/contrib/gis/sitemaps/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/sitemaps/__init__.py deleted file mode 100644 index 9b6287f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/sitemaps/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# Geo-enabled Sitemap classes. -from django.contrib.gis.sitemaps.georss import GeoRSSSitemap -from django.contrib.gis.sitemaps.kml import KMLSitemap, KMZSitemap - diff --git a/lib/python2.7/site-packages/django/contrib/gis/sitemaps/georss.py b/lib/python2.7/site-packages/django/contrib/gis/sitemaps/georss.py deleted file mode 100644 index ccb7dc2..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/sitemaps/georss.py +++ /dev/null @@ -1,53 +0,0 @@ -from django.core import urlresolvers -from django.contrib.sitemaps import Sitemap - -class GeoRSSSitemap(Sitemap): - """ - A minimal hook to produce sitemaps for GeoRSS feeds. - """ - def __init__(self, feed_dict, slug_dict=None): - """ - This sitemap object initializes on a feed dictionary (as would be passed - to `django.contrib.gis.views.feed`) and a slug dictionary. - If the slug dictionary is not defined, then it's assumed the keys provide - the URL parameter to the feed. However, if you have a complex feed (e.g., - you override `get_object`, then you'll need to provide a slug dictionary. - The slug dictionary should have the same keys as the feed dictionary, but - each value in the slug dictionary should be a sequence of slugs that may - be used for valid feeds. For example, let's say we have a feed that - returns objects for a specific ZIP code in our feed dictionary: - - feed_dict = {'zipcode' : ZipFeed} - - Then we would use a slug dictionary with a list of the zip code slugs - corresponding to feeds you want listed in the sitemap: - - slug_dict = {'zipcode' : ['77002', '77054']} - """ - # Setting up. - self.feed_dict = feed_dict - self.locations = [] - if slug_dict is None: slug_dict = {} - # Getting the feed locations. - for section in feed_dict.keys(): - if slug_dict.get(section, False): - for slug in slug_dict[section]: - self.locations.append('%s/%s' % (section, slug)) - else: - self.locations.append(section) - - def get_urls(self, page=1, site=None): - """ - This method is overrridden so the appropriate `geo_format` attribute - is placed on each URL element. - """ - urls = Sitemap.get_urls(self, page=page, site=site) - for url in urls: url['geo_format'] = 'georss' - return urls - - def items(self): - return self.locations - - def location(self, obj): - return urlresolvers.reverse('django.contrib.gis.views.feed', args=(obj,)) - diff --git a/lib/python2.7/site-packages/django/contrib/gis/sitemaps/kml.py b/lib/python2.7/site-packages/django/contrib/gis/sitemaps/kml.py deleted file mode 100644 index 837fe62..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/sitemaps/kml.py +++ /dev/null @@ -1,63 +0,0 @@ -from django.core import urlresolvers -from django.contrib.sitemaps import Sitemap -from django.contrib.gis.db.models.fields import GeometryField -from django.db import models - -class KMLSitemap(Sitemap): - """ - A minimal hook to produce KML sitemaps. - """ - geo_format = 'kml' - - def __init__(self, locations=None): - # If no locations specified, then we try to build for - # every model in installed applications. - self.locations = self._build_kml_sources(locations) - - def _build_kml_sources(self, sources): - """ - Goes through the given sources and returns a 3-tuple of - the application label, module name, and field name of every - GeometryField encountered in the sources. - - If no sources are provided, then all models. - """ - kml_sources = [] - if sources is None: - sources = models.get_models() - for source in sources: - if isinstance(source, models.base.ModelBase): - for field in source._meta.fields: - if isinstance(field, GeometryField): - kml_sources.append((source._meta.app_label, - source._meta.model_name, - field.name)) - elif isinstance(source, (list, tuple)): - if len(source) != 3: - raise ValueError('Must specify a 3-tuple of (app_label, module_name, field_name).') - kml_sources.append(source) - else: - raise TypeError('KML Sources must be a model or a 3-tuple.') - return kml_sources - - def get_urls(self, page=1, site=None): - """ - This method is overrridden so the appropriate `geo_format` attribute - is placed on each URL element. - """ - urls = Sitemap.get_urls(self, page=page, site=site) - for url in urls: url['geo_format'] = self.geo_format - return urls - - def items(self): - return self.locations - - def location(self, obj): - return urlresolvers.reverse('django.contrib.gis.sitemaps.views.%s' % self.geo_format, - kwargs={'label' : obj[0], - 'model' : obj[1], - 'field_name': obj[2], - } - ) -class KMZSitemap(KMLSitemap): - geo_format = 'kmz' diff --git a/lib/python2.7/site-packages/django/contrib/gis/sitemaps/views.py b/lib/python2.7/site-packages/django/contrib/gis/sitemaps/views.py deleted file mode 100644 index 9682c12..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/sitemaps/views.py +++ /dev/null @@ -1,114 +0,0 @@ -from __future__ import unicode_literals - -from django.http import HttpResponse, Http404 -from django.template import loader -from django.contrib.sites.models import get_current_site -from django.core import urlresolvers -from django.core.paginator import EmptyPage, PageNotAnInteger -from django.contrib.gis.db.models.fields import GeometryField -from django.db import connections, DEFAULT_DB_ALIAS -from django.db.models import get_model -from django.utils import six -from django.utils.translation import ugettext as _ - -from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz - -def index(request, sitemaps): - """ - This view generates a sitemap index that uses the proper view - for resolving geographic section sitemap URLs. - """ - current_site = get_current_site(request) - sites = [] - protocol = 'https' if request.is_secure() else 'http' - for section, site in sitemaps.items(): - if callable(site): - pages = site().paginator.num_pages - else: - pages = site.paginator.num_pages - sitemap_url = urlresolvers.reverse('django.contrib.gis.sitemaps.views.sitemap', kwargs={'section': section}) - sites.append('%s://%s%s' % (protocol, current_site.domain, sitemap_url)) - - if pages > 1: - for page in range(2, pages+1): - sites.append('%s://%s%s?p=%s' % (protocol, current_site.domain, sitemap_url, page)) - xml = loader.render_to_string('sitemap_index.xml', {'sitemaps': sites}) - return HttpResponse(xml, content_type='application/xml') - -def sitemap(request, sitemaps, section=None): - """ - This view generates a sitemap with additional geographic - elements defined by Google. - """ - maps, urls = [], [] - if section is not None: - if section not in sitemaps: - raise Http404(_("No sitemap available for section: %r") % section) - maps.append(sitemaps[section]) - else: - maps = list(six.itervalues(sitemaps)) - - page = request.GET.get("p", 1) - current_site = get_current_site(request) - for site in maps: - try: - if callable(site): - urls.extend(site().get_urls(page=page, site=current_site)) - else: - urls.extend(site.get_urls(page=page, site=current_site)) - except EmptyPage: - raise Http404(_("Page %s empty") % page) - except PageNotAnInteger: - raise Http404(_("No page '%s'") % page) - xml = loader.render_to_string('gis/sitemaps/geo_sitemap.xml', {'urlset': urls}) - return HttpResponse(xml, content_type='application/xml') - -def kml(request, label, model, field_name=None, compress=False, using=DEFAULT_DB_ALIAS): - """ - This view generates KML for the given app label, model, and field name. - - The model's default manager must be GeoManager, and the field name - must be that of a geographic field. - """ - placemarks = [] - klass = get_model(label, model) - if not klass: - raise Http404('You must supply a valid app label and module name. Got "%s.%s"' % (label, model)) - - if field_name: - try: - info = klass._meta.get_field_by_name(field_name) - if not isinstance(info[0], GeometryField): - raise Exception - except: - raise Http404('Invalid geometry field.') - - connection = connections[using] - - if connection.ops.postgis: - # PostGIS will take care of transformation. - placemarks = klass._default_manager.using(using).kml(field_name=field_name) - else: - # There's no KML method on Oracle or MySQL, so we use the `kml` - # attribute of the lazy geometry instead. - placemarks = [] - if connection.ops.oracle: - qs = klass._default_manager.using(using).transform(4326, field_name=field_name) - else: - qs = klass._default_manager.using(using).all() - for mod in qs: - mod.kml = getattr(mod, field_name).kml - placemarks.append(mod) - - # Getting the render function and rendering to the correct. - if compress: - render = render_to_kmz - else: - render = render_to_kml - return render('gis/kml/placemarks.kml', {'places' : placemarks}) - -def kmz(request, label, model, field_name=None, using=DEFAULT_DB_ALIAS): - """ - This view returns KMZ for the given app label, model, and field name. - """ - return kml(request, label, model, field_name, compress=True, using=using) diff --git a/lib/python2.7/site-packages/django/contrib/gis/static/gis/js/OLMapWidget.js b/lib/python2.7/site-packages/django/contrib/gis/static/gis/js/OLMapWidget.js deleted file mode 100644 index b20e872..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/static/gis/js/OLMapWidget.js +++ /dev/null @@ -1,376 +0,0 @@ -(function() { -/** - * Transforms an array of features to a single feature with the merged - * geometry of geom_type - */ -OpenLayers.Util.properFeatures = function(features, geom_type) { - if (features.constructor == Array) { - var geoms = []; - for (var i=0; i - */ - -OpenLayers.Format.DjangoWKT = OpenLayers.Class(OpenLayers.Format.WKT, { - initialize: function(options) { - OpenLayers.Format.WKT.prototype.initialize.apply(this, [options]); - this.regExes.justComma = /\s*,\s*/; - }, - - parse: { - 'point': function(str) { - var coords = OpenLayers.String.trim(str).split(this.regExes.spaces); - return new OpenLayers.Feature.Vector( - new OpenLayers.Geometry.Point(coords[0], coords[1]) - ); - }, - - 'multipoint': function(str) { - var point; - var points = OpenLayers.String.trim(str).split(this.regExes.justComma); - var components = []; - for(var i=0, len=points.length; i0) { - pieces.push(','); - } - pieces.push(this.extractGeometry(collection[i])); - } - pieces.push(')'); - } else { - pieces.push(this.extractGeometry(features.geometry)); - } - return pieces.join(''); - }, - - CLASS_NAME: "OpenLayers.Format.DjangoWKT" -}); - -function MapWidget(options) { - this.map = null; - this.controls = null; - this.panel = null; - this.layers = {}; - this.wkt_f = new OpenLayers.Format.DjangoWKT(); - - // Mapping from OGRGeomType name to OpenLayers.Geometry name - if (options['geom_name'] == 'Unknown') options['geom_type'] = OpenLayers.Geometry; - else if (options['geom_name'] == 'GeometryCollection') options['geom_type'] = OpenLayers.Geometry.Collection; - else options['geom_type'] = eval('OpenLayers.Geometry' + options['geom_name']); - - // Default options - this.options = { - color: 'ee9900', - default_lat: 0, - default_lon: 0, - default_zoom: 4, - is_collection: options['geom_type'] instanceof OpenLayers.Geometry.Collection, - layerswitcher: false, - map_options: {}, - map_srid: 4326, - modifiable: true, - mouse_position: false, - opacity: 0.4, - point_zoom: 12, - scale_text: false, - scrollable: true - }; - - // Altering using user-provied options - for (var property in options) { - if (options.hasOwnProperty(property)) { - this.options[property] = options[property]; - } - } - - this.map = this.create_map(); - - var defaults_style = { - 'fillColor': '#' + this.options.color, - 'fillOpacity': this.options.opacity, - 'strokeColor': '#' + this.options.color, - }; - if (this.options.geom_name == 'LineString') { - defaults_style['strokeWidth'] = 3; - } - var styleMap = new OpenLayers.StyleMap({'default': OpenLayers.Util.applyDefaults(defaults_style, OpenLayers.Feature.Vector.style['default'])}); - this.layers.vector = new OpenLayers.Layer.Vector(" " + this.options.name, {styleMap: styleMap}); - this.map.addLayer(this.layers.vector); - var wkt = document.getElementById(this.options.id).value; - if (wkt) { - var feat = OpenLayers.Util.properFeatures(this.read_wkt(wkt), this.options.geom_type); - this.write_wkt(feat); - if (this.options.is_collection) { - for (var i=0; i 1) { - old_feats = [this.layers.vector.features[0]]; - this.layers.vector.removeFeatures(old_feats); - this.layers.vector.destroyFeatures(old_feats); - } - this.write_wkt(event.feature); - } -}; - -MapWidget.prototype.modify_wkt = function(event) { - if (this.options.is_collection) { - if (this.options.geom_name == 'MultiPoint') { - this.add_wkt(event); - return; - } else { - var feat = new OpenLayers.Feature.Vector(new this.options.geom_type()); - for (var i=0; i - #{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; } - #{{ id }}_map .aligned label { float:inherit; } - #{{ id }}_admin_map { position: relative; vertical-align: top; float: {{ LANGUAGE_BIDI|yesno:"right,left" }}; } - {% if not display_wkt %}#{{ id }} { display: none; }{% endif %} - .olControlEditingToolbar .olControlModifyFeatureItemActive { - background-image: url("{% static "admin/img/gis/move_vertex_on.png" %}"); - background-repeat: no-repeat; - } - .olControlEditingToolbar .olControlModifyFeatureItemInactive { - background-image: url("{% static "admin/img/gis/move_vertex_off.png" %}"); - background-repeat: no-repeat; - } - - -{% endblock %} - - -
-Delete all Features -{% if display_wkt %}

WKT debugging window:

{% endif %} - - -
diff --git a/lib/python2.7/site-packages/django/contrib/gis/templates/gis/admin/openlayers.js b/lib/python2.7/site-packages/django/contrib/gis/templates/gis/admin/openlayers.js deleted file mode 100644 index 4425fee..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/templates/gis/admin/openlayers.js +++ /dev/null @@ -1,176 +0,0 @@ -{% load l10n %} -OpenLayers.Projection.addTransform("EPSG:4326", "EPSG:3857", OpenLayers.Layer.SphericalMercator.projectForward); -{% block vars %}var {{ module }} = {}; -{{ module }}.map = null; {{ module }}.controls = null; {{ module }}.panel = null; {{ module }}.re = new RegExp("^SRID=\\d+;(.+)", "i"); {{ module }}.layers = {}; -{{ module }}.modifiable = {{ modifiable|yesno:"true,false" }}; -{{ module }}.wkt_f = new OpenLayers.Format.WKT(); -{{ module }}.is_collection = {{ is_collection|yesno:"true,false" }}; -{{ module }}.collection_type = '{{ collection_type }}'; -{{ module }}.is_generic = {{ is_generic|yesno:"true,false" }}; -{{ module }}.is_linestring = {{ is_linestring|yesno:"true,false" }}; -{{ module }}.is_polygon = {{ is_polygon|yesno:"true,false" }}; -{{ module }}.is_point = {{ is_point|yesno:"true,false" }}; -{% endblock %} -{{ module }}.get_ewkt = function(feat){ - return 'SRID={{ srid|unlocalize }};' + {{ module }}.wkt_f.write(feat); -}; -{{ module }}.read_wkt = function(wkt){ - // OpenLayers cannot handle EWKT -- we make sure to strip it out. - // EWKT is only exposed to OL if there's a validation error in the admin. - var match = {{ module }}.re.exec(wkt); - if (match){wkt = match[1];} - return {{ module }}.wkt_f.read(wkt); -}; -{{ module }}.write_wkt = function(feat){ - if ({{ module }}.is_collection){ {{ module }}.num_geom = feat.geometry.components.length;} - else { {{ module }}.num_geom = 1;} - document.getElementById('{{ id }}').value = {{ module }}.get_ewkt(feat); -}; -{{ module }}.add_wkt = function(event){ - // This function will sync the contents of the `vector` layer with the - // WKT in the text field. - if ({{ module }}.is_collection){ - var feat = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.{{ geom_type }}()); - for (var i = 0; i < {{ module }}.layers.vector.features.length; i++){ - feat.geometry.addComponents([{{ module }}.layers.vector.features[i].geometry]); - } - {{ module }}.write_wkt(feat); - } else { - // Make sure to remove any previously added features. - if ({{ module }}.layers.vector.features.length > 1){ - old_feats = [{{ module }}.layers.vector.features[0]]; - {{ module }}.layers.vector.removeFeatures(old_feats); - {{ module }}.layers.vector.destroyFeatures(old_feats); - } - {{ module }}.write_wkt(event.feature); - } -}; -{{ module }}.modify_wkt = function(event){ - if ({{ module }}.is_collection){ - if ({{ module }}.is_point){ - {{ module }}.add_wkt(event); - return; - } else { - // When modifying the selected components are added to the - // vector layer so we only increment to the `num_geom` value. - var feat = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.{{ geom_type }}()); - for (var i = 0; i < {{ module }}.num_geom; i++){ - feat.geometry.addComponents([{{ module }}.layers.vector.features[i].geometry]); - } - {{ module }}.write_wkt(feat); - } - } else { - {{ module }}.write_wkt(event.feature); - } -}; -// Function to clear vector features and purge wkt from div -{{ module }}.deleteFeatures = function(){ - {{ module }}.layers.vector.removeFeatures({{ module }}.layers.vector.features); - {{ module }}.layers.vector.destroyFeatures(); -}; -{{ module }}.clearFeatures = function (){ - {{ module }}.deleteFeatures(); - document.getElementById('{{ id }}').value = ''; - {% localize off %} - {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}), {{ default_zoom }}); - {% endlocalize %} -}; -// Add Select control -{{ module }}.addSelectControl = function(){ - var select = new OpenLayers.Control.SelectFeature({{ module }}.layers.vector, {'toggle' : true, 'clickout' : true}); - {{ module }}.map.addControl(select); - select.activate(); -}; -{{ module }}.enableDrawing = function(){ - {{ module }}.map.getControlsByClass('OpenLayers.Control.DrawFeature')[0].activate(); -}; -{{ module }}.enableEditing = function(){ - {{ module }}.map.getControlsByClass('OpenLayers.Control.ModifyFeature')[0].activate(); -}; -// Create an array of controls based on geometry type -{{ module }}.getControls = function(lyr){ - {{ module }}.panel = new OpenLayers.Control.Panel({'displayClass': 'olControlEditingToolbar'}); - {{ module }}.controls = [new OpenLayers.Control.Navigation()]; - if (!{{ module }}.modifiable && lyr.features.length) return; - if ({{ module }}.is_linestring || {{ module }}.is_generic){ - {{ module }}.controls.push(new OpenLayers.Control.DrawFeature(lyr, OpenLayers.Handler.Path, {'displayClass': 'olControlDrawFeaturePath'})); - } - if ({{ module }}.is_polygon || {{ module }}.is_generic){ - {{ module }}.controls.push(new OpenLayers.Control.DrawFeature(lyr, OpenLayers.Handler.Polygon, {'displayClass': 'olControlDrawFeaturePolygon'})); - } - if ({{ module }}.is_point || {{ module }}.is_generic){ - {{ module }}.controls.push(new OpenLayers.Control.DrawFeature(lyr, OpenLayers.Handler.Point, {'displayClass': 'olControlDrawFeaturePoint'})); - } - if ({{ module }}.modifiable){ - {{ module }}.controls.push(new OpenLayers.Control.ModifyFeature(lyr, {'displayClass': 'olControlModifyFeature'})); - } -}; -{{ module }}.init = function(){ - {% block map_options %}// The options hash, w/ zoom, resolution, and projection settings. - var options = { -{% autoescape off %}{% for item in map_options.items %} '{{ item.0 }}' : {{ item.1 }}{% if not forloop.last %},{% endif %} -{% endfor %}{% endautoescape %} };{% endblock %} - // The admin map for this geometry field. - {% block map_creation %} - {{ module }}.map = new OpenLayers.Map('{{ id }}_map', options); - // Base Layer - {{ module }}.layers.base = {% block base_layer %}new OpenLayers.Layer.WMS("{{ wms_name }}", "{{ wms_url }}", {layers: '{{ wms_layer }}'{{ wms_options|safe }}});{% endblock %} - {{ module }}.map.addLayer({{ module }}.layers.base); - {% endblock %} - {% block extra_layers %}{% endblock %} - {% if is_linestring %}OpenLayers.Feature.Vector.style["default"]["strokeWidth"] = 3; // Default too thin for linestrings. {% endif %} - {{ module }}.layers.vector = new OpenLayers.Layer.Vector(" {{ field_name }}"); - {{ module }}.map.addLayer({{ module }}.layers.vector); - // Read WKT from the text field. - var wkt = document.getElementById('{{ id }}').value; - if (wkt){ - // After reading into geometry, immediately write back to - // WKT - - diff --git a/lib/python2.7/site-packages/django/contrib/gis/templates/gis/sitemaps/geo_sitemap.xml b/lib/python2.7/site-packages/django/contrib/gis/templates/gis/sitemaps/geo_sitemap.xml deleted file mode 100644 index dbf858e..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/templates/gis/sitemaps/geo_sitemap.xml +++ /dev/null @@ -1,17 +0,0 @@ -{% autoescape off %} - -{% spaceless %} -{% for url in urlset %} - - {{ url.location|escape }} - {% if url.lastmod %}{{ url.lastmod|date:"Y-m-d" }}{% endif %} - {% if url.changefreq %}{{ url.changefreq }}{% endif %} - {% if url.priority %}{{ url.priority }}{% endif %} - {% if url.geo_format %} - {{ url.geo_format }} - {% endif %} - -{% endfor %} -{% endspaceless %} - -{% endautoescape %} diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/tests/__init__.py deleted file mode 100644 index 1703f3f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -def geo_apps(): - """ - Returns a list of GeoDjango test applications that reside in - `django.contrib.gis.tests` that can be used with the current - database and the spatial libraries that are installed. - """ - from django.db import connection - from django.contrib.gis.geos import GEOS_PREPARE - from django.contrib.gis.gdal import HAS_GDAL - - apps = ['geoapp', 'relatedapp'] - - # No distance queries on MySQL. - if not connection.ops.mysql: - apps.append('distapp') - - # Test geography support with PostGIS 1.5+. - if connection.ops.postgis and connection.ops.geography: - apps.append('geogapp') - - # The following GeoDjango test apps depend on GDAL support. - if HAS_GDAL: - # Geographic admin, LayerMapping, and ogrinspect test apps - # all require GDAL. - apps.extend(['geoadmin', 'layermap', 'inspectapp']) - - # 3D apps use LayerMapping, which uses GDAL and require GEOS 3.1+. - if connection.ops.postgis and GEOS_PREPARE: - apps.append('geo3d') - return [('django.contrib.gis.tests', app) for app in apps] diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.dbf b/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.dbf deleted file mode 100644 index 6ba9d69..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.dbf and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.prj b/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.prj deleted file mode 100644 index a30c00a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.shp b/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.shp deleted file mode 100644 index e430020..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.shp and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.shx b/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.shx deleted file mode 100644 index a1487ad..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/ch-city/ch-city.shx and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.dbf b/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.dbf deleted file mode 100644 index 8b27633..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.dbf and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.prj b/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.prj deleted file mode 100644 index a30c00a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.shp b/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.shp deleted file mode 100644 index 1c46ccc..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.shp and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.shx b/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.shx deleted file mode 100644 index 6be3fd6..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/cities/cities.shx and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.dbf b/lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.dbf deleted file mode 100644 index ccdbb26..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.dbf and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.shp b/lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.shp deleted file mode 100644 index 2e7dca5..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.shp and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.shx b/lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.shx deleted file mode 100644 index 46ed3bb..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/counties/counties.shx and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/geometries.json b/lib/python2.7/site-packages/django/contrib/gis/tests/data/geometries.json deleted file mode 100644 index b1a6ad1..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/data/geometries.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "polygons": [ - {"wkt": "POLYGON ((0 0, 0 100, 100 100, 100 0, 0 0), (10 10, 10 90, 90 90, 90 10, 10 10))", "n_i": 1, "ext_ring_cs": [[0, 0], [0, 100], [100, 100], [100, 0], [0, 0]], "n_p": 10, "area": 3600.0, "centroid": [50.0, 50.0]}, - {"wkt": "POLYGON ((0 0, 0 100, 100 100, 100 0, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10), (80 80, 80 90, 90 90, 90 80, 80 80))", "n_i": 2, "ext_ring_cs": [[0, 0], [0, 100], [100, 100], [100, 0], [0, 0]], "n_p": 15, "area": 9800.0, "centroid": [50.0, 50.0]}, - {"wkt": "POLYGON ((0 0, 0 100, 100 100, 100 0, 0 0))", "n_i": 0, "ext_ring_cs": [[0, 0], [0, 100], [100, 100], [100, 0], [0, 0]], "n_p": 5, "area": 10000.0, "centroid": [50.0, 50.0]}, - {"wkt": "POLYGON ((-95.3848703124799471 29.7056021479768511, -95.3851905195191847 29.7046588196500281, -95.3859356966379011 29.7025053545605502, -95.3860723000647539 29.7020963367038391, -95.3871517697222089 29.6989779021280995, -95.3865578518265522 29.6990856888057202, -95.3862634205175226 29.6999471753441782, -95.3861991779541967 29.6999591988978615, -95.3856773799358137 29.6998323107113578, -95.3856209915427229 29.6998005235473741, -95.3855833545501639 29.6996619391729801, -95.3855776331865002 29.6996232659570047, -95.3850162731712885 29.6997236706530536, -95.3831047357410284 29.7000847603095082, -95.3829800724914776 29.7000676365023502, -95.3828084594470909 29.6999969684031200, -95.3828131504821499 29.6999090511531065, -95.3828022942979601 29.6998152117366025, -95.3827893930918833 29.6997790953076759, -95.3825174668099862 29.6998267772748825, -95.3823521544804862 29.7000451723151606, -95.3820491918785223 29.6999682034582335, -95.3817932841505893 29.6999640407204772, -95.3815438924600443 29.7005983712500630, -95.3807812390843424 29.7007538492921590, -95.3778578936435935 29.7012966201172048, -95.3770817300034679 29.7010555145969093, -95.3772763716395957 29.7004995005932031, -95.3769891024414420 29.7005797730360186, -95.3759855007185990 29.7007754783987821, -95.3759516423090474 29.7007305400669388, -95.3765252155960042 29.6989549173240874, -95.3766842746727832 29.6985134987163164, -95.3768510987262914 29.6980530300744938, -95.3769198676258014 29.6977137204527573, -95.3769616670751930 29.6973351617272172, -95.3770309229297766 29.6969821084304186, -95.3772352596880637 29.6959751305871613, -95.3776232419333354 29.6945439060847463, -95.3776849628727064 29.6943364710766069, -95.3779699491714723 29.6926548349458947, -95.3781945479573494 29.6920088336742545, -95.3785807118394189 29.6908279316076005, -95.3787441368896651 29.6908846275832197, -95.3787903214163890 29.6907152912461640, -95.3791765069353659 29.6893335376821526, -95.3794935959513026 29.6884781789101595, -95.3796592071232112 29.6880066681407619, -95.3799788182090111 29.6873687353035081, -95.3801545516183893 29.6868782380716993, -95.3801258908302145 29.6867756621337762, -95.3801104284899566 29.6867229678809572, -95.3803803523746154 29.6863753372986459, -95.3821028558287622 29.6837392961470421, -95.3827289584682205 29.6828097375216160, -95.3827494698109035 29.6790739156259278, -95.3826022014838486 29.6776502228345507, -95.3825047356438063 29.6765773006280753, -95.3823473035336917 29.6750405250369127, -95.3824540163482055 29.6750076408228587, -95.3838984230304305 29.6745679207378679, -95.3916547074937426 29.6722459226508377, -95.3926154662749468 29.6719609085105489, -95.3967246645118081 29.6707316485589736, -95.3974588054406780 29.6705065336410989, -95.3978523748756828 29.6703795547846845, -95.3988598162279970 29.6700874981900853, -95.3995628600665952 29.6698505300412414, -95.4134721665944170 29.6656841279906232, -95.4143262068232616 29.6654291174019278, -95.4159685142480214 29.6649750989232288, -95.4180067396277565 29.6643253024318021, -95.4185886692196590 29.6641482768691063, -95.4234155309609662 29.6626925393704788, -95.4287785503196346 29.6611023620959706, -95.4310287312749352 29.6604222580752648, -95.4320295629628959 29.6603361318136720, -95.4332899683975739 29.6600560661713608, -95.4342675748811047 29.6598454934599900, -95.4343110414310871 29.6598411486215490, -95.4345576779282538 29.6598147020668499, -95.4348823041721630 29.6597875803673112, -95.4352827715209457 29.6597762346946681, -95.4355290431309982 29.6597827926562374, -95.4359197997999331 29.6598014511782715, -95.4361907884752156 29.6598444333523368, -95.4364608955807228 29.6598901433108217, -95.4367250147512323 29.6599494499910712, -95.4364898759758091 29.6601880616540186, -95.4354501111810691 29.6616378572201107, -95.4381459623171224 29.6631265631655126, -95.4367852490863129 29.6642266600024023, -95.4370040894557263 29.6643425389568769, -95.4367078350812648 29.6645492592343238, -95.4366081749871285 29.6646291473027297, -95.4358539359938192 29.6652308742342932, -95.4350327668927889 29.6658995989314462, -95.4350580905272921 29.6678812477895271, -95.4349710541447536 29.6680054925936965, -95.4349500440473548 29.6671410080890006, -95.4341492724148850 29.6678790545191688, -95.4340248868274728 29.6680353198492135, -95.4333227845797438 29.6689245624945990, -95.4331325652123326 29.6691616138940901, -95.4321314741096955 29.6704473333237253, -95.4320435792664341 29.6702578985411982, -95.4320147929883547 29.6701800936425109, -95.4319764538662980 29.6683246590817085, -95.4317490976340679 29.6684974372577166, -95.4305958185342718 29.6694049049170374, -95.4296600735653016 29.6701723430938493, -95.4284928989940937 29.6710931793380972, -95.4274630532378580 29.6719378813640091, -95.4273056811974811 29.6720684984625791, -95.4260554084574864 29.6730668861566969, -95.4253558063699643 29.6736342467365724, -95.4249278826026028 29.6739557343648919, -95.4248648873821423 29.6745400910786152, -95.4260016131471929 29.6750987014005858, -95.4258567183010911 29.6753452063069929, -95.4260238081486847 29.6754322077221353, -95.4258707374502393 29.6756647377294307, -95.4257951755816691 29.6756407098663360, -95.4257701599566985 29.6761077719536068, -95.4257726684792260 29.6761711204603955, -95.4257980187195614 29.6770219651929423, -95.4252712669032519 29.6770161558853758, -95.4249234392992065 29.6770068683962300, -95.4249574272905789 29.6779707498635759, -95.4244725881033702 29.6779825646764159, -95.4222269476429545 29.6780711474441716, -95.4223032371999267 29.6796029391538809, -95.4239133706588945 29.6795331493690355, -95.4224579084327331 29.6813706893847780, -95.4224290108823965 29.6821953228763924, -95.4230916478977349 29.6822130268724109, -95.4222928279595521 29.6832041816675343, -95.4228763710016352 29.6832087677714505, -95.4223401691637179 29.6838987872753748, -95.4211655906087088 29.6838784024852984, -95.4201984153205558 29.6851319258758082, -95.4206156387716362 29.6851623398125319, -95.4213438084897660 29.6851763011334739, -95.4212071118618752 29.6853679931624974, -95.4202651399651245 29.6865313962980508, -95.4172061157659783 29.6865816431043932, -95.4182217951255183 29.6872251197301544, -95.4178664826439160 29.6876750901471631, -95.4180678442928780 29.6877960336377207, -95.4188763472917572 29.6882826379510938, -95.4185374500596311 29.6887137897831934, -95.4182121713132290 29.6885097429738813, -95.4179857231741551 29.6888118367840086, -95.4183106010563620 29.6890048676118212, -95.4179489865331334 29.6894546700979056, -95.4175581746284820 29.6892323606815438, -95.4173439957341571 29.6894990139807007, -95.4177411199311081 29.6897435034738422, -95.4175789200209721 29.6899207529979208, -95.4170598559864800 29.6896042165807508, -95.4166733682539814 29.6900891174451367, -95.4165941362704331 29.6900347214235047, -95.4163537218065301 29.6903529467753238, -95.4126843270708775 29.6881086357212780, -95.4126604121378392 29.6880942378803496, -95.4126672298953338 29.6885951670109982, -95.4126680884821923 29.6887052446594275, -95.4158080137241882 29.6906382377959339, -95.4152061403821961 29.6910871045531586, -95.4155842583188161 29.6917382915894308, -95.4157426793520358 29.6920726941677096, -95.4154520563662203 29.6922052332446427, -95.4151389936167078 29.6923261661269571, -95.4148649784384872 29.6924343866430256, -95.4144051352401590 29.6925623927348106, -95.4146792019416665 29.6926770338507744, -95.4148824479948985 29.6928117893696388, -95.4149851734360226 29.6929823719519774, -95.4140436551925291 29.6929626643100946, -95.4140465993023241 29.6926545917254892, -95.4137269186733334 29.6927395764256090, -95.4137372859685513 29.6935432485666624, -95.4135702836218655 29.6933186678088283, -95.4133925235973237 29.6930415229852152, -95.4133017035615580 29.6928685062036166, -95.4129588921634593 29.6929391128977862, -95.4125107395559695 29.6930481664661485, -95.4102647423187307 29.6935850183258019, -95.4081931340840157 29.6940907430947760, -95.4078783596459772 29.6941703429951609, -95.4049213975000043 29.6948723732981961, -95.4045944244127071 29.6949626434239207, -95.4045865139788134 29.6954109019001358, -95.4045953345484037 29.6956972800496963, -95.4038879332535146 29.6958296089365490, -95.4040366394459340 29.6964389004769842, -95.4032774779020798 29.6965643341263892, -95.4026066501239853 29.6966646227683881, -95.4024991226393837 29.6961389766619703, -95.4011781398631911 29.6963566063186377, -95.4011524097636112 29.6962596176762190, -95.4018184046368276 29.6961399466727336, -95.4016995838361908 29.6956442609415099, -95.4007100753964608 29.6958900524002978, -95.4008032469935188 29.6962639900781404, -95.3995660267125487 29.6965636449370329, -95.3996140564775601 29.6967877962763644, -95.3996364430014410 29.6968901984825280, -95.3984003269631842 29.6968679634805746, -95.3981442026887265 29.6983660679730335, -95.3980178461957706 29.6990890276252415, -95.3977097967130163 29.7008526152273049, -95.3962347157626027 29.7009697553607630, -95.3951949050136250 29.7004740386619019, -95.3957564950617183 29.6990281830553187, -95.3965927101519924 29.6968771129030706, -95.3957496517238184 29.6970800358387095, -95.3957720559467361 29.6972264611230727, -95.3957391586571788 29.6973548894558732, -95.3956286413405365 29.6974949857280883, -95.3955111053256957 29.6975661086270186, -95.3953215342724121 29.6976022763384790, -95.3951795558443365 29.6975846977491038, -95.3950369632041060 29.6975175779330200, -95.3949401089966500 29.6974269267953304, -95.3948740281415581 29.6972903308506346, -95.3946650813866910 29.6973397326847923, -95.3947654059391112 29.6974882560192022, -95.3949627316619768 29.6980355864961858, -95.3933200807862249 29.6984590863712796, -95.3932606497523494 29.6984464798710839, -95.3932983699113350 29.6983154306484352, -95.3933058014696655 29.6982165816983610, -95.3932946347785133 29.6981089778195759, -95.3931780601756287 29.6977068906794841, -95.3929928222970602 29.6977541771878180, -95.3930873169846478 29.6980676264932946, -95.3932743746374570 29.6981249406449663, -95.3929512584706316 29.6989526513922222, -95.3919850280655197 29.7014358632108646, -95.3918950918929056 29.7014169320765724, -95.3916928317890296 29.7019232352846423, -95.3915424614970959 29.7022988712928289, -95.3901530441668939 29.7058519502930061, -95.3899656322116698 29.7059156823562418, -95.3897628748670883 29.7059900058266777, -95.3896062677805787 29.7060738276384946, -95.3893941800512266 29.7061891695242046, -95.3892150365492455 29.7062641292949436, -95.3890502563035199 29.7063339729630940, -95.3888717930715586 29.7063896908080736, -95.3886925428988945 29.7064453871994978, -95.3885376849411983 29.7064797304524149, -95.3883284158984139 29.7065153575050189, -95.3881046767627794 29.7065368368267357, -95.3878809284696132 29.7065363048447537, -95.3876046356120924 29.7065288525102424, -95.3873060894974714 29.7064822806001452, -95.3869851943158409 29.7063993367575350, -95.3865967896568065 29.7062870572919202, -95.3861785624983156 29.7061492099008184, -95.3857375009733488 29.7059887337478798, -95.3854573290902152 29.7058683664514618, -95.3848703124799471 29.7056021479768511))", "n_i": 0, "ext_ring_cs": false, "n_p": 264, "area": 0.00129917360654, "centroid": [-95.403569179437341, 29.681772571690402]} - ], - "multipolygons": [ - {"wkt": "MULTIPOLYGON (((100 20, 180 20, 180 100, 100 100, 100 20)), ((20 100, 100 100, 100 180, 20 180, 20 100)), ((100 180, 180 180, 180 260, 100 260, 100 180)), ((180 100, 260 100, 260 180, 180 180, 180 100)))","valid": true, "num_geom":4, "n_p":20}, - {"wkt": "MULTIPOLYGON (((60 300, 320 220, 260 60, 60 100, 60 300)), ((60 300, 320 220, 260 60, 60 100, 60 300)))", "valid": false}, - {"wkt": "MULTIPOLYGON (((180 60, 240 160, 300 60, 180 60)), ((80 80, 180 60, 160 140, 240 160, 360 140, 300 60, 420 100, 320 280, 120 260, 80 80)))", "valid": true, "num_geom": 2, "n_p": 14} - ], - "errors": [ - {"wkt": "GEOMETR##!@#%#............a32515", "bad": true, "hex": false}, - {"wkt": "Foo.Bar", "bad": true, "hex": false}, - {"wkt": "POINT (5, 23)", "bad": true, "hex": false}, - {"wkt": "AAABBBDDDAAD##@#1113511111-098111111111111111533333333333333", "bad": true, "hex": true}, - {"wkt": "FFFFFFFFFFFFFFFFF1355555555555555555565111", "bad": true, "hex": true}, - {"wkt": "", "bad": true, "hex": false} - ], - "wkt_out": [ - {"wkt": "POINT (110 130)", "ewkt": "POINT (110.0000000000000000 130.0000000000000000)", "kml": "110.0,130.0,0", "gml": "110,130"}, - {"wkt": "POINT (110 130 85)", "ewkt": "POINT Z (110.0000000000000000 130.0000000000000000 85.0000000000000000)", "kml": "110.0,130.0,85.0", "gml": "110,130,85"}, - {"wkt": "LINESTRING (40 40,50 130,130 130)", "ewkt": "LINESTRING (40.0000000000000000 40.0000000000000000, 50.0000000000000000 130.0000000000000000, 130.0000000000000000 130.0000000000000000)", "kml": "40.0,40.0,0 50.0,130.0,0 130.0,130.0,0", "gml": "40,40 50,130 130,130"}, - {"wkt": "POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))", "ewkt": "POLYGON ((150.0000000000000000 150.0000000000000000, 410.0000000000000000 150.0000000000000000, 280.0000000000000000 20.0000000000000000, 20.0000000000000000 20.0000000000000000, 150.0000000000000000 150.0000000000000000), (170.0000000000000000 120.0000000000000000, 330.0000000000000000 120.0000000000000000, 260.0000000000000000 50.0000000000000000, 100.0000000000000000 50.0000000000000000, 170.0000000000000000 120.0000000000000000))", "kml": "150.0,150.0,0 410.0,150.0,0 280.0,20.0,0 20.0,20.0,0 150.0,150.0,0170.0,120.0,0 330.0,120.0,0 260.0,50.0,0 100.0,50.0,0 170.0,120.0,0", "gml": "150,150 410,150 280,20 20,20 150,150170,120 330,120 260,50 100,50 170,120"}, - {"wkt": "MULTIPOINT (10 80,110 170,110 120)", "ewkt": "MULTIPOINT (10.0000000000000000 80.0000000000000000, 110.0000000000000000 170.0000000000000000, 110.0000000000000000 120.0000000000000000)", "kml": "10.0,80.0,0110.0,170.0,0110.0,120.0,0", "gml": "10,80110,170110,120"}, - {"wkt": "MULTILINESTRING ((110 100,40 30,180 30),(170 30,110 90,50 30))", "ewkt": "MULTILINESTRING ((110.0000000000000000 100.0000000000000000, 40.0000000000000000 30.0000000000000000, 180.0000000000000000 30.0000000000000000), (170.0000000000000000 30.0000000000000000, 110.0000000000000000 90.0000000000000000, 50.0000000000000000 30.0000000000000000))", "kml": "110.0,100.0,0 40.0,30.0,0 180.0,30.0,0170.0,30.0,0 110.0,90.0,0 50.0,30.0,0", "gml": "110,100 40,30 180,30170,30 110,90 50,30"}, - {"wkt": "MULTIPOLYGON (((110 110,70 200,150 200,110 110),(110 110,100 180,120 180,110 110)),((110 110,150 20,70 20,110 110),(110 110,120 40,100 40,110 110)))", "ewkt": "MULTIPOLYGON (((110.0000000000000000 110.0000000000000000, 70.0000000000000000 200.0000000000000000, 150.0000000000000000 200.0000000000000000, 110.0000000000000000 110.0000000000000000), (110.0000000000000000 110.0000000000000000, 100.0000000000000000 180.0000000000000000, 120.0000000000000000 180.0000000000000000, 110.0000000000000000 110.0000000000000000)), ((110.0000000000000000 110.0000000000000000, 150.0000000000000000 20.0000000000000000, 70.0000000000000000 20.0000000000000000, 110.0000000000000000 110.0000000000000000), (110.0000000000000000 110.0000000000000000, 120.0000000000000000 40.0000000000000000, 100.0000000000000000 40.0000000000000000, 110.0000000000000000 110.0000000000000000)))", "kml": "110.0,110.0,0 70.0,200.0,0 150.0,200.0,0 110.0,110.0,0110.0,110.0,0 100.0,180.0,0 120.0,180.0,0 110.0,110.0,0110.0,110.0,0 150.0,20.0,0 70.0,20.0,0 110.0,110.0,0110.0,110.0,0 120.0,40.0,0 100.0,40.0,0 110.0,110.0,0", "gml": "110,110 70,200 150,200 110,110110,110 100,180 120,180 110,110110,110 150,20 70,20 110,110110,110 120,40 100,40 110,110"}, - {"wkt": "GEOMETRYCOLLECTION (POINT (110 260),LINESTRING (110 0,110 60))", "ewkt": "GEOMETRYCOLLECTION (POINT (110.0000000000000000 260.0000000000000000), LINESTRING (110.0000000000000000 0.0000000000000000, 110.0000000000000000 60.0000000000000000))", "kml": "110.0,260.0,0110.0,0.0,0 110.0,60.0,0", "gml": "110,260110,0 110,60"} - ], - "hex_wkt": [ - {"wkt": "POINT(0 1)", "hex": "01010000000000000000000000000000000000F03F"}, - {"wkt": "POINT(0 1 5)", "hex": "01010000800000000000000000000000000000F03F0000000000001440"}, - {"wkt": "LINESTRING(0 1, 2 3, 4 5)", "hex": "0102000000030000000000000000000000000000000000F03F0000000000000040000000000000084000000000000010400000000000001440"}, - {"wkt": "POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))", "hex": "010300000001000000050000000000000000000000000000000000000000000000000024400000000000000000000000000000244000000000000024400000000000000000000000000000244000000000000000000000000000000000"}, - {"wkt": "MULTIPOINT(0 0, 10 0, 10 10, 0 10, 0 0)", "hex": "010400000005000000010100000000000000000000000000000000000000010100000000000000000024400000000000000000010100000000000000000024400000000000002440010100000000000000000000000000000000002440010100000000000000000000000000000000000000"}, - {"wkt": "MULTILINESTRING((0 0, 10 0, 10 10, 0 10),(20 20, 30 20))", "hex": "01050000000200000001020000000400000000000000000000000000000000000000000000000000244000000000000000000000000000002440000000000000244000000000000000000000000000002440010200000002000000000000000000344000000000000034400000000000003E400000000000003440"}, - {"wkt": "MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)),((20 20, 20 30, 30 30, 30 20, 20 20),(25 25, 25 26, 26 26, 26 25, 25 25)))", "hex": "010600000002000000010300000001000000050000000000000000000000000000000000000000000000000024400000000000000000000000000000244000000000000024400000000000000000000000000000244000000000000000000000000000000000010300000002000000050000000000000000003440000000000000344000000000000034400000000000003E400000000000003E400000000000003E400000000000003E40000000000000344000000000000034400000000000003440050000000000000000003940000000000000394000000000000039400000000000003A400000000000003A400000000000003A400000000000003A40000000000000394000000000000039400000000000003940"}, - {"wkt": "GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)),((20 20, 20 30, 30 30, 30 20, 20 20),(25 25, 25 26, 26 26, 26 25, 25 25))),MULTILINESTRING((0 0, 10 0, 10 10, 0 10),(20 20, 30 20)),MULTIPOINT(0 0, 10 0, 10 10, 0 10, 0 0))", "hex": "010700000003000000010600000002000000010300000001000000050000000000000000000000000000000000000000000000000024400000000000000000000000000000244000000000000024400000000000000000000000000000244000000000000000000000000000000000010300000002000000050000000000000000003440000000000000344000000000000034400000000000003E400000000000003E400000000000003E400000000000003E40000000000000344000000000000034400000000000003440050000000000000000003940000000000000394000000000000039400000000000003A400000000000003A400000000000003A400000000000003A4000000000000039400000000000003940000000000000394001050000000200000001020000000400000000000000000000000000000000000000000000000000244000000000000000000000000000002440000000000000244000000000000000000000000000002440010200000002000000000000000000344000000000000034400000000000003E400000000000003440010400000005000000010100000000000000000000000000000000000000010100000000000000000024400000000000000000010100000000000000000024400000000000002440010100000000000000000000000000000000002440010100000000000000000000000000000000000000"} - ], - "json_geoms": [ - {"wkt": "POINT(100 0)", "json": "{ \"type\": \"Point\", \"coordinates\": [ 100.000000, 0.000000 ] }"}, - {"wkt": "POLYGON((0 0, -10 0, -10 -10, 0 -10, 0 0))", "json": "{ \"type\": \"Polygon\", \"coordinates\": [ [ [ 0.000000, 0.000000 ], [ -10.000000, 0.000000 ], [ -10.000000, -10.000000 ], [ 0.000000, -10.000000 ], [ 0.000000, 0.000000 ] ] ] }"}, - {"wkt": "MULTIPOLYGON(((102 2, 103 2, 103 3, 102 3, 102 2)), ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0), (100.2 0.2, 100.8 0.2, 100.8 0.8, 100.2 0.8, 100.2 0.2)))", "json": "{ \"type\": \"MultiPolygon\", \"coordinates\": [ [ [ [ 102.000000, 2.000000 ], [ 103.000000, 2.000000 ], [ 103.000000, 3.000000 ], [ 102.000000, 3.000000 ], [ 102.000000, 2.000000 ] ] ], [ [ [ 100.000000, 0.000000 ], [ 101.000000, 0.000000 ], [ 101.000000, 1.000000 ], [ 100.000000, 1.000000 ], [ 100.000000, 0.000000 ] ], [ [ 100.200000, 0.200000 ], [ 100.800000, 0.200000 ], [ 100.800000, 0.800000 ], [ 100.200000, 0.800000 ], [ 100.200000, 0.200000 ] ] ] ] }"}, - {"wkt": "GEOMETRYCOLLECTION(POINT(100 0),LINESTRING(101.0 0.0, 102.0 1.0))", "json": "{ \"type\": \"GeometryCollection\", \"geometries\": [ { \"type\": \"Point\", \"coordinates\": [ 100.000000, 0.000000 ] }, { \"type\": \"LineString\", \"coordinates\": [ [ 101.000000, 0.000000 ], [ 102.000000, 1.000000 ] ] } ] }"}, - {"wkt": "MULTILINESTRING((100.0 0.0, 101.0 1.0),(102.0 2.0, 103.0 3.0))", "json": "\\n\\n{ \"type\": \"MultiLineString\",\\n \"coordinates\": [\\n [ [100.0, 0.0], [101.0, 1.0] ],\\n [ [102.0, 2.0], [103.0, 3.0] ]\\n ]\\n }\\n\\n", "not_equal": true} - ], - "points": [ - {"wkt": "POINT (5 23)", "x": 5.0, "y": 23.0, "centroid": [5.0, 23.0]}, - {"wkt": "POINT (-95.338492 29.723893)", "x": -95.338492, "y": 29.723893, "centroid": [-95.338492, 29.723893]}, - {"wkt": "POINT(1.234 5.678)", "x": 1.234, "y": 5.678, "centroid": [1.234, 5.678]}, - {"wkt": "POINT(4.321 8.765)", "x": 4.321, "y": 8.765, "centroid": [4.321, 8.765]}, - {"wkt": "POINT(10 10)", "x": 10, "y": 10, "centroid": [10.0, 10.0]}, - {"wkt": "POINT (5 23 8)", "x": 5.0, "y": 23.0, "z": 8.0, "centroid": [5.0, 23.0]} - ], - "multipoints":[ - {"wkt": "MULTIPOINT(10 10, 20 20 )", "n_p": 2, "coords": [[10.0, 10.0], [20.0, 20.0]], "centroid": [15.0, 15.0]}, - {"wkt": "MULTIPOINT(10 10, 20 20, 10 20, 20 10)", "n_p": 4, "coords": [[10.0, 10.0], [20.0, 20.0], [10.0, 20.0], [20.0, 10.0]], "centroid": [15.0, 15.0]} - ], - "linestrings": [ - {"wkt": "LINESTRING (60 180, 120 100, 180 180)", "n_p": 3, "centroid": [120.0, 140.0], "coords": [[60.0, 180.0], [120.0, 100.0], [180.0, 180.0]]}, - {"wkt": "LINESTRING (0 0, 5 5, 10 5, 10 10)", "n_p": 4, "centroid": [6.1611652351681556, 4.6966991411008934], "coords": [[0.0, 0.0], [5.0, 5.0], [10.0, 5.0], [10.0, 10.0]]} - ], - "linearrings": [ - {"wkt": "LINEARRING (649899.3065171393100172 4176512.3807915160432458, 649902.7294133581453934 4176512.7834989596158266, 649906.5550170192727819 4176514.3942507002502680, 649910.5820134161040187 4176516.0050024418160319, 649914.4076170771149918 4176518.0184616246260703, 649917.2264131171396002 4176519.4278986593708396, 649920.0452871860470623 4176521.6427505780011415, 649922.0587463703704998 4176522.8507948759943247, 649924.2735982896992937 4176524.4616246484220028, 649926.2870574744883925 4176525.4683542405255139, 649927.8978092158213258 4176526.8777912775985897, 649929.3072462501004338 4176528.0858355751261115, 649930.1126611357321963 4176529.4952726080082357, 649927.4951798024121672 4176506.9444361114874482, 649899.3065171393100172 4176512.3807915160432458)", "n_p": 15} - ], - "multilinestrings": [ - {"wkt": "MULTILINESTRING ((0 0, 0 100), (100 0, 100 100))", "n_p": 4, "centroid": [50.0, 50.0], "coords": [[[0, 0], [0, 100]], [[100, 0], [100, 100]]]}, - {"wkt": "MULTILINESTRING ((20 20, 60 60), (20 -20, 60 -60), (-20 -20, -60 -60), (-20 20, -60 60), (-80 0, 0 80, 80 0, 0 -80, -80 0), (-40 20, -40 -20), (-20 40, 20 40), (40 20, 40 -20), (20 -40, -20 -40))", "n_p": 21, "centroid": [0.0, 0.0], "coords": [[[20.0, 20.0], [60.0, 60.0]], [[20.0, -20.0], [60.0, -60.0]], [[-20.0, -20.0], [-60.0, -60.0]], [[-20.0, 20.0], [-60.0, 60.0]], [[-80.0, 0.0], [0.0, 80.0], [80.0, 0.0], [0.0, -80.0], [-80.0, 0.0]], [[-40.0, 20.0], [-40.0, -20.0]], [[-20.0, 40.0], [20.0, 40.0]], [[40.0, 20.0], [40.0, -20.0]], [[20.0, -40.0], [-20.0, -40.0]]]} - ], - "buffer_geoms": [ - {"wkt": "POINT(0 0)", - "buffer_wkt": "POLYGON ((5 0,4.903926402016153 -0.97545161008064,4.619397662556435 -1.913417161825447,4.157348061512728 -2.777851165098009,3.53553390593274 -3.535533905932735,2.777851165098015 -4.157348061512724,1.913417161825454 -4.619397662556431,0.975451610080648 -4.903926402016151,0.000000000000008 -5.0,-0.975451610080632 -4.903926402016154,-1.913417161825439 -4.619397662556437,-2.777851165098002 -4.157348061512732,-3.53553390593273 -3.535533905932746,-4.157348061512719 -2.777851165098022,-4.619397662556429 -1.913417161825462,-4.903926402016149 -0.975451610080656,-5.0 -0.000000000000016,-4.903926402016156 0.975451610080624,-4.619397662556441 1.913417161825432,-4.157348061512737 2.777851165097995,-3.535533905932752 3.535533905932723,-2.777851165098029 4.157348061512714,-1.913417161825468 4.619397662556426,-0.975451610080661 4.903926402016149,-0.000000000000019 5.0,0.975451610080624 4.903926402016156,1.913417161825434 4.61939766255644,2.777851165097998 4.157348061512735,3.535533905932727 3.535533905932748,4.157348061512719 2.777851165098022,4.619397662556429 1.91341716182546,4.90392640201615 0.975451610080652,5 0))", - "width": 5.0, "quadsegs": 8 - }, - {"wkt": "POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))", - "buffer_wkt": "POLYGON ((-2 0,-2 10,-1.961570560806461 10.390180644032258,-1.847759065022573 10.765366864730179,-1.662939224605091 11.111140466039204,-1.414213562373095 11.414213562373096,-1.111140466039204 11.662939224605092,-0.765366864730179 11.847759065022574,-0.390180644032256 11.961570560806461,0 12,10 12,10.390180644032256 11.961570560806461,10.765366864730179 11.847759065022574,11.111140466039204 11.66293922460509,11.414213562373096 11.414213562373096,11.66293922460509 11.111140466039204,11.847759065022574 10.765366864730179,11.961570560806461 10.390180644032256,12 10,12 0,11.961570560806461 -0.390180644032256,11.847759065022574 -0.76536686473018,11.66293922460509 -1.111140466039204,11.414213562373096 -1.414213562373095,11.111140466039204 -1.66293922460509,10.765366864730179 -1.847759065022573,10.390180644032256 -1.961570560806461,10 -2,0.0 -2.0,-0.390180644032255 -1.961570560806461,-0.765366864730177 -1.847759065022575,-1.1111404660392 -1.662939224605093,-1.41421356237309 -1.4142135623731,-1.662939224605086 -1.111140466039211,-1.84775906502257 -0.765366864730189,-1.961570560806459 -0.390180644032268,-2 0))", - "width": 2.0, "quadsegs": 8 - } - ], - "relate_geoms": [ - {"wkt_a": "MULTIPOINT(80 70, 20 20, 200 170, 140 120)", - "wkt_b": "MULTIPOINT(80 170, 140 120, 200 80, 80 70)", - "pattern": "0F0FFF0F2", "result": true - }, - {"wkt_a": "POINT(20 20)", - "wkt_b": "POINT(40 60)", - "pattern": "FF0FFF0F2", "result": true - }, - {"wkt_a": "POINT(110 110)", - "wkt_b": "LINESTRING(200 200, 110 110, 200 20, 20 20, 110 110, 20 200, 200 200)", - "pattern": "0FFFFF1F2", "result": true - }, - {"wkt_a": "MULTILINESTRING((20 20, 90 20, 170 20), (90 20, 90 80, 90 140))", - "wkt_b": "MULTILINESTRING((90 20, 170 100, 170 140), (130 140, 130 60, 90 20, 20 90, 90 20))", - "pattern": "FF10F0102", "result": true - } - ], - "topology_geoms": [ - {"wkt_a": "POLYGON ((-5.0 0.0, -5.0 10.0, 5.0 10.0, 5.0 0.0, -5.0 0.0))", - "wkt_b": "POLYGON ((0.0 -5.0, 0.0 5.0, 10.0 5.0, 10.0 -5.0, 0.0 -5.0))" - }, - {"wkt_a": "POLYGON ((2 0, 18 0, 18 15, 2 15, 2 0))", - "wkt_b": "POLYGON ((10 1, 11 3, 13 4, 15 6, 16 8, 16 10, 15 12, 13 13, 11 12, 10 10, 9 12, 7 13, 5 12, 4 10, 4 8, 5 6, 7 4, 9 3, 10 1))" - } - ], - "diff_geoms": [ - {"wkt": "POLYGON ((-5 0,-5 10,5 10,5 5,0 5,0 0,-5 0))"}, - {"wkt": "POLYGON ((2 0, 2 15, 18 15, 18 0, 2 0), (10 1, 11 3, 13 4, 15 6, 16 8, 16 10, 15 12, 13 13, 11 12, 10 10, 9 12, 7 13, 5 12, 4 10, 4 8, 5 6, 7 4, 9 3, 10 1))"} - ], - "sdiff_geoms": [ - {"wkt": "MULTIPOLYGON (((-5 0,-5 10,5 10,5 5,0 5,0 0,-5 0)),((0 0,5 0,5 5,10 5,10 -5,0 -5,0 0)))"}, - {"wkt": "POLYGON ((2 0, 2 15, 18 15, 18 0, 2 0), (10 1, 11 3, 13 4, 15 6, 16 8, 16 10, 15 12, 13 13, 11 12, 10 10, 9 12, 7 13, 5 12, 4 10, 4 8, 5 6, 7 4, 9 3, 10 1))"} - ], - "intersect_geoms": [ - {"wkt": "POLYGON ((5 5,5 0,0 0,0 5,5 5))"}, - {"wkt": "POLYGON ((10 1, 9 3, 7 4, 5 6, 4 8, 4 10, 5 12, 7 13, 9 12, 10 10, 11 12, 13 13, 15 12, 16 10, 16 8, 15 6, 13 4, 11 3, 10 1))"} - ], - "union_geoms": [ - {"wkt": "POLYGON ((-5 0,-5 10,5 10,5 5,10 5,10 -5,0 -5,0 0,-5 0))"}, - {"wkt": "POLYGON ((2 0, 2 15, 18 15, 18 0, 2 0))"} - ] -} diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.dbf b/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.dbf deleted file mode 100644 index a88d171..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.dbf and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.prj b/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.prj deleted file mode 100644 index a30c00a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.shp b/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.shp deleted file mode 100644 index 6d93de7..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.shp and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.shx b/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.shx deleted file mode 100644 index 7b9088a..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/interstates/interstates.shx and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.dbf b/lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.dbf deleted file mode 100644 index aa21090..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.dbf and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.shp b/lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.shp deleted file mode 100644 index bdcfb83..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.shp and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.shx b/lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.shx deleted file mode 100644 index dea663e..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/invalid/emptypoints.shx and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.dbf b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.dbf deleted file mode 100644 index b2b4eca..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.dbf and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.prj b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.prj deleted file mode 100644 index a30c00a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.shp b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.shp deleted file mode 100644 index 95e8b0a..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.shp and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.shx b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.shx deleted file mode 100644 index 087f3da..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_point/test_point.shx and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.dbf b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.dbf deleted file mode 100644 index 7965bd6..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.dbf and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.prj b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.prj deleted file mode 100644 index a30c00a..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shp b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shp deleted file mode 100644 index b22930b..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shp and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shx b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shx deleted file mode 100644 index c92f78b..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shx and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_vrt/test_vrt.csv b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_vrt/test_vrt.csv deleted file mode 100644 index dff648f..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_vrt/test_vrt.csv +++ /dev/null @@ -1,4 +0,0 @@ -POINT_X,POINT_Y,NUM -1.0,2.0,5 -5.0,23.0,17 -100.0,523.5,23 diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_vrt/test_vrt.vrt b/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_vrt/test_vrt.vrt deleted file mode 100644 index 979c179..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/data/test_vrt/test_vrt.vrt +++ /dev/null @@ -1,7 +0,0 @@ - - -test_vrt.csv -wkbPoint25D - - - \ No newline at end of file diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/data/texas.dbf b/lib/python2.7/site-packages/django/contrib/gis/tests/data/texas.dbf deleted file mode 100644 index 827c065..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/data/texas.dbf and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/fixtures/initial_data.json.gz b/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/fixtures/initial_data.json.gz deleted file mode 100644 index 5151d33..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/fixtures/initial_data.json.gz and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/models.py b/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/models.py deleted file mode 100644 index bf08829..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/models.py +++ /dev/null @@ -1,58 +0,0 @@ -from django.contrib.gis.db import models -from django.utils.encoding import python_2_unicode_compatible - -@python_2_unicode_compatible -class SouthTexasCity(models.Model): - "City model on projected coordinate system for South Texas." - name = models.CharField(max_length=30) - point = models.PointField(srid=32140) - objects = models.GeoManager() - def __str__(self): return self.name - -@python_2_unicode_compatible -class SouthTexasCityFt(models.Model): - "Same City model as above, but U.S. survey feet are the units." - name = models.CharField(max_length=30) - point = models.PointField(srid=2278) - objects = models.GeoManager() - def __str__(self): return self.name - -@python_2_unicode_compatible -class AustraliaCity(models.Model): - "City model for Australia, using WGS84." - name = models.CharField(max_length=30) - point = models.PointField() - objects = models.GeoManager() - def __str__(self): return self.name - -@python_2_unicode_compatible -class CensusZipcode(models.Model): - "Model for a few South Texas ZIP codes (in original Census NAD83)." - name = models.CharField(max_length=5) - poly = models.PolygonField(srid=4269) - objects = models.GeoManager() - def __str__(self): return self.name - -@python_2_unicode_compatible -class SouthTexasZipcode(models.Model): - "Model for a few South Texas ZIP codes." - name = models.CharField(max_length=5) - poly = models.PolygonField(srid=32140, null=True) - objects = models.GeoManager() - def __str__(self): return self.name - -@python_2_unicode_compatible -class Interstate(models.Model): - "Geodetic model for U.S. Interstates." - name = models.CharField(max_length=10) - path = models.LineStringField() - objects = models.GeoManager() - def __str__(self): return self.name - -@python_2_unicode_compatible -class SouthTexasInterstate(models.Model): - "Projected model for South Texas Interstates." - name = models.CharField(max_length=10) - path = models.LineStringField(srid=32140) - objects = models.GeoManager() - def __str__(self): return self.name diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/tests.py b/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/tests.py deleted file mode 100644 index 2ed17a0..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/tests.py +++ /dev/null @@ -1,367 +0,0 @@ -from __future__ import absolute_import - -from django.db import connection -from django.db.models import Q -from django.contrib.gis.geos import HAS_GEOS -from django.contrib.gis.measure import D # alias for Distance -from django.contrib.gis.tests.utils import ( - HAS_SPATIAL_DB, mysql, oracle, postgis, spatialite, no_oracle, no_spatialite -) -from django.test import TestCase -from django.utils.unittest import skipUnless - -if HAS_GEOS and HAS_SPATIAL_DB: - from django.contrib.gis.geos import GEOSGeometry, LineString - - from .models import (AustraliaCity, Interstate, SouthTexasInterstate, - SouthTexasCity, SouthTexasCityFt, CensusZipcode, SouthTexasZipcode) - - -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB and not mysql, - "Geos and spatial db (not mysql) are required.") -class DistanceTest(TestCase): - - if HAS_GEOS and HAS_SPATIAL_DB: - # A point we are testing distances with -- using a WGS84 - # coordinate that'll be implicitly transormed to that to - # the coordinate system of the field, EPSG:32140 (Texas South Central - # w/units in meters) - stx_pnt = GEOSGeometry('POINT (-95.370401017314293 29.704867409475465)', 4326) - # Another one for Australia - au_pnt = GEOSGeometry('POINT (150.791 -34.4919)', 4326) - - def get_names(self, qs): - cities = [c.name for c in qs] - cities.sort() - return cities - - def test01_init(self): - "Test initialization of distance models." - self.assertEqual(9, SouthTexasCity.objects.count()) - self.assertEqual(9, SouthTexasCityFt.objects.count()) - self.assertEqual(11, AustraliaCity.objects.count()) - self.assertEqual(4, SouthTexasZipcode.objects.count()) - self.assertEqual(4, CensusZipcode.objects.count()) - self.assertEqual(1, Interstate.objects.count()) - self.assertEqual(1, SouthTexasInterstate.objects.count()) - - @no_spatialite - def test02_dwithin(self): - "Testing the `dwithin` lookup type." - # Distances -- all should be equal (except for the - # degree/meter pair in au_cities, that's somewhat - # approximate). - tx_dists = [(7000, 22965.83), D(km=7), D(mi=4.349)] - au_dists = [(0.5, 32000), D(km=32), D(mi=19.884)] - - # Expected cities for Australia and Texas. - tx_cities = ['Downtown Houston', 'Southside Place'] - au_cities = ['Mittagong', 'Shellharbour', 'Thirroul', 'Wollongong'] - - # Performing distance queries on two projected coordinate systems one - # with units in meters and the other in units of U.S. survey feet. - for dist in tx_dists: - if isinstance(dist, tuple): dist1, dist2 = dist - else: dist1 = dist2 = dist - qs1 = SouthTexasCity.objects.filter(point__dwithin=(self.stx_pnt, dist1)) - qs2 = SouthTexasCityFt.objects.filter(point__dwithin=(self.stx_pnt, dist2)) - for qs in qs1, qs2: - self.assertEqual(tx_cities, self.get_names(qs)) - - # Now performing the `dwithin` queries on a geodetic coordinate system. - for dist in au_dists: - if isinstance(dist, D) and not oracle: type_error = True - else: type_error = False - - if isinstance(dist, tuple): - if oracle: dist = dist[1] - else: dist = dist[0] - - # Creating the query set. - qs = AustraliaCity.objects.order_by('name') - if type_error: - # A ValueError should be raised on PostGIS when trying to pass - # Distance objects into a DWithin query using a geodetic field. - self.assertRaises(ValueError, AustraliaCity.objects.filter(point__dwithin=(self.au_pnt, dist)).count) - else: - self.assertEqual(au_cities, self.get_names(qs.filter(point__dwithin=(self.au_pnt, dist)))) - - def test03a_distance_method(self): - "Testing the `distance` GeoQuerySet method on projected coordinate systems." - # The point for La Grange, TX - lagrange = GEOSGeometry('POINT(-96.876369 29.905320)', 4326) - # Reference distances in feet and in meters. Got these values from - # using the provided raw SQL statements. - # SELECT ST_Distance(point, ST_Transform(ST_GeomFromText('POINT(-96.876369 29.905320)', 4326), 32140)) FROM distapp_southtexascity; - m_distances = [147075.069813, 139630.198056, 140888.552826, - 138809.684197, 158309.246259, 212183.594374, - 70870.188967, 165337.758878, 139196.085105] - # SELECT ST_Distance(point, ST_Transform(ST_GeomFromText('POINT(-96.876369 29.905320)', 4326), 2278)) FROM distapp_southtexascityft; - # Oracle 11 thinks this is not a projected coordinate system, so it's s - # not tested. - ft_distances = [482528.79154625, 458103.408123001, 462231.860397575, - 455411.438904354, 519386.252102563, 696139.009211594, - 232513.278304279, 542445.630586414, 456679.155883207] - - # Testing using different variations of parameters and using models - # with different projected coordinate systems. - dist1 = SouthTexasCity.objects.distance(lagrange, field_name='point') - dist2 = SouthTexasCity.objects.distance(lagrange) # Using GEOSGeometry parameter - if spatialite or oracle: - dist_qs = [dist1, dist2] - else: - dist3 = SouthTexasCityFt.objects.distance(lagrange.ewkt) # Using EWKT string parameter. - dist4 = SouthTexasCityFt.objects.distance(lagrange) - dist_qs = [dist1, dist2, dist3, dist4] - - # Original query done on PostGIS, have to adjust AlmostEqual tolerance - # for Oracle. - if oracle: tol = 2 - else: tol = 5 - - # Ensuring expected distances are returned for each distance queryset. - for qs in dist_qs: - for i, c in enumerate(qs): - self.assertAlmostEqual(m_distances[i], c.distance.m, tol) - self.assertAlmostEqual(ft_distances[i], c.distance.survey_ft, tol) - - @no_spatialite - def test03b_distance_method(self): - "Testing the `distance` GeoQuerySet method on geodetic coordnate systems." - if oracle: tol = 2 - else: tol = 5 - - # Testing geodetic distance calculation with a non-point geometry - # (a LineString of Wollongong and Shellharbour coords). - ls = LineString( ( (150.902, -34.4245), (150.87, -34.5789) ) ) - if oracle or connection.ops.geography: - # Reference query: - # SELECT ST_distance_sphere(point, ST_GeomFromText('LINESTRING(150.9020 -34.4245,150.8700 -34.5789)', 4326)) FROM distapp_australiacity ORDER BY name; - distances = [1120954.92533513, 140575.720018241, 640396.662906304, - 60580.9693849269, 972807.955955075, 568451.8357838, - 40435.4335201384, 0, 68272.3896586844, 12375.0643697706, 0] - qs = AustraliaCity.objects.distance(ls).order_by('name') - for city, distance in zip(qs, distances): - # Testing equivalence to within a meter. - self.assertAlmostEqual(distance, city.distance.m, 0) - else: - # PostGIS 1.4 and below is limited to disance queries only - # to/from point geometries, check for raising of ValueError. - self.assertRaises(ValueError, AustraliaCity.objects.distance, ls) - self.assertRaises(ValueError, AustraliaCity.objects.distance, ls.wkt) - - # Got the reference distances using the raw SQL statements: - # SELECT ST_distance_spheroid(point, ST_GeomFromText('POINT(151.231341 -33.952685)', 4326), 'SPHEROID["WGS 84",6378137.0,298.257223563]') FROM distapp_australiacity WHERE (NOT (id = 11)); - # SELECT ST_distance_sphere(point, ST_GeomFromText('POINT(151.231341 -33.952685)', 4326)) FROM distapp_australiacity WHERE (NOT (id = 11)); st_distance_sphere - if connection.ops.postgis and connection.ops.proj_version_tuple() >= (4, 7, 0): - # PROJ.4 versions 4.7+ have updated datums, and thus different - # distance values. - spheroid_distances = [60504.0628957201, 77023.9489850262, 49154.8867574404, - 90847.4358768573, 217402.811919332, 709599.234564757, - 640011.483550888, 7772.00667991925, 1047861.78619339, - 1165126.55236034] - sphere_distances = [60580.9693849267, 77144.0435286473, 49199.4415344719, - 90804.7533823494, 217713.384600405, 709134.127242793, - 639828.157159169, 7786.82949717788, 1049204.06569028, - 1162623.7238134] - - else: - spheroid_distances = [60504.0628825298, 77023.948962654, 49154.8867507115, - 90847.435881812, 217402.811862568, 709599.234619957, - 640011.483583758, 7772.00667666425, 1047861.7859506, - 1165126.55237647] - sphere_distances = [60580.7612632291, 77143.7785056615, 49199.2725132184, - 90804.4414289463, 217712.63666124, 709131.691061906, - 639825.959074112, 7786.80274606706, 1049200.46122281, - 1162619.7297006] - - # Testing with spheroid distances first. - hillsdale = AustraliaCity.objects.get(name='Hillsdale') - qs = AustraliaCity.objects.exclude(id=hillsdale.id).distance(hillsdale.point, spheroid=True) - for i, c in enumerate(qs): - self.assertAlmostEqual(spheroid_distances[i], c.distance.m, tol) - if postgis: - # PostGIS uses sphere-only distances by default, testing these as well. - qs = AustraliaCity.objects.exclude(id=hillsdale.id).distance(hillsdale.point) - for i, c in enumerate(qs): - self.assertAlmostEqual(sphere_distances[i], c.distance.m, tol) - - @no_oracle # Oracle already handles geographic distance calculation. - def test03c_distance_method(self): - "Testing the `distance` GeoQuerySet method used with `transform` on a geographic field." - # Normally you can't compute distances from a geometry field - # that is not a PointField (on PostGIS 1.4 and below). - if not connection.ops.geography: - self.assertRaises(ValueError, CensusZipcode.objects.distance, self.stx_pnt) - - # We'll be using a Polygon (created by buffering the centroid - # of 77005 to 100m) -- which aren't allowed in geographic distance - # queries normally, however our field has been transformed to - # a non-geographic system. - z = SouthTexasZipcode.objects.get(name='77005') - - # Reference query: - # SELECT ST_Distance(ST_Transform("distapp_censuszipcode"."poly", 32140), ST_GeomFromText('', 32140)) FROM "distapp_censuszipcode"; - dists_m = [3553.30384972258, 1243.18391525602, 2186.15439472242] - - # Having our buffer in the SRID of the transformation and of the field - # -- should get the same results. The first buffer has no need for - # transformation SQL because it is the same SRID as what was given - # to `transform()`. The second buffer will need to be transformed, - # however. - buf1 = z.poly.centroid.buffer(100) - buf2 = buf1.transform(4269, clone=True) - ref_zips = ['77002', '77025', '77401'] - - for buf in [buf1, buf2]: - qs = CensusZipcode.objects.exclude(name='77005').transform(32140).distance(buf) - self.assertEqual(ref_zips, self.get_names(qs)) - for i, z in enumerate(qs): - self.assertAlmostEqual(z.distance.m, dists_m[i], 5) - - def test04_distance_lookups(self): - "Testing the `distance_lt`, `distance_gt`, `distance_lte`, and `distance_gte` lookup types." - # Retrieving the cities within a 20km 'donut' w/a 7km radius 'hole' - # (thus, Houston and Southside place will be excluded as tested in - # the `test02_dwithin` above). - qs1 = SouthTexasCity.objects.filter(point__distance_gte=(self.stx_pnt, D(km=7))).filter(point__distance_lte=(self.stx_pnt, D(km=20))) - - # Can't determine the units on SpatiaLite from PROJ.4 string, and - # Oracle 11 incorrectly thinks it is not projected. - if spatialite or oracle: - dist_qs = (qs1,) - else: - qs2 = SouthTexasCityFt.objects.filter(point__distance_gte=(self.stx_pnt, D(km=7))).filter(point__distance_lte=(self.stx_pnt, D(km=20))) - dist_qs = (qs1, qs2) - - for qs in dist_qs: - cities = self.get_names(qs) - self.assertEqual(cities, ['Bellaire', 'Pearland', 'West University Place']) - - # Doing a distance query using Polygons instead of a Point. - z = SouthTexasZipcode.objects.get(name='77005') - qs = SouthTexasZipcode.objects.exclude(name='77005').filter(poly__distance_lte=(z.poly, D(m=275))) - self.assertEqual(['77025', '77401'], self.get_names(qs)) - # If we add a little more distance 77002 should be included. - qs = SouthTexasZipcode.objects.exclude(name='77005').filter(poly__distance_lte=(z.poly, D(m=300))) - self.assertEqual(['77002', '77025', '77401'], self.get_names(qs)) - - def test05_geodetic_distance_lookups(self): - "Testing distance lookups on geodetic coordinate systems." - # Line is from Canberra to Sydney. Query is for all other cities within - # a 100km of that line (which should exclude only Hobart & Adelaide). - line = GEOSGeometry('LINESTRING(144.9630 -37.8143,151.2607 -33.8870)', 4326) - dist_qs = AustraliaCity.objects.filter(point__distance_lte=(line, D(km=100))) - - if oracle or connection.ops.geography: - # Oracle and PostGIS 1.5 can do distance lookups on arbitrary geometries. - self.assertEqual(9, dist_qs.count()) - self.assertEqual(['Batemans Bay', 'Canberra', 'Hillsdale', - 'Melbourne', 'Mittagong', 'Shellharbour', - 'Sydney', 'Thirroul', 'Wollongong'], - self.get_names(dist_qs)) - else: - # PostGIS 1.4 and below only allows geodetic distance queries (utilizing - # ST_Distance_Sphere/ST_Distance_Spheroid) from Points to PointFields - # on geometry columns. - self.assertRaises(ValueError, dist_qs.count) - - # Ensured that a ValueError was raised, none of the rest of the test is - # support on this backend, so bail now. - if spatialite: return - - # Too many params (4 in this case) should raise a ValueError. - self.assertRaises(ValueError, len, - AustraliaCity.objects.filter(point__distance_lte=('POINT(5 23)', D(km=100), 'spheroid', '4'))) - - # Not enough params should raise a ValueError. - self.assertRaises(ValueError, len, - AustraliaCity.objects.filter(point__distance_lte=('POINT(5 23)',))) - - # Getting all cities w/in 550 miles of Hobart. - hobart = AustraliaCity.objects.get(name='Hobart') - qs = AustraliaCity.objects.exclude(name='Hobart').filter(point__distance_lte=(hobart.point, D(mi=550))) - cities = self.get_names(qs) - self.assertEqual(cities, ['Batemans Bay', 'Canberra', 'Melbourne']) - - # Cities that are either really close or really far from Wollongong -- - # and using different units of distance. - wollongong = AustraliaCity.objects.get(name='Wollongong') - d1, d2 = D(yd=19500), D(nm=400) # Yards (~17km) & Nautical miles. - - # Normal geodetic distance lookup (uses `distance_sphere` on PostGIS. - gq1 = Q(point__distance_lte=(wollongong.point, d1)) - gq2 = Q(point__distance_gte=(wollongong.point, d2)) - qs1 = AustraliaCity.objects.exclude(name='Wollongong').filter(gq1 | gq2) - - # Geodetic distance lookup but telling GeoDjango to use `distance_spheroid` - # instead (we should get the same results b/c accuracy variance won't matter - # in this test case). - if postgis: - gq3 = Q(point__distance_lte=(wollongong.point, d1, 'spheroid')) - gq4 = Q(point__distance_gte=(wollongong.point, d2, 'spheroid')) - qs2 = AustraliaCity.objects.exclude(name='Wollongong').filter(gq3 | gq4) - querysets = [qs1, qs2] - else: - querysets = [qs1] - - for qs in querysets: - cities = self.get_names(qs) - self.assertEqual(cities, ['Adelaide', 'Hobart', 'Shellharbour', 'Thirroul']) - - def test06_area(self): - "Testing the `area` GeoQuerySet method." - # Reference queries: - # SELECT ST_Area(poly) FROM distapp_southtexaszipcode; - area_sq_m = [5437908.90234375, 10183031.4389648, 11254471.0073242, 9881708.91772461] - # Tolerance has to be lower for Oracle and differences - # with GEOS 3.0.0RC4 - tol = 2 - for i, z in enumerate(SouthTexasZipcode.objects.area()): - self.assertAlmostEqual(area_sq_m[i], z.area.sq_m, tol) - - def test07_length(self): - "Testing the `length` GeoQuerySet method." - # Reference query (should use `length_spheroid`). - # SELECT ST_length_spheroid(ST_GeomFromText('', 4326) 'SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]]'); - len_m1 = 473504.769553813 - len_m2 = 4617.668 - - if spatialite: - # Does not support geodetic coordinate systems. - self.assertRaises(ValueError, Interstate.objects.length) - else: - qs = Interstate.objects.length() - if oracle: tol = 2 - else: tol = 3 - self.assertAlmostEqual(len_m1, qs[0].length.m, tol) - - # Now doing length on a projected coordinate system. - i10 = SouthTexasInterstate.objects.length().get(name='I-10') - self.assertAlmostEqual(len_m2, i10.length.m, 2) - - @no_spatialite - def test08_perimeter(self): - "Testing the `perimeter` GeoQuerySet method." - # Reference query: - # SELECT ST_Perimeter(distapp_southtexaszipcode.poly) FROM distapp_southtexaszipcode; - perim_m = [18404.3550889361, 15627.2108551001, 20632.5588368978, 17094.5996143697] - if oracle: tol = 2 - else: tol = 7 - for i, z in enumerate(SouthTexasZipcode.objects.perimeter()): - self.assertAlmostEqual(perim_m[i], z.perimeter.m, tol) - - # Running on points; should return 0. - for i, c in enumerate(SouthTexasCity.objects.perimeter(model_att='perim')): - self.assertEqual(0, c.perim.m) - - def test09_measurement_null_fields(self): - "Testing the measurement GeoQuerySet methods on fields with NULL values." - # Creating SouthTexasZipcode w/NULL value. - SouthTexasZipcode.objects.create(name='78212') - # Performing distance/area queries against the NULL PolygonField, - # and ensuring the result of the operations is None. - htown = SouthTexasCity.objects.get(name='Downtown Houston') - z = SouthTexasZipcode.objects.distance(htown.point).area().get(name='78212') - self.assertEqual(None, z.distance) - self.assertEqual(None, z.area) diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/models.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/models.py deleted file mode 100644 index 81e5f55..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/models.py +++ /dev/null @@ -1,77 +0,0 @@ -from django.contrib.gis.db import models -from django.utils.encoding import python_2_unicode_compatible - -@python_2_unicode_compatible -class City3D(models.Model): - name = models.CharField(max_length=30) - point = models.PointField(dim=3) - objects = models.GeoManager() - - def __str__(self): - return self.name - -@python_2_unicode_compatible -class Interstate2D(models.Model): - name = models.CharField(max_length=30) - line = models.LineStringField(srid=4269) - objects = models.GeoManager() - - def __str__(self): - return self.name - -@python_2_unicode_compatible -class Interstate3D(models.Model): - name = models.CharField(max_length=30) - line = models.LineStringField(dim=3, srid=4269) - objects = models.GeoManager() - - def __str__(self): - return self.name - -@python_2_unicode_compatible -class InterstateProj2D(models.Model): - name = models.CharField(max_length=30) - line = models.LineStringField(srid=32140) - objects = models.GeoManager() - - def __str__(self): - return self.name - -@python_2_unicode_compatible -class InterstateProj3D(models.Model): - name = models.CharField(max_length=30) - line = models.LineStringField(dim=3, srid=32140) - objects = models.GeoManager() - - def __str__(self): - return self.name - -@python_2_unicode_compatible -class Polygon2D(models.Model): - name = models.CharField(max_length=30) - poly = models.PolygonField(srid=32140) - objects = models.GeoManager() - - def __str__(self): - return self.name - -@python_2_unicode_compatible -class Polygon3D(models.Model): - name = models.CharField(max_length=30) - poly = models.PolygonField(dim=3, srid=32140) - objects = models.GeoManager() - - def __str__(self): - return self.name - -class Point2D(models.Model): - point = models.PointField() - objects = models.GeoManager() - -class Point3D(models.Model): - point = models.PointField(dim=3) - objects = models.GeoManager() - -class MultiPoint3D(models.Model): - mpoint = models.MultiPointField(dim=3) - objects = models.GeoManager() diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/tests.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/tests.py deleted file mode 100644 index df9f356..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/tests.py +++ /dev/null @@ -1,278 +0,0 @@ -from __future__ import absolute_import, unicode_literals - -import os -import re - -from django.contrib.gis.gdal import HAS_GDAL -from django.contrib.gis.geos import HAS_GEOS -from django.contrib.gis.tests.utils import postgis -from django.test import TestCase -from django.utils._os import upath -from django.utils.unittest import skipUnless - -if HAS_GEOS: - from django.contrib.gis.db.models import Union, Extent3D - from django.contrib.gis.geos import GEOSGeometry, LineString, Point, Polygon - - from .models import (City3D, Interstate2D, Interstate3D, InterstateProj2D, - InterstateProj3D, Point2D, Point3D, MultiPoint3D, Polygon2D, Polygon3D) - -if HAS_GDAL: - from django.contrib.gis.utils import LayerMapping, LayerMapError - - -data_path = os.path.realpath(os.path.join(os.path.dirname(upath(__file__)), '..', 'data')) -city_file = os.path.join(data_path, 'cities', 'cities.shp') -vrt_file = os.path.join(data_path, 'test_vrt', 'test_vrt.vrt') - -# The coordinates of each city, with Z values corresponding to their -# altitude in meters. -city_data = ( - ('Houston', (-95.363151, 29.763374, 18)), - ('Dallas', (-96.801611, 32.782057, 147)), - ('Oklahoma City', (-97.521157, 34.464642, 380)), - ('Wellington', (174.783117, -41.315268, 14)), - ('Pueblo', (-104.609252, 38.255001, 1433)), - ('Lawrence', (-95.235060, 38.971823, 251)), - ('Chicago', (-87.650175, 41.850385, 181)), - ('Victoria', (-123.305196, 48.462611, 15)), -) - -# Reference mapping of city name to its altitude (Z value). -city_dict = dict((name, coords) for name, coords in city_data) - -# 3D freeway data derived from the National Elevation Dataset: -# http://seamless.usgs.gov/products/9arc.php -interstate_data = ( - ('I-45', - 'LINESTRING(-95.3708481 29.7765870 11.339,-95.3694580 29.7787980 4.536,-95.3690305 29.7797359 9.762,-95.3691886 29.7812450 12.448,-95.3696447 29.7850144 10.457,-95.3702511 29.7868518 9.418,-95.3706724 29.7881286 14.858,-95.3711632 29.7896157 15.386,-95.3714525 29.7936267 13.168,-95.3717848 29.7955007 15.104,-95.3717719 29.7969804 16.516,-95.3717305 29.7982117 13.923,-95.3717254 29.8000778 14.385,-95.3719875 29.8013539 15.160,-95.3720575 29.8026785 15.544,-95.3721321 29.8040912 14.975,-95.3722074 29.8050998 15.688,-95.3722779 29.8060430 16.099,-95.3733818 29.8076750 15.197,-95.3741563 29.8103686 17.268,-95.3749458 29.8129927 19.857,-95.3763564 29.8144557 15.435)', - ( 11.339, 4.536, 9.762, 12.448, 10.457, 9.418, 14.858, - 15.386, 13.168, 15.104, 16.516, 13.923, 14.385, 15.16 , - 15.544, 14.975, 15.688, 16.099, 15.197, 17.268, 19.857, - 15.435), - ), - ) - -# Bounding box polygon for inner-loop of Houston (in projected coordinate -# system 32140), with elevation values from the National Elevation Dataset -# (see above). -bbox_data = ( - 'POLYGON((941527.97 4225693.20,962596.48 4226349.75,963152.57 4209023.95,942051.75 4208366.38,941527.97 4225693.20))', - (21.71, 13.21, 9.12, 16.40, 21.71) -) - - -@skipUnless(HAS_GEOS and HAS_GDAL and postgis, "Geos, GDAL and postgis are required.") -class Geo3DTest(TestCase): - """ - Only a subset of the PostGIS routines are 3D-enabled, and this TestCase - tries to test the features that can handle 3D and that are also - available within GeoDjango. For more information, see the PostGIS docs - on the routines that support 3D: - - http://postgis.refractions.net/documentation/manual-1.4/ch08.html#PostGIS_3D_Functions - """ - - def _load_interstate_data(self): - # Interstate (2D / 3D and Geographic/Projected variants) - for name, line, exp_z in interstate_data: - line_3d = GEOSGeometry(line, srid=4269) - line_2d = LineString([l[:2] for l in line_3d.coords], srid=4269) - - # Creating a geographic and projected version of the - # interstate in both 2D and 3D. - Interstate3D.objects.create(name=name, line=line_3d) - InterstateProj3D.objects.create(name=name, line=line_3d) - Interstate2D.objects.create(name=name, line=line_2d) - InterstateProj2D.objects.create(name=name, line=line_2d) - - def _load_city_data(self): - for name, pnt_data in city_data: - City3D.objects.create(name=name, point=Point(*pnt_data, srid=4326)) - - def _load_polygon_data(self): - bbox_wkt, bbox_z = bbox_data - bbox_2d = GEOSGeometry(bbox_wkt, srid=32140) - bbox_3d = Polygon(tuple((x, y, z) for (x, y), z in zip(bbox_2d[0].coords, bbox_z)), srid=32140) - Polygon2D.objects.create(name='2D BBox', poly=bbox_2d) - Polygon3D.objects.create(name='3D BBox', poly=bbox_3d) - - def test_3d_hasz(self): - """ - Make sure data is 3D and has expected Z values -- shouldn't change - because of coordinate system. - """ - self._load_interstate_data() - for name, line, exp_z in interstate_data: - interstate = Interstate3D.objects.get(name=name) - interstate_proj = InterstateProj3D.objects.get(name=name) - for i in [interstate, interstate_proj]: - self.assertTrue(i.line.hasz) - self.assertEqual(exp_z, tuple(i.line.z)) - - self._load_city_data() - for name, pnt_data in city_data: - city = City3D.objects.get(name=name) - z = pnt_data[2] - self.assertTrue(city.point.hasz) - self.assertEqual(z, city.point.z) - - def test_3d_polygons(self): - """ - Test the creation of polygon 3D models. - """ - self._load_polygon_data() - p3d = Polygon3D.objects.get(name='3D BBox') - self.assertTrue(p3d.poly.hasz) - self.assertIsInstance(p3d.poly, Polygon) - self.assertEqual(p3d.poly.srid, 32140) - - def test_3d_layermapping(self): - """ - Testing LayerMapping on 3D models. - """ - point_mapping = {'point' : 'POINT'} - mpoint_mapping = {'mpoint' : 'MULTIPOINT'} - - # The VRT is 3D, but should still be able to map sans the Z. - lm = LayerMapping(Point2D, vrt_file, point_mapping, transform=False) - lm.save() - self.assertEqual(3, Point2D.objects.count()) - - # The city shapefile is 2D, and won't be able to fill the coordinates - # in the 3D model -- thus, a LayerMapError is raised. - self.assertRaises(LayerMapError, LayerMapping, - Point3D, city_file, point_mapping, transform=False) - - # 3D model should take 3D data just fine. - lm = LayerMapping(Point3D, vrt_file, point_mapping, transform=False) - lm.save() - self.assertEqual(3, Point3D.objects.count()) - - # Making sure LayerMapping.make_multi works right, by converting - # a Point25D into a MultiPoint25D. - lm = LayerMapping(MultiPoint3D, vrt_file, mpoint_mapping, transform=False) - lm.save() - self.assertEqual(3, MultiPoint3D.objects.count()) - - def test_kml(self): - """ - Test GeoQuerySet.kml() with Z values. - """ - self._load_city_data() - h = City3D.objects.kml(precision=6).get(name='Houston') - # KML should be 3D. - # `SELECT ST_AsKML(point, 6) FROM geo3d_city3d WHERE name = 'Houston';` - ref_kml_regex = re.compile(r'^-95.363\d+,29.763\d+,18$') - self.assertTrue(ref_kml_regex.match(h.kml)) - - def test_geojson(self): - """ - Test GeoQuerySet.geojson() with Z values. - """ - self._load_city_data() - h = City3D.objects.geojson(precision=6).get(name='Houston') - # GeoJSON should be 3D - # `SELECT ST_AsGeoJSON(point, 6) FROM geo3d_city3d WHERE name='Houston';` - ref_json_regex = re.compile(r'^{"type":"Point","coordinates":\[-95.363151,29.763374,18(\.0+)?\]}$') - self.assertTrue(ref_json_regex.match(h.geojson)) - - def test_union(self): - """ - Testing the Union aggregate of 3D models. - """ - # PostGIS query that returned the reference EWKT for this test: - # `SELECT ST_AsText(ST_Union(point)) FROM geo3d_city3d;` - self._load_city_data() - ref_ewkt = 'SRID=4326;MULTIPOINT(-123.305196 48.462611 15,-104.609252 38.255001 1433,-97.521157 34.464642 380,-96.801611 32.782057 147,-95.363151 29.763374 18,-95.23506 38.971823 251,-87.650175 41.850385 181,174.783117 -41.315268 14)' - ref_union = GEOSGeometry(ref_ewkt) - union = City3D.objects.aggregate(Union('point'))['point__union'] - self.assertTrue(union.hasz) - self.assertEqual(ref_union, union) - - def test_extent(self): - """ - Testing the Extent3D aggregate for 3D models. - """ - self._load_city_data() - # `SELECT ST_Extent3D(point) FROM geo3d_city3d;` - ref_extent3d = (-123.305196, -41.315268, 14,174.783117, 48.462611, 1433) - extent1 = City3D.objects.aggregate(Extent3D('point'))['point__extent3d'] - extent2 = City3D.objects.extent3d() - - def check_extent3d(extent3d, tol=6): - for ref_val, ext_val in zip(ref_extent3d, extent3d): - self.assertAlmostEqual(ref_val, ext_val, tol) - - for e3d in [extent1, extent2]: - check_extent3d(e3d) - - def test_perimeter(self): - """ - Testing GeoQuerySet.perimeter() on 3D fields. - """ - self._load_polygon_data() - # Reference query for values below: - # `SELECT ST_Perimeter3D(poly), ST_Perimeter2D(poly) FROM geo3d_polygon3d;` - ref_perim_3d = 76859.2620451 - ref_perim_2d = 76859.2577803 - tol = 6 - self.assertAlmostEqual(ref_perim_2d, - Polygon2D.objects.perimeter().get(name='2D BBox').perimeter.m, - tol) - self.assertAlmostEqual(ref_perim_3d, - Polygon3D.objects.perimeter().get(name='3D BBox').perimeter.m, - tol) - - def test_length(self): - """ - Testing GeoQuerySet.length() on 3D fields. - """ - # ST_Length_Spheroid Z-aware, and thus does not need to use - # a separate function internally. - # `SELECT ST_Length_Spheroid(line, 'SPHEROID["GRS 1980",6378137,298.257222101]') - # FROM geo3d_interstate[2d|3d];` - self._load_interstate_data() - tol = 3 - ref_length_2d = 4368.1721949481 - ref_length_3d = 4368.62547052088 - self.assertAlmostEqual(ref_length_2d, - Interstate2D.objects.length().get(name='I-45').length.m, - tol) - self.assertAlmostEqual(ref_length_3d, - Interstate3D.objects.length().get(name='I-45').length.m, - tol) - - # Making sure `ST_Length3D` is used on for a projected - # and 3D model rather than `ST_Length`. - # `SELECT ST_Length(line) FROM geo3d_interstateproj2d;` - ref_length_2d = 4367.71564892392 - # `SELECT ST_Length3D(line) FROM geo3d_interstateproj3d;` - ref_length_3d = 4368.16897234101 - self.assertAlmostEqual(ref_length_2d, - InterstateProj2D.objects.length().get(name='I-45').length.m, - tol) - self.assertAlmostEqual(ref_length_3d, - InterstateProj3D.objects.length().get(name='I-45').length.m, - tol) - - def test_scale(self): - """ - Testing GeoQuerySet.scale() on Z values. - """ - self._load_city_data() - # Mapping of City name to reference Z values. - zscales = (-3, 4, 23) - for zscale in zscales: - for city in City3D.objects.scale(1.0, 1.0, zscale): - self.assertEqual(city_dict[city.name][2] * zscale, city.scale.z) - - def test_translate(self): - """ - Testing GeoQuerySet.translate() on Z values. - """ - self._load_city_data() - ztranslations = (5.23, 23, -17) - for ztrans in ztranslations: - for city in City3D.objects.translate(0, 0, ztrans): - self.assertEqual(city_dict[city.name][2] + ztrans, city.translate.z) diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/views.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/views.py deleted file mode 100644 index 60f00ef..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/models.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/models.py deleted file mode 100644 index af08988..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/models.py +++ /dev/null @@ -1,12 +0,0 @@ -from django.contrib.gis.db import models -from django.contrib.gis import admin -from django.utils.encoding import python_2_unicode_compatible - -@python_2_unicode_compatible -class City(models.Model): - name = models.CharField(max_length=30) - point = models.PointField() - objects = models.GeoManager() - def __str__(self): return self.name - -admin.site.register(City, admin.OSMGeoAdmin) diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/tests.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/tests.py deleted file mode 100644 index 1bb54f2..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/tests.py +++ /dev/null @@ -1,73 +0,0 @@ -from __future__ import absolute_import - -from django.contrib.gis.geos import HAS_GEOS -from django.contrib.gis.tests.utils import HAS_SPATIAL_DB -from django.test import TestCase -from django.test.utils import override_settings -from django.utils.unittest import skipUnless - -if HAS_GEOS and HAS_SPATIAL_DB: - from django.contrib.gis import admin - from django.contrib.gis.geos import Point - - from .models import City - -GOOGLE_MAPS_API_KEY = 'XXXX' - - -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") -class GeoAdminTest(TestCase): - urls = 'django.contrib.gis.tests.geoadmin.urls' - - def test_ensure_geographic_media(self): - geoadmin = admin.site._registry[City] - admin_js = geoadmin.media.render_js() - self.assertTrue(any([geoadmin.openlayers_url in js for js in admin_js])) - - def test_olmap_OSM_rendering(self): - geoadmin = admin.site._registry[City] - result = geoadmin.get_map_widget(City._meta.get_field('point'))( - ).render('point', Point(-79.460734, 40.18476)) - self.assertIn( - """geodjango_point.layers.base = new OpenLayers.Layer.OSM("OpenStreetMap (Mapnik)");""", - result) - - def test_olmap_WMS_rendering(self): - geoadmin = admin.GeoModelAdmin(City, admin.site) - result = geoadmin.get_map_widget(City._meta.get_field('point'))( - ).render('point', Point(-79.460734, 40.18476)) - self.assertIn( - """geodjango_point.layers.base = new OpenLayers.Layer.WMS("OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: \'basic\', format: 'image/jpeg'});""", - result) - - def test_olwidget_has_changed(self): - """ - Check that changes are accurately noticed by OpenLayersWidget. - """ - geoadmin = admin.site._registry[City] - form = geoadmin.get_changelist_form(None)() - has_changed = form.fields['point']._has_changed - - initial = Point(13.4197458572965953, 52.5194108501149799, srid=4326) - data_same = "SRID=3857;POINT(1493879.2754093995 6894592.019687599)" - data_almost_same = "SRID=3857;POINT(1493879.2754093990 6894592.019687590)" - data_changed = "SRID=3857;POINT(1493884.0527237 6894593.8111804)" - - self.assertTrue(has_changed(None, data_changed)) - self.assertTrue(has_changed(initial, "")) - self.assertFalse(has_changed(None, "")) - self.assertFalse(has_changed(initial, data_same)) - self.assertFalse(has_changed(initial, data_almost_same)) - self.assertTrue(has_changed(initial, data_changed)) - - @override_settings(GOOGLE_MAPS_API_KEY=GOOGLE_MAPS_API_KEY) - def test_google_map_scripts(self): - """ - Testing GoogleMap.scripts() output. See #20773. - """ - from django.contrib.gis.maps.google.gmap import GoogleMap - - google_map = GoogleMap() - scripts = google_map.scripts - self.assertIn(GOOGLE_MAPS_API_KEY, scripts) - self.assertIn("new GMap2", scripts) diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/urls.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/urls.py deleted file mode 100644 index f415872..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/urls.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.conf.urls import patterns, include -from django.contrib import admin - -urlpatterns = patterns('', - (r'^admin/', include(admin.site.urls)), -) diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/__init__.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/feeds.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/feeds.py deleted file mode 100644 index f53431c..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/feeds.py +++ /dev/null @@ -1,66 +0,0 @@ -from __future__ import absolute_import - -from django.contrib.gis import feeds - -from .models import City - - -class TestGeoRSS1(feeds.Feed): - link = '/city/' - title = 'Test GeoDjango Cities' - - def items(self): - return City.objects.all() - - def item_link(self, item): - return '/city/%s/' % item.pk - - def item_geometry(self, item): - return item.point - -class TestGeoRSS2(TestGeoRSS1): - def geometry(self, obj): - # This should attach a element for the extent of - # of the cities in the database. This tuple came from - # calling `City.objects.extent()` -- we can't do that call here - # because `extent` is not implemented for MySQL/Oracle. - return (-123.30, -41.32, 174.78, 48.46) - - def item_geometry(self, item): - # Returning a simple tuple for the geometry. - return item.point.x, item.point.y - -class TestGeoAtom1(TestGeoRSS1): - feed_type = feeds.GeoAtom1Feed - -class TestGeoAtom2(TestGeoRSS2): - feed_type = feeds.GeoAtom1Feed - - def geometry(self, obj): - # This time we'll use a 2-tuple of coordinates for the box. - return ((-123.30, -41.32), (174.78, 48.46)) - -class TestW3CGeo1(TestGeoRSS1): - feed_type = feeds.W3CGeoFeed - -# The following feeds are invalid, and will raise exceptions. -class TestW3CGeo2(TestGeoRSS2): - feed_type = feeds.W3CGeoFeed - -class TestW3CGeo3(TestGeoRSS1): - feed_type = feeds.W3CGeoFeed - - def item_geometry(self, item): - from django.contrib.gis.geos import Polygon - return Polygon(((0, 0), (0, 1), (1, 1), (1, 0), (0, 0))) - -# The feed dictionary to use for URLs. -feed_dict = { - 'rss1' : TestGeoRSS1, - 'rss2' : TestGeoRSS2, - 'atom1' : TestGeoAtom1, - 'atom2' : TestGeoAtom2, - 'w3cgeo1' : TestW3CGeo1, - 'w3cgeo2' : TestW3CGeo2, - 'w3cgeo3' : TestW3CGeo3, -} diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/fixtures/initial_data.json.gz b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/fixtures/initial_data.json.gz deleted file mode 100644 index c695082..0000000 Binary files a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/fixtures/initial_data.json.gz and /dev/null differ diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/models.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/models.py deleted file mode 100644 index fa83859..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/models.py +++ /dev/null @@ -1,56 +0,0 @@ -from django.contrib.gis.db import models -from django.contrib.gis.tests.utils import mysql, spatialite -from django.utils.encoding import python_2_unicode_compatible - -# MySQL spatial indices can't handle NULL geometries. -null_flag = not mysql - -@python_2_unicode_compatible -class Country(models.Model): - name = models.CharField(max_length=30) - mpoly = models.MultiPolygonField() # SRID, by default, is 4326 - objects = models.GeoManager() - def __str__(self): return self.name - -@python_2_unicode_compatible -class City(models.Model): - name = models.CharField(max_length=30) - point = models.PointField() - objects = models.GeoManager() - def __str__(self): return self.name - -# This is an inherited model from City -class PennsylvaniaCity(City): - county = models.CharField(max_length=30) - founded = models.DateTimeField(null=True) - objects = models.GeoManager() # TODO: This should be implicitly inherited. - -@python_2_unicode_compatible -class State(models.Model): - name = models.CharField(max_length=30) - poly = models.PolygonField(null=null_flag) # Allowing NULL geometries here. - objects = models.GeoManager() - def __str__(self): return self.name - -@python_2_unicode_compatible -class Track(models.Model): - name = models.CharField(max_length=30) - line = models.LineStringField() - objects = models.GeoManager() - def __str__(self): return self.name - -class Truth(models.Model): - val = models.BooleanField(default=False) - objects = models.GeoManager() - -if not spatialite: - @python_2_unicode_compatible - class Feature(models.Model): - name = models.CharField(max_length=20) - geom = models.GeometryField() - objects = models.GeoManager() - def __str__(self): return self.name - - class MinusOneSRID(models.Model): - geom = models.PointField(srid=-1) # Minus one SRID. - objects = models.GeoManager() diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/sitemaps.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/sitemaps.py deleted file mode 100644 index 0e85fda..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/sitemaps.py +++ /dev/null @@ -1,12 +0,0 @@ -from __future__ import absolute_import - -from django.contrib.gis.sitemaps import GeoRSSSitemap, KMLSitemap, KMZSitemap - -from .feeds import feed_dict -from .models import City, Country - - -sitemaps = {'kml' : KMLSitemap([City, Country]), - 'kmz' : KMZSitemap([City, Country]), - 'georss' : GeoRSSSitemap(feed_dict), - } diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_feeds.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_feeds.py deleted file mode 100644 index 778cadc..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_feeds.py +++ /dev/null @@ -1,96 +0,0 @@ -from __future__ import absolute_import - -from xml.dom import minidom - -from django.conf import settings -from django.contrib.sites.models import Site -from django.contrib.gis.geos import HAS_GEOS -from django.contrib.gis.tests.utils import HAS_SPATIAL_DB -from django.test import TestCase -from django.utils.unittest import skipUnless - -if HAS_GEOS: - from .models import City - - -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") -class GeoFeedTest(TestCase): - - urls = 'django.contrib.gis.tests.geoapp.urls' - - def setUp(self): - Site(id=settings.SITE_ID, domain="example.com", name="example.com").save() - self.old_Site_meta_installed = Site._meta.installed - Site._meta.installed = True - - def tearDown(self): - Site._meta.installed = self.old_Site_meta_installed - - def assertChildNodes(self, elem, expected): - "Taken from syndication/tests.py." - actual = set([n.nodeName for n in elem.childNodes]) - expected = set(expected) - self.assertEqual(actual, expected) - - def test_geofeed_rss(self): - "Tests geographic feeds using GeoRSS over RSSv2." - # Uses `GEOSGeometry` in `item_geometry` - doc1 = minidom.parseString(self.client.get('/feeds/rss1/').content) - # Uses a 2-tuple in `item_geometry` - doc2 = minidom.parseString(self.client.get('/feeds/rss2/').content) - feed1, feed2 = doc1.firstChild, doc2.firstChild - - # Making sure the box got added to the second GeoRSS feed. - self.assertChildNodes(feed2.getElementsByTagName('channel')[0], - ['title', 'link', 'description', 'language', - 'lastBuildDate', 'item', 'georss:box', 'atom:link'] - ) - - # Incrementing through the feeds. - for feed in [feed1, feed2]: - # Ensuring the georss namespace was added to the element. - self.assertEqual(feed.getAttribute('xmlns:georss'), 'http://www.georss.org/georss') - chan = feed.getElementsByTagName('channel')[0] - items = chan.getElementsByTagName('item') - self.assertEqual(len(items), City.objects.count()) - - # Ensuring the georss element was added to each item in the feed. - for item in items: - self.assertChildNodes(item, ['title', 'link', 'description', 'guid', 'georss:point']) - - def test_geofeed_atom(self): - "Testing geographic feeds using GeoRSS over Atom." - doc1 = minidom.parseString(self.client.get('/feeds/atom1/').content) - doc2 = minidom.parseString(self.client.get('/feeds/atom2/').content) - feed1, feed2 = doc1.firstChild, doc2.firstChild - - # Making sure the box got added to the second GeoRSS feed. - self.assertChildNodes(feed2, ['title', 'link', 'id', 'updated', 'entry', 'georss:box']) - - for feed in [feed1, feed2]: - # Ensuring the georsss namespace was added to the element. - self.assertEqual(feed.getAttribute('xmlns:georss'), 'http://www.georss.org/georss') - entries = feed.getElementsByTagName('entry') - self.assertEqual(len(entries), City.objects.count()) - - # Ensuring the georss element was added to each entry in the feed. - for entry in entries: - self.assertChildNodes(entry, ['title', 'link', 'id', 'summary', 'georss:point']) - - def test_geofeed_w3c(self): - "Testing geographic feeds using W3C Geo." - doc = minidom.parseString(self.client.get('/feeds/w3cgeo1/').content) - feed = doc.firstChild - # Ensuring the geo namespace was added to the element. - self.assertEqual(feed.getAttribute('xmlns:geo'), 'http://www.w3.org/2003/01/geo/wgs84_pos#') - chan = feed.getElementsByTagName('channel')[0] - items = chan.getElementsByTagName('item') - self.assertEqual(len(items), City.objects.count()) - - # Ensuring the geo:lat and geo:lon element was added to each item in the feed. - for item in items: - self.assertChildNodes(item, ['title', 'link', 'description', 'guid', 'geo:lat', 'geo:lon']) - - # Boxes and Polygons aren't allowed in W3C Geo feeds. - self.assertRaises(ValueError, self.client.get, '/feeds/w3cgeo2/') # Box in - self.assertRaises(ValueError, self.client.get, '/feeds/w3cgeo3/') # Polygons in diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_regress.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_regress.py deleted file mode 100644 index 43dbcfd..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_regress.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- encoding: utf-8 -*- -from __future__ import absolute_import, unicode_literals - -from datetime import datetime - -from django.contrib.gis.geos import HAS_GEOS -from django.contrib.gis.tests.utils import no_mysql, no_spatialite -from django.contrib.gis.shortcuts import render_to_kmz -from django.contrib.gis.tests.utils import HAS_SPATIAL_DB -from django.db.models import Count, Min -from django.test import TestCase -from django.utils.unittest import skipUnless - -if HAS_GEOS: - from .models import City, PennsylvaniaCity, State, Truth - - -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") -class GeoRegressionTests(TestCase): - - def test_update(self): - "Testing GeoQuerySet.update(). See #10411." - pnt = City.objects.get(name='Pueblo').point - bak = pnt.clone() - pnt.y += 0.005 - pnt.x += 0.005 - - City.objects.filter(name='Pueblo').update(point=pnt) - self.assertEqual(pnt, City.objects.get(name='Pueblo').point) - City.objects.filter(name='Pueblo').update(point=bak) - self.assertEqual(bak, City.objects.get(name='Pueblo').point) - - def test_kmz(self): - "Testing `render_to_kmz` with non-ASCII data. See #11624." - name = "Åland Islands" - places = [{'name' : name, - 'description' : name, - 'kml' : '5.0,23.0' - }] - kmz = render_to_kmz('gis/kml/placemarks.kml', {'places' : places}) - - @no_spatialite - @no_mysql - def test_extent(self): - "Testing `extent` on a table with a single point. See #11827." - pnt = City.objects.get(name='Pueblo').point - ref_ext = (pnt.x, pnt.y, pnt.x, pnt.y) - extent = City.objects.filter(name='Pueblo').extent() - for ref_val, val in zip(ref_ext, extent): - self.assertAlmostEqual(ref_val, val, 4) - - def test_unicode_date(self): - "Testing dates are converted properly, even on SpatiaLite. See #16408." - founded = datetime(1857, 5, 23) - mansfield = PennsylvaniaCity.objects.create(name='Mansfield', county='Tioga', point='POINT(-77.071445 41.823881)', - founded=founded) - self.assertEqual(founded, PennsylvaniaCity.objects.datetimes('founded', 'day')[0]) - self.assertEqual(founded, PennsylvaniaCity.objects.aggregate(Min('founded'))['founded__min']) - - def test_empty_count(self): - "Testing that PostGISAdapter.__eq__ does check empty strings. See #13670." - # contrived example, but need a geo lookup paired with an id__in lookup - pueblo = City.objects.get(name='Pueblo') - state = State.objects.filter(poly__contains=pueblo.point) - cities_within_state = City.objects.filter(id__in=state) - - # .count() should not throw TypeError in __eq__ - self.assertEqual(cities_within_state.count(), 1) - - def test_defer_or_only_with_annotate(self): - "Regression for #16409. Make sure defer() and only() work with annotate()" - self.assertIsInstance(list(City.objects.annotate(Count('point')).defer('name')), list) - self.assertIsInstance(list(City.objects.annotate(Count('point')).only('name')), list) - - def test_boolean_conversion(self): - "Testing Boolean value conversion with the spatial backend, see #15169." - t1 = Truth.objects.create(val=True) - t2 = Truth.objects.create(val=False) - - val1 = Truth.objects.get(pk=t1.pk).val - val2 = Truth.objects.get(pk=t2.pk).val - # verify types -- should't be 0/1 - self.assertIsInstance(val1, bool) - self.assertIsInstance(val2, bool) - # verify values - self.assertEqual(val1, True) - self.assertEqual(val2, False) diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_sitemaps.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_sitemaps.py deleted file mode 100644 index 337b4b7..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_sitemaps.py +++ /dev/null @@ -1,104 +0,0 @@ -from __future__ import absolute_import - -from io import BytesIO -from xml.dom import minidom -import zipfile - -from django.conf import settings -from django.contrib.gis.geos import HAS_GEOS -from django.contrib.gis.tests.utils import HAS_SPATIAL_DB -from django.contrib.sites.models import Site -from django.test import TestCase -from django.utils.unittest import skipUnless - -if HAS_GEOS: - from .models import City, Country - - -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") -class GeoSitemapTest(TestCase): - - urls = 'django.contrib.gis.tests.geoapp.urls' - - def setUp(self): - Site(id=settings.SITE_ID, domain="example.com", name="example.com").save() - self.old_Site_meta_installed = Site._meta.installed - Site._meta.installed = True - - def tearDown(self): - Site._meta.installed = self.old_Site_meta_installed - - def assertChildNodes(self, elem, expected): - "Taken from syndication/tests.py." - actual = set([n.nodeName for n in elem.childNodes]) - expected = set(expected) - self.assertEqual(actual, expected) - - def test_geositemap_index(self): - "Tests geographic sitemap index." - # Getting the geo index. - doc = minidom.parseString(self.client.get('/sitemap.xml').content) - index = doc.firstChild - self.assertEqual(index.getAttribute('xmlns'), 'http://www.sitemaps.org/schemas/sitemap/0.9') - self.assertEqual(3, len(index.getElementsByTagName('sitemap'))) - - def test_geositemap_kml(self): - "Tests KML/KMZ geographic sitemaps." - for kml_type in ('kml', 'kmz'): - doc = minidom.parseString(self.client.get('/sitemaps/%s.xml' % kml_type).content) - - # Ensuring the right sitemaps namespaces are present. - urlset = doc.firstChild - self.assertEqual(urlset.getAttribute('xmlns'), 'http://www.sitemaps.org/schemas/sitemap/0.9') - self.assertEqual(urlset.getAttribute('xmlns:geo'), 'http://www.google.com/geo/schemas/sitemap/1.0') - - urls = urlset.getElementsByTagName('url') - self.assertEqual(2, len(urls)) # Should only be 2 sitemaps. - for url in urls: - self.assertChildNodes(url, ['loc', 'geo:geo']) - # Making sure the 'geo:format' element was properly set. - geo_elem = url.getElementsByTagName('geo:geo')[0] - geo_format = geo_elem.getElementsByTagName('geo:format')[0] - self.assertEqual(kml_type, geo_format.childNodes[0].data) - - # Getting the relative URL since we don't have a real site. - kml_url = url.getElementsByTagName('loc')[0].childNodes[0].data.split('http://example.com')[1] - - if kml_type == 'kml': - kml_doc = minidom.parseString(self.client.get(kml_url).content) - elif kml_type == 'kmz': - # Have to decompress KMZ before parsing. - buf = BytesIO(self.client.get(kml_url).content) - zf = zipfile.ZipFile(buf) - self.assertEqual(1, len(zf.filelist)) - self.assertEqual('doc.kml', zf.filelist[0].filename) - kml_doc = minidom.parseString(zf.read('doc.kml')) - - # Ensuring the correct number of placemarks are in the KML doc. - if 'city' in kml_url: - model = City - elif 'country' in kml_url: - model = Country - self.assertEqual(model.objects.count(), len(kml_doc.getElementsByTagName('Placemark'))) - - def test_geositemap_georss(self): - "Tests GeoRSS geographic sitemaps." - from .feeds import feed_dict - - doc = minidom.parseString(self.client.get('/sitemaps/georss.xml').content) - - # Ensuring the right sitemaps namespaces are present. - urlset = doc.firstChild - self.assertEqual(urlset.getAttribute('xmlns'), 'http://www.sitemaps.org/schemas/sitemap/0.9') - self.assertEqual(urlset.getAttribute('xmlns:geo'), 'http://www.google.com/geo/schemas/sitemap/1.0') - - # Making sure the correct number of feed URLs were included. - urls = urlset.getElementsByTagName('url') - self.assertEqual(len(feed_dict), len(urls)) - - for url in urls: - self.assertChildNodes(url, ['loc', 'geo:geo']) - # Making sure the 'geo:format' element was properly set to 'georss'. - geo_elem = url.getElementsByTagName('geo:geo')[0] - geo_format = geo_elem.getElementsByTagName('geo:format')[0] - self.assertEqual('georss', geo_format.childNodes[0].data) diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/tests.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/tests.py deleted file mode 100644 index 617d92b..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/tests.py +++ /dev/null @@ -1,788 +0,0 @@ -from __future__ import absolute_import - -import re - -from django.db import connection -from django.contrib.gis import gdal -from django.contrib.gis.geos import HAS_GEOS -from django.contrib.gis.tests.utils import ( - HAS_SPATIAL_DB, no_mysql, no_oracle, no_spatialite, - mysql, oracle, postgis, spatialite) -from django.test import TestCase -from django.utils import six, unittest -from django.utils.unittest import skipUnless - -if HAS_GEOS: - from django.contrib.gis.geos import (fromstr, GEOSGeometry, - Point, LineString, LinearRing, Polygon, GeometryCollection) - - from .models import Country, City, PennsylvaniaCity, State, Track - -if HAS_GEOS and not spatialite: - from .models import Feature, MinusOneSRID - - -def postgis_bug_version(): - spatial_version = getattr(connection.ops, "spatial_version", (0,0,0)) - return spatial_version and (2, 0, 0) <= spatial_version <= (2, 0, 1) - - -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") -class GeoModelTest(TestCase): - - def test_fixtures(self): - "Testing geographic model initialization from fixtures." - # Ensuring that data was loaded from initial data fixtures. - self.assertEqual(2, Country.objects.count()) - self.assertEqual(8, City.objects.count()) - self.assertEqual(2, State.objects.count()) - - def test_proxy(self): - "Testing Lazy-Geometry support (using the GeometryProxy)." - ## Testing on a Point - pnt = Point(0, 0) - nullcity = City(name='NullCity', point=pnt) - nullcity.save() - - # Making sure TypeError is thrown when trying to set with an - # incompatible type. - for bad in [5, 2.0, LineString((0, 0), (1, 1))]: - try: - nullcity.point = bad - except TypeError: - pass - else: - self.fail('Should throw a TypeError') - - # Now setting with a compatible GEOS Geometry, saving, and ensuring - # the save took, notice no SRID is explicitly set. - new = Point(5, 23) - nullcity.point = new - - # Ensuring that the SRID is automatically set to that of the - # field after assignment, but before saving. - self.assertEqual(4326, nullcity.point.srid) - nullcity.save() - - # Ensuring the point was saved correctly after saving - self.assertEqual(new, City.objects.get(name='NullCity').point) - - # Setting the X and Y of the Point - nullcity.point.x = 23 - nullcity.point.y = 5 - # Checking assignments pre & post-save. - self.assertNotEqual(Point(23, 5), City.objects.get(name='NullCity').point) - nullcity.save() - self.assertEqual(Point(23, 5), City.objects.get(name='NullCity').point) - nullcity.delete() - - ## Testing on a Polygon - shell = LinearRing((0, 0), (0, 100), (100, 100), (100, 0), (0, 0)) - inner = LinearRing((40, 40), (40, 60), (60, 60), (60, 40), (40, 40)) - - # Creating a State object using a built Polygon - ply = Polygon(shell, inner) - nullstate = State(name='NullState', poly=ply) - self.assertEqual(4326, nullstate.poly.srid) # SRID auto-set from None - nullstate.save() - - ns = State.objects.get(name='NullState') - self.assertEqual(ply, ns.poly) - - # Testing the `ogr` and `srs` lazy-geometry properties. - if gdal.HAS_GDAL: - self.assertEqual(True, isinstance(ns.poly.ogr, gdal.OGRGeometry)) - self.assertEqual(ns.poly.wkb, ns.poly.ogr.wkb) - self.assertEqual(True, isinstance(ns.poly.srs, gdal.SpatialReference)) - self.assertEqual('WGS 84', ns.poly.srs.name) - - # Changing the interior ring on the poly attribute. - new_inner = LinearRing((30, 30), (30, 70), (70, 70), (70, 30), (30, 30)) - ns.poly[1] = new_inner - ply[1] = new_inner - self.assertEqual(4326, ns.poly.srid) - ns.save() - self.assertEqual(ply, State.objects.get(name='NullState').poly) - ns.delete() - - @no_mysql - def test_lookup_insert_transform(self): - "Testing automatic transform for lookups and inserts." - # San Antonio in 'WGS84' (SRID 4326) - sa_4326 = 'POINT (-98.493183 29.424170)' - wgs_pnt = fromstr(sa_4326, srid=4326) # Our reference point in WGS84 - - # Oracle doesn't have SRID 3084, using 41157. - if oracle: - # San Antonio in 'Texas 4205, Southern Zone (1983, meters)' (SRID 41157) - # Used the following Oracle SQL to get this value: - # SELECT SDO_UTIL.TO_WKTGEOMETRY(SDO_CS.TRANSFORM(SDO_GEOMETRY('POINT (-98.493183 29.424170)', 4326), 41157)) FROM DUAL; - nad_wkt = 'POINT (300662.034646583 5416427.45974934)' - nad_srid = 41157 - else: - # San Antonio in 'NAD83(HARN) / Texas Centric Lambert Conformal' (SRID 3084) - nad_wkt = 'POINT (1645978.362408288754523 6276356.025927528738976)' # Used ogr.py in gdal 1.4.1 for this transform - nad_srid = 3084 - - # Constructing & querying with a point from a different SRID. Oracle - # `SDO_OVERLAPBDYINTERSECT` operates differently from - # `ST_Intersects`, so contains is used instead. - nad_pnt = fromstr(nad_wkt, srid=nad_srid) - if oracle: - tx = Country.objects.get(mpoly__contains=nad_pnt) - else: - tx = Country.objects.get(mpoly__intersects=nad_pnt) - self.assertEqual('Texas', tx.name) - - # Creating San Antonio. Remember the Alamo. - sa = City.objects.create(name='San Antonio', point=nad_pnt) - - # Now verifying that San Antonio was transformed correctly - sa = City.objects.get(name='San Antonio') - self.assertAlmostEqual(wgs_pnt.x, sa.point.x, 6) - self.assertAlmostEqual(wgs_pnt.y, sa.point.y, 6) - - # If the GeometryField SRID is -1, then we shouldn't perform any - # transformation if the SRID of the input geometry is different. - # SpatiaLite does not support missing SRID values. - if not spatialite: - m1 = MinusOneSRID(geom=Point(17, 23, srid=4326)) - m1.save() - self.assertEqual(-1, m1.geom.srid) - - def test_createnull(self): - "Testing creating a model instance and the geometry being None" - c = City() - self.assertEqual(c.point, None) - - @no_spatialite # SpatiaLite does not support abstract geometry columns - def test_geometryfield(self): - "Testing the general GeometryField." - Feature(name='Point', geom=Point(1, 1)).save() - Feature(name='LineString', geom=LineString((0, 0), (1, 1), (5, 5))).save() - Feature(name='Polygon', geom=Polygon(LinearRing((0, 0), (0, 5), (5, 5), (5, 0), (0, 0)))).save() - Feature(name='GeometryCollection', - geom=GeometryCollection(Point(2, 2), LineString((0, 0), (2, 2)), - Polygon(LinearRing((0, 0), (0, 5), (5, 5), (5, 0), (0, 0))))).save() - - f_1 = Feature.objects.get(name='Point') - self.assertEqual(True, isinstance(f_1.geom, Point)) - self.assertEqual((1.0, 1.0), f_1.geom.tuple) - f_2 = Feature.objects.get(name='LineString') - self.assertEqual(True, isinstance(f_2.geom, LineString)) - self.assertEqual(((0.0, 0.0), (1.0, 1.0), (5.0, 5.0)), f_2.geom.tuple) - - f_3 = Feature.objects.get(name='Polygon') - self.assertEqual(True, isinstance(f_3.geom, Polygon)) - f_4 = Feature.objects.get(name='GeometryCollection') - self.assertEqual(True, isinstance(f_4.geom, GeometryCollection)) - self.assertEqual(f_3.geom, f_4.geom[2]) - - @no_mysql - def test_inherited_geofields(self): - "Test GeoQuerySet methods on inherited Geometry fields." - # Creating a Pennsylvanian city. - mansfield = PennsylvaniaCity.objects.create(name='Mansfield', county='Tioga', point='POINT(-77.071445 41.823881)') - - # All transformation SQL will need to be performed on the - # _parent_ table. - qs = PennsylvaniaCity.objects.transform(32128) - - self.assertEqual(1, qs.count()) - for pc in qs: self.assertEqual(32128, pc.point.srid) - - def test_raw_sql_query(self): - "Testing raw SQL query." - cities1 = City.objects.all() - # Only PostGIS would support a 'select *' query because of its recognized - # HEXEWKB format for geometry fields - as_text = 'ST_AsText' if postgis else 'asText' - cities2 = City.objects.raw('select id, name, %s(point) from geoapp_city' % as_text) - self.assertEqual(len(cities1), len(list(cities2))) - self.assertTrue(isinstance(cities2[0].point, Point)) - - -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") -class GeoLookupTest(TestCase): - - @no_mysql - def test_disjoint_lookup(self): - "Testing the `disjoint` lookup type." - ptown = City.objects.get(name='Pueblo') - qs1 = City.objects.filter(point__disjoint=ptown.point) - self.assertEqual(7, qs1.count()) - - qs2 = State.objects.filter(poly__disjoint=ptown.point) - self.assertEqual(1, qs2.count()) - self.assertEqual('Kansas', qs2[0].name) - - def test_contains_contained_lookups(self): - "Testing the 'contained', 'contains', and 'bbcontains' lookup types." - # Getting Texas, yes we were a country -- once ;) - texas = Country.objects.get(name='Texas') - - # Seeing what cities are in Texas, should get Houston and Dallas, - # and Oklahoma City because 'contained' only checks on the - # _bounding box_ of the Geometries. - if not oracle: - qs = City.objects.filter(point__contained=texas.mpoly) - self.assertEqual(3, qs.count()) - cities = ['Houston', 'Dallas', 'Oklahoma City'] - for c in qs: self.assertEqual(True, c.name in cities) - - # Pulling out some cities. - houston = City.objects.get(name='Houston') - wellington = City.objects.get(name='Wellington') - pueblo = City.objects.get(name='Pueblo') - okcity = City.objects.get(name='Oklahoma City') - lawrence = City.objects.get(name='Lawrence') - - # Now testing contains on the countries using the points for - # Houston and Wellington. - tx = Country.objects.get(mpoly__contains=houston.point) # Query w/GEOSGeometry - nz = Country.objects.get(mpoly__contains=wellington.point.hex) # Query w/EWKBHEX - self.assertEqual('Texas', tx.name) - self.assertEqual('New Zealand', nz.name) - - # Spatialite 2.3 thinks that Lawrence is in Puerto Rico (a NULL geometry). - if not spatialite: - ks = State.objects.get(poly__contains=lawrence.point) - self.assertEqual('Kansas', ks.name) - - # Pueblo and Oklahoma City (even though OK City is within the bounding box of Texas) - # are not contained in Texas or New Zealand. - self.assertEqual(0, len(Country.objects.filter(mpoly__contains=pueblo.point))) # Query w/GEOSGeometry object - self.assertEqual((mysql and 1) or 0, - len(Country.objects.filter(mpoly__contains=okcity.point.wkt))) # Qeury w/WKT - - # OK City is contained w/in bounding box of Texas. - if not oracle: - qs = Country.objects.filter(mpoly__bbcontains=okcity.point) - self.assertEqual(1, len(qs)) - self.assertEqual('Texas', qs[0].name) - - # Only PostGIS has `left` and `right` lookup types. - @no_mysql - @no_oracle - @no_spatialite - def test_left_right_lookups(self): - "Testing the 'left' and 'right' lookup types." - # Left: A << B => true if xmax(A) < xmin(B) - # Right: A >> B => true if xmin(A) > xmax(B) - # See: BOX2D_left() and BOX2D_right() in lwgeom_box2dfloat4.c in PostGIS source. - - # Getting the borders for Colorado & Kansas - co_border = State.objects.get(name='Colorado').poly - ks_border = State.objects.get(name='Kansas').poly - - # Note: Wellington has an 'X' value of 174, so it will not be considered - # to the left of CO. - - # These cities should be strictly to the right of the CO border. - cities = ['Houston', 'Dallas', 'Oklahoma City', - 'Lawrence', 'Chicago', 'Wellington'] - qs = City.objects.filter(point__right=co_border) - self.assertEqual(6, len(qs)) - for c in qs: self.assertEqual(True, c.name in cities) - - # These cities should be strictly to the right of the KS border. - cities = ['Chicago', 'Wellington'] - qs = City.objects.filter(point__right=ks_border) - self.assertEqual(2, len(qs)) - for c in qs: self.assertEqual(True, c.name in cities) - - # Note: Wellington has an 'X' value of 174, so it will not be considered - # to the left of CO. - vic = City.objects.get(point__left=co_border) - self.assertEqual('Victoria', vic.name) - - cities = ['Pueblo', 'Victoria'] - qs = City.objects.filter(point__left=ks_border) - self.assertEqual(2, len(qs)) - for c in qs: self.assertEqual(True, c.name in cities) - - # The left/right lookup tests are known failures on PostGIS 2.0/2.0.1 - # http://trac.osgeo.org/postgis/ticket/2035 - if postgis_bug_version(): - test_left_right_lookups = unittest.expectedFailure(test_left_right_lookups) - - def test_equals_lookups(self): - "Testing the 'same_as' and 'equals' lookup types." - pnt = fromstr('POINT (-95.363151 29.763374)', srid=4326) - c1 = City.objects.get(point=pnt) - c2 = City.objects.get(point__same_as=pnt) - c3 = City.objects.get(point__equals=pnt) - for c in [c1, c2, c3]: self.assertEqual('Houston', c.name) - - @no_mysql - def test_null_geometries(self): - "Testing NULL geometry support, and the `isnull` lookup type." - # Creating a state with a NULL boundary. - State.objects.create(name='Puerto Rico') - - # Querying for both NULL and Non-NULL values. - nullqs = State.objects.filter(poly__isnull=True) - validqs = State.objects.filter(poly__isnull=False) - - # Puerto Rico should be NULL (it's a commonwealth unincorporated territory) - self.assertEqual(1, len(nullqs)) - self.assertEqual('Puerto Rico', nullqs[0].name) - - # The valid states should be Colorado & Kansas - self.assertEqual(2, len(validqs)) - state_names = [s.name for s in validqs] - self.assertEqual(True, 'Colorado' in state_names) - self.assertEqual(True, 'Kansas' in state_names) - - # Saving another commonwealth w/a NULL geometry. - nmi = State.objects.create(name='Northern Mariana Islands', poly=None) - self.assertEqual(nmi.poly, None) - - # Assigning a geomery and saving -- then UPDATE back to NULL. - nmi.poly = 'POLYGON((0 0,1 0,1 1,1 0,0 0))' - nmi.save() - State.objects.filter(name='Northern Mariana Islands').update(poly=None) - self.assertEqual(None, State.objects.get(name='Northern Mariana Islands').poly) - - @no_mysql - def test_relate_lookup(self): - "Testing the 'relate' lookup type." - # To make things more interesting, we will have our Texas reference point in - # different SRIDs. - pnt1 = fromstr('POINT (649287.0363174 4177429.4494686)', srid=2847) - pnt2 = fromstr('POINT(-98.4919715741052 29.4333344025053)', srid=4326) - - # Not passing in a geometry as first param shoud - # raise a type error when initializing the GeoQuerySet - self.assertRaises(ValueError, Country.objects.filter, mpoly__relate=(23, 'foo')) - - # Making sure the right exception is raised for the given - # bad arguments. - for bad_args, e in [((pnt1, 0), ValueError), ((pnt2, 'T*T***FF*', 0), ValueError)]: - qs = Country.objects.filter(mpoly__relate=bad_args) - self.assertRaises(e, qs.count) - - # Relate works differently for the different backends. - if postgis or spatialite: - contains_mask = 'T*T***FF*' - within_mask = 'T*F**F***' - intersects_mask = 'T********' - elif oracle: - contains_mask = 'contains' - within_mask = 'inside' - # TODO: This is not quite the same as the PostGIS mask above - intersects_mask = 'overlapbdyintersect' - - # Testing contains relation mask. - self.assertEqual('Texas', Country.objects.get(mpoly__relate=(pnt1, contains_mask)).name) - self.assertEqual('Texas', Country.objects.get(mpoly__relate=(pnt2, contains_mask)).name) - - # Testing within relation mask. - ks = State.objects.get(name='Kansas') - self.assertEqual('Lawrence', City.objects.get(point__relate=(ks.poly, within_mask)).name) - - # Testing intersection relation mask. - if not oracle: - self.assertEqual('Texas', Country.objects.get(mpoly__relate=(pnt1, intersects_mask)).name) - self.assertEqual('Texas', Country.objects.get(mpoly__relate=(pnt2, intersects_mask)).name) - self.assertEqual('Lawrence', City.objects.get(point__relate=(ks.poly, intersects_mask)).name) - - -@skipUnless(HAS_GEOS and HAS_SPATIAL_DB, "Geos and spatial db are required.") -class GeoQuerySetTest(TestCase): - # Please keep the tests in GeoQuerySet method's alphabetic order - - @no_mysql - def test_centroid(self): - "Testing the `centroid` GeoQuerySet method." - qs = State.objects.exclude(poly__isnull=True).centroid() - if oracle: - tol = 0.1 - elif spatialite: - tol = 0.000001 - else: - tol = 0.000000001 - for s in qs: - self.assertEqual(True, s.poly.centroid.equals_exact(s.centroid, tol)) - - @no_mysql - def test_diff_intersection_union(self): - "Testing the `difference`, `intersection`, `sym_difference`, and `union` GeoQuerySet methods." - geom = Point(5, 23) - tol = 1 - qs = Country.objects.all().difference(geom).sym_difference(geom).union(geom) - - # XXX For some reason SpatiaLite does something screwey with the Texas geometry here. Also, - # XXX it doesn't like the null intersection. - if spatialite: - qs = qs.exclude(name='Texas') - else: - qs = qs.intersection(geom) - - for c in qs: - if oracle: - # Should be able to execute the queries; however, they won't be the same - # as GEOS (because Oracle doesn't use GEOS internally like PostGIS or - # SpatiaLite). - pass - else: - self.assertEqual(c.mpoly.difference(geom), c.difference) - if not spatialite: - self.assertEqual(c.mpoly.intersection(geom), c.intersection) - self.assertEqual(c.mpoly.sym_difference(geom), c.sym_difference) - self.assertEqual(c.mpoly.union(geom), c.union) - - @no_mysql - @no_spatialite # SpatiaLite does not have an Extent function - def test_extent(self): - "Testing the `extent` GeoQuerySet method." - # Reference query: - # `SELECT ST_extent(point) FROM geoapp_city WHERE (name='Houston' or name='Dallas');` - # => BOX(-96.8016128540039 29.7633724212646,-95.3631439208984 32.7820587158203) - expected = (-96.8016128540039, 29.7633724212646, -95.3631439208984, 32.782058715820) - - qs = City.objects.filter(name__in=('Houston', 'Dallas')) - extent = qs.extent() - - for val, exp in zip(extent, expected): - self.assertAlmostEqual(exp, val, 4) - - @no_mysql - @no_oracle - @no_spatialite - def test_force_rhr(self): - "Testing GeoQuerySet.force_rhr()." - rings = ( ( (0, 0), (5, 0), (0, 5), (0, 0) ), - ( (1, 1), (1, 3), (3, 1), (1, 1) ), - ) - rhr_rings = ( ( (0, 0), (0, 5), (5, 0), (0, 0) ), - ( (1, 1), (3, 1), (1, 3), (1, 1) ), - ) - State.objects.create(name='Foo', poly=Polygon(*rings)) - s = State.objects.force_rhr().get(name='Foo') - self.assertEqual(rhr_rings, s.force_rhr.coords) - - @no_mysql - @no_oracle - @no_spatialite - def test_geohash(self): - "Testing GeoQuerySet.geohash()." - if not connection.ops.geohash: return - # Reference query: - # SELECT ST_GeoHash(point) FROM geoapp_city WHERE name='Houston'; - # SELECT ST_GeoHash(point, 5) FROM geoapp_city WHERE name='Houston'; - ref_hash = '9vk1mfq8jx0c8e0386z6' - h1 = City.objects.geohash().get(name='Houston') - h2 = City.objects.geohash(precision=5).get(name='Houston') - self.assertEqual(ref_hash, h1.geohash) - self.assertEqual(ref_hash[:5], h2.geohash) - - def test_geojson(self): - "Testing GeoJSON output from the database using GeoQuerySet.geojson()." - # Only PostGIS 1.3.4+ and SpatiaLite 3.0+ support GeoJSON. - if not connection.ops.geojson: - self.assertRaises(NotImplementedError, Country.objects.all().geojson, field_name='mpoly') - return - - pueblo_json = '{"type":"Point","coordinates":[-104.609252,38.255001]}' - houston_json = '{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"coordinates":[-95.363151,29.763374]}' - victoria_json = '{"type":"Point","bbox":[-123.30519600,48.46261100,-123.30519600,48.46261100],"coordinates":[-123.305196,48.462611]}' - chicago_json = '{"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"bbox":[-87.65018,41.85039,-87.65018,41.85039],"coordinates":[-87.65018,41.85039]}' - if postgis and connection.ops.spatial_version < (1, 4, 0): - pueblo_json = '{"type":"Point","coordinates":[-104.60925200,38.25500100]}' - houston_json = '{"type":"Point","crs":{"type":"EPSG","properties":{"EPSG":4326}},"coordinates":[-95.36315100,29.76337400]}' - victoria_json = '{"type":"Point","bbox":[-123.30519600,48.46261100,-123.30519600,48.46261100],"coordinates":[-123.30519600,48.46261100]}' - elif spatialite: - victoria_json = '{"type":"Point","bbox":[-123.305196,48.462611,-123.305196,48.462611],"coordinates":[-123.305196,48.462611]}' - - # Precision argument should only be an integer - self.assertRaises(TypeError, City.objects.geojson, precision='foo') - - # Reference queries and values. - # SELECT ST_AsGeoJson("geoapp_city"."point", 8, 0) FROM "geoapp_city" WHERE "geoapp_city"."name" = 'Pueblo'; - self.assertEqual(pueblo_json, City.objects.geojson().get(name='Pueblo').geojson) - - # 1.3.x: SELECT ST_AsGeoJson("geoapp_city"."point", 8, 1) FROM "geoapp_city" WHERE "geoapp_city"."name" = 'Houston'; - # 1.4.x: SELECT ST_AsGeoJson("geoapp_city"."point", 8, 2) FROM "geoapp_city" WHERE "geoapp_city"."name" = 'Houston'; - # This time we want to include the CRS by using the `crs` keyword. - self.assertEqual(houston_json, City.objects.geojson(crs=True, model_att='json').get(name='Houston').json) - - # 1.3.x: SELECT ST_AsGeoJson("geoapp_city"."point", 8, 2) FROM "geoapp_city" WHERE "geoapp_city"."name" = 'Victoria'; - # 1.4.x: SELECT ST_AsGeoJson("geoapp_city"."point", 8, 1) FROM "geoapp_city" WHERE "geoapp_city"."name" = 'Houston'; - # This time we include the bounding box by using the `bbox` keyword. - self.assertEqual(victoria_json, City.objects.geojson(bbox=True).get(name='Victoria').geojson) - - # 1.(3|4).x: SELECT ST_AsGeoJson("geoapp_city"."point", 5, 3) FROM "geoapp_city" WHERE "geoapp_city"."name" = 'Chicago'; - # Finally, we set every available keyword. - self.assertEqual(chicago_json, City.objects.geojson(bbox=True, crs=True, precision=5).get(name='Chicago').geojson) - - def test_gml(self): - "Testing GML output from the database using GeoQuerySet.gml()." - if mysql or (spatialite and not connection.ops.gml) : - self.assertRaises(NotImplementedError, Country.objects.all().gml, field_name='mpoly') - return - - # Should throw a TypeError when tyring to obtain GML from a - # non-geometry field. - qs = City.objects.all() - self.assertRaises(TypeError, qs.gml, field_name='name') - ptown1 = City.objects.gml(field_name='point', precision=9).get(name='Pueblo') - ptown2 = City.objects.gml(precision=9).get(name='Pueblo') - - if oracle: - # No precision parameter for Oracle :-/ - gml_regex = re.compile(r'^-104.60925\d+,38.25500\d+ ') - elif spatialite and connection.ops.spatial_version < (3, 0, 0): - # Spatialite before 3.0 has extra colon in SrsName - gml_regex = re.compile(r'^-104.609251\d+,38.255001') - else: - gml_regex = re.compile(r'^-104\.60925\d+,38\.255001') - - for ptown in [ptown1, ptown2]: - self.assertTrue(gml_regex.match(ptown.gml)) - - # PostGIS < 1.5 doesn't include dimension im GMLv3 output. - if postgis and connection.ops.spatial_version >= (1, 5, 0): - self.assertIn('', - City.objects.gml(version=3).get(name='Pueblo').gml) - - def test_kml(self): - "Testing KML output from the database using GeoQuerySet.kml()." - # Only PostGIS and Spatialite (>=2.4.0-RC4) support KML serialization - if not (postgis or (spatialite and connection.ops.kml)): - self.assertRaises(NotImplementedError, State.objects.all().kml, field_name='poly') - return - - # Should throw a TypeError when trying to obtain KML from a - # non-geometry field. - qs = City.objects.all() - self.assertRaises(TypeError, qs.kml, 'name') - - # The reference KML depends on the version of PostGIS used - # (the output stopped including altitude in 1.3.3). - if connection.ops.spatial_version >= (1, 3, 3): - ref_kml = '-104.609252,38.255001' - else: - ref_kml = '-104.609252,38.255001,0' - - # Ensuring the KML is as expected. - ptown1 = City.objects.kml(field_name='point', precision=9).get(name='Pueblo') - ptown2 = City.objects.kml(precision=9).get(name='Pueblo') - for ptown in [ptown1, ptown2]: - self.assertEqual(ref_kml, ptown.kml) - - # Only PostGIS has support for the MakeLine aggregate. - @no_mysql - @no_oracle - @no_spatialite - def test_make_line(self): - "Testing the `make_line` GeoQuerySet method." - # Ensuring that a `TypeError` is raised on models without PointFields. - self.assertRaises(TypeError, State.objects.make_line) - self.assertRaises(TypeError, Country.objects.make_line) - # Reference query: - # SELECT AsText(ST_MakeLine(geoapp_city.point)) FROM geoapp_city; - ref_line = GEOSGeometry('LINESTRING(-95.363151 29.763374,-96.801611 32.782057,-97.521157 34.464642,174.783117 -41.315268,-104.609252 38.255001,-95.23506 38.971823,-87.650175 41.850385,-123.305196 48.462611)', srid=4326) - self.assertEqual(ref_line, City.objects.make_line()) - - @no_mysql - def test_num_geom(self): - "Testing the `num_geom` GeoQuerySet method." - # Both 'countries' only have two geometries. - for c in Country.objects.num_geom(): - self.assertEqual(2, c.num_geom) - - for c in City.objects.filter(point__isnull=False).num_geom(): - # Oracle and PostGIS 2.0+ will return 1 for the number of - # geometries on non-collections, whereas PostGIS < 2.0.0 - # will return None. - if postgis and connection.ops.spatial_version < (2, 0, 0): - self.assertIsNone(c.num_geom) - else: - self.assertEqual(1, c.num_geom) - - @no_mysql - @no_spatialite # SpatiaLite can only count vertices in LineStrings - def test_num_points(self): - "Testing the `num_points` GeoQuerySet method." - for c in Country.objects.num_points(): - self.assertEqual(c.mpoly.num_points, c.num_points) - - if not oracle: - # Oracle cannot count vertices in Point geometries. - for c in City.objects.num_points(): self.assertEqual(1, c.num_points) - - @no_mysql - def test_point_on_surface(self): - "Testing the `point_on_surface` GeoQuerySet method." - # Reference values. - if oracle: - # SELECT SDO_UTIL.TO_WKTGEOMETRY(SDO_GEOM.SDO_POINTONSURFACE(GEOAPP_COUNTRY.MPOLY, 0.05)) FROM GEOAPP_COUNTRY; - ref = {'New Zealand' : fromstr('POINT (174.616364 -36.100861)', srid=4326), - 'Texas' : fromstr('POINT (-103.002434 36.500397)', srid=4326), - } - - elif postgis or spatialite: - # Using GEOSGeometry to compute the reference point on surface values - # -- since PostGIS also uses GEOS these should be the same. - ref = {'New Zealand' : Country.objects.get(name='New Zealand').mpoly.point_on_surface, - 'Texas' : Country.objects.get(name='Texas').mpoly.point_on_surface - } - - for c in Country.objects.point_on_surface(): - if spatialite: - # XXX This seems to be a WKT-translation-related precision issue? - tol = 0.00001 - else: - tol = 0.000000001 - self.assertEqual(True, ref[c.name].equals_exact(c.point_on_surface, tol)) - - @no_mysql - @no_spatialite - def test_reverse_geom(self): - "Testing GeoQuerySet.reverse_geom()." - coords = [ (-95.363151, 29.763374), (-95.448601, 29.713803) ] - Track.objects.create(name='Foo', line=LineString(coords)) - t = Track.objects.reverse_geom().get(name='Foo') - coords.reverse() - self.assertEqual(tuple(coords), t.reverse_geom.coords) - if oracle: - self.assertRaises(TypeError, State.objects.reverse_geom) - - @no_mysql - @no_oracle - def test_scale(self): - "Testing the `scale` GeoQuerySet method." - xfac, yfac = 2, 3 - tol = 5 # XXX The low precision tolerance is for SpatiaLite - qs = Country.objects.scale(xfac, yfac, model_att='scaled') - for c in qs: - for p1, p2 in zip(c.mpoly, c.scaled): - for r1, r2 in zip(p1, p2): - for c1, c2 in zip(r1.coords, r2.coords): - self.assertAlmostEqual(c1[0] * xfac, c2[0], tol) - self.assertAlmostEqual(c1[1] * yfac, c2[1], tol) - - @no_mysql - @no_oracle - @no_spatialite - def test_snap_to_grid(self): - "Testing GeoQuerySet.snap_to_grid()." - # Let's try and break snap_to_grid() with bad combinations of arguments. - for bad_args in ((), range(3), range(5)): - self.assertRaises(ValueError, Country.objects.snap_to_grid, *bad_args) - for bad_args in (('1.0',), (1.0, None), tuple(map(six.text_type, range(4)))): - self.assertRaises(TypeError, Country.objects.snap_to_grid, *bad_args) - - # Boundary for San Marino, courtesy of Bjorn Sandvik of thematicmapping.org - # from the world borders dataset he provides. - wkt = ('MULTIPOLYGON(((12.41580 43.95795,12.45055 43.97972,12.45389 43.98167,' - '12.46250 43.98472,12.47167 43.98694,12.49278 43.98917,' - '12.50555 43.98861,12.51000 43.98694,12.51028 43.98277,' - '12.51167 43.94333,12.51056 43.93916,12.49639 43.92333,' - '12.49500 43.91472,12.48778 43.90583,12.47444 43.89722,' - '12.46472 43.89555,12.45917 43.89611,12.41639 43.90472,' - '12.41222 43.90610,12.40782 43.91366,12.40389 43.92667,' - '12.40500 43.94833,12.40889 43.95499,12.41580 43.95795)))') - sm = Country.objects.create(name='San Marino', mpoly=fromstr(wkt)) - - # Because floating-point arithmetic isn't exact, we set a tolerance - # to pass into GEOS `equals_exact`. - tol = 0.000000001 - - # SELECT AsText(ST_SnapToGrid("geoapp_country"."mpoly", 0.1)) FROM "geoapp_country" WHERE "geoapp_country"."name" = 'San Marino'; - ref = fromstr('MULTIPOLYGON(((12.4 44,12.5 44,12.5 43.9,12.4 43.9,12.4 44)))') - self.assertTrue(ref.equals_exact(Country.objects.snap_to_grid(0.1).get(name='San Marino').snap_to_grid, tol)) - - # SELECT AsText(ST_SnapToGrid("geoapp_country"."mpoly", 0.05, 0.23)) FROM "geoapp_country" WHERE "geoapp_country"."name" = 'San Marino'; - ref = fromstr('MULTIPOLYGON(((12.4 43.93,12.45 43.93,12.5 43.93,12.45 43.93,12.4 43.93)))') - self.assertTrue(ref.equals_exact(Country.objects.snap_to_grid(0.05, 0.23).get(name='San Marino').snap_to_grid, tol)) - - # SELECT AsText(ST_SnapToGrid("geoapp_country"."mpoly", 0.5, 0.17, 0.05, 0.23)) FROM "geoapp_country" WHERE "geoapp_country"."name" = 'San Marino'; - ref = fromstr('MULTIPOLYGON(((12.4 43.87,12.45 43.87,12.45 44.1,12.5 44.1,12.5 43.87,12.45 43.87,12.4 43.87)))') - self.assertTrue(ref.equals_exact(Country.objects.snap_to_grid(0.05, 0.23, 0.5, 0.17).get(name='San Marino').snap_to_grid, tol)) - - def test_svg(self): - "Testing SVG output using GeoQuerySet.svg()." - if mysql or oracle: - self.assertRaises(NotImplementedError, City.objects.svg) - return - - self.assertRaises(TypeError, City.objects.svg, precision='foo') - # SELECT AsSVG(geoapp_city.point, 0, 8) FROM geoapp_city WHERE name = 'Pueblo'; - svg1 = 'cx="-104.609252" cy="-38.255001"' - # Even though relative, only one point so it's practically the same except for - # the 'c' letter prefix on the x,y values. - svg2 = svg1.replace('c', '') - self.assertEqual(svg1, City.objects.svg().get(name='Pueblo').svg) - self.assertEqual(svg2, City.objects.svg(relative=5).get(name='Pueblo').svg) - - @no_mysql - def test_transform(self): - "Testing the transform() GeoQuerySet method." - # Pre-transformed points for Houston and Pueblo. - htown = fromstr('POINT(1947516.83115183 6322297.06040572)', srid=3084) - ptown = fromstr('POINT(992363.390841912 481455.395105533)', srid=2774) - prec = 3 # Precision is low due to version variations in PROJ and GDAL. - - # Asserting the result of the transform operation with the values in - # the pre-transformed points. Oracle does not have the 3084 SRID. - if not oracle: - h = City.objects.transform(htown.srid).get(name='Houston') - self.assertEqual(3084, h.point.srid) - self.assertAlmostEqual(htown.x, h.point.x, prec) - self.assertAlmostEqual(htown.y, h.point.y, prec) - - p1 = City.objects.transform(ptown.srid, field_name='point').get(name='Pueblo') - p2 = City.objects.transform(srid=ptown.srid).get(name='Pueblo') - for p in [p1, p2]: - self.assertEqual(2774, p.point.srid) - self.assertAlmostEqual(ptown.x, p.point.x, prec) - self.assertAlmostEqual(ptown.y, p.point.y, prec) - - @no_mysql - @no_oracle - def test_translate(self): - "Testing the `translate` GeoQuerySet method." - xfac, yfac = 5, -23 - qs = Country.objects.translate(xfac, yfac, model_att='translated') - for c in qs: - for p1, p2 in zip(c.mpoly, c.translated): - for r1, r2 in zip(p1, p2): - for c1, c2 in zip(r1.coords, r2.coords): - # XXX The low precision is for SpatiaLite - self.assertAlmostEqual(c1[0] + xfac, c2[0], 5) - self.assertAlmostEqual(c1[1] + yfac, c2[1], 5) - - @no_mysql - def test_unionagg(self): - "Testing the `unionagg` (aggregate union) GeoQuerySet method." - tx = Country.objects.get(name='Texas').mpoly - # Houston, Dallas -- Oracle has different order. - union1 = fromstr('MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)') - union2 = fromstr('MULTIPOINT(-96.801611 32.782057,-95.363151 29.763374)') - qs = City.objects.filter(point__within=tx) - self.assertRaises(TypeError, qs.unionagg, 'name') - # Using `field_name` keyword argument in one query and specifying an - # order in the other (which should not be used because this is - # an aggregate method on a spatial column) - u1 = qs.unionagg(field_name='point') - u2 = qs.order_by('name').unionagg() - tol = 0.00001 - if oracle: - union = union2 - else: - union = union1 - self.assertEqual(True, union.equals_exact(u1, tol)) - self.assertEqual(True, union.equals_exact(u2, tol)) - qs = City.objects.filter(name='NotACity') - self.assertEqual(None, qs.unionagg(field_name='point')) - - def test_non_concrete_field(self): - pkfield = City._meta.get_field_by_name('id')[0] - orig_pkfield_col = pkfield.column - pkfield.column = None - try: - list(City.objects.all()) - finally: - pkfield.column = orig_pkfield_col diff --git a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/urls.py b/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/urls.py deleted file mode 100644 index 55a5fa3..0000000 --- a/lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/urls.py +++ /dev/null @@ -1,18 +0,0 @@ -from __future__ import absolute_import - -from django.conf.urls import patterns - -from .feeds import feed_dict -from .sitemaps import sitemaps - - -urlpatterns = patterns('', - (r'^feeds/(?P.*)/$', 'django.contrib.gis.views.feed', {'feed_dict': feed_dict}), -) - -urlpatterns += patterns('django.contrib.gis.sitemaps.views', - (r'^sitemap.xml$', 'index', {'sitemaps' : sitemaps}), - (r'^sitemaps/(?P
\w+)\.xml$', 'sitemap', {'sitemaps' : sitemaps}), - (r'^sitemaps/kml/(?P