QGIS – Creating Point on Surface in QGIS

centroidsogr2ogrpoint-creationqgisvector

As far as I can tell, the option to "Create point on surface for each part" in the QGIS Centroid tool is not returning the correct geometry when activated in QGIS (version 3.8.1-Zanzibar/GDAL v 2.2.3 on Debian).

If we take a simple "banana-shaped" polygon:

enter image description here

and run the tool (Vector > Geometry Tools > Centroids) as follows:

enter image description here

we get the following output, which represents the centroid, but not the point on surface.

enter image description here

We can cross check this output using ogr2ogr as follows:

ogr2ogr -dialect SQLite -sql "SELECT ST_Centroid(geometry) FROM tmp" tmp_centroid.shp tmp.shp

which returns the identical centroid:

enter image description here

whereas the following command forces the point on the surface of the polygon:

ogr2ogr -dialect SQLite -sql "SELECT ST_PointOnSurface(geometry) FROM tmp" tmp_ptonsurf.shp tmp.shp

enter image description here

is this a bug or is there something else that should be run/enabled in order to get the point on surface using the QGIS tool?

Best Answer

In QGIS 3.10 this option is not available using Vector > Geometry Tools > Centroids.

enter image description here

However if you search for "Point on surface" in the Processing Toolbox (Ctrl+Shift+T) using QGIS 3.10 the functionality is there and works.

enter image description here

enter image description here