Giter Club home page Giter Club logo

collect-earth-online's Introduction

Collect Earth Online

Crowd-sourced visual interpretation of on-demand satellite imagery

Installation Requirements

Required

Application Configuration

On startup, the CEO application reads a file called config.edn in the top level directory of this repository, which contains various user-configurable system parameters. A sample file called config.example.edn is provided with this repository to get you started. To begin, simply copy it to config.edn. Then edit it according to the following sections.

Please note that you must replace all values surrounded with angle brackets (e.g., “<api-key>”) with actual values for the application to work correctly. Most of the fields should be self-explanatory.

PostgreSQL Database Setup

PostgreSQL needs to be installed on the machine that will be hosting this website. This installation task is system specific and is beyond the scope of this README, so please follow the instructions for your operating system and PostgreSQL version. However, please ensure that the database server’s superuser account is named postgres and that you know its database connection password before proceeding.

PostgreSQL Server

To confirm that PostgreSQL is running as a server on your machine, you’ll need to check its systmed or sysvinit process. To figure out which you’re using on your system, run ps -p 1 -o comm=. Once you know if you’re using systemd or sysvinit, you can run the following command:

# If you're using systemd:
sudo systemctl status postgresql.service
# If you're using sysvinit:
sudo service postgresql status

If it’s not running, you’ll need to start it by running:

# If you're using systemd:
sudo systemctl start postgresql.service
# If you're using sysvinit:
sudo service postgresql start

Finally, to ensure that your PostgreSQL server always restarts when your system reboots, you can run:

# If you're using systemd:
sudo systemctl enable postgresql.service
# If you're using sysvinit:
sudo update-rc.d postgresql enable

CEO Database

Once the PostgreSQL database server is running on your machine, you should navigate to the top level directory (i.e., the directory containing this README) and run the database build command as follows:

clojure -M:build-db build-all --dev-data

This will begin by creating a new database and role called ceo and then add the postgis and pgcrypto extensions to it. Next, the script will populate the database with the schemas, tables, and functions that are necessary for storing and processing ceo’s data. Finally, it will load some default data into these tables that is necessary for the website to function properly. You can optionally load dev data with --dev-data. This will initialize the DB with 3 users, an imagery source, and a project.

If you wish to use a live copy of the CEO database instead of the dev data and you have a .dump file, run the following command:

clojure -M:build-db restore -f /path/to/ceo/database/ceo-db-<year>-<month>-<day>.dump

Performance Settings

If you want to improve the performance of your Postgresql server, one way is to visit the pgtune website and input your system settings. This will generate a set of configuration options that you can add to the postgresql.conf file in your system-specific Postgresql data directory.

If you would like to keep these settings separate for your own reference, you can add them to a file called “performance.conf” that you should place in your Postgresql data directory. You can then import these settings into postgresql.conf by adding this line to the end of that file:

include = 'performance.conf'

Note that the Postgresql server will need to be restarted for these changes to take effect.

Environment Variable Setup

In order for your command line shell to find the programs installed above, you will need to update your environment variables. Under GNU/Linux, *BSD, or MacOS X, you can set these through your shell’s .*rc or .*profile configuration files in your $HOME directory. In a Windows environment, you will need to set either the USER (for the current user only) or SYSTEM (for any user) environment variables under your system settings menu.

Step 1: Add JAVA_HOME

On a Unix machine using bash (e.g., GNU/Linux or MacOS X):

export JAVA_HOME=<jdk-installation-directory>

On a Unix machine using csh or tcsh (e.g., *BSD):

setenv JAVA_HOME <jdk-installation-directory>

On a Windows machine:

JAVA_HOME = C:\Program Files\Java\jdk-X.X.X

Replace X.X.X with the JDK version installed on your computer. In order to run CEO, your JDK version has to be either 11 or 17.

Step 2: Update PATH

On a Unix machine using bash (e.g., GNU/Linux or MacOS X):

export PATH=$PATH:$JAVA_HOME/bin

On a Unix machine using csh or tcsh (e.g., *BSD):

setenv PATH $PATH\:$JAVA_HOME/bin

On a Windows machine, add these entries to the PATH environment variable:

%JAVA_HOME%\bin
C:\Program Files\PostgreSQL\X\lib
C:\Program Files\PostgreSQL\X\bin
C:\Program Files\7-Zip

Replace X with the PostgreSQL version installed on your computer.

Configuration

Copy config.default.edn to config.edn and update any settings that you wish. The base set of defaults should be sufficient to run CEO in a development setting.

Python dependencies

Use pip to install dependencies. The python / clj interop does not support virtual environments.

pip install -r requirements.txt
pip install earthengine-api --upgrade

Development Web Server

Google Earth Engine authentication

