Questions tagged [string]

A sequence of characters.

Filter by
Sorted by
Tagged with
6
votes
2answers
176 views

Removing two letters only if they appear at end of a field in QGIS labels

I am trying to remove the letters 'a' and 'o' only if they appear at the end of the field 'name' while labeling. For example, I'm working with names like: Ontario, Manitoba, Alberta, Quebec, Nova ...
-1
votes
1answer
35 views

How do you add user variables to custom python functions in QGIS Function Editor?

How do you add user input variables to a Custom Function created in Python in QGIS3.x. I found the below piece of code but need to modify it to control the string to split by and the index value to ...
4
votes
2answers
145 views

Count number of times matching string appears in another column (similar to Excel COUNTIF)

Which function can I use to count the number of times a string for a row in column "LeaseName" matches another row's string for "LeaseName"? For example, Row 1 is 'HADLEY #9' and I want to know the ...
1
vote
2answers
102 views

How to get current date “YYYY-MM-DD” in string format in GEE script

I tried to get current "YYYY-MM-DD" in Google Earth Engine script. I succeeded to get current "YYYY-MM-DD" in "Date" format in GEE script. But I want to convert it to String format for setting as a ...
1
vote
1answer
27 views

Dissolve ArcGIS Pro Python doesn't take string variable for field list

I try to dissolve layer having multiple fields statistics calculated. I prepared a string variable which has all the information in it. When I paste printed variable into dissolve it works. However I'...
2
votes
1answer
44 views

Proj string issue

Could anyone explain why the target in this proj string is not correct? $ projinfo -s EPSG:4326 -t '+proj=gnom +lat_0=61.39107201212929 +lon_0=-58.56360634793518' -o PROJ target CRS string is not ...
5
votes
2answers
191 views

Find lower/upper case letters in QGIS

Is there a possibility to find lower and/or upper case letters in QGIS? I know that it is possible to convert all lower to upper: upper('hello WOrld') → 'HELLO WORLD' and all upper case to lower: ...
0
votes
0answers
45 views

Rasterize: Best way to burn string values into raster (string to real) (QGIS)

I have to rasterize a polygon layer. Unfortunately the values of the field I have to burn into the raster has a variety of string entry's like "L239x" or "a403" (case sensitive!). RAT (Raster ...
8
votes
4answers
406 views

Counting the occurrence of a specific letter within a string (QGIS)?

I have a field which contains a series of words separated by commas. I am wondering if it is possible to count the number of times the letter 'G' occurs. Alternatively it might be possible to split ...
2
votes
1answer
22 views

ArcPy .replace Field Calculator - replace only standalone 0's with 111, not all instances of 0

I've searched on google intensively, must be missing something here: I only want to replace (in a string field) standalone zeros (len is 1 character), but the .replace function replaces all instances ...
2
votes
0answers
49 views

Complex parametrized string to export gpkg in Python [closed]

I'm trying to write a Python script that does a process (in this case a buffer) iteratively. The input layer is always the same but, in each iteration, the name of the output file must change and It ...
0
votes
0answers
24 views

Local Coordinates Transform to CRS string

I am fairly new to coordinate system transformation, so I am rather lost on the following case. I intend to process LIDAR data into LAS files and usually use global coordinates. this case uses local ...
1
vote
1answer
31 views

Why does Arcpy CalculateField alter string being written to string field?

I have a "Model_Version" field in my feature class that is being used for record keeping. I do not intend to ever do any numeric operations with it, so I am storing it as a string field. Right now ...
0
votes
0answers
124 views

ValueError: could not convert string to float: 'x_degree'

