1 (edited by Sebastian 22-01-2018 06:49:35)

Topic: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi,

as seen in my other post I was able to setup Warehouse and Indicia Forms. Now I am facing some new (basic) hurdles. I have tried to search the forum on this but my keywords seem to be too general to find something specific.

So here is what I am seeing. I want to customize the data entry form to our needs. For example, when adding a new attribute in the warehouse (Custom attributes -> sample attributes -> New sample attribute and then Lookup lists -> Survey datasets -> setup attributes) the new attribute does not show up in the Drupal Indicia Form website right away. It seems to take round about 10 minutes for it to update. I guess there is some kind of scheduled job running in the background to load the information from warehouse. Can I run this by hand to update my forms whenever I need to?

Second question I have is about conditional form fields. I have seen those used in ebird.org data entry form. It's like "if you click this particular checkbox you see three more fields to be filled and de-selecting the checkbox hides the extra fields again". I have not found how to add this in warehouse or Indicia IForms yet.

Third, what's the difference between Occurrence Attributes and Sample Attributes? Sorry if that sounds kind of stupid but I am not a native speaker and as well I have no sound biological background.

Thank you very much in advance! Any advice or comment is highly appreciated.

Sebastian

2

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi Sebastian

1. There is a cache to improve performance which is why you don't see the updates immediately. On your Drupal website go to Configuration > IForm > IForm Admin Tasks and click the Clear Indicia Cache button.

2. Typically we write custom JavaScript for this using the method described at http://indicia-docs.readthedocs.io/en/l … ality.html

3. A Sample is about the person-place-time where one or many species Occurrences are seen. A typical Sample Attribute might be the weather when the sample was made. It is the same for all the species recorded in that sample. A typical Occurrence Attribute might be gender. It may vary from one species occurrence to another.

Jim Bacon

3

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi Jim,

thanks again for your prompt and helpful answer!

Sebastian

4

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi,

unfortunately I seem to still get lost in the vast ocean of Indicia. I feel kind of stupid but I literally spend hours trying to get the map/spatial reference thing to work and failed. I guess it's something very basic again I am missing.

The map and spacial reference field are shown. I can also navigate on the map (zoom, drag) but clicking on the map does not seem to select a reference point. The text field stays empty.

On other websites (like http://www.bioliv.co.uk/?q=record/sighting or http://somerc.co.uk/?q=record/sighting) I see the map working great - on click spacial ref. field being filled, zoom in to the next level for more detailed selection and even help text like "Good. 100m square selected. We've switched to a satellite view to allow you to locate your position even better.".

Looking through the code for a bit I found the map option clickForSpatialRef but I don't seem to get it to work setting that option either. Then I though I might need to install GeoServer for that to work. But now that I have it up and running I see no difference. Just feeling lost here, sorry.

Here is part of my user interface config:

[spatial reference]
@lockable=true
@class=control-width-4
@label=Enter a spatial reference<br/><strong>Or</strong> simply click on your position on the map <div id="map-help" style="display: none" class="ui-state-highlight ui-corner-allpage-notice"></div>
<br/>
[*]
[place search]
[map]
@helpToPickPrecisionMin=100
@helpToPickPrecisionMax=10
@helpToPickPrecisionSwitchAt=100
@helpDiv=map-help
@clickForSpatialRef=true

It feels like JavaScript is not doing anything but I am sure it is because the place search is working great! So JavaScript and google API keys
should be all fine. Hope someone has an idea to point me on what I am missing.

Thanks,
Sebastian

5

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Ok, turns out I just needed a break. Coming back I figured out what I had done wrong...

When setting up the warehouse connection to the drupal instance (and vise versa) I had the website URL as https://localhost/warehouse/ and this URL was used by the spacial ref JavaScripts too. Now when a localhost URL is being used in the JavaScript engine in the browser localhost means on the client computer. That's why it always failed. So I changed the configuration to use my official domain name everywhere and got working.

At least to some extend. There is still an issue as it zooms in to the highest level of detail right with the first click on the map - not step by step as I see it for the other mentioned websites. But I guess this is because Indicia does not come with a grid layer for Germany by default. In IForm settings I have set GRID REFERENCE SYSTEMS to "GPS Latitude and Longitude (WGS84)". Any advice on how to add a proper grid for Germany, Switzerland and Austria would be great!

Sebastian

6

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi Sebastian,

Is this module helpful to you https://indicia-docs.readthedocs.io/en/ … f-mtb.html ?

To use it you would have to enable it on the warehouse in the file application/config/config.php and enable it in your Drupal site at the url /admin/config/iform/settings in the 'List of spatial or grid reference systems'

Jim Bacon.

7 (edited by Sebastian 30-01-2018 23:53:23)

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi Jim,

again you pointed me just the right way. Thanks!

Though I still haven't worked it all out quite nicely. Added the module to the warehouse config and then added 4314 to the 'List of spatial or grid reference systems' (text field as it didn't show up as checkbox like the others). Now When I click on the map, let's say Berlin, I get "13, 53" in the spatial reference text field. To me this seems like the reverse but shortenedf WGS84 value (e.g. 52.50459N 13.44321E). Not really the german Messtischblatt. Is there a nice way to debug those modules to see if I actually run the correct module? I looked through the code (modules/sref_mtb/) but couldn't find a match to what I saw on the website.

