Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ST_Force2D for PostGIS 2.1+ #777

Closed
wants to merge 1 commit into from
Closed

Use ST_Force2D for PostGIS 2.1+ #777

wants to merge 1 commit into from

Conversation

strk
Copy link
Contributor

@strk strk commented Jul 29, 2013

This is to avoid the WARNING about ST_Force_2D being deprecated when using PostGIS-2.1.0+.

@ghost ghost assigned jef-n Aug 7, 2013
@strk
Copy link
Contributor Author

strk commented Sep 5, 2013

note: PostGIS-2.1.0 was just released so this wouldn't be bad to also have in the 2.0 branch of qgis...

@strk
Copy link
Contributor Author

strk commented Sep 5, 2013

Well, pushed as 38d960e in master and as 7304dc1 in 2.0 branch...

@strk strk closed this Sep 5, 2013
@strk strk deleted the master-pgis-2.1.0 branch September 5, 2013 15:55
nyalldawson added a commit to nyalldawson/QGIS that referenced this pull request Aug 1, 2016
All pointer based methods have been removed.

Now we have only:

  void setGeometry( const QgsGeometry& geom )

and

  QgsGeometry geometry() const

Benefits include avoiding a whole lot of tricky pointer lifetime
issues, potential memory leaks, and finally closing qgis#777, which
has survived for over 9 years!...

Impacts on PyQGIS code:
- no more need for the messy
  g = QgsGeometry( feature.geometry() )
  workaround, just use g = feature.geometry() instead
- IMPORTANT: you can no longer test whether a feature has geometry
 using `if f.geometry():`, since QgsFeature::geometry() will
 *always* return an object. Instead, use
 `if not f.geometry().isEmpty():`, or preferably the new method
 `if not f.hasGeometry():`

Fix qgis#777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants