Closed agrignard closed 4 years ago
@LeticiaIG @gamalielpalomo any update on this part?
3D buildings and DEM almost done, working on agents following the terrain (3D moving).
[https://github.com/CityScope/CSL_Guadalajara/issues/15#issuecomment-606503249] The terrain was obtained through Google Earth. I used a gh component which with the input of a WSG84 coordinate set, queries the Google elevation API and returns the elevation coordinates. And from there, triangulating the points, I built the mesh. So perhaps the representation was not very accurate. Now I am working with a .asc obtained from https://portal.opentopography.org/rasterOutput?jobId=rt1585694003893. (just sent the .asc file to Gamal) Since we did not have the buildings inside the blocks, these were drawn by hand, so a shapefile had to be created from the resulting polygons. I've already accomplished that, now I'm squaring it so that altitude and depth fields in the new shapefile are consistent with the terrain
I don't know if I am using the syntax correctly. Does the facet "elevation:true" allow to show each cell elevation? I am using it with an .asc file and seems dont work
@gamalielpalomowhich .asf file are you mentionning? is it in the github?
Yes the elevation:"valueToVisualize
is here to show the elevation if you specify which value you want to map (in this case valueToVisualize)
Can you try with this model and just replacing hab10 by your .asc
/**
* Name: ESRI ASCII to grid model
* Author: Patrick Taillandier
* Description: Model which shows how to initialize a grid using a ESRI ASCII file
* Tags: grid, load_file, asc
*/
model ascimport
global {
//definiton of the file to import
file grid_data <- file('../includes/hab10.asc') ;
//computation of the environment size from the geotiff file
geometry shape <- envelope(grid_data);
}
//definition of the grid from the asc file: the width and height of the grid are directly read from the asc file. The values of the asc file are stored in the grid_value attribute of the cells.
grid cell file: grid_data{
init {
color<- grid_value = 0.0 ? #black : (grid_value = 1.0 ? #green : #yellow);
}
}
experiment gridloading type: gui {
output {
display "As DEM" type: opengl{
grid cell lines: #gray elevation: grid_value * 300 ;
}
display "As 2D grid" type: java2D {
grid cell lines: #black;
}
}
}
It works! I'am uploading the latest version
Great!!! Good job, it look great!
Add a digital Elevation Model using this model as an example in the GAMA model library Data/Data Importation/models/Grid DEM.gaml