whosonfirst / whosonfirst-www-spelunker

A simple Flask-based spelunker for poking around Who's On First data
BSD 3-Clause "New" or "Revised" License
7 stars 9 forks source link

Add download option for simple attributes #91

Closed nvkelso closed 7 years ago

nvkelso commented 7 years ago

In the command line wof-csv-to-feature-collection script we allow either "all" original WOF properties with all their nesting (the default in the Spelunker download now), or a simpler "editor" template that has far fewer properties that are easy to work with in an editor like QGIS.

We should add a property template option to the download option to enable the same functionality. This would be useful for Mapzen's own workflow for editing neighbourhoods, and many other people don't need to parse thru a 100 empty name fields, either.

See:

Specifically instead of 100s of columns the editor template only has:

And if it's a neighbourhood placetype it also adds:

thisisaaronland commented 7 years ago

@dphiffer - this should be relatively straightforward to implement (client-side) assuming we can fetch the aliases files directly from here: https://github.com/whosonfirst/whosonfirst-properties/tree/master/aliases because blah blah blah CORS blah blah blah.

dphiffer commented 7 years ago

I am looking into this now. I'll add a new JSON alias file to whosonfirst-properties and a Makefile target to update a local copy in the Spelunker. I don't think we should use the existing one, since it maps simple-to-complex (name turns into wof:name) rather than the reverse (wof:name into name).

dphiffer commented 7 years ago

Okay I have this up and running on https://whosonfirst.dev.mapzen.com/spelunker/

Let me know if it looks okay...

dphiffer commented 7 years ago

^ @nvkelso @thisisaaronland

nvkelso commented 7 years ago

Nice! It's working great for me, thank you :)

nvkelso commented 7 years ago

Some comparisons:

GeoJSON gets almost 50% smaller

screen shot 2017-07-06 at 11 07 48

Shapefile DBF shows larger win as null props take up more DBF space:

screen shot 2017-07-06 at 11 08 31