You will need a Google Earth Engine account to use the GeoDash. To apply for a GEE account, visit https://signup.earthengine.google.com/#!/. Once you receive an account, you can store local authentication information with:

earthengine authenticate

This command will open a window in your browser containing a key that you should copy and paste back into your terminal. You do not need to update the :gee section of config.edn if you use this method. If the above method is giving you issues, try following https://developers.google.com/earth-engine/guides/python_install#expandable-2.

Modifying hosts file

Add the following line to your hosts file. This local URL should be used for local development in place of localhost due to CORS settings on CEO’s Mapbox account.

127.0.0.1 local.collect.earth

Create accounts

To be able to crate accounts without having to send email for confirmation, set :auto-validate? of :mail to true in config.edn.

There can only be one superuser account with user_uid of 1 adminstrator flag set to true. Activating this flag for other users can cause their queries to sometimes not return the full result, as some of those queries assume only one root superuser to be existing.

Compile and run

To compile and run the web application, navigate to the top level project directory and run:

npm install
npm run vite-dev

Now, in a separate terminal window (because webpack needs to be running in the background), run the following commands:

npm run server-dev

The website will then be available at http://localhost:8080 unless a port is specified. These can also be configured using the :server section in your config.edn file. When using the clojure -M:server start command (which is what npm run server-dev is an alias for) an http port can be specified with -p and an https port can be specified with -P. In dev mode, server-side exceptions will be displayed in the browser and JavaScript source files will be reloaded whenever you refresh the page.

Going forward you will usually only need to run npm run webpack-dev and npm run server-dev (still in separate terminals) to get your dev environment set up. Watch for updates to SQL files or package.json and run npm run build-db-functions or npm install respectively.

Checking for Reflection Warnings

From the top level project directory run:

clojure -M:check-reflection

This will emit warnings when reflection is needed to resolve Java method calls or field accesses. To resolve any that appear, add type hints to your code. Resolving all reflection warnings can improve system performance.

Production Web Server

Sessions

It is very important to change the default :session-key in config.edn. This key is used to encrypt user session data and should be unique to each deployment. The key must be exactly 16 characters long.

Email Server

To set up the email server for system emails, open the “config.edn” file in the root directory of the application. Edit the default EDN object containing server details to the file, replacing the values with your own.

Enabling HTTPS (optional)

To enable HTTPS from within the server, view the Triangulum HTTPS page for further instructions on enabling HTTPS.

Google Earth Engine service account

For production it is recommended that you use a service account with a key file. You can obtain your key file by logging into your service account, navigating to the account menu, and clicking “Create key > JSON”. Then, download that JSON key file and place it in the root directory of CEO. Set the email for your service account and key path in the :gee section of config.edn.

:gee {:ee-account  "[email protected]"
      :ee-key-path "ceo-gee-key.json"}

Launching the Web Server

To compile and run the web application, navigate to the top level project directory and run:

npm install
npm run webpack-prod
clojure -M:build-db functions -d ceo
clojure -M:server start -m [dev|prod] [-p 8080] [-P 8443] [-r]

The website will then be available at http://localhost:8080 unless a port is specified. These can also be configured using the :server section in your config.edn file. An http port can be specified with -p and an https port can be specified with -P. In dev mode, server-side exceptions will be displayed in the browser and Clojure source files will be reloaded whenever you refresh the page. These features are disabled in prod mode. If -m is unspecified, it will default to prod mode.

Running the Web Server as a System Service

View the Triangulum Systemd page for further instructions on enabling the app as a system service.

Maintaining Daily Logs

By default the server will log to standard out. If you would like to have the system log to YYYY-DD-MM.log, use the “-o path” option to specify an output path. You can either specify a path relative to the top level directory of this repository or an absolute path on your filesystem. The logger will keep the 10 most recent logs.

Using the Announcement Banner

On each page load clojure will read the value of announcement.txt. If text is found, the value will be inserted into a HTML element that displays as a red banner at the top of the page. To add a new announcement, edit announcement.txt and add a new message. To remove the announcement, edit announcement.txt and remove all text.

Contact

Authors:

License and Distribution

Copyright © 2016-2022 FAO.

Collect Earth Online is distributed by FAO under the terms of the MIT License. See LICENSE in this directory for more information.

collect-earth-online's People

Contributors

a-luz avatar ajb2189 avatar aliceliquori avatar billyz313 avatar biplovbhandari avatar c11 avatar davidsaah avatar dependabot[bot] avatar gtondapu avatar herrtunante avatar jdilger avatar jollyblondgiant avatar jonnvega avatar justineb17 avatar kdyson avatar kyle-woodward avatar lambdatronic avatar oliver-be avatar rfontanarosa avatar rjsheperd avatar sifbiri avatar sirmspencer avatar supershivas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collect-earth-online's Issues

Error when uploading large csv files

