Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoSentinel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoSentinel
Commits
10df42d2
Commit
10df42d2
authored
May 28, 2018
by
Mario Chirinos Colunga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
045ac78b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
wktToShape.py
geosentinel/wktToShape.py
+40
-0
productToRGBJPG.sh
tools/productToRGBJPG.sh
+1
-0
No files found.
geosentinel/wktToShape.py
0 → 100644
View file @
10df42d2
#!/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
)
tools/productToRGBJPG.sh
View file @
10df42d2
...
@@ -50,6 +50,7 @@ do
...
@@ -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"
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"
# convert rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg" -resize 640x480\! rgb/$fileout1/$fileout2"_"$fileout1".jpg"
# rm rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg"
# rm rgb/$fileout1/$fileout2"_"$fileout1"_t.jpg"
rm
*
.xml
fi
fi
cd
$PRODCUTSDIR
cd
$PRODCUTSDIR
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment