Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabular data view added, see https://github.com/tyrasd/overpass-ide/issues/8 #18

Closed
wants to merge 10 commits into from

Conversation

jongleur1983
Copy link

Not beautiful yet - detailed css is missing, and with lot's of ideas to extend further, but working, and basically solving the issue #8.

As a side node I changed the view buttons (Map, Data) functionality to easily support more than two tabs
(I added a third one for the table), and slightly generalized the css code.

Not very nice yet and with lot's of options to expand, but possible.

As a side node I changed the view buttons (Map, Data) functionality to easily support more than two buttons
(I added a third one for the table)
@tyrasd
Copy link
Owner

tyrasd commented Jul 30, 2013

Thanks for the work! But I see two major drawbacks:

  1. I don't think that it makes much sense to show each and every node in the table. As in the map view, untagged way-nodes shouldn't show up, because they only define the geometry of their parent way and are otherwise uninteresting.
  2. The table should also contain some geometry information. Probably, a geometry column containing WKT, or at least lat/lon columns for POIs.

So, maybe it would be better to do the data-to-table conversion based on the already produced GeoJSON (see onGeoJsonReady and overpass.geojson).

Also, for better usability I think it would be better to use some third-party "sortable js table". Maybe jQuery(UI) has something to offer.

@sabas
Copy link

sabas commented Aug 12, 2013

Tabular data would be a nice addition! (as a note, I searched to answer a person who asked for this kind of feature :-) ).

For the third party plugin, I'd suggest http://datatables.net/ which loads either from html or from json.

@jongleur1983
Copy link
Author

Unfortunately datatables as well as all other jquery table plugins that read json/javascript objects require these Objects to be array as a direct mapping.
Thus if we have overall tags of the keys highway, name and source, you would have to build a 3-column-array with a row per object, containing all three cells, like

[
 ["residential", "Main Street", "Bing Aerial Imagery"],
 ["primary", null, null],
 ["secondary", null, "Yahoo"]
]

Generating this requires assembling another javascript object. What the overpass-ide currently maintains as far as I saw is a more sparse json-object, like (to stay at the example above):

[
 { highway="residential", name="Main Street", source="Bing Aerial Imagery" },
 { highway="primary"},
 { highway="secondary", source="Yahoo"}
]

I did not yet find a jquery plugin that would be able to define the table by attributes of such objects or that could read this object.

@sabas
Copy link

sabas commented Aug 12, 2013

Here's a dump for a simple point

[{id: 1585013815
lat: 44.402411
lon: 8.9480538
tags: {amenity:kindergarten, name:Asilo Infantile Borgopila}
amenity: "kindergarten"
name: "Asilo Infantile Borgopila"
type: "node"}]

A way returns an array of node ids inside the object, and for each node an object like this one provided..
So some sort of translation must happen... In your commit you generate html table, datatables read also html..

What about https://github.com/mapbox/geojson.io ?
It has a similar feature but no sorting.

@jongleur1983
Copy link
Author

worked on my patch today, but it's not finished yet.
Current state:

  • datatable plugin is used for sorting and paging
  • fixed bugs at reload (which broke the table)
  • renamed the fixed columns (id, type, geo) to id, type and geo to hopefully avoid conflicts with osm attributes.
  • show all tags as columns. columns are ordered by the number of objects carrying the corresponding tags. (so if all objects have a highway tag, most have a name, some a source and one a note, then that's the column order)
  • restricted column width to a fixed value and added tooltips to the columns.

Todo before I want to offer the patch again:

  • there should be no tooltip if the content fits to the cell (currently all cells have the tooltip)
  • alternating row colors

additional ideas IMHO to be in some later patch/extension:

  • filtering data
  • customizing columns (width, order, hide columns)

@tyrasd
Copy link
Owner

tyrasd commented Aug 16, 2013

Hey guys! This is awesome.

  • datatables looks very promising, thanks @sabas!
  • I know there could be a memory usage issue in some cases, but I'd guess that for the typical use case it shouldn't matter too much. In worst case, we could always delay the table-creation to the time the user actually activates the tab.
  • @jongleur1983: can you update this pull request with your latest code? I'd love to see it. ;)

- showing all attributes, ordered by number of objects carrying the tag
- avoid conflict between id and the tag id as well as between type and the tag type and geometry and the tag geometry
- show tooltips on the cells. TODO: only show them were content is hidden due to the overflow property
@jongleur1983
Copy link
Author

worked on the first todo, but not finished yet, so please ignore the lots of debug stuff in the console (which is a lot, I know)
There are still bugs I know about (see commit message)

@saerdnaer
Copy link

Hi, what's the current state of this idea?

@jongleur1983
Copy link
Author

Hi saerdner,
current state is as it is here, don't have the time to push it to final stage, currently during my master thesis. If you want, feel free to join the work; I'm happy to help where I can.

The current state is that there is a data table showing all entries of the last download.
It tries to filter these to meaningful entries from the query, currently (which does not include entries pulled for recursion/display, e.g. untagged nodes that are pulled for being used in ways returned by the query), but that's one of the issues that's a little bit difficult: How to decide that?

I think filtering in tables does not yet work, sorting is slightly too simple (not good at dealing with empty values, not dealing well with numeric values like housenumbers).

I think it's in a state where it might be included in the application as an experimental feature, but it's not finished and could be improved further before.

@saerdnaer
Copy link

Ah, I totally missed the "demo" at https://jongleur1983.github.io/overpass-ide/

I had to use Firefox, as Chrome didn't allow me to ignore all the "unsave" scripts referenced via http instead of https. But https://tyrasd.github.io/overpass-ide/ has the same problems.

Regarding joining the work: I have the same "problem": My master thesis waits to be done. But maybe it might be nice relief... ;-)

