public void createSpatialIndex ( String tableName , String geomColumnName ) throws Exception { if ( geomColumnName == null ) { geomColumnName = "the_geom" ; } String realColumnName = getProperColumnNameCase ( tableName , geomColumnName ) ; String realTableName = getProperTableNameCase ( tableName ) ; String sql = "CREATE SPATIAL INDEX ON " + realTableName + "(" + realColumnName + ");" ; execOnConnection ( connection -> { try ( IHMStatement stmt = connection . createStatement ( ) ) { stmt . execute ( sql . toString ( ) ) ; } return null ; } ) ; }
Create a spatial index .