pick your flavor of gvsig: both are good

another high quality spatial desktop software is gvSig. there are two versions, gvsig & a forked gvsig ce (community edition). both are really great but i have a preference for the ce edition (more tools). through the ce edition is a bit stale with older release, hoping this will change. the topology functions are really outstanding as is the sextante toolbox (victor olay is a very talented dev!). there are many functions that are not found else where ie. mean direction of lines, minimun enclosing shapes (the rectangle is min area based as opposed to saga’s min rect perimeter) & the geometric properties of lines that will calc bearing from north:)

from website:
gvSIG CE is a community driven GIS project fork of gvSIG that will be bundled with SEXTANTE, GRASS GIS and SAGA. This project is not supported by the gvSIG Association. gvSIG CE is not an official project of gvSIG.

you’ll need to increase the memory of the default settings to handle large projects. java based program, so set the -Xmx higher (look in the bin dir for the *.ini file).

it’s context based workflow, meaning if the attribute table is highlighted only those tools will be shown & likewise for the active layer.

note: when defining an initial layer, you must set the projection. select layer & click properties in menu tab to right.

in terms of capabilities, ive set -Xms to 1500M & processed geometries of lines of ~ 6 million line segments. pretty good!

Quick thoughts on transforming GeoTiff tags into parseable structure -> xml

Not a complete walk through here but some quick thoughts to a post for assist on twitter. What they wanted was to turn geotiff tags into csv or xml.

If you have GDAL installed & who doesn’t these days a quick way to turn the gdalinfo info (tags) into xml is to convert raster to Virtual Raster (VRT). This is an xml representation of raster.

>> gdal_translate -of VRT [destination name with .vrt extension]

This is what you end up with:

All that’s left to do is parse :)

<VRTDataset rasterXSize=”5529″ rasterYSize=”4607″>
<SRS>PROJCS[&quot;Lambert Conformal Conic&quot;,GEOGCS[&quot;NAD83&quot;,DATUM[&quot;North_American_Datum_1983&quot;,SPHEROID[&quot;GRS 1980&quot;,6378137,298.2572221010002,AUTHORITY[&quot;EPSG&quot;,&quot;7019&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;6269&quot;]],PRIMEM[&quot;Greenwich&quot;,0],UNIT[&quot;degree&quot;,0.0174532925199433],AUTHORITY[&quot;EPSG&quot;,&quot;4269&quot;]],PROJECTION[&quot;Lambert_Conformal_Conic_2SP&quot;],PARAMETER[&quot;standard_parallel_1&quot;,49],PARAMETER[&quot;standard_parallel_2&quot;,77],PARAMETER[&quot;latitude_of_origin&quot;,63.390675],PARAMETER[&quot;central_meridian&quot;,-91.86666666666666],PARAMETER[&quot;false_easting&quot;,6200000],PARAMETER[&quot;false_northing&quot;,3000000],UNIT[&quot;metre&quot;,1,AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]]]</SRS>
<GeoTransform>  5.6058900000000000e+06,  3.0000000000000000e+01,  0.0000000000000000e+00,  3.8967900000000000e+06,  0.0000000000000000e+00, -3.0000000000000000e+01</GeoTransform>
<Metadata>
<MDI key=”AREA_OR_POINT”>Area</MDI>
</Metadata>
<VRTRasterBand dataType=”Float32″ band=”1″>
<Metadata>
<MDI key=”COLOR_TABLE_RULE_RGB_0″>0.000000e+00 4.821725e+01 255 255 0 0 255 0</MDI>
<MDI key=”COLOR_TABLE_RULE_RGB_1″>4.821725e+01 9.643450e+01 0 255 0 0 255 255</MDI>
<MDI key=”COLOR_TABLE_RULE_RGB_2″>9.643450e+01 1.446518e+02 0 255 255 0 0 255</MDI>
<MDI key=”COLOR_TABLE_RULE_RGB_3″>1.446518e+02 1.928690e+02 0 0 255 255 0 255</MDI>
<MDI key=”COLOR_TABLE_RULE_RGB_4″>1.928690e+02 2.410863e+02 255 0 255 255 0 0</MDI>
<MDI key=”COLOR_TABLE_RULES_COUNT”>5</MDI>
</Metadata>
<NoDataValue>-9.99900000000000E+03</NoDataValue>
<ColorInterp>Gray</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT=”1″>cded_30m.tif</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize=”5529″ RasterYSize=”4607″ DataType=”Float32″ BlockXSize=”5529″ BlockYSize=”1″ />
<SrcRect xOff=”0″ yOff=”0″ xSize=”5529″ ySize=”4607″ />
<DstRect xOff=”0″ yOff=”0″ xSize=”5529″ ySize=”4607″ />
</SimpleSource>
</VRTRasterBand>
</VRTDataset>

