Hot answers tagged

5

Loop through a list of field names perhaps: fields = ['field1', 'field2', 'etc...', 'field12'] # Or fields = [f.name for f in arcpy.ListFields(out_dataset)] fms = arcpy.FieldMappings() for field in fields: #Define field mapping objects fm = arcpy.FieldMap() # ***NOTE: 'field1, field2, etc, are actual fields that have different names*** ...


5

You need to set Layer Options > GEOMETRY to any option except <Default> in Save Vector Layer as... window.


4

It's hard-coded and you cannot change the default value until developers add an option to change the default value. This is the related source code of Layer Options: Link ... layerOptions.insert( QStringLiteral( "SEPARATOR" ), new QgsVectorFileWriter::SetOption( QObject::tr( "Field separator character." ), ...


4

You may choose: to use GDAL using ogrmerge.py like here but with setting a destination target not a file but your database compare to this example https://twitter.com/ThomasG77/status/1362118505819176966 See ogrmerge doc looping with bash doing something like below (not exact as it depends from your own table structure) psql -c "CREATE TABLE ...


3

You could use Miller (https://github.com/johnkerl/miller). Starting in example from this example input.csv lat/lon 12 14 15 13 38 5 37 4 2 3 35 4 4 3 38 7 8 6 and running mlr --csv reshape -r "[0-9]" -o item,value \ then filter -x -S '$value==""' \ then label y,x,value ./input.csv >./output.csv you will have y,x,value 38,14,5 ...


3

Your problem is that, that is not a CSV file - which is a series of features one per row. What you have is more like an ASCII grid file, so with some editing you might be able to import it that way. You need to create a header block: ncols 4 nrows 6 xllcorner 0.0 yllcorner 0.0 cellsize 0.25 NODATA_value -9999 where you can fill ...


3

When you open a csv file, with GeoPandas it automatically adds a geometry field, empty here gdf = gpd.read_file('myFile.csv') print(r) GEOMETRY name geometry 0 MULTIPOLYGON (((-53.753618620372258 -16.815490... Greens None 1 MULTIPOLYGON (((-53.762200546706367 -16.803172... Tomas ...


3

You will need to learn how to use field calculator. See this section of the manual to start. Then, your field is a string (text) field from which you need to extract the relevant substrings for the x coordinate and y coordinate and convert them into numbers. The expression substr(string,startpos,length) will let you extract length characters starting at ...


3

Select rows Copy selected rows to clipboard Paste in Excel


1

If you add the CSV to QGIS (doens't need geometry or coordinates to do this) then you could use the Vector general > Join attributes by field value tool in the Processing Toolbox to join the SHP and the CSV by road name. Wherever it doesn't work is where you need to correct one or the other.


1

Solved! The problem was that I should be passing these particular option(s) to the function that creates the layer, and not to the function that creates the data source. Eg, like this: let options = ["GEOMETRY=AS_XYZ", "CREATE_CSVT=YES"] var cOpts = options.map { strdup($0) } cOpts.append(nil) let ogrLayer = GDALDatasetCreateLayer(ds, ...


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