whosonfirst / go-whosonfirst-export

Go package for exporting Who's On First documents.
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Difference with py-mapzen-whosonfirst-export #7

Open Joxit opened 4 years ago

Joxit commented 4 years ago

Hi there,

I know that this repository is experimental, I have a question for the export methods. I see a difference between the python version and go, it's the precision of the geometries. Is this a mandatory transformation when working on WOF documents? Or this project is now good enough ?

Python 2 will soon be deprecated, this may be an opportunity to finalize this project by the way. :)

Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.

thisisaaronland commented 4 years ago

It's difficult to say with confidence that the Go tooling is ready to replace, or sit next to, the Python bindings.

It is currently being tested in the update branch of the go-whosonfirst-browser tool and it seems to working well:

If you've had any experiences, good or bad, testing the Go bindings we'd love to hear about them.

The EOL of Python 2.7 is not ideal but it's done and we'll start the migration process soon enough.

Joxit commented 4 years ago

Thank you for your answer, ok so if I do some contributions, it will be still with the python version for now.

I minified a wof document and then I played to Spot the difference between go and python exporter and here are what I found :

  1. No precision reduction on coordinates
  2. No use of utf-8 hexa codes
  3. Extra space after the colon
  4. 2 spaces instead of 4 for the indentation
  5. Sometime an extra space at the end of the line

Example for 2, 3, 4

-    "name:jpn_x_preferred":[
-        "\u30a2\u30f3\u30c6\u30a3\u30fc\u30d6"
+    "name:jpn_x_preferred": [
+      "アンティーブ"
    ],

Example for 1 and 5

  "bbox": [
-    7.064374,
-    43.54155,
-    7.145075,
-    43.622545
+    7.06437411574864, 
+    43.54155041682094, 
+    7.14507537244949, 
+    43.62254464156442
]

In fact, I'm working on a WOF command line aggregator to make easy my work with WOF documents. This add bash completion with some features for export (for example export all git stagged files or all files of a specific commit, I used this for whosonfirst-data/whosonfirst-data-admin-fr#17).

thisisaaronland commented 4 years ago

That's super helpful!

It's probably time to put together a reference document that

  1. Makes explicit encoding decisions (for example I think we decided decimal precision would be capped at 13 points but could be less).
  2. Language bindings can consult and test against.

(cc @nvkelso @stepps00 @tomtaylor)

For the time being I've filed the following issues:

(Also, yay Rust tools!)

thisisaaronland commented 4 years ago

I have started an issues specific to the topic of formalizing how WOF (GeoJSON) documents are marshaled over here:

https://github.com/whosonfirst/whosonfirst-cookbook/issues/35

Please weigh in with comments, suggestions and #feelings.

Joxit commented 4 years ago

Hey! Thank you for all your thread on cookbook !

(Yeah, one more language in the list of WOF tools :stuck_out_tongue:)