GCWizard icon indicating copy to clipboard operation
GCWizard copied to clipboard

Coordinate Parse: Convertion will be done twice

Open S-Man42 opened this issue 3 years ago • 5 comments

Example:

OpenLocationCode.parse(input)

calls parseOpenLocationCode -> calls openLocationCodeToLatLon just for parsing.

Then it must be converted to LatLng with

OpenLocationCode.toLatLng

which calls openLocationCodeToLatLng for the second time...

Needs enhancement!

S-Man42 avatar Jun 30 '21 12:06 S-Man42

I don't see a real problem or alternative. With parse only the text (input) is accepted. With openLocationCodeToLatLon it is then checked whether valid coordinates can really be determined from this text. If not, null is returned.

Mike-3 avatar Jul 05 '21 16:07 Mike-3

Doesnt it makes sense, if on parsing a valid coord appears, to store it in the object. So it can be used later in toLatLon

S-Man42 avatar Jul 05 '21 17:07 S-Man42

But then with this format (and with others) we would have to store 2 data and keep them synchronized. The original text and LatLng. The original input should also be retained. I don't think it's useful or necessary.

Mike-3 avatar Jul 05 '21 17:07 Mike-3

hm... i don't like it. But it's not high priority. Let's pospone it...

S-Man42 avatar Jul 05 '21 17:07 S-Man42

Even worse: Parsing takes on place ever widget change I learned yesterday

S-Man42 avatar Sep 08 '22 07:09 S-Man42