7

For features use this expression: string_to_array(geom_to_wkt($geometry),' ')[0] And then you can get one of WKT geometry type: 'Point', 'LineString', 'Polygon', 'MultiPoint', 'MultiLineString', 'MultiPolygon', 'GeometryCollection' etc.


6

Another solution for features using a custom function via the Function Editor from qgis.utils import iface from qgis.core import * from qgis.gui import * @qgsfunction(args='auto', group='Custom') def geomfunction(feature, parent): layer = iface.activeLayer() layer_wkb = layer.wkbType() layer_wkb_type = QgsWkbTypes.displayString(layer_wkb) ...


5

For a layer this is probably the most suitable expression: layer_property(@layer,'geometry_type') Check QGIS Documentation for more details. Please keep in mind, that this expression will return strictly the geometry type of a layer, e.g. it is 'Polygon' even though this layer contain 'MultiPolygon' features in it. Result of using the layer_property() And ...


4

This is referred to as (spatial) (K)NN search; the most performant approach is a LATERAL sub-query in conjunction with the index driven <-> operator: SELECT a.id, b.id, -- a.geom / b.geom FROM <points1> AS pt1 CROSS JOIN LATERAL ( SELECT id FROM <points2> ORDER BY geom <-> a.geom LIMIT 1 ) AS b ; I ...


4

Look for a definition Not in every case it is clear to which next line the end of one line should be connected. So the first step is to find a defnition what means "vertical line" in your case and based on what criteria to select the lines than should be connected. As of now, you do it manually, thus you have an implicit understanding. Make it ...


3

PostGIS indexes and functions are all coded to handle arbitrary geometry types. So there is no performance gain by using a more specific geometry typmod parameter.


2

This solution uses QGIS expressions to implement what I proposed as an algorithmic approach in the other answer. Proceed as follows: Befor starting, make sure all your lines have the same direction (N to S). From your lines, extract separately start- end end-points using Geometry by expression with this expression: start_point ($geometry) and end_point($...


2

You can easily dump Openlayers Layer to GeoJSON saving not only geometry but all the attributes as well. GeoJSON can be store anywhere, as a file or in a database. import GeoJSON from 'ol/format/GeoJSON.js' const format = new GeoJSON({ featureProjection: 'EPSG:3857' }); const layers = map.getLayers(); // map is 'ol/Map' object const source = layers.item(0)....


1

You might want to consider using GeoPandas to create a GeoDataFrame that can be pushed into CARTO to populate the the_geom column from your Pandas DataFrame using the points_from_xy function (see https://geopandas.org/gallery/create_geopandas_from_pandas.html) import geopandas as gpd gdf = GeoDataFrame(df, geometry=geopandas.points_from_xy(df['longitude'], ...


1

I'm afraid you have to do it manually as OSM has an own feature for the Gulf of Finland, but it does not include the waters near Helsinki: those you want to get rid of. If you click with the query features tool on the OSM Website to these waters, no element for this water body is shown. So what you can do (I did it in QGIS using the QuickOSM Plugin). I ...


1

OBJECTID fields are a unique type of field that will not carry over well when changing up a feature class or creating a new feature class. It's why having a unique identifier for each row is highly encouraged for record keeping as OBJECTID should not be used for that. Without an alternative UID to use for joins, BERA's comment to have a new field and enter ...


1

The problems with the gaps within the triangulation with v.delaunay is solved with the solution as provided by @Babel. But along the borders there were points in this dataset that were left out of the triangulation and lines (brown) ended up not as expected (blue). The following steps helped me to get the output I want. remove duplicate geometries and add a ...


Only top voted, non community-wiki answers of a minimum length are eligible