Commit ff386a56 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

wkt to shape

parent 99b2a0ca
...@@ -5,7 +5,7 @@ import osgeo.ogr as ogr ...@@ -5,7 +5,7 @@ import osgeo.ogr as ogr
import osgeo.osr as osr import osgeo.osr as osr
import sys import sys
def wktToShape(wkt, shapefileName): def wktToShape(wkt, shapefileName, layerName="wkt"):
'''! '''!
''' '''
# set up the shapefile driver # set up the shapefile driver
...@@ -17,7 +17,7 @@ def wktToShape(wkt, shapefileName): ...@@ -17,7 +17,7 @@ def wktToShape(wkt, shapefileName):
# create the spatial reference, WGS84 # create the spatial reference, WGS84
srs = osr.SpatialReference() srs = osr.SpatialReference()
srs.ImportFromEPSG(4326) srs.ImportFromEPSG(4326)
layer = data_source.CreateLayer("layer", srs, ogr.wkbPolygon) layer = data_source.CreateLayer(layerName, srs, ogr.wkbPolygon)
# Create the point from the Well Known Text # Create the point from the Well Known Text
geometry = ogr.CreateGeometryFromWkt(wkt) geometry = ogr.CreateGeometryFromWkt(wkt)
......
...@@ -24,7 +24,6 @@ do ...@@ -24,7 +24,6 @@ do
echo PASS $f echo PASS $f
fi fi
RGBCROPED=$JP2DIR"rgbCroped/" RGBCROPED=$JP2DIR"rgbCroped/"
if [ ! -d $RGBCROPED ]; then if [ ! -d $RGBCROPED ]; then
mkdir $RGBCROPED mkdir $RGBCROPED
...@@ -33,12 +32,6 @@ do ...@@ -33,12 +32,6 @@ do
fileout1=$(echo $filepattern | cut -d"_" -f1) fileout1=$(echo $filepattern | cut -d"_" -f1)
fileout2=$(echo $filepattern | cut -d"_" -f2) fileout2=$(echo $filepattern | cut -d"_" -f2)
#
# if [ ! -e rgb/$fileout2"_"$fileout1".tiff" ]; then
# gdal_merge.py -separate -co PHOTOMETRIC=RGB -o rgb/$fileout2"_"$fileout1".tiff" $filepattern"04.jp2" $filepattern"03.jp2" $filepattern"02.jp2"
# fi
if [ ! -d $RGBCROPED$fileout1 ]; then if [ ! -d $RGBCROPED$fileout1 ]; then
mkdir $RGBCROPED$fileout1 mkdir $RGBCROPED$fileout1
fi fi
...@@ -50,8 +43,9 @@ do ...@@ -50,8 +43,9 @@ do
## rm rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg" ## rm rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg"
fi fi
cd $PRODCUTSDIR # cd $PRODCUTSDIR
done done
rm *.xml
## if [ ! -d "video" ]; then ## if [ ! -d "video" ]; then
## mkdir video ## mkdir video
## fi ## fi
......
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