<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Ahh yes! I sorta-kinda got it to work.
The configuration you specified was giving errors when I tried to
synchronize, so I ended up using this one:<br>
<br>
<tt>{</tt><tt><br>
</tt><tt> "map": {</tt><tt><br>
</tt><tt> "name": "OwnerName",</tt><tt><br>
</tt><tt> "description": "Details"</tt><tt><br>
</tt><tt> },</tt><tt><br>
</tt><tt> "url": <a class="moz-txt-link-rfc2396E" href="http://meshwith.me/nyc.geo.json">"http://meshwith.me/nyc.geo.json"</a></tt><tt><br>
</tt><tt>}</tt><br>
<br>
I put the proper GeoJSON up there obviously, and as you saw I
filed a bug with NodeAtlas about their GeoJSON not actually being
GeoJSON. I would like to get some sort of hook system so that they
can tell us when they have a new node and have it either run the
synchronize command, or just have the new node data sent to us.<br>
<pre class="moz-signature" cols="72">Finn Herzfeld
Seattle Meshnet Project</pre>
On 06/11/2014 01:43 AM, Nemesis wrote:<br>
</div>
<blockquote cite="mid:539816B4.1060601@ninux.org" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">On 06/11/2014 09:49 AM, Finn Herzfeld
wrote:<br>
</div>
<blockquote cite="mid:53980A26.3000401@seattlemesh.net"
type="cite">Ah, turns out they do output GeoJSON, or something
they call GeoJSON, I havent verified it too much.<br>
<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://map.nycmesh.net/api/all?geojson">http://map.nycmesh.net/api/all?geojson</a><br>
<br>
</blockquote>
<br>
Unfortunately that is not serializable GeoJSON but it can be fixed
easily.<br>
<br>
Try this: <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://geojsonlint.com/">http://geojsonlint.com/</a><br>
<br>
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.<br>
<br>
<blockquote cite="mid:53980A26.3000401@seattlemesh.net"
type="cite"> I dropped that URL in and it still complains about
lack of configuration.</blockquote>
<br>
Yes, there are few config keys that need to be setup.<br>
<br>
put this in it:<br>
<br>
{<br>
"url": "<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://map.nycmesh.net/api/all?geojson">http://map.nycmesh.net/api/all?geojson</a>",<br>
"map": {}<br>
}<br>
<br>
this should pass validation, but it won't work because the output
of the URL is not standard GeoJSON<br>
(yeah, the empty map object is quite ugly.. :D).<br>
<br>
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.<br>
<br>
Once you have all this in place, you should run the command:<br>
<br>
<b>python manage.py synchronize</b><br>
<br>
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.<br>
<br>
There could be some issues, basically the map object is a map
between keys of the target urls and keys in nodeshot.<br>
<br>
I see for example that the GeoJSON issued by nodeatlas has objects
like:<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"> "Contact": "Reddit: shotintoeternity",
"Details": "Home",
"OwnerName": "shotintoeternity",
"PGP": "0000000000000000",
"Status": 896
</pre>
"Details" could be mapped to the "name" key in nodeshot.<br>
<br>
While "Contact" could be "description".<br>
<br>
"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")<br>
<br>
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).<br>
<br>
The final config JSON should be:<br>
<br>
{<br>
"url": "<a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://map.nycmesh.net/api/all?geojson">http://map.nycmesh.net/api/all?geojson</a>",<br>
"map": {<br>
"name": "Details",<br>
"description": "Contact"<br>
}<br>
}<br>
<br>
Federico<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Nodeshot mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nodeshot@ml.ninux.org">Nodeshot@ml.ninux.org</a>
<a class="moz-txt-link-freetext" href="http://ml.ninux.org/mailman/listinfo/nodeshot">http://ml.ninux.org/mailman/listinfo/nodeshot</a>
</pre>
</blockquote>
<br>
</body>
</html>