Skip to main content
46 votes
Accepted

Read a table from an ESRI file geodatabase (.gdb) using R

This can now be read by sf, with vessel <- sf::st_read(dsn = "Zone9_2014_01.gdb", layer = "Zone9_2014_01_Vessel") It returns a warning (no feature geometries present) but also a data.frame with ...
Edzer Pebesma's user avatar
15 votes

Sorting by multiple fields at same time in QGIS?

This can now be done without any plugins or database-specific work, at least for version 3.2+. To sort by multiple columns: Right click on the attribute table column header and choose "Sort..." Add ...
Eron Lloyd's user avatar
13 votes
Accepted

Adding excel table to QGIS print composer?

Save your excel file as CSV file go to Add Vector Layer in QGIS and navigate to your CSV file and load it In the print composer, go to Add attribute table, as you can see below: Select the Source ...
ahmadhanb's user avatar
  • 41k
10 votes
Accepted

Add cumulative sum column to attribute table

It can be done with an expression. Bear in mind this only works if the original table is already ordered with N descending as feature IDs increase. Since the result field is empty, we need to get past ...
Gabriel's user avatar
  • 3,145
10 votes
Accepted

Change date format into readable format in GEE

Earth Engine handles time for their assets in Unix Epoch Time (Miliseconds since 1970). This is the format you get from image.get("system:time_start"). For filtering and other functions thats also the ...
JonasV's user avatar
  • 3,784
9 votes
Accepted

Copy/Paste attribute table qgis without the wkt_geom column?

Yes. In Settings> Options> Data Sources: Copy features as: "Plain text, no geometry"
HeikkiVesanto's user avatar
8 votes

Working around Table does not contain OIDs arcpy Error 000339?

I am getting the same error as you, I have tested your workflow on 10.3.1. I get the error in both cases, when I have the source view is registered with geodatabase and when it's not. Running the ...
Alex Tereshenkov's user avatar
8 votes

Sorting by multiple fields at same time in QGIS?

You can use the Sort and Number plugin. It allows you to sort an attribute table by up to 3 fields, then it creates an additional field that contains the order of the sorted features. Disclaimer: I'm ...
ArMoraer's user avatar
  • 5,639
7 votes

Sorting by multiple fields at same time in QGIS?

The DB Manager plugin in QGIS now has a 'Virtual Layers' node that allows you to write SQL commands against shapefiles loaded into your QGIS project. So now that you have this ability, the SQL logic ...
DPSSpatial_BoycottingGISSE's user avatar
7 votes

Sorting by multiple fields at same time in QGIS?

If is OK to save the result permanently you can sort the shapefile with GDAL ogr2ogr -f "ESRI Shapefile" -dialect sqlite -sql "SELECT * FROM my_shapefile ORDER BY attr_1, attr_2, attr_3" sorted.shp ...
user30184's user avatar
  • 66.8k
7 votes
Accepted

Working around Table does not contain OIDs arcpy Error 000339?

The Copy Rows to in_memory as suggested by @alex-tereshenkov took the processing time for this part of the script down from 2mins+ to 38 seconds, however I have found an even quicker solution that ...
Midavalo's user avatar
  • 29.8k
7 votes
Accepted

Filling blanks (missing values) in table with value above using ArcGIS Field Calculator?

Assuming this structure: create new field and run this field calculator expression on it: def fillMe(text): global before if text=="-": return before else: before=text return before -------...
FelixIP's user avatar
  • 23.1k
7 votes
Accepted

How to select duplicate records based on multiple fields?

I was faced with a similar problem today, but I ended up using FME which was really quick and easy. What I was thinking was an update cursor which loops through the rows. Store the row in a list. ...
Fezter's user avatar
  • 21.9k
7 votes

Exporting Lists from Earth Engine

In no way the best solution to this as it will require some formatting of the csv after download. But it was the quickest I could do without having to spend way too much time re-writing all your code....
Sean Roulet's user avatar
  • 2,210
7 votes

Adding a table frame in ATLAS for QGIS

Add your attribute table to the layout and than check the box to include only the current atlas object: As an alternative, you could add a text field. You than can introduce fields from the attribute ...
Babel's user avatar
  • 72.2k
6 votes
Accepted

Merge Shapefiles and Add File Name to Attribute Table

