[Nodeshot] External GeoRSS layer configuration?

Nemesis nemesis at ninux.org
Wed Jun 11 10:43:32 CEST 2014


On 06/11/2014 09:49 AM, Finn Herzfeld wrote:
> Ah, turns out they do output GeoJSON, or something they call GeoJSON,
> I havent verified it too much.
>
> http://map.nycmesh.net/api/all?geojson
>

Unfortunately that is not serializable GeoJSON but it can be fixed easily.

Try this: http://geojsonlint.com/

Report to the devs this issue, we had a similar issue in nodeshot too
and we had to standardize the output so that other applications using
GeoJSON would work out of the box.

> I dropped that URL in and it still complains about lack of configuration.

Yes, there are few config keys that need to be setup.

put this in it:

{
"url": "http://map.nycmesh.net/api/all?geojson",
"map": {}
}

this should pass validation, but it won't work because the output of the
URL is not standard GeoJSON
(yeah, the empty map object is quite ugly.. :D).

To test the importer you can do something easy: copy only what is inside
the "data" key, that's serializable GeoJSON, test it in geojsonlint.com
to be sure it ok, then save it on a file (I did it now as example and I
attached the file nycmeshnet.geojson) and put it on a public server,
then insert the URL of that file in place of map.nycmesh.net/api/ecc.

Once you have all this in place, you should run the command:

*python manage.py synchronize*

It is not still possible to launch this action from the web interface,
but it should be fairly easy to implement so somewhen soon will be
available.

There could be some issues, basically the map object is a map between
keys of the target urls and keys in nodeshot.

I see for example that the GeoJSON issued by nodeatlas has objects like:

        "Contact": "Reddit: shotintoeternity",
        "Details": "Home",
        "OwnerName": "shotintoeternity",
        "PGP": "0000000000000000",
        "Status": 896

"Details" could be mapped to the "name" key in nodeshot.

While "Contact" could be "description".

"Status" is a bit more difficult to map because you should have
corresponding statuses in your database with the same slug as the ones
in the target GeoJSON (in this case a status with slug "896")

If the importer doesn't find a valid corresponding status it will use
the default status (which by default is Potential but you can change it
from the web ui if you need).

The final config JSON should be:

{
     "url": "http://map.nycmesh.net/api/all?geojson",
     "map": {
         "name": "Details",
         "description": "Contact"
    }
}

