New answers tagged

1

We found a way to do this in Excel: https://exceljet.net/formula/count-specific-words-in-a-cell


4

When you SELECT a column FROM a table, the column value(s) are made available to functions, either per row, or as aggregates. Function results can be passed consecutively into enclosing functions. In this case you would simply SELECT ST_AsText(ST_Segmentize(geom::GEOGRAPHY, 50)) AS geom FROM public.segments ; Note that I use a cast (::) to GEOGRAPHY; ...


5

From the answers in the comments: 1. In order to concatenate unique values with group by clause: group_concat(distinct Locality) Order by: 2. Data ordering (by the data sample link from comment): From your data, it looks like that the start/End chainage fields are connected with the direction & order so this looks the most promising sql (see image): ...


3

You get an entry for each voter because you are grouping on the voter column as well, which results in groups that are all single rows. And you cannot include voter_name in the query unless you either aggregate on the column or build groups that include the column, which means that you have to add one more query level to achieve your objective. Here are a ...


8

Let's assume there is a layer called "line" (blue), see image below. So, the vital thing, there must be a distinction between Centroid and Midpoint. There several articles available online, for instance, I personally would consider this one Mathematics: What is the difference between midpoint, center and centroid?. My personal distinction in terms of the ...


2

If you're asking about Esri geodatabases, arcpy.ListFeatureClasses does exactly this given an input workspace (e.g. geodatabase connection). The code (Python 3) from their example: import arcpy import os arcpy.env.workspace = "c:/base/gdb.gdb" datasets = arcpy.ListDatasets(feature_type='feature') datasets = [''] + datasets if datasets is not None else [] ...


1

You need to remove the double quotes in the file. Either don't create them in the text file in the first place (better) or otherwise delete them from the variable when reading it back in using replace(): expr = open('./Output.txt').readline().replace('"', '') Ie, your expr in/from the file should be: Project IN ('C1335', 'C1410', 'C1237') NOT: "Project ...


0

As Taras and Ian Turton suggested, function ST_Buffer() is the best solution for this problem, even though my version of the db server doesn't support it yet.


2

The correct query is Select uid, ST_ApproximateMedialAxis(geom) from public.bufferrail;


3

The -spat parameter in ogr2ogr https://gdal.org/programs/ogr2ogr.html#ogr2ogr affects all available layers. This selects data withing the given rectangle from all layers if you write only the name of the datasource into the command but not the layername. So just "...input.gpkg" instead of "...input.gpkg selected_layer". ogr2ogr -f gpkg -spat 100000 6000000 ...


Top 50 recent answers are included