summaryrefslogtreecommitdiff
path: root/docs/_build/html/import_export.html
blob: 2e9045b989b94ae9a63600a5e58247e692086244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Import/export &mdash; Chimère v2.0 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '2.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Chimère v2.0 documentation" href="index.html" />
    <link rel="next" title="Customisation" href="customisation.html" />
    <link rel="prev" title="Administration" href="administration.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="customisation.html" title="Customisation"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="administration.html" title="Administration"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Chimère v2.0 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="import-export">
<h1>Import/export<a class="headerlink" href="#import-export" title="Permalink to this headline">¶</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Author:</th><td class="field-body">Étienne Loks</td>
</tr>
<tr class="field"><th class="field-name">date:</th><td class="field-body">2012-11-28</td>
</tr>
<tr class="field"><th class="field-name">Copyright:</th><td class="field-body">CC-BY 3.0</td>
</tr>
</tbody>
</table>
<p>This document presents the administration of Chimère.
It has been updated for version 2.0.0.</p>
<div class="section" id="importing">
<span id="id1"></span><h2>Importing<a class="headerlink" href="#importing" title="Permalink to this headline">¶</a></h2>
<p>In Chimère the import mechanism is based on <strong>Import object</strong>. These objects
are stored in database to keep trace of imports and to facilitate the
re-importation from the same source. In fact if possible the update of data from
a same type of source is managed.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The ability to do such updates depends on the existence of a unique id
for each object on your source.</p>
</div>
<p>To add an <strong>Import object</strong> you need to go to <em>Chimere &gt; Imports</em> then <strong>Add</strong>.</p>
<p>After that you&#8217;ll have to select your source type and then the form depends on
this source type.</p>
<div class="section" id="common-fields">
<h3>Common fields<a class="headerlink" href="#common-fields" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><strong>Name by default</strong>: if no name can be identified to the newly imported object
this is the name that will be used. If this field is empty the name of the
associated category will be use.</li>
<li><strong>SRID</strong>: Chimère will try to identify automatically the correct projection
from the given source. But sometimes the information is not present or cannot
be guessed (for instance a shapefile that uses non standard proj file). In
this case Chimère will use WGS84 by default (the classic latitude/longitude)
but it is not always correct. If you experience problems with items
localisation you should put here the SRID associated to the projection of
your source.</li>
<li><strong>Origin</strong>: if not null this field will be associated to each item imported in
order to easily identify where the item came from. For OSM import the source
is automatically added.</li>
<li><strong>License</strong>: if not null this field will be associated to each item imported in
order to easily identify the license associated to the item. For OSM import
the license is automatically added.</li>
<li><strong>Associated subcategories (mandatory)</strong>: The selected subcategories will be
associated to newly imported items.</li>
</ul>
</div>
<div class="section" id="kml-import">
<h3>KML import<a class="headerlink" href="#kml-import" title="Permalink to this headline">¶</a></h3>
<img alt="_images/chimere_admin_import_KML.png" src="_images/chimere_admin_import_KML.png" />
<ul class="simple">
<li><strong>Web address/source file (mandatory)</strong>: your KML could be distant or a local
file. You&#8217;ll have to fill one of the two fields.</li>
<li><strong>Filter</strong>: if you want to import only a specific <em>Folder</em> of your KML file
put his name on this field.</li>
<li><strong>Zipped file</strong>: if your source is a KMLZ file (a zipped KML), check this case.</li>
</ul>
</div>
<div class="section" id="shapefile-import">
<h3>Shapefile import<a class="headerlink" href="#shapefile-import" title="Permalink to this headline">¶</a></h3>
<img alt="_images/chimere_admin_import_shapefile.png" src="_images/chimere_admin_import_shapefile.png" />
<ul class="simple">
<li><strong>Web address/source file (mandatory)</strong>: your shapefile could be distant or a
local file. You&#8217;ll have to fill one of the two fields.</li>
<li><strong>Zipped file</strong>: only zipped shapefiles are accepted so this checkbox has to be
checked.</li>
</ul>
</div>
<div class="section" id="georss-import">
<h3>GeoRSS import<a class="headerlink" href="#georss-import" title="Permalink to this headline">¶</a></h3>
<p>Simple GeoRSS and W3C GeoRSS are managed.</p>
<img alt="_images/chimere_admin_import_georss.png" src="_images/chimere_admin_import_georss.png" />
<ul class="simple">
<li><strong>Web address (mandatory)</strong>: only distant GeoRSS are managed.</li>
</ul>
</div>
<div class="section" id="csv-import">
<h3>CSV import<a class="headerlink" href="#csv-import" title="Permalink to this headline">¶</a></h3>
<p>The format of the CSV file (number and order of columns) managed by Chimère
varies depending on the properties you have added on your Chimère instance.
So we recommend you to first do an export of some items in CSV with Chimère.
The CSV format of the exported file will meet Chimère requirements.</p>
<p>By the way because of the geometry of the item this format is not very
convenient to add new content but could be handy to update informations.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If you mean to update existing data by this import, do <em>not</em> modify the
geometry column.</p>
</div>
<img alt="_images/chimere_admin_import_CSV.png" src="_images/chimere_admin_import_CSV.png" />
<ul class="simple">
<li><strong>Web address/source file (mandatory)</strong>: your CSV file could be distant or a
local file. You&#8217;ll have to fill one of the two fields.</li>
</ul>
</div>
<div class="section" id="openstreetmap-import">
<span id="osm-import"></span><h3>OpenStreetMap import<a class="headerlink" href="#openstreetmap-import" title="Permalink to this headline">¶</a></h3>
<img alt="_images/chimere_admin_import_OSM.png" src="_images/chimere_admin_import_OSM.png" />
<p>To import from OSM Chimère use the XAPI API of OSM.</p>
<ul class="simple">
<li><strong>Web address (mandatory)</strong>: XAPI url used to import data. This field should
be filled with a default address. By default the MapQuest server is used as it
seems to be the more robust. If you experience problems with OSM import, check
the availability of the XAPI server used and eventually change it.</li>
<li><strong>Filter area (mandatory)</strong>: draw the bounding box you want to use for your
OSM import.</li>
<li><strong>Filter type (mandatory)</strong>: choose if you want to import way or nodes.</li>
<li><strong>Filter tag (mandatory)</strong>: choose the OSM key/value couple used to filter OSM
data. A link to the <a class="reference external" href="https://wiki.openstreetmap.org/wiki/Map_Features">OSM Map features page</a> is provided to help you
find appropriate values.</li>
<li><strong>Refresh button</strong>: this button convert your choices to appropriate XAPI args.
You have to hit this button before validating the form.</li>
</ul>
</div>
<div class="section" id="id2">
<h3>Importing<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<p>Once your new import item created, select it in the import object list, choose
the <strong>Import</strong> action and validate.</p>
<p>The import should be processing normally. If not, an explicit error message
should be printed in the state column of your import.</p>
<p>You can also launch imports with the CLI (ideal for crontab jobs). In the
project directory you only need to launch the command:</p>
<div class="highlight-python"><pre>./manage.py chimere_import &lt;import_id&gt;</pre>
</div>
<ul class="simple">
<li><em>import_id</em> is the import ID</li>
</ul>
<p>If you launch the command without <em>import_id</em> the list of imports available is
presented and you can choose one.</p>
</div>
<div class="section" id="managing-imported-data">
<h3>Managing imported data<a class="headerlink" href="#managing-imported-data" title="Permalink to this headline">¶</a></h3>
<p>All new imported items have the state <strong>Imported</strong>. To make them available on
the map you&#8217;ll have to validate them. If you don&#8217;t want some items to be visible on
the map, instead of deleting them it is recommended to set them to the state
<strong>Disabled</strong>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Be careful with duplicates between your existing data and imported data. This
is particularly important if you want to export your data to OSM.</p>
</div>
</div>
</div>
<div class="section" id="exporting">
<h2>Exporting<a class="headerlink" href="#exporting" title="Permalink to this headline">¶</a></h2>
<div class="section" id="export-to-csv-kml-shapefile">
<h3>Export to CSV/KML/Shapefile<a class="headerlink" href="#export-to-csv-kml-shapefile" title="Permalink to this headline">¶</a></h3>
<p>Directly from the <a class="reference internal" href="fr/administration.html#geographic-items-management"><em>geographic items list</em></a> you
can export to the chosen format. All you have to do is to select the desired
items, choose the appropriate action in the action list and validate.</p>
<p>You can also launch exports with the CLI (ideal for crontab jobs). In the
project directory you only need to launch the command:</p>
<div class="highlight-python"><pre>./manage.py chimere_export &lt;subcategory_id&gt; &lt;CSV|KML|SHP&gt; \
                           &lt;marker|route&gt; &lt;filename&gt;</pre>
