orbisgis / geoclimate

Geospatial processing toolbox for environmental and climate studies
GNU Lesser General Public License v3.0
59 stars 15 forks source link

org.h2.jdbc.JdbcSQLSyntaxErrorException: Duplication du nom de colonnes "TYPE_WATER" #921

Closed adwien closed 7 months ago

adwien commented 7 months ago

I tested geoclimate on Linux with Cannes : '''{ "description": "Processing OSM data", "input": { "locations": [ "Cannes" ] }, "output": { "folder": "/home/adrien/Documents/mes_scripts/Geoclimate/projet" }, "parameters": { "rsu_indicators": { "indicatorUse": [ "LCZ", "TEB", "UTRF" ], "svfSimplified": true, "estimateHeight": true }, "grid_indicators": { "x_size": 100, "y_size": 100, "rowCol": false, "output" : "geojson", "indicators" :["BUILDING_FRACTION", "BUILDING_HEIGHT", "BUILDING_POP", "BUILDING_TYPE_FRACTION", "WATER_FRACTION", "VEGETATION_FRACTION", "ROAD_FRACTION", "IMPERVIOUS_FRACTION", "FREE_EXTERNAL_FACADE_DENSITY", "BUILDING_HEIGHT_WEIGHTED", "BUILDING_SURFACE_DENSITY", "SEA_LAND_FRACTION", "ASPECT_RATIO", "SVF", "HEIGHT_OF_ROUGHNESS_ELEMENTS", "TERRAIN_ROUGHNESS_CLASS", "UTRF_AREA_FRACTION", "UTRF_FLOOR_AREA_FRACTION", "LCZ_PRIMARY"] } } } ''' and a have this error: ''' { "description": "Processing OSM data", "input": { "locations": [ "Cannes" ] }, "output": { "folder": "/home/adrien/Documents/mes_scripts/Geoclimate/projet" }, "parameters": { "rsu_indicators": { "indicatorUse": [ "LCZ", "TEB", "UTRF" ], "svfSimplified": true, "estimateHeight": true }, "grid_indicators": { "x_size": 100, "y_size": 100, "rowCol": false, "output" : "geojson", "indicators" :["BUILDING_FRACTION", "BUILDING_HEIGHT", "BUILDING_POP", "BUILDING_TYPE_FRACTION", "WATER_FRACTION", "VEGETATION_FRACTION", "ROAD_FRACTION", "IMPERVIOUS_FRACTION", "FREE_EXTERNAL_FACADE_DENSITY", "BUILDING_HEIGHT_WEIGHTED", "BUILDING_SURFACE_DENSITY", "SEA_LAND_FRACTION", "ASPECT_RATIO", "SVF", "HEIGHT_OF_ROUGHNESS_ELEMENTS", "TERRAIN_ROUGHNESS_CLASS", "UTRF_AREA_FRACTION", "UTRF_FLOOR_AREA_FRACTION", "LCZ_PRIMARY"] } } } '''

ebocher commented 7 months ago

Thanks. Please share the full log message.

adwien commented 7 months ago

