ajstarks / deck

A Go Package for generation of slide decks and information displays
Other
300 stars 21 forks source link

Maps #14

Closed gedw99 closed 2 years ago

gedw99 commented 2 years ago

Been talking to the science users and one thing that is coming up is the ability to have basic poly line style maps at the global , country , city level .

The use case is that often they have csv data that relates to locations. For example Covid by geography.

Often they combine it with dcharts so that the end user can see the data via a bar chart ( or other ) and a map.

In the map there are a few ways they display the data representation:

Country poly line is filled with a colour that relates back to a legend.

Circle ( filled in ) in the centre of the country or state or city. The size ( and perhaps colour ) of the circle represents the quantity that relates back to a legend ( if also using colour ).

I was doing a little bit of research and it seems geojson is popular as a data format to describe maps so that might be a good data source.

I don’t know if this should be part of dcharts but I suspect it’s the right area.

Decksh could then compose a map chart and other charts ? I am presuming that decksh can make calls to the dcharts package to output deck markup, but have not checked.

There is another related requirement with this that I might as well bring up here. They are finding that sonetines they need to have the chart zoomable.

For example in a map you might want to zoom and pan. Or to click on a country and to then see the map chart for that country should the map chart of the states of that country. Then in a state the cities etc. Presume that the user can go back out also.

in addition when composing using decksh they would want to be able to layout slides with each country map on each slide. So to me the zoom feature is perhaps u der the hood in actual fact just navigating to different slides !! It would mean adding the ability to navigate decks via sone sort of data driven meta.

In a heat map chart ( do we even have these ) they want to click an area and god to the next level , and also go back out.

I know there are many different things to what I described above. I wanted to show a reasonable expansive use case to show all the aspects so that the technical aspects can be dissected out of the epic use case.

there may be a need in general for routing for example not just for maps but in general.

ajstarks commented 2 years ago

Note that I recently added polylines to deck and decksh, so rendering geo data works. For example, to make this:

image

I converted geo data to polylines. (previously the code used polygons, which share the same syntax).

Yes, the markup for charts and maps are ultimately the same format so they can be mixed as needed. You can use whatever tool you use to navigate slides (like a PDF reader) to manage the inteaction.

ajstarks commented 2 years ago

see: https://github.com/ajstarks/kml for a program to convert KML files to deck markup: image

gedw99 commented 2 years ago

Thank @ajstarks for the rapid response !!

i had a quick look on my mobile at the KML repo. It as always looks nice and simple to use - thanks.

i guess users can download KML data from Google Earth , as I presume KML is google invented format?

i am thinking that because the users only need the Country, state, City level that I can download Al if it and store it , so that I users don’t need to use Google Earth. In which case I would index the data to allow them to call up at runtime what geographical area they want.

I am away in the forest on holidays so will pick this up next week. Again Thankyou for the km/h repo !

i will work it up from that basis and publsh on a repo. I wil need to layer more stuff on top to make it very easy for them to do it.

Also if there is any movement on the quasi IDE let me know as I plan to work that up when I am back also.

ajstarks commented 2 years ago

Note that KML is a standard: https://www.ogc.org/standards/kml/.
My program may evolve as there are more extensive packages like:

Also note the source of the data in the repo is from the US Census: https://www.census.gov/geographies/mapping-files/time-series/geo/kml-cartographic-boundary-files.html

gedw99 commented 2 years ago

Thanks @ajstarks

The 2nd package looks really cool cause it does 3d calculations. The biomimicry people are talking about using map data with elevation to help visualise where at an XYZ plants etc are located in what proportions. Showing this on a 2d map with contour lines to represent the Z height is one of the other things I am cooking up. In that case I would then overlay circles to represent the centroid and colour to represent quantity.

Another science group want to represent Carbon Sequestration and Methane leaks. That data comes from NASA, EU satellites using spectral analysis. In that case I would be using the spectral data , converting to deck poly lines with colour to represent quantity. I would probably also add the actual spectral bitmap colour data as a layer they can toggle on and off. I know deck does not have layers or interactivity built in but I can built a higher lever package on top to do it I expect.

Later I might try to do isometric views from the 3d map data with deck rendering it. The circles that represent location and quantity would then be projected into the isometric view. Interaction would probably be some sort of zoom and Orbit Tool written on top of Deck.

I was thinking about how best to make interaction part of decksh so that the users themselves can add these are other types of interactions, instead of me hard coding it with golang on top of Deck. I think it’s best i make an issue to explain the approach though

ajstarks commented 2 years ago

KML is now a package: https://github.com/ajstarks/kml

gedw99 commented 2 years ago

thanks !!!