This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Freguesias from | |
# https://dados.gov.pt/pt/datasets/freguesias-de-portugal/ | |
# Landcover from | |
# aws s3 cp s3://esa-worldcover/v200/2021/map/ESA_WorldCover_10m_2021_v200_N39W009_Map.tif ~/Desktop/wcpt/ | |
# Create new database | |
psql -d postgres -c "DROP DATABASE IF EXISTS wc_stats" | |
psql -d postgres -c "CREATE DATABASE wc_stats" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A script to sync S3 data fast to a local folder or EBS store. | |
The script calls aws s3 sync in parallel for subfolders. | |
In addition to parallel sync calls, also increase the concurrent | |
request for each sync call using an ~/.aws/config file | |
[default] | |
s3 = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rio Cube Bern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
response = requests.post( | |
"http://127.0.0.1:8000/rgb/?start=2022-01-01&end=2022-01-31&mode=ndvi", | |
json={ | |
"bbox": [128.774676, -22.256217, 128.789557, -22.241022], | |
"geometry": { | |
"coordinates": [ | |
[ | |
[128.77626, -22.24742], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>spatialsankey.js - sankey diagrams on a map</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
<style> | |
body { | |
position: absolute; | |
width:100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
RUN apt-get update && apt-get upgrade -y | |
RUN apt-get install -y \ | |
wget\ | |
libproj-dev\ | |
python-dev\ | |
build-essential\ | |
libffi-dev\ | |
git\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework import serializers | |
class ParlerModelSerializer(serializers.ModelSerializer): | |
"""Serializer to handle django-parler fields""" | |
def __init__(self, *args, **kwargs): | |
# Get list of translated fields | |
fields = self.Meta.model._translations_model.get_translated_fields() | |
# Separate parler fields and scilent fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet GeoJSON Example</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>spatialsankey.js - sankey diagrams on a map</title> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI=" crossorigin="" /> | |
<style> | |
body { | |
position: absolute; | |
width:100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script to setup a Elastic Beanstalk AMI with geospatial libraries | |
# Author: Daniel Wiesmann, July 14, 2014 | |
# | |
# sh aws_ami_prep.sh > aws_ami_prep.log 2>&1 & | |
# Go to ec2-user home directory | |
cd /home/ec2-user |
NewerOlder