Skip to content

Commit

Permalink
Fix some error when the building height are formated
Browse files Browse the repository at this point in the history
  • Loading branch information
ebocher committed Jan 12, 2024
1 parent 8d5254a commit e850b9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ String formatEstimatedBuilding(JdbcDataSource datasource, String inputTableName,
datasource.eachRow(queryMapper) { row ->
def heightRoof = row.height_roof
def type = row.type
def formatedData = formatHeightsAndNbLevels(null, heightRoof, 0, h_lev_min,
def formatedData = formatHeightsAndNbLevels(0, heightRoof, 0, h_lev_min,
type, null)
def nbLevels = formatedData.nbLevels
def heightWall = formatedData.heightWall
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,35 +288,7 @@ class InputDataFormattingTest {

def h2GIS = H2GIS.open("${file.absolutePath + File.separator}osm_gislayers;AUTO_SERVER=TRUE".toString())

//def zoneToExtract ="Shanghai, Chine"
def zoneToExtract = "École Lycée Joliot-Curie,Rennes"
zoneToExtract = "New York"
zoneToExtract = "Québec, Québec (Agglomération), Capitale-Nationale, Québec, Canada"
//zoneToExtract = "Bucarest"
zoneToExtract = "Helsinki"
//zoneToExtract ="Göteborgs Stad"
//zoneToExtract = "Londres, Grand Londres, Angleterre, Royaume-Uni"
zoneToExtract = "Vannes"
//zoneToExtract="rezé"
//zoneToExtract = "Brest"

//river Göta älv
zoneToExtract = [57.6753, 11.7982, 57.6955, 11.8656]
//Taal Crater Lake
//zoneToExtract =[13.4203,120.2165,14.5969 , 122.0293]
//Le Havre
zoneToExtract = [49.4370, -0.0230, 49.5359, 0.2053,]
//aeroway Toulouse https://www.openstreetmap.org/way/739797641#map=14/43.6316/1.3590
zoneToExtract = [43.610539, 1.334152, 43.648808, 1.392689]

zoneToExtract = "Göteborgs Stad"

zoneToExtract = "Riantec"
zoneToExtract =[50, 8.6, 50.2, 8.8]

//zoneToExtract="Sassenage"

zoneToExtract=[50, 8.6, 50.2, 8.8]
def zoneToExtract = "Redon"

Map extractData = OSM.InputDataLoading.extractAndCreateGISLayers(h2GIS, zoneToExtract)

Expand Down Expand Up @@ -347,19 +319,13 @@ class InputDataFormattingTest {


//Roads

def inputRoadTableName = OSM.InputDataFormatting.formatRoadLayer( h2GIS,extractData.road, extractData.zone_envelope)
h2GIS.save(inputRoadTableName,"${file.absolutePath + File.separator}osm_road_${formatedPlaceName}.geojson", true)

//Rails
/*format = OSM.InputDataFormatting.formatRailsLayer()
format.execute([
datasource : h2GIS,
inputTableName : extractData.results.railTableName,
inputZoneEnvelopeTableName: extractData.results.zoneEnvelopeTableName,
epsg : epsg])
h2GIS.getTable(format.results.outputTableName).save("./target/osm_rails_${formatedPlaceName}.geojson", true)
*/
def inputRailTableName = OSM.InputDataFormatting.formatRailsLayer( h2GIS,extractData.rail, extractData.zone_envelope)
h2GIS.save(inputRailTableName,"${file.absolutePath + File.separator}osm_rail_${formatedPlaceName}.geojson", true)


//Vegetation
def inputVegetationTableName = OSM.InputDataFormatting.formatVegetationLayer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,11 @@ class WorflowOSMTest extends WorkflowAbstractTest {
File dirFile = new File(directory)
dirFile.delete()
dirFile.mkdir()
def location = "Nice"
def location = "Redon"
//def nominatim = org.orbisgis.geoclimate.osmtools.OSMTools.Utilities.getNominatimData("Redon")
// location = nominatim.bbox

location=[43.725068,7.297883,43.727635,7.301284]
//location=[43.725068,7.297883,43.727635,7.301284]

def osm_parmeters = [
"description" : "Example of configuration file to run the OSM workflow and store the result in a folder",
Expand Down

0 comments on commit e850b9e

Please sign in to comment.