Skip to content

Instantly share code, notes, and snippets.

@etj
etj / radme.md
Created October 1, 2025 08:28
Change pw to GeoNode user

Run a django shell

DJANGO_SETTINGS_MODULE=geonode.settings  manage.py shell
from geonode.people.models import Profile
p = Profile.objects.get(username="admin")
p.set_password("adminxxx")
p.save()

The local setup will allow you to run GeoNode locally, and all other services in docker containers.

These are the involved files:

  • docker-compose-local.yml: this file is as similar as possible to the docker-compose.yml file. Probably it only has the django container commented out

  • docker-compose-local-override.yml: all the local customizations go here

  • .env-local: the env file

  • '.env-local-geonode': some env vars, modified in order to make GeoNode run locally

@etj
etj / gwc_layer_seed.py
Created July 7, 2022 10:50
Seeds GeoWebCache layers
import requests
import json
import sys
def usage():
print("Bad number of args given.\n\nUsage:")
print (f" {sys.argv[0]} GEOSERVER_URL USERNAME PASSWORD\n")
if len(sys.argv) != 4:
usage()
@etj
etj / gwc_layer_config.py
Created July 7, 2022 10:46
Create gwc layers for each configured geoserver layer
import requests
import json
import sys
def usage():
print("Bad number of args given.\n\nUsage:")
print (f" {sys.argv[0]} GEOSERVER_URL USERNAME PASSWORD\n")
if len(sys.argv) != 4:
usage()
@etj
etj / check_layers.sh
Created September 23, 2021 10:49
Check GeoServer layers via API
USERNAME=admin
PW=YOUR_PASSWORD
BASEURL=THE_BASE_URL_OF_YOUR_SERVER
echo CHECKING SERVER $BASEURL
LAYERS=$(curl -s -u $USERNAME:$PW $BASEURL/geoserver/rest/layers.json)
for LAYERNAME in $(echo $LAYERS | jq ".layers.layer[] | .name" ) ; do
# echo LAYER is "$LAYERNAME"
<gmd:MD_Metadata
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gco="http://www.isotc211.org/2005/gco"
xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd">
<gmd:fileIdentifier>
<gco:CharacterString>{{layer.uuid}}</gco:CharacterString>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--https://www.geoportal.de/gds/xml.php?uuid=C3B4183D-1F70-0001-3BFA-AF761F001BF0-->
<ns4:MD_Metadata xmlns:ns4="http://www.isotc211.org/2005/gmd" xmlns="http://www.isotc211.org/2005/gmd" xmlns:ns2="http://www.isotc211.org/2005/gco" xmlns:ns3="http://www.isotc211.org/2005/srv" xmlns:ns5="http://www.opengis.net/gml" xmlns:ns6="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd">
<ns4:fileIdentifier>
<ns2:CharacterString>C3B4183D-1F70-0001-3BFA-AF761F001BF0</ns2:CharacterString>
</ns4:fileIdentifier>
<ns4:language>
<ns4:LanguageCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#LanguageCode" codeListValue="ger">ger</ns4:LanguageCode>
</ns4:language>
<ns4:characterSet>
@etj
etj / hibernate-spatial-h2-geodb-1.1.1.pom
Created December 6, 2017 12:30
Original pom.xml files for hibernate-spatial 1.1.1 specific db dialects
<!--
~ $Id:$ ~ ~ This file is part of Hibernate Spatial, an extension to
the ~ hibernate ORM solution for geographic data. ~ ~ Copyright 2010
Geodan IT b.v. ~ ~ This library is free software; you can redistribute
it and/or ~ modify it under the terms of the GNU Lesser General Public
~ License as published by the Free Software Foundation; either ~
version 2.1 of the License, or (at your option) any later version. ~ ~
This library is distributed in the hope that it will be useful, ~ but
WITHOUT ANY WARRANTY; without even the implied warranty of ~
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~