Opened 5 years ago

Closed 5 years ago

Last modified 4 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: master
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

Change History (14)

comment:1 Changed 5 years ago by Sergey Fedoseev

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:2 Changed 5 years ago by Claude Paroz

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 Changed 5 years ago by Sergey Fedoseev

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 Changed 5 years ago by Sergey Fedoseev

Has patch: set

comment:5 Changed 5 years ago by Claude Paroz

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

comment:6 Changed 5 years ago by Tim Graham

Patch needs improvement: set

Left comments for improvement.

comment:7 Changed 5 years ago by Sergey Fedoseev

Patch needs improvement: unset

comment:8 Changed 5 years ago by Tim Graham <timograham@…>

In b7177cc:

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

comment:9 Changed 5 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

comment:10 Changed 5 years ago by Tim Graham <timograham@…>

In 7803f42:

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

comment:11 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 7a452c5:

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

comment:12 Changed 4 years ago by Tim Graham <timograham@…>

In a0149848:

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

comment:13 Changed 4 years ago by Tim Graham <timograham@…>

In 19d8e64a:

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

comment:14 Changed 4 years ago by Tim Graham <timograham@…>

In 997c9f70:

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

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