1

I am attempting to upload a feature collection which has a SURVEYDATE column. However, when I ask for the property, it returns null.

var table = ee.FeatureCollection("users/shopvac18/zm/NAS_ZM_2")

print(table.first())

// ee.Feature with a series of properties, including "SURVEYDATE"


print(ee.Feature(table.first()).get("SURVEYDATE"))

// null

Here is a link to a small example

Link to the original csv.

2 Answers 2

1

The property name seems to have a U+FEFF "Byte Order Mark" at the beginning of it, which is an invisible character some programs insert at the beginning of files (even though it really only means anything for the now-rare case of UTF-16 encoded text). Earth Engine does not strip this character, so the property name of the first column is not what it looks like and doesn't match.

You can access the property by writing the special character (escaped) as table.first().get("\uFEFFSURVEYDATE"), but it would be best to change whatever processing step inserted that character to not do so. However, I downloaded and examined your CSV file and it doesn't have the character in it. Are you sure that it's the exact same file that you used? I don't have a full explanation, given that.

1
  • Hi Kevin, many thanks for the prompt response. I believe that my colleague ingested this document in Excel at some point, and that may have added the character. May 12, 2021 at 16:13
1

Issue is probably due to inappropriate upload of CSV file to your assets. In following image of your table, it can be observed there are not coordinates for whatever feature.

enter image description here

In my case, however, where I uploaded original CSV to my assets, it looks as follows. Coordinates for each feature are present.

enter image description here

So, additionally to your code lines, I created a function for printing all 374 values for SURVEYDATE property (full code here).

var table = ee.FeatureCollection("users/joseguerreroa/NAS_ZM");

print(table.first());

print(ee.Feature(table.first()).get("SURVEYDATE"));

var getProperty = table.toList(table.size()).map(function (ele) {
  
  return ee.Feature(ele).get("SURVEYDATE");
  
});

print("SURVEYDATE", getProperty);

Result after running above code it can be observed in following image.

enter image description here

1
  • Thanks for the prompt answer! Does your "users/joseguerreroa/NAS_ZM" asset have geometries that can be added to the map? I believe that the reason the latitude and longitude columns do not appear in my original upload is because they are ingested as EE geometry objects. Also, could you kindly share that asset? Your linked code example doesn't work May 12, 2021 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.