I want to create a decimal degree (dd) field from degree minute seconds (DMS) as a script tool. The CSV looks like this. My code looks like this: import arcpy inTable = arcpy.GetParameterAsText(...
0
votes
1answer
110 views

Adding spaces in string using Python parser of ArcMap field calculator

I am using ArcGIS Desktop 10.6. I have a integer field [no_lot] which contains values in the following format: '3 546 777' I need to transfer the data into a text field for joining purposes. I ...
0
votes
0answers
41 views

Using gdal_translate with a high number of gcp

I've a CSV file witch describes the coordinates of each pixels in a image, it is structured like this: xcoord,ycoord,row,col 716657.6518375501,4784215.095395751,0,0 716657.6915582813,4784215....
0
votes
1answer
53 views

Slicing all values in field using arcpy.da.UpdateCursor

I have a folder with a (3) shapefiles. Each shp. has a field titled "country" with a country name. I've already set my desired workspace correctly and everything else in my script works for what I ...
2
votes
0answers
55 views

QGIS3 python: right(QTextStream) - getting unexpected type ' str'

I have a field type double that I need to reduce from 9 digits to 8 ie 123456789 -> 23456789. If I do it as an integer I loose leading zeros ie 10002345 -> 2345. I am attempting to use refactor fields ...
3
votes
2answers
74 views

Omitting certain style string labels in QGIS 3 rule-based labeling

I’m labeling airport taxiways. The taxiway labels are all strings but they tend to be one of three varieties and I would only like to show one of those. I’ve been trying to mess around with Rule-Based ...
4
votes
1answer
67 views

Evaluate string in field calculator QGIS

Is there any way to evaluate a string as an expression in QGIS. For example, I want to evaluate the string in Column 'hukg' as an expression.
0
votes
3answers
205 views

Concatenating list of strings using ArcPy?

My code from Returning strings showing all vertices from all polygons in shapefile using ArcPy? creates is the following: import arcpy fc=r'D:\GIS Data\TOOLS\EV calc in Python\Data.gdb\PolyWGS842' ...
2
votes
1answer
178 views

Returning strings showing all vertices from all polygons in shapefile using ArcPy?

I want to have a string showing all vertices from all polygons in a shapefile. In my example below my code lists all vertices and the first column shows the polygon they are part of (I only have 2 in ...
0
votes
1answer
2k views

Python3 Replace “/” With “\” [closed]

I want to import several spatial csv files (points) into QGIS. The path to the folder, where the csv files are located is stored in the variable "Folder_Path". The file names are stored in a list. It ...
2
votes
0answers
32 views

Receiving strange characters from GPS tracker, is this HEX or binary?

I am struggling with a GSM GPS tracker. It looks like a clone of GT02A, and it is a relatively common model. My problem is that when it sends data to my server, it is not readable. I set it to send ...
2
votes
0answers
106 views

Conversion to_string provides NULL in QGIS

I've been trying to convert a decimal row into a string row using a few methods. Below is my CSV file: also, note that csv header has been updated too, State;AverageRainfall;ProbabilityBelow;...
2
votes
1answer
62 views

Inserting string without ' ' in QGIS modeler?

QGIS 3.4.7 I have a lot of Models where there are some string inputs. In all of them, I have to enter the string between quotation marks ''. I understand the meaning and pourpose of them in any ...
2
votes
1answer
32 views

Running IDW, but values are '<1' not 0.934 so they are Strings not Doubles

I am trying to use some interpolation tools for analytical data of concentrations of Benzene for monitoring wells. A decent amount of our values for Benzene are '<1' (not 0.943 or 0.345) because of ...
2
votes
0answers
28 views

Long string field for Atlas in QGIS [closed]

In QGIS 3.4 I need a long string field to store one description (2000 characters) for each point. The project is based on *.shp files however they manage only 254. I need to compile lots of formats ...
1
vote
2answers
94 views

Using the Expression String Builder to ultilise specific data within an attribute table

I have an issue relating to the 'Expression String Builder'. I have a series of data over a 8 year period. I need to collect that data for only a 5 year period. Once collected I need to find the ...
2
votes
3answers
175 views

Batch rename MODIS data?

I have MOD13Q1 NDVI images. Data are named in this format: MOD13Q1.A2007049.h26v06.006.2015161224938_MODIS_Grid_16DAY_250m_500m_VI.tif (YYYYDDD) Here 2007 is a year and 049 is day in year. I ...
1
vote
0answers
72 views

String slicing in ArcMap dynamic text element

Is it possible to slice a string in ArcMap's HTML-like dynamic text elements? I've got a string field "Code" with contents like 'A.3.5', I need to extract the number in the middle ('3' in this case). ...
1
vote
1answer
232 views

Creating drop-down list from dynamic field values in ModelBuilder?

I am trying to create a drop-down list containing all the values from a particular field, that I can use as an input for the Select by Attributes tool in ModelBuilder. The answer I’ve seen to ...
0
votes
1answer
85 views

Map.addLayer automation

As in the Hillshade Example, I wanted to automate adding all Layer from one Image for visual inspection. var band_names =Image.bandNames() print(ee.String(band_names.get(0))) for (var i = 0; i < ...
0
votes
1answer
160 views

.bandnames() as String

var bandname = ee.String(ee.ImageCollection.first().bandNames()) gets a print of: using ee.Image.regexpRename(bandname, new_name) or using var bandname = ee.String(bandname) results in : ...
0
votes
2answers
74 views

String Formatting;-Calling values from a dictionary to select by attribute in fc

New to python. In the code below, I create a dictionary b={} and wish to call keys to select by attribute. All goes well until I am required to format strings to come up with whereclause. I am ...
3
votes
2answers
172 views

FME geometry conversion from string?

I have an xlsx file that has incorrect X, Y location. Essentially the false northing is out 5000000 and there's no decimal point. As you can see in the image below the current file format is on the ...
1
vote
1answer
513 views

Selecting multiple values from a string in ArcMap?

I have a text field containing values like "1A,2P,13,17,22,34". I want to select the values that I need by a definition query of a layer. For a single value worked using LIKE and % but I need to ...
7
votes
2answers
4k views

How to extract a part of string from fields in QGIS field calculator?

I want to create a new field in my attribute table. My goal: returning all digits between the / and _ characters of the field named "location" by applying the next expression: regexp_substr( "Text", ...
0
votes
1answer
125 views

Dataset '{}' does not exist or is not supported in arcpy

I am trying to insert some variable into a simple arcpy call using .format(var1, var2) as I would in a string. I am new to using Python 3.6, so maybe there's been some change in how this is done. When ...
1
vote
1answer
42 views

Python Labelling in ArcGIS - Two Languages one string

I am trying to format a label in two languages in a way they appear on one line and not stacked in ArcGIS any ideas? Maplex Stacked label feature is not ticked so this does not help. This is how they ...
0
votes
2answers
5k views

Changing string to integer using ArcGIS Field Calculator?

I have a table with two fields. One field (type short) is empty. One field (type string) is full of digits. There are no random characters in that field, just digits. I want to convert the string ...
5
votes
3answers
124 views

If any of B contains all of A, then count # of times A is in all of B

BACKGROUND: Long time reader, first time poster. Looking for help using QGIS to score data in a CSV table that was yielded from processing the contiguous neighbors of every polygon from a file with ...
1
vote
0answers
722 views

Edit Field Name In Attribute Table (QGIS 3) [duplicate]

This seems like such a simple task, yet after researching how to execute it in QGIS I've been unsuccessful. I'm merely trying to rename columns in my attribute table. My existing field is currently ...
2
votes
1answer
419 views

split attribute using ArcGIS Field Calculator

I have a long string in one attribute. I want to be able to extract a small portion of it into a new attribute. This is an example of the attribute: "< html xmlns:fo="http://www.w3.org/1999/XSL/...
0
votes
1answer
244 views

If-then-else Statements and string errors?

I'm defining a string field based on contents of another string field. Simply put, if the contents of field A contain this value, then fill field B with this text. It throws a string related error ...
1
vote
2answers
682 views

Comparing string values in field calculator

I am trying to compare the values of 2 fields in my attribute table and update a 3rd field as a result. In the field calculator I have CASE when (("Address") like ("COUNTYNAME" )) then 'Match' ...
0
votes
1answer
109 views

carto /cartocss : is there a function for “contains”?

I know how to set a specific color for a specific value (here specific_string) of a specific field (here field1) #mydataset[field1="specific_string"] { marker-fill: #000000; But what if I want to ...
1
vote
3answers
2k views

What is the limit to a column (field) title string in ArcMap?

Is the column heading limited to 10 characters? Is there a workaround besides changing the alias? I hear that QGIS does not have this issue. I downloaded shapefile data from https://egis-hud....
1
vote
0answers
163 views

Converting @layer_name tokens into Shapefile Attributes (Columns/Rows) using QGIS Expression Editor?

I'm a fairly novice Python user and I've been banging my head against this problem for a number of days now. Assumptions I've made: This is doable within QGIS, and does not need to be done ...
1
vote
0answers
965 views

Converting table asset data type from 'Long' to 'String'

I am attempting to generate 50 random points per land use class through Google Earth Engine. I have performed this operation before on an earlier instance, where the inputs were the following (1) ...