Re: [Wikidata-tech] Globe coordinates precision question (technical)

2015-01-13 Thread Markus Krötzsch

Hi Thiemo,

Thanks for the background information. I agree with these default 
choices -- seems useful. Just two comments:



There may be an option to enter the precision as a number, if requested,
but I don't think this is necessary at this point.


I think the point is simply that it is not nice to have a wiki system 
where some (useful) edits can not be made by normal people but only by 
developers.


...

We currently have null values in the database. I tend to think of them
as not yet entered. I'm not sure if we should reject this at any
point, I prefer to apply the auto-detection instead (so the answer is,
again, neither nor).


The problem is that auto-detection cannot be applied to the JSON data, 
because the values there are double numbers. Auto-detection would 
require the user input (decimal number string) to work. Therefore, we 
now default to 1.0/3600 when seeing null precisions in the data.


Cheers,

Markus

___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Globe coordinates precision question (technical)

2015-01-13 Thread Thiemo Mättig
Hi Markus,

 (1a) Wikibase will continue to support arbitrary precision values for
coordinates, and the UI will be extended so people can actually enter them.
 (1b) Wikibase will restrict the set of supported precision values for
coordinates to those already supported in the UI. Other values are
considered an error that will have to be fixed in the future.

In my opinion, possibly neither nor, with a tendency towards (a). Currently
the API accepts any number (which makes sense in my opinion, how should the
API provide a set of allowed precisions and why and how should it reject
certain numbers?). The UI supports an auto-detection and a selection of
predefined precisions, which is much easier to use. There may be an option
to enter the precision as a number, if requested, but I don't think this is
necessary at this point.

I recently introduced limits of 0.0001° (8 decimal places) and
00°00'00.01 to the precision auto-detection to work around IEEE rounding
issues (which happens both in- and externally). Both limits are equivalent
to approximately 1 mm which should be enough for anybody(tm).

There are not really hard limits when using the API. What is entered is
stored, which is how it should be in my opinion.

There is a hard limit of 1 in the formatters. Precisions bigger than 1 are
ignored and default to 1.

Rounding errors and IEEE issues in the precision do not matter. The
formatters calculate the number of significant decimal places from the
precision (which is basically a type of rounding to either a fraction of a
degree, minute or second smaller than the precision, depending on the
output format). When parsing this formatted string the internal IEEE
representation may change, but this possible loss is a one time thing,
does not sum up and is irrelevant for the displayed string and equality
checks (if they are done right).

 (2a) Null values for precision are an error that should be fixed in the
data. Wikibase will reject such data in the future.
 (2b) Null values for precision have a meaning. It is as follows (please
explain): ...

We currently have null values in the database. I tend to think of them as
not yet entered. I'm not sure if we should reject this at any point, I
prefer to apply the auto-detection instead (so the answer is, again,
neither nor).

 this was added only last November.

There always was a fall back to 1/3600° if no precision was given, but that
code was incomplete. If a coordinate with no precision made it to the
database you could not see, edit and fix it. This is possible now. Instead
of applying the auto-detection in the formatter (which would be possible
but may be confusing and inconsistent) the output defaults to the most
common DD°MM'SS (a.k.a. 1/3600°).

There are quite a lot of edge cases. I already fixed a lot of them (and
added tests to make sure they never break) and will happily add and fix
more. Just tell me if you find one.

Best

-- 
Thiemo Mättig
Software-Entwickler

Wikimedia Deutschland e.V. | Tempelhofer Ufer 23-24 | 10963 Berlin
Tel. (030) 219 158 26-0
http://wikimedia.de

Stellen Sie sich eine Welt vor, in der jeder Mensch an der Menge allen
Wissens frei teilhaben kann. Helfen Sie uns dabei!
http://spenden.wikimedia.de/

Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/681/51985.
___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Globe coordinates precision question (technical)

2015-01-12 Thread Markus Krötzsch

On 12.01.2015 15:59, Daniel Kinzler wrote:

Am 12.01.2015 14:48, schrieb Markus Krötzsch:

Anybody? If the answer is we not thought about this yet then it would be good
to know this, too. Any considerations that have led to the current
implementation are of interest.


The range is limited (no extremely large or extremely small percisions), but
inside that range, you can pick any number. The reason is that we need to be
able to support precisions that are given in the actual sources; some sources
give them as fractions of a degree, but some give them in meters or kilometers,
which then must be converted to degrees depending on the location, given very
odd numbers.

As for the range, I think the least precise we support is 1 degree, and the most
precise is 10^-8 degrees, but I can very well be wrong there. I think we agreed
at some point that anything beyond a meter is not useful.

I think it was Maarten Dammers who brought up the need for supporting arbitrary
precision values, not just a fixed set.



Great, this clarifies a lot for me. The other question was what to make 
of null values for precision. Do they mean no precision known or 
something else?


Markus

___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Globe coordinates precision question (technical)

2015-01-12 Thread Daniel Kinzler
Am 12.01.2015 15:09, schrieb Markus Krötzsch:
 Great, this clarifies a lot for me. The other question was what to make of 
 null
 values for precision. Do they mean no precision known or something else?

IIRC, null is a bug here. Not sure how to handle that - we don't have the
original string, and we can't really guess the precision based on the float
values.

Looking at GeoCoordinateFormatter, I see this:

if ( $precision = 0 ) {
$precision = 1 / 3600;
}

I.e. it assumes 1 arc sec if no percision is given. Not great, but not much else
we can do at this point.


-- 
Daniel Kinzler
Senior Software Developer

Wikimedia Deutschland
Gesellschaft zur Förderung Freien Wissens e.V.

___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Globe coordinates precision question (technical)

2015-01-11 Thread Stas Malyshev
Hi!

 Which of the following statements are most accurate given the technical
 roadmap of Wikibase?
 
 (1a) Wikibase will continue to support arbitrary precision values for
 coordinates, and the UI will be extended so people can actually enter them.
 (1b) Wikibase will restrict the set of supported precision values for
 coordinates to those already supported in the UI. Other values are
 considered an error that will have to be fixed in the future.

I'm not in the know about the technical roadmap, but I have a question -
why would arbitrary precision be needed? I.e., 0.01''[1] is a
centimeter-scale resolution. I'm not sure what coordinates can be even
known with such resolution, let alone be needed for anything practical.

[1]
https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Geographical_coordinates#Precision_guidelines


Thanks,
--
Stas Malyshev
smalys...@wikimedia.org

___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech