From 03af9c2b80b862a99a778b7bba54fd0d5c138fd6 Mon Sep 17 00:00:00 2001 From: Commandre Benjamin <benjamin.commandre@irstea.fr> Date: Wed, 16 Sep 2020 16:08:50 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20probl=C3=A8me=20projection=20gdal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Archive.py | 15 ++++++--------- config.ini | 4 +++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/Archive.py b/app/Archive.py index 678cecd..9199317 100644 --- a/app/Archive.py +++ b/app/Archive.py @@ -128,19 +128,20 @@ class Archive(): # Processus to convert the UTM shapefile # in decimal degrees shapefile with ogr2ogr in command line - utm_outfile = "{0}/UTM_{1}".format(os.path.split(self.emprise)[0], os.path.split(self.emprise)[1]) + # utm_outfile = "{0}/UTM_{1}".format(os.path.split(self.emprise)[0], os.path.split(self.emprise)[1]) - if os.path.exists(utm_outfile): - os.remove(utm_outfile) + # if os.path.exists(utm_outfile): + # os.remove(utm_outfile) # wgs84 : 4326 - self.vector_projection_with_epsg(self.emprise, utm_outfile, epsg=4326) + # self.vector_projection_with_epsg(self.emprise, utm_outfile, epsg=4326) # To get shapefile extent # Avec import ogr driver = ogr.GetDriverByName('ESRI Shapefile') # Open shapefile - data_source = driver.Open(utm_outfile, 0) + # data_source = driver.Open(utm_outfile, 0) + data_source = driver.Open(self.emprise, 0) if data_source is None: self.logger.error('Could not open file') @@ -153,14 +154,10 @@ class Archive(): ## Close source data data_source.Destroy() - area_coord_corner = str(extent_[2]) + ',' + str(extent_[0]) + ',' + str(extent_[3]) + ',' + str(extent_[1]) - return "{},{},{},{}".format(extent_[0], extent_[2], extent_[1], extent_[3]) def listing_by_tile(self): - nbImage = 0 - for tuile in self.liste_tuiles : self.requete['location'] = tuile diff --git a/config.ini b/config.ini index 35d1c38..c83fbc8 100644 --- a/config.ini +++ b/config.ini @@ -1,9 +1,11 @@ [donnees] # chemin/vers/shapefile/emprise +# Le shapefile doit en géographie WGS84 (EPSG:4326) chemin_emprise = # chemin/vers/shapefile/zone_etude # Si vide, zone d'étude = emprise +# Le shapefile doit en géographie WGS84 (EPSG:4326) chemin_zone_etude = # Liste des tuiles Sentinel2 à télécharger @@ -36,7 +38,7 @@ chemin = # - Tuile (Regroupe les images en fonction de la tuile sentinel2 auquelle elles correspondent ) groupe = Tuile -# Vrai si extraction des images des archives, faux si téléchagement de celles-ci +# "True" si extraction des images des archives, "False" si téléchagement de celles-ci extraction = False [theia] -- GitLab