[GeoNode-users] How to export GeoStories

Orestes Sanchez orestes at estotienearreglo.es
Mon Apr 25 16:08:57 PDT 2022


Hi! 

I am in a trial evaluating Geonode for our research team (I setup two servers running 3.3.x). I am creating GeoStories in one server and I would like to export them to another server. I had a look at the options, but there are no available export nor download management commands for GeoStories. Is there any way to export them safely? I think this is probably a recurring question here, I mean that of how to move a layer/map/geostory/etc to another server.

If the answer is not :( I am exploring other ways, like serializing to JSON the GeoStory data, exporting it using a Django management command, and then import it using another Django management command. 

I also had a look at the internal models on the source code. I found that the GeoStory is managed by GeoAppData in GeoApp model (see https://github.com/GeoNode/geonode/blob/4ff10aee6ee5d7022b987274227eaa7fabe553e8/geonode/geoapps/models.py#L141 <https://github.com/GeoNode/geonode/blob/4ff10aee6ee5d7022b987274227eaa7fabe553e8/geonode/geoapps/models.py#L141>). I had a look at the data representation and I think I can manage to export it to JSON, in fact, the blob is a escaped JSON string. The main issue is how to export map and layers.

I know that exporting a map that is inside a GeoStory is not trivial, I didn't pretend to export them, but at least exporting the minimum scaffolding of the GeoStory components (images, text, layout, etc), as well as the MapStore styling. Then I was considering manually editing the json file to patch maps and layers to use references on the target server. I was thinking the process will be something like this:
1. export the geostory in the source server to a json file, using the new export-geostory management command (to be done). It doesn't look like rocket science, 
2. manually create the maps in the target server.
3. manually edit the json file to patch the map/layer resources.
4. import the geostory in the target server, using the new import-geostory management command (to be done).

Does it make sense? Do you suggest any other approach?

Regards.
--
“If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." - Red Adair




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20220426/a7d89774/attachment.html>


More information about the geonode-users mailing list