mirror of
https://github.com/xbgmsharp/postgsail.git
synced 2025-09-17 11:17:46 +00:00
Fix error if data type is None
This commit is contained in:
@@ -394,14 +394,17 @@ AS $geojson_py$
|
|||||||
import json
|
import json
|
||||||
parsed = json.loads(original)
|
parsed = json.loads(original)
|
||||||
output = []
|
output = []
|
||||||
for idx, x in enumerate(parsed):
|
#plpy.notice(parsed)
|
||||||
#plpy.notice(idx, x)
|
# [None, None]
|
||||||
for feature in x:
|
if None not in parsed:
|
||||||
#plpy.notice(feature)
|
for idx, x in enumerate(parsed):
|
||||||
if (feature['geometry']['type'] != geometry_type):
|
#plpy.notice(idx, x)
|
||||||
output.append(feature)
|
for feature in x:
|
||||||
#else:
|
#plpy.notice(feature)
|
||||||
# plpy.notice('ignoring')
|
if (feature['geometry']['type'] != geometry_type):
|
||||||
|
output.append(feature)
|
||||||
|
#else:
|
||||||
|
# plpy.notice('ignoring')
|
||||||
return json.dumps(output)
|
return json.dumps(output)
|
||||||
$geojson_py$ -- TRANSFORM FOR TYPE jsonb LANGUAGE plpython3u;
|
$geojson_py$ -- TRANSFORM FOR TYPE jsonb LANGUAGE plpython3u;
|
||||||
IMMUTABLE STRICT;
|
IMMUTABLE STRICT;
|
||||||
|
Reference in New Issue
Block a user