You are viewing limited content. For full access, please sign in.

Discussion

Discussion

BUG: Geolocation Latitude / Longitude Input Fields Rounding (WORKAROUND)

posted on August 12, 2020

Using Laserfiche Forms Professional 10.4.444 I noticed that when a longitude and latitude value of more than 15 digits was entered they were automatically rounded either up or down.

Due to the precision of this type of data I strongly feel that this should not be happening and will distort location points.

Steps to reproduce the problem:

  1. Place a Geolocation component onto a form
  2. Edit the Geolocation component and check "Specify coordinates"
  3. Preview the form and put the following values in the Latitude and Longitude input boxes:

    45.525522934555745, -122.72527460439186
     
  4. Once entered the form will convert them to the following:

    45.5255229345557,-122.725274604392

 

I was able to create a workaround by adding the following code in the JavaScript section of the form:

 

LF.number.defaultPrecision = 20;

 

1 0
replied on August 13, 2020

Using JavaScript will only change the precision restriction in the front end, the value submitted will become 15 digits as there is backend restriction as well.

Forms uses 15 digits for geolocation as with such precision there will be at least 12 decimal places and 8 decimal places represents 1 mm at distance (https://en.wikipedia.org/wiki/Decimal_degrees#Precision).

1 0
replied on August 14, 2020

Thank you Xiuhong for the reply. My concern is mostly that it’s rounding the coordinate after the restriction.

replied on August 14, 2020

Thank you Xiuhong for the reply. My concern is mostly that it’s rounding the coordinate after the restriction.

0 0
replied on August 16, 2020 Show version history

Can you share from which other application you get the Latitude/Longitude value with more than 15 digits? We want to check the use case. For browser such as Chrome, the current location returned only has 7 digits. 

0 0
replied on August 17, 2020

Xiuhong,

I noticed the issue when I was working on a solution to the following post (https://answers.laserfiche.com/questions/164930/Limit-Geolocation-Values#177267 ). If I were to manually/programmatically populate the Geolocation Longitude and Latitude boxes (Specify coordinates checked) with -122.72527460439186, 45.525522934555745 then finding the edge of the polygon would fail because forms would automatically round the value.

Trust me, I am not concerned whether or not someone wants a location down to the size of an atom but more so with the rounding of these fields along with the size restriction as I may want to use this type of field with my own or custom coordinate system.

 

Thanks!

Wesley Funderberg

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.