Não foi possível enviar o arquivo. Será algum problema com as permissões?
Diferenças
Aqui você vê as diferenças entre duas revisões dessa página.
software:art:curso:bodmin [2007/12/12 00:52] paulojus criada |
software:art:curso:bodmin [2007/12/12 00:53] (atual) paulojus |
||
---|---|---|---|
Linha 11: | Linha 11: | ||
require(splancs) | require(splancs) | ||
data(bodmin) | data(bodmin) | ||
- | <code> | + | </code> |
getting to know the data | getting to know the data | ||
Linha 18: | Linha 18: | ||
polymap(bodmin$poly) | polymap(bodmin$poly) | ||
pointmap(as.points(bodmin), add=TRUE) see the plot! | pointmap(as.points(bodmin), add=TRUE) see the plot! | ||
- | <code> | + | </code> |
\\ | \\ | ||
\\ | \\ | ||
Linha 27: | Linha 27: | ||
<code R> | <code R> | ||
ker <- kernel2d(as.points(bodmin), bodmin$poly, h0=2, nx=100, ny=100) | ker <- kernel2d(as.points(bodmin), bodmin$poly, h0=2, nx=100, ny=100) | ||
+ | </code> | ||
plot splancs results | plot splancs results | ||
Linha 33: | Linha 34: | ||
polygon(bodmin$poly, lwd=2) | polygon(bodmin$poly, lwd=2) | ||
pointmap(as.points(bodmin), add=TRUE, pch=19) see the plot | pointmap(as.points(bodmin), add=TRUE, pch=19) see the plot | ||
- | <code> | + | </code> |
\\ | \\ | ||
Linha 43: | Linha 44: | ||
con = openConn() | con = openConn() | ||
con | con | ||
- | <code> | + | </code> |
how to delete an existing database (if already exists) | how to delete an existing database (if already exists) | ||
Linha 49: | Linha 50: | ||
if(any(showDbs(con)=="bodmin")) | if(any(showDbs(con)=="bodmin")) | ||
deleteDb(con, "bodmin", force=T) | deleteDb(con, "bodmin", force=T) | ||
- | <code> | + | </code> |
creating a new database | creating a new database | ||
Linha 55: | Linha 56: | ||
bod = createDb(con, "bodmin") | bod = createDb(con, "bodmin") | ||
bod | bod | ||
- | <code> | + | </code> |
aRT uses "sp" representations of spatial objects. | aRT uses "sp" representations of spatial objects. | ||
Linha 67: | Linha 67: | ||
## | ## | ||
l_points <- importSpData(bod, xy, "coords") | l_points <- importSpData(bod, xy, "coords") | ||
- | <code> | + | </code> |
checking the status of the database | checking the status of the database | ||
<code R> | <code R> | ||
bod | bod | ||
- | <code> | + | </code> |
Note: the importSpData() command above encapsulates several steps | Note: the importSpData() command above encapsulates several steps | ||
Linha 86: | Linha 86: | ||
addPolygons(l_pol, pol) | addPolygons(l_pol, pol) | ||
createTable(l_pol, "t_pol") | createTable(l_pol, "t_pol") | ||
- | <code> | + | </code> |
c. Preparing and transfering the image (raster) | c. Preparing and transfering the image (raster) | ||
Linha 97: | Linha 97: | ||
l_kernel <- createLayer(bod, "kernel") | l_kernel <- createLayer(bod, "kernel") | ||
addRaster(l_kernel, g) | addRaster(l_kernel, g) | ||
- | <code> | + | </code> |
Linha 104: | Linha 104: | ||
l_splancs <- createLayer(bod, "kernelsplancs") | l_splancs <- createLayer(bod, "kernelsplancs") | ||
addRaster(l_splancs, ker) | addRaster(l_splancs, ker) | ||
- | <code> | + | </code> |
Linha 110: | Linha 110: | ||
<code R> | <code R> | ||
bod | bod | ||
- | <code> | + | </code> |
**//open and inspect the database in terraView!!!//** | **//open and inspect the database in terraView!!!//** | ||
Linha 123: | Linha 123: | ||
fullgrid(g)=TRUE | fullgrid(g)=TRUE | ||
plot(pol, add=T, lwd=2) | plot(pol, add=T, lwd=2) | ||
- | <code> | + | </code> |
Ploting the DB layers -- plot from aRT | Ploting the DB layers -- plot from aRT | ||
Linha 130: | Linha 130: | ||
plot(l_points, add=T, pch=19) | plot(l_points, add=T, pch=19) | ||
plot(l_pol, add=T, lwd=2) | plot(l_pol, add=T, lwd=2) | ||
- | <code> | + | </code> |
\\ | \\ | ||
Linha 140: | Linha 140: | ||
th <- createTheme(l_kernel, "raster", view="vbod1") | th <- createTheme(l_kernel, "raster", view="vbod1") | ||
setVisual(th, visualRaster(color=rev(heat.colors(21))), mode="r") | setVisual(th, visualRaster(color=rev(heat.colors(21))), mode="r") | ||
- | <code> | + | </code> |
Linha 150: | Linha 150: | ||
th <- createTheme(l_splancs, "kernelsplancs", view="vbod2") | th <- createTheme(l_splancs, "kernelsplancs", view="vbod2") | ||
setVisual(th, visualRaster(color=rev(heat.colors(21))), mode="r") | setVisual(th, visualRaster(color=rev(heat.colors(21))), mode="r") | ||
- | <code> | + | </code> |
checking the sattus of the data base | checking the sattus of the data base | ||
<code R> | <code R> | ||
bod | bod | ||
- | <code> | + | </code> |
\\ | \\ | ||
\\ | \\ | ||
**// open and visualise the database in terraView!!! //** | **// open and visualise the database in terraView!!! //** | ||