Commit Graph

81 Commits

Author SHA1 Message Date
Justin Bronn 85fa7d8894 Fixed #13070 -- Introduced fallback code to detect SpatiaLite 2.3.0 versions (which do not have `spatialite_version` function).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12882 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-29 19:40:59 +00:00
Justin Bronn dc1ad69f30 Fixed #11353 -- `GeometryProxy` descriptor no longer chokes when accessed from a class rather than an instance, thanks yml and Tobu; removed unnecessary imports from `types` and cleaned up whitespace.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12584 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-24 21:20:02 +00:00
Justin Bronn 901b60e7e1 Now look for `DatabaseError` during PostGIS backend initialization, as it is now raised instead of a `ProgrammingError` after changes in r12352.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12354 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-29 17:58:55 +00:00
Justin Bronn 72c39410c8 Renamed `reverse` to `reverse_geom` because of clash with existing `QuerySet` method; added `GeoQuerySet.geohash` support for producing GeoHash reprsentations.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12350 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-29 02:46:07 +00:00
Justin Bronn 5b21033847 Added `reverse` and `force_rhr` methods to `GeoQuerySet`. Refs #12416.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12349 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-29 02:20:58 +00:00
Justin Bronn ff6b44980a `GeoQuerySet.distance` now allows calculations to/from non-point geodetic geometry fields as allowed on PostGIS 1.5.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12312 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-27 23:09:46 +00:00
Justin Bronn 9a8449afe1 Fixed #12605 -- Removed redundant import of `ImproperlyConfigured`. Thanks, tmcw.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12310 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-27 18:55:36 +00:00
Justin Bronn 14acace029 Fixed #12706 -- Forgot to pass `using` kwarg in parent class initialization of `GeoQuerySet`. Thanks, albsen.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12309 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-27 16:24:48 +00:00
Justin Bronn 474ce51ffd Fixed #12690 -- Fixed SQL template used for Oracle's with `SDO_RELATE` function, added `truncate_params` attribute to spatial backend, and re-enabled the `relate` lookup tests. Thanks, jtiai, for the bug report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-26 17:32:11 +00:00
Justin Bronn 5ec44450df Modified `GeoManager.get_query_set` to reflect changes made for database routing in r12272.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12275 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-22 18:30:23 +00:00
Russell Keith-Magee 1b3dc8ad9a Fixed #12540, #12541 -- Added database routers, allowing for configurable database use behavior in a multi-db setup, and improved error checking for cross-database joins.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12272 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-22 14:30:06 +00:00
Justin Bronn 6b659270d6 Fixed problems associated with the `GeometryField` SRID cache: it is now keyed by the connection alias rather than the spatial backend name (e.g., `spatial_ref_sys` tables may have different entries, even if backend is the same), explicitly pass in connection alias to `SpatialRefSys` query to ensure correct entry is retrieved, and removed unused code from `GeometryField.get_distance`. Thanks, Josh Livni, for the bug report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12258 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-18 21:49:13 +00:00
Justin Bronn a1fbc0dc36 Fixed #12637 -- GeoDjango's `inspectdb` command is now a subclass of Django's, and works with all spatial backends (Oracle and SpatiaLite did work before). This changeset introduces new introspection modules for all of the spatial backends and adds hooks to the original `inspectdb.Command` class to enable reuse.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12257 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-18 21:02:47 +00:00
Adrian Holovaty 5ceed0a053 Changed a whole bunch of places to raise exception instances instead of old-style raising exception classes plus a comma. Good for the future Python 3 conversion
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10 18:36:20 +00:00
Justin Bronn 89ded975fe Fixed #12479 -- Pass in connection argument to `as_sql` in `GeoSQLCompiler.get_columns`. Thanks, jpwatts, for bug report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12083 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-04 02:37:46 +00:00
Justin Bronn f2d0ae93f8 Fixed problem in which SpatiaLite library would not be loaded for the connection under certain circumstances, e.g., when using the geographic admin. Thanks, jtiai, for the bug report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12037 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 10:36:22 +00:00
Justin Bronn c35868ab9b Fixed #12468 -- Use the `DatabaseOperations` class from the `postgresql_psycopg2` backend as the base class for `PostGISOperations`. Thanks, drdaeman, for bug report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12033 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-31 08:03:50 +00:00
Justin Bronn ca64e9d85f Fixed #12458 -- no longer use try/except/finally syntax in PostGIS and SpatiaLite backends as it's incompatible with Python 2.4. Thanks, knutin, for bug report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12026 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-29 11:18:35 +00:00
Justin Bronn a488589461 Fixed #12344 -- Using `select_related()` on geographic fields with the Oracle spatial backend now works.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12022 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-29 10:18:56 +00:00
Justin Bronn 4ab21fbf40 Fixed `GeoManager.get_query_set` incompatibility with `db_manager` method.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12021 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-29 09:57:37 +00:00
Justin Bronn 9b8e90f937 Yes, Virginia, `ST_MakeLine` really exists in PostGIS 1.3 and above.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-24 15:07:53 +00:00
Justin Bronn e1f6b4b82f Added tests for PostGIS geography support; added `proj_version_tuple` to PostGIS spatial backend operations; made `distapp` tests take into account different datums in PROJ.4 4.7; and added svn:ignore properties for recently-added directories.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-23 20:45:08 +00:00
Russell Keith-Magee ff60c5f9de Fixed #1142 -- Added multiple database support.
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project.
Congratulations to Alex for a job well done.

