Failed with PointData and PointCoordinate

  • Asked
  • Active
  • Viewed 2445 times
0

Dear OpenForis team,

I would like to have plot coordinates presented by default according to strata and plots. For this, I am using a function 'idm:samplingPointCoordinate(strata, plot)' in a 'plot_coordinate' attribute. However, with a change of stratum and plot id, plot coordinates do not change. Where did I make a mistake?

Besides, I need to have a list of available plot ids per stratum (one stratum can have several plots). Thus, a plot attribute is defined as 'calculated' with the following function: 'idm:samplingPointData('plot', strata). In this case, drop down plot window is not active. What is wrong here?

I would appreciate your help very much. Cheers, Roksolana

1

Accepted answer

Dear Roksolana,
The problem with the default value is that it is evaluated once when the field where it's defined is created, so in your case it is evaluated when the fields strata and plot are still blank.
What you could do is to add an "Apply if" condition to the default value expression to evaluate it when both strata and plot are filled; the expression could be something like:

idm:not-blank(strata) and idm:not-blank(plots)

Then, if you need to have a list of available plot ids per stratum, you need to define a hierarchical code list where you have stratum at the first level and plot ids at the second level, then you could make your stratum attribute in the survey a code attribute that uses the list you have just created and add use the same list for the "plot_id" attribute, but selecting "stratum" as parent code attribute.
I hope it's clear now, please let us know if you need further help.
Thanks,
Open Foris Team

1

Accepted answer

Dear Roksolana,
We will contact you to your private email address to better understand your problem.
Many thanks,
Open Foris Team

1

Accepted answer

Dear Roksolana,
Please make your attribute in the survey designer not "calculated" and keep the same expression in the Default Values. With the expression you are using a calculated attribute won't work (at least with the current version of Collect).
Many thanks,
Open Foris Team

0

Accepted answer

Thank you for your hints, I fixed my issues.

Now I have another problem with circular dependency. How to resolve it?

Circular dependency found in graph for node /strata/plots/height[2]/tree_id java.lang.IllegalStateException: Circular dependency found in graph for node /strata/plots/height[2]/tree_id at org.openforis.idm.model.DependencyGraph$GraphSorter.visit(DependencyGraph.java:385) at org.openforis.idm.model.DependencyGraph$GraphSorter.visit(DependencyGraph.java:391) at org.openforis.idm.model.DependencyGraph$GraphSorter.visit(DependencyGraph.java:391) at org.openforis.idm.model.DependencyGraph$GraphSorter.sort(DependencyGraph.java:378) at org.openforis.idm.model.CalculatedAttributeDependencyGraph.getSortedDependentItems(CalculatedAttributeDependencyGraph.java:30) at org.openforis.idm.model.DependencyGraph.getDependentNodes(DependencyGraph.java:148) at org.openforis.idm.model.DependencyGraph.dependenciesForItems(DependencyGraph.java:137) at org.openforis.idm.model.DependencyGraph.dependenciesFor(DependencyGraph.java:129) at org.openforis.idm.model.Record.determineCalculatedAttributes(Record.java:400) at org.openforis.collect.model.RecordUpdater.recalculateDependentCalculatedAttributes(RecordUpdater.java:468) at org.openforis.collect.model.RecordUpdater.initializeEntity(RecordUpdater.java:879) at org.openforis.collect.model.RecordUpdater.addEntity(RecordUpdater.java:202) at org.openforis.collect.model.RecordUpdater.addNode(RecordUpdater.java:179) at org.openforis.collect.command.handler.AddNodeCommandHandler.executeForResult(AddNodeCommandHandler.java:16) at org.openforis.collect.command.handler.AddNodeCommandHandler.executeForResult(AddNodeCommandHandler.java:9) at org.openforis.collect.command.handler.RecordCommandHandler$1$1.execute(RecordCommandHandler.java:72) at org.openforis.concurrency.Worker.run(Worker.java:103) at org.openforis.concurrency.Job.runTask(Job.java:95) at org.openforis.concurrency.Job.execute(Job.java:80) at org.openforis.concurrency.Worker.run(Worker.java:103) at org.openforis.concurrency.SimpleJobManager$2.run(SimpleJobManager.java:120) at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:286) at java.lang.Thread.run(Thread.java:748)

0

Accepted answer

thank you, I corrected it as you suggested! Everything works fine.

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Tip: type a few words from the error message, or put a tag in [brackets] to look only there.

Menu

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.