11:27:05.519 [main] INFO GeoClimate -- 1 osm areas will be processed 11:27:06.643 [main] INFO GeoClimate -- Downloading the Nominatim data. 11:27:07.054 [main] INFO GeoClimate -- Extract the OSM data 11:27:10.923 [main] INFO GeoClimate -- Downloading the OSM data from overpass api in /tmp/cf1537df93d6dfdc94e79e62b0f1547cb5165b2f4c40364a14247adf292f7540.osm 11:27:14.345 [main] INFO GeoClimate -- The OSM file has been downloaded at /tmp/cf1537df93d6dfdc94e79e62b0f1547cb5165b2f4c40364a14247adf292f7540.osm. 11:27:14.359 [main] INFO GeoClimate -- Load the OSM file in the database. 11:27:18.550 [main] INFO GeoClimate -- The input OSM file has been loaded in the database. 11:27:26.279 [main] INFO GeoClimate -- Building layer created 11:27:26.859 [main] INFO GeoClimate -- Road layer created 11:27:26.891 [main] INFO GeoClimate -- Rail layer created 11:27:27.177 [main] INFO GeoClimate -- Vegetation layer created 11:27:27.310 [main] INFO GeoClimate -- Water layer created 11:27:27.644 [main] INFO GeoClimate -- Impervious layer created 11:27:27.822 [main] INFO GeoClimate -- Urban areas layer created 11:27:28.032 [main] INFO GeoClimate -- Coastline layer created 11:27:52.937 [main] INFO GeoClimate -- Geoclimate will try to estimate the building heights with the model BUILDING_HEIGHT_OSM_RF_2_2.model. 11:27:52.943 [main] INFO GeoClimate -- Create the units of analysis... 11:28:24.405 [main] INFO GeoClimate -- Start computing the geoindicators... 11:28:24.406 [main] INFO GeoClimate -- Start computing building indicators... 11:28:58.188 [main] INFO GeoClimate -- Start computing block indicators... 11:29:05.310 [main] INFO GeoClimate -- Start computing RSU indicators... 11:29:17.671 [main] INFO GeoClimate -- Processing urban typology surface fraction calculation 11:29:18.327 [main] WARN GeoClimate -- The column pop doesn't exist or should be numeric 11:29:20.657 [main] INFO GeoClimate -- Geoindicators calculation time: 15.345 s 11:29:20.658 [main] INFO GeoClimate -- Start computing Typology indicators... 11:29:20.659 [main] INFO GeoClimate -- All geoindicators have been computed 11:29:20.672 [main] INFO GeoClimate -- Extracting the building having no height information and estimate it 11:29:20.917 [main] INFO GeoClimate -- Collect building indicators to estimate the height 11:29:23.227 [main] INFO GeoClimate -- Start estimating the building height 11:29:44.372 [main] INFO GeoClimate -- Replace the input building table by the estimated height 11:29:44.627 [main] INFO GeoClimate -- Re-formating building layer 11:29:46.239 [main] INFO GeoClimate -- Re-formating building finishes 11:29:46.365 [main] INFO GeoClimate -- Start computing the geoindicators... 11:29:46.365 [main] INFO GeoClimate -- Start computing building indicators... 11:30:19.560 [main] INFO GeoClimate -- Start computing block indicators... 11:30:25.854 [main] INFO GeoClimate -- Start computing RSU indicators... 11:30:25.855 [main] INFO GeoClimate -- Processing urban typology surface fraction calculation 11:30:25.861 [main] INFO GeoClimate -- Processing LCZ surface fraction indicators calculation 11:30:26.499 [main] WARN GeoClimate -- The column pop doesn't exist or should be numeric 11:31:04.299 [main] INFO GeoClimate -- Geoindicators calculation time: 38.444 s 11:31:04.299 [main] INFO GeoClimate -- Start computing Typology indicators... 11:31:04.299 [main] INFO GeoClimate -- The LCZ classification will be performed 11:31:04.573 [main] INFO GeoClimate -- The URBAN TYPOLOGY classification is performed 11:31:22.870 [main] INFO GeoClimate -- All geoindicators have been computed 11:31:45.338 [main] WARN GeoClimate -- The column pop doesn't exist or should be numeric org.h2.jdbc.JdbcSQLSyntaxErrorException: Duplication du nom de colonnes "TYPE_WATER" Duplicate column name "TYPE_WATER"; SQL statement: CREATE TABLE grid_indicators_dbfcc796_68cc_4bc1_8aef_28a1f6379262 AS SELECT a.THE_GEOM,a.ID_GRID,a.ID_COL,a.ID_ROW,b.LCZ_PRIMARY_2,b.LCZ_PRIMARY_3,b.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PE_COMMERCIAL,i.TYPE_CONSTRUCTION,i.TYPE_DETACHED,i.TYPE_EDUCATION,i.TYPE_EMERGENCY,i.TYPE_ENTERTAINMENT_ARTS_CULTURE,i.TYPE_FARM_AUXILIARY,i.TYPE_GOVERNMENT,i.TYPE_GRANDSTAND,i.TYPE_HEALTHCARE,i.TYPE_HOTEL,i.TYPE_HOUSE,i.TYPE_LIGHT_INDUSTRY,i.TYPE_MILITARY,i.TYPE_MONUMENT,i.TYPE_OFFICE,i.TYPE_RELIGIOUS,i.TYPE_RESIDENTIAL,i.TYPE_RUINS,i.TYPE_SHELTER,i.TYPE_SLIGHT_CONSTRUCTION,i.TYPE_SOCIAL_BUILDING,i.TYPE_SPORT,i.TYPE_SPORTS_CENTRE,i.TYPE_SUSTENANCE,i.TYPE_TERMINAL,i.TYPE_TOWNHALL,i.TYPE_TRAIN_STATION,i.TYPE_TRANSPORT,i.TYPE_WATER,j.FREE_EXTERNAL_FACADE_DENSITY,k.BUILDING_SURFACE_DENSITY,l.LAND_FRACTION,l.SEA_FRACTION,l.TYPE_WATER,m.SVF,n.EFFECTIVE_TERRAIN_ROUGHNESS_LENGTH,o.EFFECTIVE_TERRAIN_ROUGHNESS_CLASS FROM grid as a LEFT JOIN lcz_upper_scale_statistics_area as b ON b.id_grid = a.id_grid LEFT JOIN distribLczTableInt_3cada031_6072_425f_8fa1_178751cc8b24 as c ON c.id_grid = a.id_grid LEFT JOIN utrf_area_upper_scale_statistics_area as d ON d.id_grid = a.id_grid LEFT JOIN utrf_floor_area_upper_scale_statistics_area as e ON e.id_grid = a.id_grid LEFT JOIN RSU_SURFACE_FRACTIONS as f ON f.id_grid = a.id_grid LEFT JOIN unweighted_operation_from_lower_scale as g ON g.id_grid = a.id_grid LEFT JOIN weighted_aggregated_statistics as h ON h.id_grid = a.id_grid LEFT JOIN building_type_fraction_upper_scale_statistics_area as i ON i.id_grid = a.id_grid LEFT JOIN exact_free_external_facade_density as j ON j.id_grid = a.id_grid LEFT JOIN building_surface_fraction as k ON k.id_grid = a.id_grid LEFT JOIN upper_scale_statistics_area as l ON l.id_grid = a.id_grid LEFT JOIN grid_rsu_ground_sky_view_factor as m ON m.id_grid = a.id_grid LEFT JOIN rsu_effective_terrain_roughness_length as n ON n.id_grid = a.id_grid LEFT JOIN rsu_effective_terrain_roughness_class as o ON o.id_grid = a.id_grid [42121-224] at org.h2.message.DbException.getJdbcSQLException(DbException.java:514) at org.h2.message.DbException.getJdbcSQLException(DbException.java:489) at org.h2.message.DbException.get(DbException.java:223) at org.h2.message.DbException.get(DbException.java:199) at org.h2.table.Table.setColumns(Table.java:494) at org.h2.table.TableBase.(TableBase.java:73) at org.h2.mvstore.db.MVTable.(MVTable.java:139) at org.h2.mvstore.db.Store.createTable(Store.java:216) at org.h2.schema.Schema.createTable(Schema.java:797) at org.h2.command.ddl.CreateTable.update(CreateTable.java:112) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:256) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:216) at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:174) at org.h2.jdbc.JdbcCallableStatement.executeUpdate(JdbcCallableStatement.java:96) at groovy.sql.Sql.call(Sql.java:3110) at groovy.sql.Sql.call(Sql.java:3056) at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321) at org.orbisgis.geoclimate.geoindicators.DataUtils.joinTables(DataUtils.groovy:84) at org.orbisgis.geoclimate.geoindicators.DataUtils.joinTables(DataUtils.groovy) at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321) at org.orbisgis.geoclimate.geoindicators.WorkflowGeoIndicators.rasterizeIndicators(WorkflowGeoIndicators.groovy:2061) at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321) at org.orbisgis.geoclimate.osm.WorkflowOSM$_osm_processing_closure2.doCall(WorkflowOSM.groovy:623) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1008) at groovy.lang.Closure.call(Closure.java:433) at groovy.lang.Closure.call(Closure.java:422) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2389) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2374) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2427) at org.codehaus.groovy.runtime.dgm$209.doMethodInvoke(Unknown Source) at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321) at org.orbisgis.geoclimate.osm.WorkflowOSM.osm_processing(WorkflowOSM.groovy:413) at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321) at org.orbisgis.geoclimate.osm.WorkflowOSM.workflow(WorkflowOSM.groovy:361) at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321) at org.orbisgis.geoclimate.Geoclimate.call(Geoclimate.groovy:94) at org.orbisgis.geoclimate.Geoclimate.call(Geoclimate.groovy) at picocli.CommandLine.executeUserObject(CommandLine.java:1953) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358) at picocli.CommandLine$RunLast.handle(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2314) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine$RunLast.execute(CommandLine.java:2316) at picocli.CommandLine.execute(CommandLine.java:2078) at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321) at org.orbisgis.geoclimate.Geoclimate.main(Geoclimate.groovy:134)