I tried to create a project by uploading a csv file with 10,166 points and received an error that the project could not be created. However, when reduced the number of points to 200, I was able to create the project without any trouble.

Pre-cache imagery

It would be great if the user was prompted to pre-cache imagery in order to deal with slow internet connections. The user should be able to specify the number of images they want pre-cached and then have those Digital Globe images cached. Say for example the user picks 32 then CEO goes and finds the next 32 plots and pre-caches the imagery around those plots.

Sample points from not scale-adjusting red point to a crosshair?

The current sample points (red hollow dots) aren't adjusting with scale when zooming in. Dependent on the zoom factor, a different surface parts are covered by the point. Setting the red dot to a crosshair would avoid that - but hard to see what is classified already?
Currently, the point is filled with according legend color after assigning the cover value - this is great, easy to check for mistakes and clear which points are already classified.
Is it possible to change to red dots into crosshair, and once it is classified, convert the shape from cross hair to the color coded circle after the assignment?

my project 'Demo project for Module 3' from 'Demo' institution is not visible for analysis after publishing the project

My project 'Demo project for Module 3' from 'Demo' institution is not visible for analysis after publishing the project. I can't find it in the dropdown menu neither.
Same happens when I go to institution 'USFS' and click on Mekong Mapathon v3 (project is also published).
It would be great if 'Demo project for Module 3' could be visible and ready for analysis soon, so I can make screenshots for the manual. Thanks so much!
image

export label schema and colors

Request to add an export option to export both the csv of data points (exists) and the label schema (with hex color codes)?

Institutional WMS server management

HIGH PRIORITY FOR SERVIR

We need to add in functionality for institutions to management specific WMS feeds. There are certain WMS feeds open to all institutions that we need to restrict to only institutions for SERVIR.

Project Stats don't work yet

I just classified a few points using the Mekong river project. So at least a few points are classified, but under project dashboard > project stats are all still on '0', incl points classified.

Accuracy Assessment

I've been working with the mapcha/CEO projects this week. I'm currently working in R to merge our predicted values based on lat/long and then running the confusion/error matrices.

It would be great to consider adding this process as a new feature: when we upload the csv with lat long (or a shapefile) to specify our sample locations, could we also preserve the predicted class and unique ID? Then include this info in the spreadsheet download as well? It would be pretty cool to also have the confusion/error matrices calculated in mapcha (with the ability to insert new columns for new prediction results since model building is an iterative process).

The algorithm is the traditional users vs producers accuracy. To get overall accuracy, we'd need to be able to specify sample weights if we were working with a stratified random sample.

Suggestion: Allow image source to be changed within a project

When imagery is not available (or is cloudy, etc.) for a particular year of interest, it would be helpful to be able to change the image source to see images for different years while interpreting a particular plot. Along with this, I'd suggest allowing the user to see the date of the imagery and enable the user to record the date of the image.

Improve the user experience when analyzing plots - Mouse actions & shortcuts

When assessing a plot it would be nice if it was easier to select the points.

  1. Ctrl+Left click to select all the plots within the selected rectangle (already there). It would be easier for the operator if the action would just be "Right-click" as it makes instead of having to press control.

  2. Is the user is still pressing Ctrl then clicking in one to the dots already selected would deselect it (but will keep the other ones selected). This would be very useful for instance in the case of a plot in the forest with a small road passing through it. You would like to select everything first and then just de-select the few dots that fall on top of the road....This is a very common case when assessing plots.

  3. Have a shortcut (for instance Ctrl+A) that selects all of the dots in the plot. If some dots are already classified then this shortcut selects only the non-classified plots.

  4. Have shortcuts also for the classes. For instance one selects some dots from the plot, instead of having to find the Forest class in the right frame then one can click on the key F to classify them as forest. If you have a simple survey it would be easy to have one key (for instance first letter of the class) assigned per class and make the process faster.

quantifying user skill

I gather that these discussions are already ongoing, but appropriate use of such outsourced data collection requires knowledge of the photo-interpretation skill of each user (especially if used broadly in a citizen science framework or involving high school students, undergrads, etc.) . It would be helpful if there were easy-to-use tools at the administrator level for constructing tests of user skill, given known 'gold standard' land-cover interpretations. Perhaps there could be outputs of user-specific classification accuracy that are specific to each land-cover type. This could help greatly with quantifying uncertainty prior to use of the dataset for training or validation of image classifications, or for direct use of the point data for statistical analysis independent.
Simple (but of limited utility) would be to ask the users to rank their own skill level on the interface.

GEODASH - Automatically validate image/feature collection names and load band names

When configuring an element in geodash the band names should be validated to ensure the user uses the right names.

Also, adding information tooltips would be very useful so the user understands what is expected.

When the imnagecollection name is set, then the band names available should shown directly to the user to avoid errors.

