Primary competition visual

GeoAI Challenge for Cropland Mapping by ITU

Helping Iran (Islamic Republic of), Sudan
and 1 other country
  • Iran (Islamic Republic of)
  • Sudan
  • Afghanistan
  • Scroll to see more
$4 000 USD
Challenge completed ~2 years ago
Classification
362 joined
74 active
Starti
Jun 30, 23
Closei
Oct 05, 23
Reveali
Oct 05, 23
Questions about lat/lon in the sample Notebook
Notebooks · 7 Sep 2023, 08:34 · 2

Hello Everyone.

I am new to geometry and have a question about the sample code (GeoAI_cropland_mapping_starter_notebook.ipynb).

In the code to get band data from the Earth Engine in the 7th cell, Lat/Lon is reversed as follows.

def extract_mean_pixel_values(row):
    lon = row['Lat']  # here
    lat = row['Lon']  # here
# Create a point geometry for the labeled location
point = ee.Geometry.Point(lon, lat)

Is there any intention behind this? (e.g., compliance with Earth Engine specs, etc...)

Discussion 2 answers

Hi, Thanks for the question. This sounds odd. Original sample code provided was

"""

def extract_mean_pixel_values(row):

lon = row['longitude']

lat = row['latitude']

# Create a point geometry for the labeled location

point = ee.Geometry.Point(lon, lat)

"""

Anyway, the above is correct. Please note that EE requires longitude firts when defining a point geometry

7 Sep 2023, 09:18
Upvotes 1

Thank you for your response.

It is strange. I joined it in September, the Notebook I downloaded from [Data] was as you see. (The column names in 'Train.csv' were also abbreviated as 'Lat', 'Lon').

Anyway, I can do it if I follow your answer. Thanks!