Skip to content

Commit

Permalink
ajout URL gt-rando V3
Browse files Browse the repository at this point in the history
  • Loading branch information
IdrissaD committed Oct 13, 2021
1 parent 794930d commit 05a861d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions geotrek/v_treks_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ SELECT
sources.noms_source AS producteur,
(SELECT contact FROM constants LIMIT 1) AS contact, -- adresse mail à renseigner dans les constantes
NULL AS uuid, -- pas d'uuid prévu dans Geotrek
-- construction de l'url valable pour Geotrek-rando V2
-- construction de l'url valable pour Geotrek-rando V2 (voir juste en-dessous pour l'url V3)
(SELECT url_rando FROM constants LIMIT 1) || lower(unaccent(replace(tp.practice_name, ' ', '-'))) || '/'
|| lower(unaccent(replace(btrim(regexp_replace(t."name", '[^\w -]', '', 'g')), ' ', '-'))) || '/' AS url,
-- pour Geotrek-rando V3, essayer quelque chose comme : 'urlportail/trek/' || 't.topo_object_id' || '-' || unaccent(regexp_replace(btrim(regexp_replace(t."name", '[^- ()\w]', '', 'g')), '\W', '-')) (non essayé)
-- construction de l'url valable pour Geotrek-rando V3 :
-- (SELECT url_rando FROM constants LIMIT 1) || 'trek/' || t.topo_object_id || '-' || unaccent(replace(btrim(regexp_replace(t."name", '[^\w -]', '', 'g')), ' ', '-')) AS url
NULL AS id_osm,
t."name" AS nom_itineraire,
tp.practice_name AS pratique, -- uniquement valable si vos noms de pratiques correspondent déjà au schéma, sinon passer par quelque chose comme : CASE WHEN tp.practice_name ILIKE 'Randonnée Trail' THEN 'trail'::text END AS pratique
Expand Down

0 comments on commit 05a861d

Please sign in to comment.