ebocher commented 7 months ago

Fixed in current master

yoannlmr commented 6 months ago

Hi, I have the exactly same issue for Papeete, French Polynesia... with Window ! I don't found the solution in the topic... Could you help me ?@ebocher

What's the Current master ? :-x

Thank's you !

" { "description": "Processing OSM data", "input": { "locations": [ "Papeete, Îles du Vent, Polynésie française, 98714" ] }, "output": { "folder": "C:/Users/yolam/Documents/Geoclimate/Results" }, "parameters": { "rsu_indicators": { "indicatorUse": [ "LCZ", "TEB", "UTRF" ], "svfSimplified": true, "estimateHeight": true }, "grid_indicators": { "x_size": 100, "y_size": 100, "rowCol": false, "output" : "geojson", "indicators" :["BUILDING_FRACTION", "BUILDING_HEIGHT", "BUILDING_POP", "BUILDING_TYPE_FRACTION", "WATER_FRACTION", "VEGETATION_FRACTION", "ROAD_FRACTION", "IMPERVIOUS_FRACTION", "FREE_EXTERNAL_FACADE_DENSITY", "BUILDING_HEIGHT_WEIGHTED", "BUILDING_SURFACE_DENSITY", "SEA_LAND_FRACTION", "ASPECT_RATIO", "SVF", "HEIGHT_OF_ROUGHNESS_ELEMENTS", "TERRAIN_ROUGHNESS_CLASS", "UTRF_AREA_FRACTION", "UTRF_FLOOR_AREA_FRACTION", "LCZ_PRIMARY"] } } }"