I have designed a survey and I would like to share that survey amongst different users that will be collecting data in different countries.

My problem now is that I want to make sure that the records for each country are correctly stored and that the data stored by one user in country A is for sure not going to overwrite data collected for country B.

I have generated my plot location CSV files using QGis ineach one of the countries our projectis going to work on, then I noticed that the QGis generated IDs can bethe same in different countries. This makes me think that there could be a problem.

What should I do to make sure there will be no problems?

/Question asked on behalf of a user

asked 18 Nov '14, 09:31

Open%20Foris's gravatar image

Open Foris ♦♦
accept rate: 8%

So the answer here is quite clear YOU HAVE GOT A PROBLEM!

The survey that you have designed takes an field ID as the unique identifier of a plot. If this is so then there CAN NOT BE two plots in different regions with the same ID, as this would mean that the information from one will overwrite the other.

There are three ways to fix this:

  • EASIEST : Rename the IDs of the plots. If you have one plot location file per country e.g. spain.csv, france.csv and italy.csv then edit them with Notepad++ . Use the Column editor so that you can add a prefix to the plot IDs ( so they end up having IDs like france1, france2, spain1 or spain2 ) EXAMPLE ON COLUMN EDITING

  • CORRECT : Go to the file placemark.idm.xml in the Collect Earth Project file (which is just a ZIP file) and add a "country" field that is also an identifier (so that now the ID of a plot is combination of the ID and the country, this way you could have plots with the same plot id in different countries without interfering in database) e.g. :

Your current ID is:

< text id="2" key="true" name="id" required="true" >< label xml:lang="en">Id< /label>< /text>

So you need to add this :

< text id="10000" name="country" key="true"> < label xml:lang="en">Country< /label>< /text>

Now you need to pass this information (the name of the country) to Collect Earth when the form is submitted in Google Earth. One way to do that is to add a country column to the plot files. so in the Spain.csv file you add a column and you end up with these columns(assuming that from the beginning you have the first 7 columns) :


Then you need to pass the country name from the plot file to the form: Modify the kml_template.fmt file (found in Collect Earth Project cep file) so that the countryvalue is added to the data that can be accessed by the HTML popup, add these lines to the ExtendedData block :

< Data name="country">< value>${placemark.extraInfo[1]}< /value>< /Data>

The extraInfo[1] refers to the 7th column o the plot file location ( the 6th column -region- is ${placemark.extraInfo[0]} )

Finally go to the HTML popup form ( file balloon.html inside the cep file ) and add these lines in the areas where the hidden input fields are defined :

< input type="hidden" id="collect_text_country" name="collect_text_country" value="$[country]" />

FLOW : the country name is passed to the KML data which in its turn is accessed by the pop-up balloon and is then sent as a hidden parameter to Collect Earth when the user clicks on the submit button on the form shown by Google Earth.

  • BEST SOLUTION (RECOMMENDED) Create a Collect Earth Project file PER COUNTRY so you end up with a Spain.cep France.cep and Italy.cep file as separate projects:

Copy the original Collect Earth Project file and for each country modify the URI of the survey in the placemark.idm.xml file, s for Spain you will have :

< uri>http://www.openforis.org/idm/earth/europe/spain< /uri>

Also change the project name to e.g. :

< project>Spain - Open Foris Collect Earth< /project>

And finally but very importantly change the project name in the file called project_definition.properties so you will have a line like :


Ensure that each country has different values here! Now Collect Earth will create different database schemes per project (country) so you don't have to worry about conflicting IDs!

ATTENTION : you might need to remove spaces after the less than sign in the XML!

Wow that was a painful answer :)

permanent link

answered 18 Nov '14, 12:31

collectearth's gravatar image

collectearth ♦
accept rate: 16%

Hi there, this was a good conversation. Now, do you have a file created for Ethiopia. I would like to test it by collecting some data from regions am familiar with it if there is one ready. Or, can you walk me through/throw a link how to create one if there is none yet?

Thanks, Tesfay

permanent link

answered 26 Nov '14, 18:09

Tesfay's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 18 Nov '14, 09:31

question was seen: 9,154 times

last updated: 26 Nov '14, 18:09