issue on commit 159b0c1: angular missing module

i tried to start the application but there is an angular error caused by geo.js 'cause it now imports an undefined module: geodashadmin.
only geo-dash.ftl includes the javascript in which is defined geodashadmin module.

i've fixed including the script also in the header.ftl but I don't know if it is ok:

<script type="text/javascript" src="${root}/js/geo-dash-admin.js"></script>

:)

Suggestion: Allow interpretation of two dates of imagery at the same time

When a user is interested in interpreting more than one date of imagery, it would be helpful if CEO could allow two windows to appear for a given plot with different dates of imagery so that the user can interpret the two dates at the same time. Ideally, the user would be able to quickly copy attributes from points that have not changed for one year to the next year to make the process more efficient.

Earth Engine Widgets - request for instructions

What are the options, syntax to enter in the Earth Engine widgets window? Can we add some of the popular default drop downs for the Image Collection, Bands, and columns. How do I add in a derivative of the landsat bands, such as normalized difference layers (e.g., NDVI).

GEODASH - Use templates or geodash conbfigurations from other projects

Normal/Beginner users will be at a loss when trying to configure GeoDash.

It would be much easier if the user is given a few options when starting the geodash configuration (as we do when starting a new Collect Earth project)

The options should be (more or less, we will need to define exactly what the pre-existing options should be)

    1. Geodash with NDVI charts and Landsat 8, Landsat 7 and Sentinel-2 imagery
  • 2 Geodash with Sentinel-1 and comparisons
    -3 Copy geodash from another project (import geodash json configuration)
    -4 Start from scratch

Integrate Eric's NASA-curated DigitalGlobe chipset

Pyrite's Geoserver and the NASA chipsets

  1. Ask Ganz and Anderson about the SEAMLINE_SHAPE and TILE_SHAPE SHP files in the Servir yearly data dumps (2010, 2011, 2012)

  2. Run mklink /d ftp_data E:\ftp_data in Geoserver's data_dir on Pyrite

  3. Build ImageMosaic layer from TIF files on Pyrite http://docs.geoserver.org/stable/en/user/data/raster/imagemosaic/configuration.html

  4. Try loading DigitalGlobe dataset (IMD and TIL files) with QGIS or ArcGIS https://apollomapping.com/blog/goodbye-g-faq-hello-gtm-using-imd-til-files-arcgis

  5. Give Geoserver JVM more memory (-Xmx) and install native JAI and JAI-ImageIO on Pyrite

  6. Reset GEOSERVER_DATA_DIR on Pyrite to E:\ftp-data http://docs.geoserver.org/stable/en/user/datadirectory/setting.html#datadir-setting

Plots with random dots - dots too close together

In the plots where the dots are not systematic but random, each dot should have a buffer area (a couple of meters?) so that no other dot can be placed there. If the dots are very close together it makes the classification very complicated( selecting the right dot) and also looks bad.

Check the code from the Collect Earth circle plot generator which uses random positioning of the dots : https://github.com/openforis/collect-earth/blob/master/collect-earth/collect-earth-sampler/src/main/java/org/openforis/collect/earth/sampler/processor/CircleKmlGenerator.java

Git Issues link on data collection page

can we add a link to connect to the github CEO issues tracking page from the data collection page? Right now I have to leave data collection and go to the home page to track an issue.

Random tests to identify malicious activity

I was showing this site to someone the other day and she brought up the idea of inserting a random test every once in a while in order to flag users who might be trying to intentionally mess up the data. The test might consist of randomly inserting a known plot in every 20 or 30 plots and seeing if there is obvious maliciousness. The user could be flagged as a bad user, and his/her data might be downweighted or dropped entirely.

Integrate Stefano's Collect Gateway

Clone the Collect repository, checkout branch collect4, build and launch it (setup JNDI database resource and load collect-webapp module into Tomcat 7+), and test Stefano's REST API.

Project creation example is in @fefrain channel on Open Foris slack and the implementation of the current API calls is in the SurveyController class.

GeoDash Widgets not working

When analyzing plots, the widgets for GeoDash are set up but not displaying the time series or the imagery. No errors are given in the console either.

Add Tutorial

Please add a walk through tutorial on home page

Can't delete a project

I have been testing CEO and have created several projects. Some of them are no longer valid and I would like to delete them, but can't find a way to do so.

Add reason for flagging a plot bad

Currently we have the option for users to flag a plot as bad without any justification. It will be good to add a dialog for users to provide an explanation as to why the plot was flagged as bad. These can be simple such as "Cloud cover" or "Poor resolution". This will allow administrators to track bad plots in more detail.

error warning for 'Create Project'

When creating a new project and clicking on 'Create Project', I get the following error warning
image
When going back to my institution ('Demo'), the project got still created.
Just wanted to give a heads up about this error warning.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.