Skip to content
Snippets Groups Projects
Commit 4cbc302c authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Try to read centroid layer

parent 6b3fe80a
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,8 @@ def in_window(point, window):
def open_shpc(shpc_dir):
handler = {"readers": {}}
for layer in ["extremum", "outermost_contour", "max_speed_contour"]:
for layer in ["extremum", "outermost_contour", "max_speed_contour",
"centroid"]:
try:
handler["readers"][layer] \
= shapefile.Reader(path.join(shpc_dir, layer))
......
......@@ -35,13 +35,14 @@ if handler["ishape_last"] is None:
else:
ishape = util_eddies.comp_ishape(handler, days_1950, eddy_index)
for layer in ["extremum", "outermost_contour", "max_speed_contour"]:
shapeRec = handler["readers"][layer].shapeRecord(ishape)
print("\n", layer, ":")
if shapeRec.shape.shapeType == shapefile.NULL:
dct = shapeRec.record.as_dict()
pprint.pprint(dct)
print("null shape")
else:
pprint.pprint(shapeRec.__geo_interface__)
for layer in ["extremum", "outermost_contour", "max_speed_contour", "centroid"]:
if layer in handler["readers"]:
shapeRec = handler["readers"][layer].shapeRecord(ishape)
print("\n", layer, ":")
if shapeRec.shape.shapeType == shapefile.NULL:
dct = shapeRec.record.as_dict()
pprint.pprint(dct)
print("null shape")
else:
pprint.pprint(shapeRec.__geo_interface__)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment