[Django] #26455: Add lookups and database functions to check for valid geometries and repairing them.

2 views
Skip to first unread message

Django

unread,
Apr 4, 2016, 7:27:23 AM4/4/16
to django-...@googlegroups.com
#26455: Add lookups and database functions to check for valid geometries and
repairing them.
-------------------------+-------------------------------------------------
Reporter: | Owner: yellowcap
yellowcap |
Type: New | Status: new
feature |
Component: GIS | Version: 1.9
Severity: Normal | Keywords: isvalid, makevalid, valid, geometry
Triage Stage: | Has patch: 1
Unreviewed |
Easy pickings: 0 | UI/UX: 0
-------------------------+-------------------------------------------------
There are many data sources that come with geometries that are not valid,
and clipping or intersecting functions may lead to invalid geometries
sometimes. At the same time, geographic operations often require valid
input.

The python geometries in GeoDjango have a ``valid`` property, but the same
property is not available during database queries.

To avoid errors during geoprocessing on large datasets the database side,
it can be essential to be able to filter valid geometries and possibly
repair them as well.

--
Ticket URL: <https://code.djangoproject.com/ticket/26455>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 4, 2016, 7:41:05 AM4/4/16
to django-...@googlegroups.com
#26455: Add lookups and database functions to check for valid geometries and
repairing them.
-------------------------------------+-------------------------------------
Reporter: yellowcap | Owner: yellowcap
Type: New feature | Status: new
Component: GIS | Version: 1.9
Severity: Normal | Resolution:
Keywords: isvalid, makevalid, | Triage Stage:
valid, geometry | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by yellowcap):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Here is the pr: https://github.com/django/django/pull/6412

I tried to find equivalent functions in the other spatial backends, the
only function I found was `SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT`. The
result of this function is an error code for invalid geometries.
Unfortunately I am not familiar with oracle so I dont know how to use this
properly.

https://docs.oracle.com/cd/B28359_01/appdev.111/b28400/sdo_objgeom.htm#BGHFDDBF

--
Ticket URL: <https://code.djangoproject.com/ticket/26455#comment:1>

Django

unread,
Apr 4, 2016, 10:13:40 AM4/4/16
to django-...@googlegroups.com
#26455: Add lookups and database functions to check for valid geometries and
repairing them.
-------------------------------------+-------------------------------------
Reporter: yellowcap | Owner: yellowcap
Type: New feature | Status: new
Component: GIS | Version: 1.9
Severity: Normal | Resolution:
Keywords: isvalid, makevalid, | Triage Stage: Accepted
valid, geometry |

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26455#comment:2>

Django

unread,
Apr 5, 2016, 1:22:46 PM4/5/16
to django-...@googlegroups.com
#26455: Add lookups and database functions to check for valid geometries and
repairing them.
-------------------------------------+-------------------------------------
Reporter: yellowcap | Owner: yellowcap
Type: New feature | Status: new
Component: GIS | Version: 1.9
Severity: Normal | Resolution:
Keywords: isvalid, makevalid, | Triage Stage: Ready for
valid, geometry | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/26455#comment:3>

Django

unread,
Apr 9, 2016, 9:24:38 AM4/9/16
to django-...@googlegroups.com
#26455: Add lookups and database functions to check for valid geometries and
repairing them.
-------------------------------------+-------------------------------------
Reporter: yellowcap | Owner: yellowcap
Type: New feature | Status: closed
Component: GIS | Version: 1.9
Severity: Normal | Resolution: fixed

Keywords: isvalid, makevalid, | Triage Stage: Ready for
valid, geometry | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"c12a00e554c8b4b93931b520bb94a479c5ba8706" c12a00e]:
{{{
#!CommitTicketReference repository=""
revision="c12a00e554c8b4b93931b520bb94a479c5ba8706"
Fixed #26455 -- Allowed filtering and repairing invalid geometries.

Added the IsValid and MakeValid database functions, and the isvalid
lookup,
all for PostGIS.

Thanks Tim Graham for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26455#comment:4>

Django

unread,
Apr 21, 2016, 9:13:47 AM4/21/16
to django-...@googlegroups.com
#26455: Add lookups and database functions to check for valid geometries and
repairing them.
-------------------------------------+-------------------------------------
Reporter: yellowcap | Owner: yellowcap
Type: New feature | Status: closed
Component: GIS | Version: 1.9

Severity: Normal | Resolution: fixed
Keywords: isvalid, makevalid, | Triage Stage: Ready for
valid, geometry | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"65006e0b0b5deb2e45c35975b103f0bb041c1e5c" 65006e0b]:
{{{
#!CommitTicketReference repository=""
revision="65006e0b0b5deb2e45c35975b103f0bb041c1e5c"
Refs #26455 -- Documented isvalid/makevalid in compatibility table.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26455#comment:5>

Reply all
Reply to author
Forward
0 new messages