Commit 30c6cf08 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

wkt from json

parent dd5ee94a
......@@ -4,7 +4,8 @@
import osgeo.ogr as ogr
import osgeo.osr as osr
import sys
import json
#-----------------------------------------------------------------------------
def wktToShape(wkt, shapefileName, layerName="wkt"):
'''!
'''
......@@ -34,7 +35,12 @@ def wktToShape(wkt, shapefileName, layerName="wkt"):
def main(argv):
# print (argv[1])
wktToShape(argv[1], argv[2])
if len(argv) != 3:
print("usage: " + argv[0] + "<jsonfile> <shapefileName>")
with open(argv[1]
) as json_file:
data = json.load(json_file)
wktToShape(data["wkt"], argv[2])
if __name__ == "__main__":
main(sys.argv)
......@@ -22,7 +22,7 @@ cd $USERDIR
#0.- Create Shape File From WKT
echo "${RED}Creating Shape file...${NC}"
rm -r myshape
wktToShape.py "$wkt" "myshape"
wktToShape.py $USERDIR"findProducts.json" "myshape"
#1.- Link L2A products
......
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