Skip to content

Commit

Permalink
Merge branch 'master' into lczTest0
Browse files Browse the repository at this point in the history
  • Loading branch information
SPalominos authored May 13, 2020
2 parents 0b90e0b + 91ca3b6 commit 96d0229
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import org.locationtech.jts.geom.Polygon
import org.orbisgis.orbisanalysis.osm.OSMTools
import org.orbisgis.orbisdata.datamanager.jdbc.JdbcDataSource
import org.orbisgis.orbisdata.processmanager.api.IProcess
import org.h2gis.utilities.jts_utils.GeographyUtils
import org.h2gis.utilities.GeographyUtilities
import org.h2gis.functions.spatial.crs.ST_Transform
import org.h2gis.utilities.SFSUtilities
import org.orbisgis.orbisanalysis.osm.utils.OSMElement


Expand Down Expand Up @@ -76,13 +75,13 @@ IProcess extractAndCreateGISLayers(){
/**
* Extract the OSM file from the envelope of the geometry
*/
def envelope = GeographyUtils.expandEnvelopeByMeters(geom.getEnvelopeInternal(), distance)
def envelope = GeographyUtilities.expandEnvelopeByMeters(geom.getEnvelopeInternal(), distance)

//Find the best utm zone
//Reproject the geometry and its envelope to the UTM zone
def con = datasource.getConnection();
def interiorPoint = envelope.centre()
def epsg = SFSUtilities.getSRID(con, interiorPoint.y as float, interiorPoint.x as float)
def epsg = GeographyUtilities.getSRID(con, interiorPoint.y as float, interiorPoint.x as float)
def geomUTM = ST_Transform.ST_Transform(con, geom, epsg)
def tmpGeomEnv = geom.getFactory().toGeometry(envelope)
tmpGeomEnv.setSRID(4326)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package org.orbisgis.orbisprocess.geoclimate.osm
import groovy.json.JsonSlurper
import groovy.transform.BaseScript
import org.h2gis.functions.spatial.crs.ST_Transform
import org.h2gis.utilities.SFSUtilities
import org.h2gis.utilities.jts_utils.GeographyUtils
import org.h2gis.utilities.GeographyUtilities
import org.locationtech.jts.geom.Geometry
import org.locationtech.jts.geom.MultiPolygon
import org.locationtech.jts.geom.Polygon
Expand Down Expand Up @@ -496,13 +495,13 @@ def extractOSMZone(def datasource, def zoneToExtract, def processing_parameters)
/**
* Extract the OSM file from the envelope of the geometry
*/
def envelope = GeographyUtils.expandEnvelopeByMeters(geom.getEnvelopeInternal(), processing_parameters.distance)
def envelope = GeographyUtilities.expandEnvelopeByMeters(geom.getEnvelopeInternal(), processing_parameters.distance)

//Find the best utm zone
//Reproject the geometry and its envelope to the UTM zone
def con = datasource.getConnection();
def interiorPoint = envelope.centre()
def epsg = SFSUtilities.getSRID(con, interiorPoint.y as float, interiorPoint.x as float)
def epsg = GeographyUtilities.getSRID(con, interiorPoint.y as float, interiorPoint.x as float)
def geomUTM = ST_Transform.ST_Transform(con, geom, epsg)
def tmpGeomEnv = geom.getFactory().toGeometry(envelope)
tmpGeomEnv.setSRID(4326)
Expand Down

0 comments on commit 96d0229

Please sign in to comment.