-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 [BUG] Fix schema_randonnee parser url update issues (#4022)
- fix url being duplicated in description after new import if description is null or was not updated - description and url are now parsed in a filter_description method rather than in the end method
- Loading branch information
1 parent
a763f53
commit 353ca8b
Showing
10 changed files
with
240 additions
and
17 deletions.
There are no files selected for viewing
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
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
24 changes: 24 additions & 0 deletions
24
geotrek/trekking/tests/data/schema_randonnee_parser/description_and_url.geojson
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "sql_statement", | ||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id_local": "1", | ||
"producteur": "Producer 1", | ||
"nom_itineraire": "Trek 1", | ||
"pratique": "pédestre", | ||
"depart": "Departure 1", | ||
"arrivee": "Arrival 1", | ||
"instructions": "Instructions 1", | ||
"url": "https://test.com" | ||
}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ] | ||
} | ||
} | ||
] | ||
} |
24 changes: 24 additions & 0 deletions
24
geotrek/trekking/tests/data/schema_randonnee_parser/description_no_url.geojson
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "sql_statement", | ||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id_local": "1", | ||
"producteur": "Producer 1", | ||
"nom_itineraire": "Trek 1", | ||
"pratique": "pédestre", | ||
"depart": "Departure 1", | ||
"arrivee": "Arrival 1", | ||
"instructions": "Instructions 1", | ||
"url": null | ||
}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ] | ||
} | ||
} | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
...rek/trekking/tests/data/schema_randonnee_parser/find_url_in_description.geojson
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "sql_statement", | ||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id_local": "1", | ||
"producteur": "Producer 1", | ||
"url": "https://test.com", | ||
"nom_itineraire": "Trek 1", | ||
"pratique": "pédestre", | ||
"depart": "Departure 1", | ||
"arrivee": "Arrival 1", | ||
"instructions": "Instructions 1" | ||
}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id_local": "2", | ||
"producteur": "Producer 1", | ||
"nom_itineraire": "Trek 1", | ||
"pratique": "pédestre", | ||
"depart": "Departure 1", | ||
"arrivee": "Arrival 1", | ||
"instructions": "Instructions 2" | ||
}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ] | ||
} | ||
} | ||
] | ||
} |
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
41 changes: 41 additions & 0 deletions
41
geotrek/trekking/tests/data/schema_randonnee_parser/update_url_after.geojson
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "sql_statement", | ||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id_local": "1", | ||
"producteur": "Producer 1", | ||
"url": "https://test.com", | ||
"nom_itineraire": "Trek 1", | ||
"pratique": "pédestre", | ||
"depart": "Departure 1", | ||
"arrivee": "Arrival 1", | ||
"instructions": null | ||
}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id_local": "2", | ||
"producteur": "Producer 1", | ||
"url": "https://test2.com", | ||
"nom_itineraire": "Trek 2", | ||
"pratique": "pédestre", | ||
"depart": "Departure 1", | ||
"arrivee": "Arrival 1", | ||
"instructions": "Instructions 2" | ||
}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ] | ||
} | ||
} | ||
] | ||
} |
41 changes: 41 additions & 0 deletions
41
geotrek/trekking/tests/data/schema_randonnee_parser/update_url_before.geojson
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "sql_statement", | ||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id_local": "1", | ||
"producteur": "Producer 1", | ||
"url": "https://test.com", | ||
"nom_itineraire": "Trek 1", | ||
"pratique": "pédestre", | ||
"depart": "Departure 1", | ||
"arrivee": "Arrival 1", | ||
"instructions": "Instructions 1" | ||
}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ] | ||
} | ||
}, | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id_local": "2", | ||
"producteur": "Producer 1", | ||
"url": "https://test1.com", | ||
"nom_itineraire": "Trek 2", | ||
"pratique": "pédestre", | ||
"depart": "Departure 1", | ||
"arrivee": "Arrival 1", | ||
"instructions": "Instructions 2" | ||
}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ] | ||
} | ||
} | ||
] | ||
} |
24 changes: 24 additions & 0 deletions
24
geotrek/trekking/tests/data/schema_randonnee_parser/url_no_description.geojson
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "sql_statement", | ||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, | ||
"features": [ | ||
{ | ||
"type": "Feature", | ||
"properties": { | ||
"id_local": "1", | ||
"producteur": "Producer 1", | ||
"nom_itineraire": "Trek 1", | ||
"pratique": "pédestre", | ||
"depart": "Departure 1", | ||
"arrivee": "Arrival 1", | ||
"instructions": null, | ||
"url": "https://test.com" | ||
}, | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [ [ 6.449592517966364, 44.733424655086957 ], [ 6.449539623508488, 44.733394939411369 ] ] | ||
} | ||
} | ||
] | ||
} |
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