</div>
<ul class="simple">
<li><em>subcategory_id</em> is the ID of the chosen subcategory</li>
<li><em>CSV|KML|SHP</em> is the chosen format</li>
<li><em>marker|route</em> is to get marker or route</li>
<li><em>filename</em> is the output filename</li>
</ul>
<p>If you launch the command without arguments you will be prompted for the choice
to make for your export.</p>
</div>
<div class="section" id="export-to-osm">
<h3>Export to OSM<a class="headerlink" href="#export-to-osm" title="Permalink to this headline">¶</a></h3>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If you are not sure of what you are doing with OSM export: don&#8217;t do it! It is
really important to not mess with others&#8217; data.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Only export of OSM nodes are managed.</p>
</div>
<p>OSM export is not that easily managed. First (if not yet done) you&#8217;ll have to
define an import (<a class="reference internal" href="#osm-import"><em>see above</em></a> for details). This will enable
to determine:</p>
<ul class="simple">
<li>the area concerned by your export.</li>
<li>the key/value tag to append to your new/updated items.</li>
<li>the subcategories concerned by your export. If you think that some items in
these subcategories should not be in OSM database (because there are not
relevant or because of license issues) beforehand mark them as <strong>Not for OSM</strong>
in the <em>import fields</em> of the <a class="reference internal" href="fr/administration.html#geographic-items-management"><em>geographic items forms</em></a>.</li>
</ul>
<p>The OSM export in Chimère is designed to be the more preservative possible in
regards to OSM database. That&#8217;s why before any export an import is done. If
the new import has updated data, these new data will overload data in your
Chimère (if you don&#8217;t want that: don&#8217;t do export). All pending imported items
should have been treated before doing an export.</p>
<p>To launch an export select the appropriate Import object in the imports list.
Then select the <strong>Export to OSM</strong> action and validate.
Then you&#8217;ll be asked for your OSM username and password and the API you want to
use. If you regularly use Chimère to do export, it is recommended to create an
OSM specific account for that.
The test API is available to make export test. If you want to use the test
API you&#8217;ll have to create a specific account on the test platform.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The data on the test platform are not synced with the main platform. You won&#8217;t
have the same data than the ones you got with XAPI.</p>
</div>
<p>Once all this field filled, you can (finally!) launch the export.</p>
<p>When exporting tags are automatically added/updated:</p>
<ul class="simple">
<li><em>name</em>: get from the item name in Chimère.</li>
<li><em>source</em>: to identify Chimère as a source.</li>
</ul>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Import/export</a><ul>
<li><a class="reference internal" href="#importing">Importing</a><ul>
<li><a class="reference internal" href="#common-fields">Common fields</a></li>
<li><a class="reference internal" href="#kml-import">KML import</a></li>
<li><a class="reference internal" href="#shapefile-import">Shapefile import</a></li>
<li><a class="reference internal" href="#georss-import">GeoRSS import</a></li>
<li><a class="reference internal" href="#csv-import">CSV import</a></li>
<li><a class="reference internal" href="#openstreetmap-import">OpenStreetMap import</a></li>
<li><a class="reference internal" href="#id2">Importing</a></li>
<li><a class="reference internal" href="#managing-imported-data">Managing imported data</a></li>
</ul>
</li>
<li><a class="reference internal" href="#exporting">Exporting</a><ul>
<li><a class="reference internal" href="#export-to-csv-kml-shapefile">Export to CSV/KML/Shapefile</a></li>
<li><a class="reference internal" href="#export-to-osm">Export to OSM</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="administration.html"
                        title="previous chapter">Administration</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="customisation.html"
                        title="next chapter">Customisation</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/import_export.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="customisation.html" title="Customisation"
             >next</a> |</li>
        <li class="right" >
          <a href="administration.html" title="Administration"
             >previous</a> |</li>
        <li><a href="index.html">Chimère v2.0 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, Étienne Loks.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
    </div>
  </body>
</html>