Commit 87cbe8ae authored by Phyks's avatar Phyks

Add extra checks for OpenData works importer

parent 276297dc
Pipeline #111031 passed with stages
in 3 minutes and 38 seconds
......@@ -115,6 +115,10 @@ def preprocess_lille(data):
def preprocess_loiret(data):
out = []
if not 'features' in data:
logging.warning('Invalid data for Loiret.')
return out
for item in data['features']:
try:
if 'paths' in item['geometry']:
......@@ -168,6 +172,10 @@ def preprocess_loiret(data):
def preprocess_lyon(data):
out = []
if not 'features' in data:
logging.warning('Invalid data for Lyon.')
return out
for item in data['features']:
try:
new_item = {
......@@ -197,6 +205,10 @@ def preprocess_lyon(data):
def preprocess_montpellier(data):
out = []
if not 'features' in data:
logging.warning('Invalid data for Montpellier.')
return out
for item in data['features']:
try:
new_item = {
......@@ -226,6 +238,10 @@ def preprocess_montpellier(data):
def preprocess_nancy(data):
out = []
if not 'features' in data:
logging.warning('Invalid data for Nancy.')
return out
for item in data['features']:
try:
geometry = {
......@@ -289,6 +305,10 @@ def preprocess_paris(data):
def preprocess_rennes(data):
out = []
if not 'features' in data:
logging.warning('Invalid data for Rennes.')
return out
for item in data['features']:
try:
new_item = {
......@@ -317,6 +337,10 @@ def preprocess_rennes(data):
def preprocess_seine_saint_denis(data):
out = []
if not 'features' in data:
logging.warning('Invalid data for Seine-Saint-Denis.')
return out
for item in data['features']:
try:
new_item = {
......@@ -400,6 +424,10 @@ def preprocess_toulouse(data):
def preprocess_versailles(data):
out = []
if not 'features' in data:
logging.warning('Invalid data for Versailles.')
return out
for item in data['features']:
try:
if 'paths' in item['geometry']:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment