Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Edgar Gonzalez
    @edgar
    👋 Hi here
    Is there a way how to specify media (photos, videos, links) in the geojson file?
    hotzeplotz
    @hotzeplotz
    hi, and welcome - it's still quite empty here at the moment - just getting started on Gitter!
    reading media metadata from a Pattrn instance's GeoJSON file is not an available feature: Pattrn v1 used to use JSON-formatted metadata in cells of a Google Sheet, and we haven't targeted media specifically for Pattrn v2, but we did run a demo instance during the v2 development cycle with some media attached
    i will check out that demo and document the way this can be done with Pattrn v2; if you are able to share your specific use case (especially whether you need to associate multiple media items to each event) i can try to also give some ad-hoc input
    Edgar Gonzalez
    @edgar
    Sure, I'm thinking on use pattrn to document/track the repression and violence that are happening in Venezuela, I was thinking on showing pictures from social media, YouTube videos and links to posts/articles as a way to provide context for each event
    hotzeplotz
    @hotzeplotz
    @edgar i am having a look at the demo instance i mentioned earlier and i realise my memory was tricking me: photo and video metadata is indeed embedded in the GeoJSON file. i did implement media management very quickly specifically for this demo during the Pattrn v2 development cycle so there may be some rough edges, but i should be able to update the documentation (and publish the Pattrn data package used in the demo instance) so that you can have a look and use that as a starting point for your own project
    the demo itself is live here: https://busra.platform.pattrn.co/ - though this is using an earlier version of the Pattrn v2 code, which doesn't have some features introduced later on last year
    Edgar Gonzalez
    @edgar
    Great! btw what do you think about using JSON schemas for the pattrn format?
    hotzeplotz
    @hotzeplotz
    a couple of questions - are you building the GeoJSON file yourself (e.g. via some scripts) or are you getting this ready-made from an external source? and will you need to update the data "live" or do you envisage adding data offline as needed, "build" the GeoJSON file for your instance and deploy the updated code/data bundle?
    Edgar Gonzalez
    @edgar
    My plan is for now allow journalist to load data in some shared documents, and I'll download as csv and run an script that generates the geojson file and deploy
    my concern with connecting pattrn to google sheets directly is that the internet speed in Venezuela is very bad
    I'd prefer to have the data "next" to the code. makes sense?
    hotzeplotz
    @hotzeplotz
    JSON Schemas - yes, that makes total sense: i thought about it during the v2 dev cycle but simply didn't have enough time to prioritise that. it would be interesting to hear about use cases (e.g. if people use data management tools that use JSON Schema directly) in order to target a first iteration of this feature towards real users
    yes, i do prefer to bundle data and code together too, also because of performance reasons and so that we don't have to depend on Google's TOS
    i asked about your workflow because if you do run data through your own build scripts it's much easier to handle things offline (i normally use a combination of R and Python) as compared to things that come "live" on the wire in formats on which we may have little control
    i can share the full build scripts for the demo instance linked above and you can hopefully use that as a starting point
    the example is quite specific to the shape and quirks of the raw data i had for that demo/workshop, but you should be able to see what's going on
    Edgar Gonzalez
    @edgar
    I'm more a Ruby guy but sure, thanks! if you can share with me the geojson format to support the media I can start working on that. I want to create a prototype first (with hardcoded/dummy data) to get journalist engaged
    hotzeplotz
    @hotzeplotz
    it's really very basic stuff, iterating through lists and producing JSON output, so any tooling will do really
    the GeoJSON for the demo instance is here, if you want to start having a look: https://busra.platform.pattrn.co/data/unesco-bosra/data.geojson
    Edgar Gonzalez
    @edgar
    thanks!
    hotzeplotz
    @hotzeplotz
    you will see that some of the features have a "photos" and/or "videos" arrays of objects within their GeoJSON properties, which is where the media metadata is read from. we didn't use links to web pages/articles and i can't remember if that sub-feature was updated from the Pattrn v1 codebase, but i'll have a look
    Edgar Gonzalez
    @edgar
    (sure that I'll bother you again)
    hotzeplotz
    @hotzeplotz
    @edgar i did some tests today and realised that the code for media items in Pattrn v2 is actually missing the code path that handles media items in GeoJSON datasets - it turns out i hadn't merged this from an earlier version, so i just did that. not pushed to GitHub yet as i haven't got time to double check everything, but i'll ping you once this is available
    in the meanwhile, you can add video and photo metadata as features of your GeoJSON dataset if you wish, sticking to a format similar to what you could see in the GeoJSON dataset of the demo instance i linked above yesterday (https://busra.platform.pattrn.co/data/unesco-bosra/data.geojson)
    and these features will be picked up by the updated Pattrn code (a small change to the metadata.yaml or metadata.json file for the instance is needed - i will add documentation for this)
    apologies, i meant properties, not features, of course
    basically a feature's property for photos will look like this:
    [
      {
        "source": "UNESCO",
        "src": "/data/unesco-bosra/media/photos/0010/0001.jpg",
        "subhtml": "Pas de dégâts apparents sur le cliché oblique diffusé par la nouvelle Direction des Antiquités de Bosra.",
        "thumb": "/data/unesco-bosra/media/photos/0010/0001.jpg",
        "caption": "Pas de dégâts apparents sur le cliché oblique diffusé par la nouvelle Direction des Antiquités de Bosra."
      }
    ]
    hotzeplotz
    @hotzeplotz
    it's an array so you can add as many as you need (within reason of course - if you have more than around 10 in my opinion the UX will not be very effective)
    similarly for the property for videos:
    [
      {
        "source": "UNESCO",
        "src": "https://www.youtube.com/watch?v=-Yyz4wKmcQY",
        "subhtml": "état des lieux en mars 2013.",
        "thumb": "https://i.ytimg.com/vi/-Yyz4wKmcQY/hqdefault.jpg",
        "caption": "état des lieux en mars 2013."
      }
    ]
    this is an array too, as above