OpenBeta / openbeta-graphql

The open source rock climbing API
https://openbeta.io
GNU Affero General Public License v3.0
41 stars 32 forks source link

feat: crag exporter job #379

Closed vnugent closed 10 months ago

vnugent commented 10 months ago

Issue #377

The job exports 2 files, crags.geojson and crag-groups.geojson which can be imported to mapbox studio.

sample crags.geojson

 {
      "type": "Feature",
      "properties": {
        "id": "9df915b3-bad9-5812-96b6-31cae743b668",
        "name": "Uncle Blobulus Boulder",
        "type": "crag",
        "parent": {
          "id": "232594e3-e759-5f77-aba7-132cc4c18a72",
          "name": "Canals"
        }
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          -105.88649,
          40.66144
        ]
      }
    }

sample crag-groups.geojson

 {
      "type": "Feature",
      "properties": {
        "type": "crag-group",
        "name": "Owl Rock Bouldering",
        "id": "117b2d2f-7e70-5b86-866f-70220ad7be81",
        "children": [
          {
            "id": "209312ee-d159-5a43-af8e-d6044a7406c9",
            "name": "Songbird Boulder",
            "lr": -1
          },
          {
            "id": "9c800aab-d854-55a4-aae3-a4cba9199d2b",
            "name": "Nest Boulder, The",
            "lr": -1
          }
        ]
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -113.72915589318451,
              42.08515033981814
            ],
            [
              -113.72947589710017,
              42.08556033981814
            ],
            [
              -113.72947589710017,
              42.086459660181866
            ],
            [
              -113.72826410289984,
              42.086459660181866
            ],
            [
              -113.7279441068155,
              42.086049660181864
            ],
            [
              -113.7279441068155,
              42.08515033981814
            ],
            [
              -113.72915589318451,
              42.08515033981814
            ]
          ]
        ],
        "_id": "65a33edfb8deb5f800150831"
      }
    }

Screenshot 2024-01-13 at 7 38 17 PM