[GeoNode-users] geonode-users Digest, Vol 48, Issue 39
Dagguu Damisee
dagguudamisee at gmail.com
Tue Jan 29 07:32:26 PST 2019
Thank you very much !It is so helpful.
On Mon, Jan 28, 2019 at 11:00 PM <geonode-users-request at lists.osgeo.org>
wrote:
> Send geonode-users mailing list submissions to
> geonode-users at lists.osgeo.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.osgeo.org/mailman/listinfo/geonode-users
> or, via email, send a message with subject or body 'help' to
> geonode-users-request at lists.osgeo.org
>
> You can reach the person managing the list at
> geonode-users-owner at lists.osgeo.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of geonode-users digest..."
>
>
> Today's Topics:
>
> 1. Programmatically create a map (Sam Franklin)
> 2. GWC doesn't work normaly for GeoExt client on docker Geonode
> 2.10 master (Dejan Samardzic)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 28 Jan 2019 15:36:55 +0000
> From: Sam Franklin <mr.samfranklin at gmail.com>
> To: geonode-users at lists.osgeo.org
> Subject: [GeoNode-users] Programmatically create a map
> Message-ID:
> <CAPYJVm3kzLgzX7XG=-4PEHk=
> ER5uavJMRJGih8HsfzHD9GTTdA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi List
>
> I would like to programmatically create a map that consists of my base
> layers (all configured in settings.py) and an existing layer that I've
> added to geonode.
>
> So, I have a workaround solution to do this using the manage.py
> dumpdata/loaddata commands. I've created my content manually, then dumped
> out the model configuration to JSON. Then cleaned my environment, i.e.
> deleted all the content, and then run ./manage.py loaddata config.json.
> This works, but it is not particularly robust as there are hardcoded
> primary key values for maps and layers in the JSON config.
>
> I think it might be preferable to use the geonode python package. I saw
> that there's a method 'create_from_layer_list' in /maps/models.py. I think
> this is what I want, so I wrote a short custom management command to import
> the maps model and call this method:
>
> >>>>
>
> from django.core.management.base import BaseCommand, CommandError
> from django.contrib.auth import get_user_model
> from geonode.maps.models import Map
> from geonode.layers.models import Layer
>
> class Command(BaseCommand):
> def handle(self, *args, **kwargs):
> m = Map()
> layer_name = Layer.objects.all().first().alternate
> admin_user = get_user_model().objects.get(username='admin')
> m.create_from_layer_list(admin_user, [layer_name], "test_map",
> "this is a map")
>
> >>>>
>
> This custom command created a map object but is missing any of my base
> layers, so the map doesn't render any content.
>
> Within the management command, I need to add the base layers as well, but
> am not sure of what to try next to solve this.
>
> Is the "create_from_layer_list" method the best way to go, or is there a
> better way to programmatically generate a map based on a list of layers
> (other than my dumpdata/loaddata approach).
>
> Thanks in advance for any advice.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.osgeo.org/pipermail/geonode-users/attachments/20190128/53a19c76/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Mon, 28 Jan 2019 15:03:21 +0000
> From: Dejan Samardzic <dejan.samardzic at cedis.me>
> To: "geonode-users-request at lists.osgeo.org"
> <geonode-users-request at lists.osgeo.org>,
> "geonode-users at lists.osgeo.org" <geonode-users at lists.osgeo.org>
> Subject: [GeoNode-users] GWC doesn't work normaly for GeoExt client on
> docker Geonode 2.10 master
> Message-ID: <44261616a23049a7af2291161bce0285 at cedis.me>
> Content-Type: text/plain; charset="iso-8859-2"
>
> Dear Geonode community,
>
> We have made docker Gonode 2.10 master branch installation on Ubuntu 18.04
> by Alessio's guide:
>
>
> https://docs.google.com/document/d/1S0ac9IR9IW9tUjMu7JETPLUjnfQ6P87m1PKNko8IPWY/edit
>
> after that we have configure GeoWebCache:
> 1) We have configure Caching to external postgresql database:
> Tile caching - Disk quota....Enable disk Quota ....Maximum tile cache size
> 50GiB
> Disk quota check frequency:600s
> Disk quota store type....External database
> Target database type....PostgreSQL
> JDBC data source...GeoServer managed connection pool
> JDBC Driver class name.....org.postgresql.Driver
> JDBC connection URL.....jdbc:postgresql://db:5432/geonode
> User name.....geonode
> Password.....****
> Validation query.....select 1
>
> 2) Define path for cache
> >From geoserver container:
> mkdir /var/cache/geoserver
> chmod -R 777 geoserver
> vi /usr/local/tomcat/webapps/geoserver/WEB-INF/web.xml
> insert :
> <context-param>
> <param-name>GEOWEBCACHE_CACHE_DIR</param-name>
> <param-value>/var/cache/geoserver/</param-value>
> </context-param>
>
> Now, GeoWebCache doesn't work (geowebcache-cache-result is always MISS and
> system is not generating png files in GEOWEBCACHE_CACHE_DIR).
> We have to remove/add that specitic layer in Geoserver->Tile Caching->Tile
> Layers. After that, GWC start working normally (geowebcache-cache-result is
> HIT and system start generating png files in GEOWEBCACHE_CACHE_DIR).
> Let me underline that before and after this remove/add actions, url on
> browser's Developer Tool has the same structure like:
>
> http://testgis.cedis.me/geoserver/ows?access_token=pNPeKSZxG60GgtYcUJ97RCMKKGuIXm&LAYERS=geonode%3Anovi_r5_Grbalj_3_10kV_izmjenjen&FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&TILED=true&SRS=EPSG%3A3857&BBOX=2088259.6124603,5217897.2981329,2088565.3605734,5218203.046246&WIDTH=256&HEIGHT=256
>
> Please watch for yourself:
> https://www.youtube.com/watch?v=4Y0KIBOowDM
>
> Regards,
> Dejan.
> --
>
>
>
> Dejan Samardžić Rukovodilac Sektora za ICT / IT Manager
>
> [cid:part1.024E2240.9C760C1E at cedis.me]
> CEDIS d.o.o.
> Ivana Milutinovića 12, 81000 Podgorica
> gsm: +382 67 220 971
> tel: +382 20 408 453
> email: dejan.samardzic at cedis.me<mailto:dejan.samardzic at cedis.me>
> web: www.cedis.me<http://www.cedis.me>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.osgeo.org/pipermail/geonode-users/attachments/20190128/22144a69/attachment-0001.html
> >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: image001.jpg
> Type: image/jpeg
> Size: 1641 bytes
> Desc: image001.jpg
> URL: <
> http://lists.osgeo.org/pipermail/geonode-users/attachments/20190128/22144a69/attachment-0001.jpg
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-users
>
>
> ------------------------------
>
> End of geonode-users Digest, Vol 48, Issue 39
> *********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20190129/a0727e80/attachment-0001.html>
More information about the geonode-users
mailing list