Opened 9 years ago

Last modified 8 years ago

#25665 closed Cleanup/optimization

deprecate public getters/setters for properties of `GEOSGeometry` and its subclasses — at Version 3

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 (3)

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.

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