update

parent 045ac78b
#!/usr/bin/python
# -*- coding: utf-8 -*-
import osgeo.ogr as ogr
import osgeo.osr as osr
import sys
def wktToShape(wkt, shapefileName):
'''!
'''
# set up the shapefile driver
driver = ogr.GetDriverByName("ESRI Shapefile")
# create the data source
data_source = driver.CreateDataSource(shapefileName)
# create the spatial reference, WGS84
srs = osr.SpatialReference()
srs.ImportFromEPSG(4326)
layer = data_source.CreateLayer("layer", srs, ogr.wkbPolygon)
# Create the point from the Well Known Text
geometry = ogr.CreateGeometryFromWkt(wkt)
# create the feature
feature = ogr.Feature(layer.GetLayerDefn())
# Set the feature geometry using the point
feature.SetGeometry(geometry)
# Create the feature in the layer (shapefile)
layer.CreateFeature(feature)
# Dereference the feature
feature = None
data_source = None
def main(argv):
# print (argv[1])
wktToShape(argv[1], argv[2])
if __name__ == "__main__":
main(sys.argv)
......@@ -50,6 +50,7 @@ do
gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -scale 0 4096 0 255 -of JPEG rgb/$fileout2"_"$fileout1".tiff" rgb/$fileout1/$fileout2"_"$fileout1".jpg"
# convert rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg" -resize 640x480\! rgb/$fileout1/$fileout2"_"$fileout1".jpg"
# rm rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg"
rm *.xml
fi
cd $PRODCUTSDIR
......
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