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
var Vector = function(x, y) { | |
this.x = x || 0; | |
this.y = y || 0; | |
}; | |
// return the angle of the vector in radians | |
Vector.prototype.getDirection = function() { | |
return Math.atan2(this.y, this.x); | |
}; |
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
CREATE TABLE taxonomie.taxref_mytaxref ( | |
cd_nom integer UNIQUE, | |
cd_ref integer, | |
nom_vern varchar(1000) | |
) | |
COMMENT ON TABLE taxonomie.taxref_mytaxref IS 'Attention, les modifications de cd_ref ou nom_vern intégrées dans cette table écraserons les valeurs de la table taxref.'; | |
CREATE OR REPLACE FUNCTION taxonomie.fct_trg_refresh_taxons_forautocomplete() | |
RETURNS trigger | |
LANGUAGE plpgsql |
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
# ----------------------------- | |
# PostgreSQL configuration file | |
# ----------------------------- | |
# | |
# This file consists of lines of the form: | |
# | |
# name = value | |
# | |
# (The "=" is optional.) Whitespace may be used. Comments are introduced with | |
# "#" anywhere on a line. The complete list of parameter names and allowed |
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
<!-- Matomo --> | |
<script type="text/javascript"> | |
var _paq = window._paq || []; | |
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */ | |
_paq.push(['trackPageView']); | |
_paq.push(['enableLinkTracking']); | |
(function() { | |
var u="//MY_MATOMO_URL/"; | |
_paq.push(['setTrackerUrl', u+'piwik.php']); | |
_paq.push(['setSiteId', 'MY_MATOMO_ID_SITE']); |
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
/* | |
--Fonction pas encore dans taxhub | |
CREATE OR REPLACE FUNCTION taxonomie.find_all_taxons_parents(id integer) | |
RETURNS TABLE(cd_nom integer, id_rang character varying) | |
LANGUAGE plpgsql | |
IMMUTABLE | |
AS $function$ | |
--Param : cd_nom d'un taxon quelque soit son rang | |
--Retourne une table avec le cd_nom de tout les taxons parents et leur id_rang. | |
--Retourne le cd_nom de tous les taxons parents sous forme d'un jeu de données utilisable comme une table. Les cd_nom sont ordonnées du plus bas vers le plus haut (Dumm) |
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 utils_flask_sqla import response | |
from datetime import date, time, datetime | |
import uuid | |
test_dict=dict( | |
my_datetime=datetime.now(), | |
my_uuid=uuid.uuid4(), | |
my_time=time(12,54), |
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
{ | |
"specific": { | |
"cd_nom": { | |
"type_widget": "taxonomy", | |
"attribut_label": "Taxon", | |
"type_util": "taxonomy", | |
"required": true, | |
"idComponent": "100" | |
}, | |
"id_nomenclature_nature_observation": { |
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
--Selection des occurences d'Odonates [185356] et taxons inférieurs | |
--A utiliser également pour sélectionner des espèces, afin d'inclure les éventuelles sous-espèces | |
SELECT s.* | |
FROM gn_synthese.synthese s | |
JOIN taxonomie.taxref t USING (cd_nom) | |
JOIN taxonomie.taxref_tree_parents ttp ON ttp.cd_nom_parent = t.cd_ref | |
WHERE ttp.cd_nom_parent = 185356 | |
--Exemple 2 : Liste des parents sous format JSON |
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 lancer à la racine du dossier Taxhub, après avoir renseigner les accès du S3 | |
dans le fichier de config et activé l'environnement virtuel""" | |
import config | |
import os | |
import boto3 | |
import mimetypes | |
s3 = boto3.client('s3', | |
aws_access_key_id=config.S3_KEY, |
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
CREATE TABLE xml_mtd ("xml" xml); | |
/*COPY distant XML file (with removing line feed) */ | |
COPY xml_mtd FROM PROGRAM 'curl "https://www.geo2france.fr/geonetwork/srv/api/records/6ea5c1bd-b10b-4f7e-9139-2f878c63fc74/formatters/xml?attachment=true&approved=true" | tr -d "\n" '; | |
/*Extract relevant data*/ | |
WITH ns AS ( | |
SELECT ARRAY[ | |
ARRAY['gmd', 'http://www.isotc211.org/2005/gmd'], | |
ARRAY['gco', 'http://www.isotc211.org/2005/gco'], |
OlderNewer