As well, when clicking the map it does not zoom in to the next level like it does using the British National Grid on the U.K. area. Possibly this is something that I'd need to implement for Germany.

Sebastian

8

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi Sebastian (and Jim),

Sebastian, I am independent Indicia developer who does quite a lot of work with BRC (so I know Jim already).

I just wanted stick my nose in to say I am doing a project which uses German TK25 (MTB) system at the moment. I will hopefully getting a data entry form ready in the next day or so, so I will might be fixing issues with the MTB.
So if you think your problems are going to take a long time to fix, you might want to hold off.
Obviously as I haven’t looked into it yet, if Jim can offer you a simple fix first then go with that.
I should at least be able tell you if it is working for me.

Andrew van Breda

9 (edited by Andrew van Breda 01-02-2018 22:29:38)

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi,

I setup my machine, and got the same issue following your steps.
So I just took a look inside the module code. Instead of typing 4314 into the box on the settings page, try typing
mtbqqq
or
mtbqyx

I have never used MTB before, so I am not actually sure what the format should look like, but zooming into Hamburg and clicking on it gives a format like 2425/423
Let me know if this is not correct.

I don't seem to have any issues with zooming, it should zoom in the same was as it does for British National Grid, with a double click.
If the navigation tool icon is available in the top right of the map, make sure this is selected first.
Having said that, I think you probably have done this all OK, as the zoom wouldn't of worked on British National Grid either.

Hope this helps.

Andy

10

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi,

Something I didn't notice last night, saving is actually throwing an error which I will need to work out a solution for. I would be interested to know if the spatial reference format is at least ok?

11

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Further note, looks like if you use the mtbqqq option it works fine.
mtbqyx seems to only work until save.

12

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi Andrew,

great to hear that you are working on the MTB as well. Sorry for my late reply but I am mostly able to work on this project on the weekend.

I am not an expert on MTB yet so I don't know the format of the output. 2425 for Hamburg seems correct. You can even find historical maps of that on the web - sorry it's in German but I am sure the picture speaks for itself.
I couldn't find a reference to where the figures are explained but clicking on the map I think I figured out what the numbers behind the slash mean. I attached a picture with how the sub squares are arranged.

Andrew wrote:

I don't seem to have any issues with zooming, it should zoom in the same was as it does for British National Grid, with a double click.

What I meant is that when you look at how the map works on http://www.bioliv.co.uk/?q=record/sighting for example:

  • First difference I see is that when you move the mouse over the map without clicking you see a square marking (greyish background, orange border) that moves with the mouse.

  • Clicking on the map (single not double click!!) it zooms in one step, paints a bigger orangy square on the map and prints a hint above the map (e.g. "1km square selected. Please click on the map again to provide a more accurate location.")

  • When you get to the highest zoom level (all with single clicks) it tells you "Excellent! 10m square selected. ..."

Thanks for pointing out to use "mtbqqq" (instead of "4314") in the settings. I kind of like how the BNG single click zoom works but on the other hand using "mtbqqq" is just as handy (zoom by double click or scroll wheel). Though having those hints would be nice I reckon.

Having played with this for a bit I now see two problems with the British National Grid and MTB which I was not aware of until now - not in general but in my case:

  • Although MTB has subsections (like the mentioned 2425/423) those are still way to inaccurate for my use case - I'll need to stick to WGS84 although the automatic zooming with that is horrible from my point of view, need to fix that.

  • When zooming into the BNG map by single clicks it seems to remember the zoom level and if you zoom out again manually and then single click to the map again it jumps right in. Not very nice.

Thanks again! Hope some of what I say makes sense and might be of help to you too.

Sebastian

Post's attachments

mtb.jpg 32.48 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

13

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Sebastian wrote:

I'll need to stick to WGS84 although the automatic zooming with that is horrible from my point of view, need to fix that.

My own fault as I still had options (helpToPickPrecisionMin, helpToPickPrecisionMax and helpToPickPrecisionSwitchAt) set for the map...

14

Re: Updating changes made in Warehouse to Drupal Indicia IForm and more...

Hi Sebastian,

I checked on my own machine, indeed it is the helpToPickPrecision that causes the behaviours that you describe such as the single-clicking and the help.
I have used these options before, but never really paid attention to the number of clicks.
I can confirm it doesn’t seem to work for MTB either.
I have a map page on my machine with both systems running. When British National Grid is selected, the precision hints work, but when MTB is selected it doesn’t (even after a random play with the options)
I had a quick look in the code, and I couldn’t see any code comments saying this code is linked to particular spatial references system, but seeing as it is checking precisions this probably isn’t surprising.
Again having a quick look at the code, there was nothing that screamed at me that it would be a super easy 5 min job (otherwise I would have fixed it).
I wouldn’t like to say how difficult it would be to get working, it might be quite easy or very difficult, it is just one of those things where you can’t tell until a fix is attempted.

Thanks for the information regarding MTB, this will definitely be useful to know for my project as this is the first time I will be using MTB so all knowledge is good!

Andy