Big thanks also go to:
 * Justin Bronn for keeping GIS in line with the changes,
 * Karen Tracey and Jani Tiainen for their help testing Oracle support
 * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback.
 * Malcolm Treddinick for his guidance during the GSoC submission process.
 * Simon Willison for driving the original design process
 * Cal Henderson for complaining about ponies he wanted.

... and everyone else too numerous to mention that helped to bring this feature into fruition.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22 15:18:51 +00:00
Karen Tracey 833df0afaa Fixed #12385: Made built-in field type descriptions in admindocs translatable again. Many thanks to Ramiro for the problem report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11878 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-16 18:13:34 +00:00
Karen Tracey 0986a4d2e1 Fixed #7977: Fixed admindocs to use docstrings instead of a static array to locate type information.
Thanks J. Clifford Dyer.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11833 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-12 20:25:41 +00:00
Russell Keith-Magee ce7c61d61e Refs #11109 -- Touched some whitespace so Trac will display some files correctly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11785 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-02 00:30:00 +00:00
Justin Bronn 32d0730b89 Fixed #11433 -- 3D geometry fields are now supported with PostGIS; EWKB is now used by `PostGISAdaptor`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11742 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-16 18:49:00 +00:00
Justin Bronn 562d5d8a28 Fixed #12111 -- now use PostgreSQL escape string syntax when quoting WKB to prevent spurious warnings in database logs. Thanks, Matt Russell for ticket and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-08 00:51:42 +00:00
Justin Bronn 62180a6b44 Fixed #11827: Can now calculate extent in Oracle on tables with one point.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-13 17:40:46 +00:00
Justin Bronn 1707304bad Fixed test cases and `GeoQuerySet.geojson` to support PostGIS 1.4.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-27 04:21:31 +00:00
Justin Bronn 53b8809277 Fixed #11489 -- `GeoQuery.resolve_columns` now recognizes annotations; disabled problematic test cases on Oracle and added notes on why.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11251 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-16 22:38:22 +00:00
Justin Bronn 9c5075d125 Forgot to add `collect` to `GeoManager`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-15 02:20:51 +00:00
Justin Bronn 33ea28c2b2 Forgot to add the `collect` GeoQuerySet method to correspond to the `Collect` aggregate object; also added tests for this operation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-11 20:34:27 +00:00
Justin Bronn fdcc0c774a Fixed #11381 -- `GeoManager` + `select_related` + nullable `ForeignKey` now works correctly. Thanks, bretthoerner for ticket and dgouldin for initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11123 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-29 16:31:21 +00:00
Justin Bronn be907bcdcb Fixed #11087 -- Fixed the `Count` annotation when used with `GeoManager`. Thanks to dgouldin for ticket and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10912 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 04:49:16 +00:00
Karen Tracey 50745cc31e Fixed #11066 -- Corrected 15 duplicate "the"s found in docs and code comments. Thanks kaikuehne.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10801 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-17 16:45:28 +00:00
Justin Bronn 44c062344f Fixed #10888 -- May now insert NULL `GeometryField` values on Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10631 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-24 20:24:50 +00:00
Justin Bronn 037ce4318b Fixed #10839 -- `GeoQuery` now unpickles properly on Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10615 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-21 22:35:04 +00:00
Justin Bronn bfe36750b1 Fixed #10364 -- Correctly identify test spatial database creation errors to the user.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10603 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-19 23:31:14 +00:00
Justin Bronn ff9b9e530c Fixed #9620 -- `GeometryColumns` and `SpatialRefSys` models now play nice with the `AppCache` routines.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10579 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16 22:25:01 +00:00
Justin Bronn 4eaf4155f8 Fixed #10836 -- Forgot to move import to to `where` module. Thanks, seanl for ticket & patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10572 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16 14:16:16 +00:00
Justin Bronn bd8afb1894 Fixed #10807 - `GeoWhereNode` no longer passes `Constraint` objects to where they shouldn't go.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10559 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-14 19:14:32 +00:00
Adrian Holovaty ffd7b177c9 Added experimental support for a POSTGIS_VERSION setting for GeoDjango. If set, it will tell GeoDjango not to do the postgis_lib_version() query every time the server starts up (assuming a PostGIS backend). This is intentionally undocumented because Justin mentioned he might be refactoring the backends for Django 1.2 such that this setting would be unnecessary. Until then, people can use this hook.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10549 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-12 07:19:56 +00:00
Justin Bronn d7870d3444 Upgraded SpatiaLite default initialization SQL file name for 2.3 release.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10527 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-11 22:31:28 +00:00
Justin Bronn ae7cb577dd Refactored `get_srid_info` to use the ORM (now possible since it's no longer used in `GeometryField.__init__`), and moved to `fields` module; removed unnecessary code.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-10 18:08:37 +00:00
Adrian Holovaty fd443959df Added an SRID_CACHE to GeoDjango db/models/fields/__init__.py so that we only hit the spatial_ref_sys table once per SRID per process
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10488 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-10 17:04:35 +00:00
Adrian Holovaty bb75efc050 Fixed typo in GeoDjango deprecation error message
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10487 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-10 16:58:47 +00:00
Adrian Holovaty 800b6cfbbe Changed GeoDjango GeometryField to lazily load units, units_name and _spheroid
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-10 16:58:29 +00:00
Justin Bronn 1dc72fe876 Now take advantage of new argument accepted by `AddGeometryColumn` in SpatiaLite 2.3 that allows geometry columns to specified as `NOT NULL`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10443 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-08 00:09:06 +00:00
Justin Bronn a6356cad4d Fixed #10757 -- Fixed improper selection of primary keys across relations when using `GeoManager.values`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10434 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-07 21:18:41 +00:00