Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#25665 closed Cleanup/optimization (fixed)

deprecate public getters/setters for properties of `GEOSGeometry` and its subclasses

Reported by: Sergey Fedoseev Owned by: Sergey Fedoseev
Component: GIS Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Sergey Fedoseev)


Change History (14)

comment:1 by Sergey Fedoseev, 9 years ago

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:2 by Claude Paroz, 9 years ago

Triage Stage: UnreviewedAccepted
Version: 1.8master

I would let num_points and crs, they make no harm.

I see get_srid, set_srid as an artifact from the time the property decorator didn't exist. So +1 to use the modern decorator syntax and deprecate the get/set methods.

comment:3 by Sergey Fedoseev, 9 years ago

Description: modified (diff)
Summary: alias members of `GEOSGeometry` (`num_points`, `crs`, `get_srid`, `set_srid`) should be deprecated or documenteddeprecate public getters/setters for properties of `GEOSGeometry` and its subclasses

I was motivated to deprecate num_points and crs because number of GEOSGeometry members looks disturbing for me.

In [2]: GEOSGeometry.
In [2]: from django.contrib.gis.geos import GEOSGeometry as Geometry

In [3]: Geometry.
Geometry.append            Geometry.geojson           Geometry.prepared
Geometry.area              Geometry.geom_type         Geometry.ptr
Geometry.boundary          Geometry.geom_typeid       Geometry.ptr_type
Geometry.buffer            Geometry.get_srid          Geometry.relate
Geometry.centroid          Geometry.has_cs            Geometry.relate_pattern
Geometry.clone             Geometry.hasz              Geometry.remove
Geometry.contains          Geometry.hex               Geometry.reverse
Geometry.convex_hull       Geometry.hexewkb           Geometry.ring
Geometry.coord_seq         Geometry.index             Geometry.set_srid
Geometry.count             Geometry.insert            Geometry.simple
Geometry.crosses           Geometry.intersection      Geometry.simplify
Geometry.crs               Geometry.intersects        Geometry.sort
Geometry.difference        Geometry.json              Geometry.srid
Geometry.dims              Geometry.kml               Geometry.srs
Geometry.disjoint          Geometry.length            Geometry.sym_difference
Geometry.distance          Geometry.mro               Geometry.touches
Geometry.empty             Geometry.normalize         Geometry.transform
Geometry.envelope          Geometry.num_coords        Geometry.union
Geometry.equals            Geometry.num_geom          Geometry.valid
Geometry.equals_exact      Geometry.num_points        Geometry.valid_reason
Geometry.ewkb              Geometry.ogr               Geometry.within
Geometry.ewkt              Geometry.overlaps          Geometry.wkb
Geometry.extend            Geometry.point_on_surface  Geometry.wkt
Geometry.extent            Geometry.pop 

I'll change ticket summary because there are also getters/setters for coordinates of Point and probably there are others.

comment:4 by Sergey Fedoseev, 9 years ago

Has patch: set

comment:5 by Claude Paroz, 9 years ago

Looks good, I'll let Tim make the language review.

comment:6 by Tim Graham, 9 years ago

Patch needs improvement: set

Left comments for improvement.

comment:7 by Sergey Fedoseev, 9 years ago

Patch needs improvement: unset

comment:8 by Tim Graham <timograham@…>, 9 years ago

In b7177cc:

Refs #25665 -- Deprecated getter/setter of GEOSGeometry.srid.

comment:9 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:10 by Tim Graham <timograham@…>, 9 years ago

In 7803f42:

Refs #25665 -- Deprecated getters/setters of Point coordinate properties.

comment:11 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 7a452c5:

Fixed #25665 -- Deprecated getter/setter of Point.tuple.

comment:12 by Tim Graham <timograham@…>, 8 years ago

In a0149848:

Refs #25665 -- Removed GEOSGeometry.get/set_srid() per deprecation timeline.

comment:13 by Tim Graham <timograham@…>, 8 years ago

In 19d8e64a:

Refs #25665 -- Removed deprecated getters/setters of Point coordinate properties.

comment:14 by Tim Graham <timograham@…>, 8 years ago

In 997c9f70:

Refs #25665 -- Removed deprecated getter/setter of Point.tuple.

Note: See TracTickets for help on using tickets.
Back to Top