lundi 16 mai 2011

[R] Buildings on Google Earth : from 2D to 3D



As I discover the marvels of (geo)R world, I found out this article (link)

It explains how to generate KML files from meuse, the source dataset delivered with sp package, using R software.

In the tutorial, KML files are created from scracth, writing each line of it.OGR driver only gives access to the options name and description (rdgal driver). So, "brute coding" may be necessary if you want to control other elements: color, heights for extruded objects...

Many people would like to visualize some buildings in 3D in google. The reference data that we have for buildings is often plain but there usually is a column specifying the height of each building. For example, for the french BDTOPO, the HAUTEUR column.

mercredi 8 décembre 2010

[Rasters in QGIS] Generate a Vector Grid with Average Slope Values




Operations:
  • Slope: DEM Layer.tif=[QGIS/Raster Based Terrain Analysis]=>slope.tif=>[r.in.gdal]=>slope
  • Grid: [QGIS/Vector/Research Tools/Vector Grid]=>grid.shp=[v.in.ogr]=>grid=>[v.to.rast]=>grid
  • Crossing Grid and Slope: grid*slope=[r.average]=>gridSlope=[r.to.vect]=>gridSlope=[v.out.ogr]=>gridSlope.shp

lundi 22 novembre 2010

[Talend SDI] 2 very simple , yet useful operations


Here, we'll see how to sort features by area and how to remove duplicate features.

Sort features by area

Here is an example of layer I got. The representation is not convenient for printing as small features are partially or totally covered by bigger ones. So, I'd like small features to be on the top.

Here is the job in SDI:


1-Automatically generate the schema of the shapefile




jeudi 9 septembre 2010

Importer le MNT de l'IGN avec QGIS & GRASS

Ici, nous allons voir comment importer le Modèle Numérique de Terrain de l'IGN dans QGIS/GRASS et comment visualiser le résultat dans le visionneur 3D NVIZ

jeudi 2 septembre 2010

[GRASS] Aerial Image + Shaded Relief => Shaded Aerial Image

Sometimes, one might find the relief feeling given by an aerial image a little poor. You could also find that the moment the photo was taken doesn't enhance the right elements of the relief.



One solution is to use a raster elevation to integrate a shaded relief to an aerial image.

Used modules

Prerequisites
This assumes that you already have in your mapset:
  • the aerial image: ortho
  • the elevation raster map: MNT. This article explains you how to import MNT (for french readers)
And that your GRASS region is positioned on your area of interest:

g.region rast=ortho

Creating the shaded relief

r.shaded.relief map=MNT shadedmap=MNT.shaded altitude=80 azimuth=60 zmult=1 scale=1



Combining the aerial image with the shaded relief
Here, we use the aerial image and use the intensity of the shaded relief so as to get a modified aerial image.

r.his h_map=ortho i_map=MNT.shaded g_map=ortho.shaded.green b_map=ortho.shaded.blue r_map=ortho.shaded.red

The areas of the aerial image covered by dark areas of shaded relief will get darker but those covered by white areas will remain closely the same.
That's why the choice of altitude is important during the r.shaded.relief step. Using a low altitude parameter will cause the horizontal areas of the final image to be dark. We chose a value close to 90 (mid-day time), so as to enhance the horizontal areas.

Combining the different color raster maps of the shaded aerial image
As the shaded relief aerial image has been generated in 3 different rasters maps, we have to merge them.

r.composite green=ortho.shaded.green blue=ortho.shaded.blue red=ortho.shaded.red out=ortho.shaded

Here's the result:

Here, the feeling of relief that has been added is very light. Play around the azimuth and altitude parameters to get the appropriate aspect for your map.

Note: All the operations have been performed from QGIS, sometimes from the GRASS QGIS Shell. If you use GRASS and not QGIS, this operation is unnecessary. When displaying the aerial image under GRASS, just choose "Drape Map". However, you may find an interest in applying this method under GRASS if you want to output the result...