Without coding, it could be time-consuming. Either way, the steps would be to add a field to each shapefile and populate each feature with the shapefile's name. Here's a sample script, to give you an ...
Tom's user avatar
  • 4,128
6 votes
Accepted

Remove tables - not just layers - from the map document

You should be able to use RemoveTableView just like you use RemoveLayer in your code: for tbl in arcpy.mapping.ListTableViews(mxd, "", df): arcpy.mapping.RemoveTableView(df, tbl) arcpy....
Dan Jurgella's user avatar
  • 2,378
6 votes
Accepted

Is *.xls MS Excel default format in ArcMap?

ArcMap can load lots of dataformats. The direct load of xls/xlsx is pretty nice as you have all the named sections beside the tables and don´t need to transform anything. There are some guidelines (...
Matte's user avatar
  • 6,245
6 votes
Accepted

Sorting by multiple fields at same time in QGIS?

There is actually a very simple trick. Suppose you want to sort by field "A" first, and then by field "B" within "A". First left click on the header of the field "B" (click once for ascending sort, a ...
Benoit St-Onge's user avatar
6 votes

Creating Direction data in QGIS between two layers?

Not that long ago, I did something similar using two point layers: one containing the source; the other containing destinations. Example layers: What I did was: Use the Distance to nearest hub ...
Joseph's user avatar
  • 75.9k
6 votes
Accepted

Limit the number of rows allowed in a table in PostgreSQL

You can create a trigger that checks the number of records in your destination table when an INSERT is used. The trigger would look like this: CREATE OR REPLACE FUNCTION check_number_of_row() ...
TurboGraphxBeige's user avatar
6 votes
Accepted

creating a view of multiple tables using Postgresql

The way the query is written, it will return entries whose polygon_id exist in the 3 tables. If you want the entries that exist in the main table and eventually add the values from the 2nd and 3rd ...
JGH's user avatar
  • 42.2k
6 votes
Accepted

Google Earth Engine - Remove geometry fields from FeatureCollection for export to table

You can remove the geometries by setting them to "null", like this (https://code.earthengine.google.com/e8812348780874f1ac9d54a080fc4071): // Add reducer output to the Features in the collection. ...
Bert Coerver's user avatar
  • 1,960
6 votes
Accepted

Decimals are in wrong place in latitude and longitude in Excel

Use a formula to divide by 100.
user2856's user avatar
  • 66.8k
6 votes
Accepted

Inconsistent display of HTML table font size in QGIS layouts

If you use CSS size definitions in QGIS, it‘s best to use em relative units instead of pt or px. pt/px units are changing with the dpi settings of the Layout.
christoph's user avatar
  • 5,827
6 votes

Inconsistent behaviour of getFeature() and getFeatures() when accessing CSV table with no geometry using PyQGIS

You assume that there is a feature for ids 0 and 1, but table.getFeature(0 or 1).attributes() tells us that it is not true. The following code prints existing feature ids. ids = [f.id() for f in ...
Kadir Şahbaz's user avatar
5 votes
Accepted

How to adapt a PostGIS query to modify the input table instead of creating a new table?

You cannot remove lines in the table you are currently selecting! But you can use your solution in "Edit 1" with a temporary table: BEGIN; CREATE TEMP TABLE temp1 ON COMMIT DROP AS SELECT ...
Elektordi's user avatar
  • 411
5 votes
Accepted

What is the proper syntax to use for the TableSelect_analysis to deselect everything?

You should use the Select Layer by Attribute tool to remove any selection, even with table views. This tool works on layers or table views in the table of contents, and also on layers or table ...
MacroZED's user avatar
  • 2,291
5 votes
Accepted

How to convert all tables from FGDB into CSV using OGR2OGR?

ogr2ogr -overwrite -progress -f csv "D:\NGII_Emap\" "D:\NGII_Emap\input_table.gdb" it does create the NGII_Emap folder. so if you have NGII_Emap folder already, you'd better change the name
Pil Kwon's user avatar
  • 1,040
5 votes
Accepted

Convert a list into ee.FeatureCollection in Google Earth Engine

It's simpler to use a grouped reducer rather than running reduceRegion for each class. It's also more accurate to add pixel areas rather than just counting pixels. Putting those ideas together: var ...
Mike Dixon's user avatar

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