Using GRASS within R: Part 1

Recently I’ve been doing work on determining oriented landscapes on Eastern Victoria Island. If you’re familiar with the Canadian NTS index I’m working primarily in NTS 77E for testing. Surficial geologists are very interested in processes that assist in explaining genesis. The landscape from a regional perspective can be broken down into two broad categories: 1)oriented & 2) non-oriented. Oriented really means stream line like landforms (think drumlins, flutes, eskers) that have an azimuth & can be grouped into fields. All other terrain, primarily hummocky are grouped into non-oriented.

Using the artefact rich CDED dem, I have a work-flow that identifies larger oriented features. Now the trick is to figure out the orientation that each feature exhibits & further begin to group fields that share similar orientations. I have not mentioned direction because that implies an angle & “flow” direction. By finding the streamline forms, the surficial geologist can determining from the drumlin fields what the direction of ice travel was. So the orientations I calculate will need to be adjusted after consulting with them. Not a big issue really, once you have the algorithm down for this.

 

I have been using GRASS within R. The spgrass6 package is great as it allows the creation of temporary grass location & mapsets for use. For this to work you need to have GRASS installed.

## load libraries
library(rgdal)
library(spgrass6)
library(raster)

## create tmp grass location
initGRASS(gisBase=”/usr/local/grass-6.4.3svn/”,home=tempdir(),override=T)
# gmeta<-gmeta6()

## change to permanent mapset to apply projection change for region
execGRASS(“g.mapset”,flags=c(“c”),parameters=list(mapset=”PERMANENT”))
## convert default coordinate system x,y to epsg code 3347 (can be altered later)
execGRASS(“g.proj”,flags=c(“c”),epsg=as.integer(3347))

## import clusters majority. “o” flag uses location proj. location & raster epsg must be same.
execGRASS(“r.in.gdal”,flags=c(“overwrite”,”o”),parameters=list(input=”../Tmp/saga_walk_through/Clusters_gdal.sdat”,output=”clustersInput”))

## review env settings
execGRASS(“g.gisenv”,flags=”s”)

# ## list dems
execGRASS(“g.list”,parameters=list(type=”rast”))

## set region to import clusters majority raster
execGRASS(“g.region”,flags=c(“p”,”a”),parameters=list(rast=”clustersInput”))

## apply mode 3*3 to clusters
execGRASS(“r.neighbors”,flags=c(“overwrite”),parameters=list(input=”clustersInput”,output=”clustersMode3″,method=”mode”))

### write vect to R obj for viewing
## read org clusters mode 3*3 into R
rastMode3Clusters<-readRAST6(“clustersMode3″)
## convert the spatialgriddataframe to raster object
rMode3Clusters<-raster(rastMode3Clusters)

## plot
plot(rMode3Clusters)

## write to disk for future reference. INT1U == BYTE
writeRaster(rMode3Clusters,filename=”Tmp/orgClustersMode3.tif”,format=”GTiff”,datatype=”INT1U”,NAFlag=as.integer(255),overwrite=TRUE)

 

I hope this gives you a quick idea of using GRASS within R.

I will be posting more on this matter in the coming days & will get a bit more technical with it.

 

Cheers,

Richard

OSGEO Ottawa Update

Hope everyone has had a great Holiday period!!

I’ve recently been asked to be the chair for our local Osgeo Ottawa group. Must say I am very honoured to have been asked:) Very excited to be working in this role and working with everyone in our community to keep the great momentum & friendly atmosphere that others before me have fostered. If you have any ideas, please post a comment.

Just proposed our first New Yrs meetings here. Really hope you can get out!

Looking forward to seeing everyone very soon.

Cheers,

Richard