@mmd-osm
Copy link
Contributor

mmd-osm commented Jul 16, 2016

Demo only works with http at this time: http://jongleur1983.github.io/overpass-ide/

sc3

@bjohas
Copy link

bjohas commented Jul 16, 2016

This is great - thanks. It would be amazing is if there were links added, e.g. as three small icons at the start of each row, to:
Osm (view)
Osm (edit)
Josm remote control.

This would allow editing the data as needed. Similar to the normal map output that has link to osm, and also similar to what osmose does.

@bjohas
Copy link

bjohas commented Jul 16, 2016

It seems the 'table' view does not show relations - would be great if it did!

@bjohas
Copy link

bjohas commented Jul 16, 2016

Some more thoughts:

I'd say it was important to:

  • show relations
  • have more than 100 entries - there should be an "all" option.

Nice to have:

  • It could be nice be great if you could control the order of certain fields, to put whatever fields deemed important first. This could use the [csv:("name","ref")] syntax.
  • It would also be great if there was a 'download' button at the bottom, that downloaded the raw data.

Overall, this looks really great though! Thanks for working on this!

@mmd-osm
Copy link
Contributor

mmd-osm commented Jul 17, 2016

@bjohas : before getting too excited over the demo, please keep in mind that this pull request is almost 3 years old. I guess those involved might have other priorities right now (maybe I'm wrong here).

There's some great opportunity to get this prototype ready for inclusion. If you're interested, you should probably sync up with @tyrasd.

@jongleur1983
Copy link
Author

Hi.
I started this pull request, but you're right, it's slightly out of my scope currently.
I'm happy about the interest and any possible progress it get's again now, but I have no idea if and when I'll have time to work on it again, especially as I didn't do much in Javascript in the last months.

So if anybody else want's to help, feel free to start.

@bjohas
Copy link

bjohas commented Jul 18, 2016

Thanks for the feedback!

Do you think it may be worth sending a message to the dev list, seeing whether anybody else is interested?

@jongleur1983
Copy link
Author

no idea, not sure. I didn't even know there's a dev list for overpass turbo, I prefer following github issues directly usually, but why not?

@bjohas
Copy link

bjohas commented Jul 27, 2016

I've forked @jongleur1983 's version, and merged it with upstream, see https://github.com/bjohas/overpass-ide/commits/gh-pages. I need to do a fair bit more testing, but it seems to work so far.

@jongleur1983
Copy link
Author

cool, thanks.

@d1g
Copy link

d1g commented Nov 6, 2016

Based on what I seen in

http://jongleur1983.github.io/overpass-ide/

    1. "add column" and "remove column" controls can be moved below the table (i.e. inactive area)
  • 1a. "remove column" controls can be removed afterwards
    1. Show "10" entries control can be merged within "Showing 1 to 10 of 72 entries" text
    1. next/previous page controls should be bigger
    1. I want possibility to pageup/pagedown them using keyboard (or CTRL + left/right)
    1. 25 lines should be default (not 10)
    1. there should be visible link to "download csv" (in order to use more comprehensive CSV tools)
    1. "Table" can be renamed to CSV, older tab "Data" to "OSM XML"

@saerdnaer
Copy link

saerdnaer commented Nov 9, 2016

"Table" can be renamed to CSV, older tab "Data" to "OSM XML"

The data tab might also show OSM JSON, depending on the query.

@tyrasd tyrasd closed this May 4, 2017
@mmd-osm
Copy link
Contributor

mmd-osm commented May 5, 2017

Hmm... what happened to this one? Stale, obsolete?

@bjohas
Copy link

bjohas commented May 5, 2017

I'm still very interested in this. Happy to help out in some way.

@d1g
Copy link

d1g commented May 5, 2017

I think that the best read-only option is to export to csv

Then we would have many solutions e.g.: http://nicolas.kruchten.com/pivottable/examples/index.html

@bjohas
Copy link

bjohas commented May 5, 2017

A webservice would still be good, to allow linking directly from overpass-turbo. It could be built outside of overpass-turbo, as an independent service (though it would require a separate API query). However, for fast inspection, something sits within overpass-turbo (and allows queries to made, adjusted etc) could be helpful.

@tyrasd
Copy link
Owner

tyrasd commented May 5, 2017

Stale

Yeah. Since we already have a dedicated feature-request ticket for this, I think it makes sense continue discussions there: #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants