forked from GeoScripting-WUR/PythonWeek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runningapythonscript.Rmd
48 lines (35 loc) · 1.34 KB
/
runningapythonscript.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: "Tutorial: the pointbuffer python script"
author: "Jan Verbesselt, Aldo Bergsma, Jorge Mendes de Jesus"
date: "17 Nov 2014"
output:
html_document:
toc: true
theme: united
---
# Introduction
### Launch osgeo live from vmware viewer, login.
### How to start Python via the terminal.
### Open the python script within the editor.
# Run the pointbuffer.py script
Below we will explain step by step what is done is the python script so that you
can work on the script from home.
```{r, engine='python'}
from osgeo import ogr
from osgeo import osr
# Create a point geometry
wkt = "POINT (173914.00 441864.00)"
pt = ogr.CreateGeometryFromWkt(wkt)
print(pt)
```
# More info about creating a markdown document in Rstudio via R
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.