Federico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ml.ninux.org/pipermail/nodeshot/attachments/20140611/59d5173a/attachment-0001.html>
-------------- next part --------------
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "fc00::",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9823,
          40.6761
        ]
      },
      "properties": {
        "Contact": "meshmaster--at--wynn.com",
        "Details": "supernode 2.4 and 5 Ghz under construction",
        "OwnerName": "wa3yre",
        "PGP": "0000000000000000",
        "Status": 1920
      }
    },
    {
      "type": "Feature",
      "id": "fc00:d117:b9d3:7194:ffff:ffff:ffff:ffff",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9196,
          40.7379
        ]
      },
      "properties": {
        "Contact": "will at fastmail.us (use OTR)",
        "OwnerName": "William",
        "PGP": "0000000000000000",
        "Status": 128
      }
    },
    {
      "type": "Feature",
      "id": "fc00:dead:dead::",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9771,
          40.7236
        ]
      },
      "properties": {
        "Details": "269 E7th 10009",
        "OwnerName": "Jim",
        "PGP": "0000000000000000",
        "Status": 1920
      }
    },
    {
      "type": "Feature",
      "id": "fc01::",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9903,
          40.669
        ]
      },
      "properties": {
        "Contact": "Reddit: shotintoeternity",
        "Details": "Home",
        "OwnerName": "shotintoeternity",
        "PGP": "0000000000000000",
        "Status": 896
      }
    },
    {
      "type": "Feature",
      "id": "fc02::",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9252,
          40.7639
        ]
      },
      "properties": {
        "Contact": "upho",
        "OwnerName": "Quin Kennedy",
        "PGP": "0000000000000000",
        "Status": 128
      }
    },
    {
      "type": "Feature",
      "id": "fc03::",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9447,
          40.6699
        ]
      },
      "properties": {
        "OwnerName": "TestNode",
        "PGP": "0000000000000000",
        "Status": 512
      }
    },
    {
      "type": "Feature",
      "id": "fc05:2d70:2146:9298:73b9:14fb:d7a9:633a",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9567,
          40.7795
        ]
      },
      "properties": {
        "Contact": "werecat on irc",
        "Details": "Home Node",
        "OwnerName": "Werecat",
        "PGP": "2974c83b00000000",
        "Status": 1921
      }
    },
    {
      "type": "Feature",
      "id": "fc06::",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9114,
          40.7833
        ]
      },
      "properties": {
        "OwnerName": "astoria_pi_1",
        "PGP": "0000000000000000",
        "Status": 640
      }
    },
    {
      "type": "Feature",
      "id": "fc08::",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9186,
          40.7824
        ]
      },
      "properties": {
        "Contact": "ironghost on #nycmeshnet",
        "Details": "Home",
        "OwnerName": "IronGhost",
        "PGP": "0000000000000000",
        "Status": 128
      }
    },
    {
      "type": "Feature",
      "id": "fc10::",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9293,
          40.6995
        ]
      },
      "properties": {
        "Contact": "Reddit typ0w",
        "Details": "address fake, looking to connect",
        "OwnerName": "Daniel Piestrak",
        "PGP": "0000000000000000",
        "Status": 1792
      }
    },
    {
      "type": "Feature",
      "id": "fc15::",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9203,
          40.7059
        ]
      },
      "properties": {
        "Details": "address fake",
        "OwnerName": "Adrienne",
        "PGP": "0000000000000000",
        "Status": 0
      }
    },
    {
      "type": "Feature",
      "id": "fc7e:22c2:e29b:7688:6194:1bc9:333b:119e",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9634,
          40.6524
        ]
      },
      "properties": {
        "Contact": "ntrlshrp",
        "Details": "tbd",
        "OwnerName": "timebox",
        "PGP": "0000000000000000",
        "Status": 1152
      }
    },
    {
      "type": "Feature",
      "id": "fcd1:3111:8040:d6f3:9865:5466:4367:6d76",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9722,
          40.7487
        ]
      },
      "properties": {
        "Details": "test",
        "OwnerName": "tisaac",
        "PGP": "0000000000000000",
        "Status": 128
      }
    },
    {
      "type": "Feature",
      "id": "fce1:6e7a:b114:33cc:a823:8e94:10dd:815b",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9376,
          40.825
        ]
      },
      "properties": {
        "Contact": "snikus\/ksnieck\/kurt",
        "Details": "apt, 6 floor, roof access",
        "OwnerName": "snikus",
        "PGP": "0000000000000000",
        "Status": 1920
      }
    },
    {
      "type": "Feature",
      "id": "fce1:6e7a:b114:33cc:a823:8e94:10dd:815c",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9808,
          40.7188
        ]
      },
      "properties": {
        "Details": "Address is fake",
        "OwnerName": "jimbeam",
        "PGP": "0000000000000000",
        "Status": 1920
      }
    },
    {
      "type": "Feature",
      "id": "fce1:6e7a:b114:33cc:a823:8e94:10dd:815d",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9795,
          40.7903
        ]
      },
      "properties": {
        "Details": "Address is fake... facing north and west",
        "OwnerName": "jimbeam",
        "PGP": "0000000000000000",
        "Status": 1920
      }
    },
    {
      "type": "Feature",
      "id": "fcf4:14e6:306f:6108:1e51:ee68:1e39:5449",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.9911,
          40.7123
        ]
      },
      "properties": {
        "Contact": "peter at nycmesh.net",
        "Details": "Home. No roof access, 13th floor window facing north",
        "OwnerName": "azlyth",
        "PGP": "0000000000000000",
        "Status": 1920
      }
    }
  ]
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://ml.ninux.org/pipermail/nodeshot/attachments/20140611/59d5173a/attachment-0001.sig>


More information about the Nodeshot mailing list