mirror of
https://github.com/almet/notmyidea.git
synced 2025-04-28 19:42:37 +02:00
Update documentation
This commit is contained in:
parent
c4994114b4
commit
2dc67b7244
1 changed files with 4 additions and 5 deletions
|
@ -38,7 +38,6 @@
|
|||
<p>Last week, I’ve been lucky to start working on <a href="https://github.com/umap-project/umap/">uMap</a>, an open-source map-making tool to create and share customizable maps, based on Open Street Map data.</p>
|
||||
<p>My goal is to add real-time collaboration to uMap, but <strong>we first want to be sure to understand the issue correctly</strong>. There are multiple ways to solve this, so one part of the journey is to understand the problem properly (then, we’ll be able to chose the right path forward).</p>
|
||||
<p>Part of the work is documenting it, so expect to see some blog posts around this in the future.</p>
|
||||
<p>Also, this is made possible via the generous help of <a href="http://scopyleft.fr/">ScopyLeft</a>, so thanks to them!</p>
|
||||
<h2 id="installation">Installation</h2>
|
||||
<p>I’ve started by installing uMap on my machine, made it work and read the codebase. uMap is written in Python and Django, and using old school Javascript, specifically using the Leaflet library for <span class="caps">SIG</span>-related interface.</p>
|
||||
<p>Installing uMap was simple. On a mac:</p>
|
||||
|
@ -99,12 +98,12 @@ the current code base.</p>
|
|||
<li>The actual rendering and modifications of the map are directly done in JavaScript, on the clients.</li>
|
||||
</ul>
|
||||
<p>The data is split in multiple layers. At the time of writing, concurrent writes to the same layers are not possible, as one edit would potentially overwrite the other one. It’s possible to have concurrent edits on different layers, though.</p>
|
||||
<p>When a change occurs, <a href="https://github.com/umap-project/umap/blob/master/umap/views.py#L917-L948">each <code>DataLayer</code> is sent by the client to the server</a>.</p>
|
||||
<p>When a change occurs, <a href="https://github.com/umap-project/umap/blob/c16a01778b4686a562d97fde1cfd3433777d7590/umap/views.py#L917-L948">each <code>DataLayer</code> is sent by the client to the server</a>.</p>
|
||||
<ul>
|
||||
<li>The data is updated on the server.</li>
|
||||
<li><strong>If the data has been modified by another client</strong>, an <code>HTTP 422 (Unprocessable Entity)</code> status is returned, which makes it possible to detect conflicts. The users are prompted about it, and asked if they want to overwrite the changes.</li>
|
||||
<li>The files are stored as geojson files on the server as <code>{datalayer.pk}_{timestamp}.geojson</code>. <a href="https://github.com/umap-project/umap/blob/master/umap/models.py#L426:L426">A history of the last changes is preserved</a> (The default settings preserves the last 10 revisions).</li>
|
||||
<li>The data is stored <a href="https://github.com/umap-project/umap/blob/master/umap/static/umap/js/umap.js#L158-L163">in a Leaflet object</a> and <a href="https://github.com/umap-project/umap/blob/master/umap/static/umap/js/umap.js#L1095:L1095">backups are made manually</a> (it does not seem that changes are saved automatically).</li>
|
||||
<li>The files are stored as geojson files on the server as <code>{datalayer.pk}_{timestamp}.geojson</code>. <a href="https://github.com/umap-project/umap/blob/c16a01778b4686a562d97fde1cfd3433777d7590/umap/models.py#L426-L433">A history of the last changes is preserved</a> (The default settings preserves the last 10 revisions).</li>
|
||||
<li>The data is stored <a href="https://github.com/umap-project/umap/blob/c16a01778b4686a562d97fde1cfd3433777d7590/umap/static/umap/js/umap.js#L158-L163">in a Leaflet object</a> and <a href="https://github.com/umap-project/umap/blob/c16a01778b4686a562d97fde1cfd3433777d7590/umap/static/umap/js/umap.js#L1095:L1095">backups are made manually</a> (it does not seem that changes are saved automatically).</li>
|
||||
</ul>
|
||||
<h3 id="data">Data</h3>
|
||||
<p>Each layer consists of:</p>
|
||||
|
@ -195,7 +194,7 @@ features we want.</p>
|
|||
<p>o <strong>If the target location specifies an object member that does exist,
|
||||
that member’s value is replaced.</strong></p>
|
||||
</blockquote>
|
||||
<p>It seems to bad for us, as in our case this will happen each time a new feature is added to the feature collection.</p>
|
||||
<p>It seems too bad for us, as this will happen each time a new feature is added to the feature collection.</p>
|
||||
<p>It’s not working out of the box, but we could probably hack something together by having all features defined by a unique id, and send this to the server. We wouldn’t be using vanilla <code>geojson</code> files though, but adding some complexity on top of it.</p>
|
||||
<p>At this point, I’ve left this here and went to experiment with the other ideas. After all, the goal here is not (yet) to have something functional, but to clarify how the different options would play off.</p>
|
||||
<h3 id="using-crdts">Using CRDTs</h3>
|
||||
|
|
Loading…
Reference in a new issue