Skip to content

Instantly share code, notes, and snippets.

View RCura's full-sized avatar

Robin Cura RCura

View GitHub Profile
@RCura
RCura / gist:4073277
Created November 14, 2012 16:52
subprocess / gdalwarp error
# -*- coding: utf-8 -*-
import subprocess
#gdalwarp -q -cutline "/media/robin/DATA/Donnees_M2/monPolygoneLAEA.shp" -crop_to_cutline -dstalpha -of GTiff "/media/robin/DATA/Donnees_M2/popu01clc00v5/popgrid.tif" "/media/robin/DATA/Donnees_M2/popu01clc00v5/popgridCut.tif"
# This command works
polyPath = "/media/robin/DATA/Donnees_M2/monPolygoneLAEA.shp"
rasterPath = "/media/robin/DATA/Donnees_M2/popu01clc00v5/popgrid.tif"
outRasterPath = "/media/robin/DATA/Donnees_M2/popu01clc00v5/popgridCut.tif"
@RCura
RCura / Launcher.scala
Created January 11, 2013 13:37
test javafx
package fr.geocite.myprojet
import javafx.event.ActionEvent
import javafx.event.EventHandler
import javafx.scene.Group
import javafx.scene.Scene
import javafx.scene.control._
import javafx.scene.effect.Lighting
import javafx.scene.paint.Color
import javafx.scene.text.Text
@RCura
RCura / Launcher.scala
Created January 18, 2013 15:51
JavaFX et typage
package fr.geocite.myprojet
import javafx.event.ActionEvent
import javafx.event.EventHandler
import javafx.scene.{control, Group, Scene}
import javafx.scene.control._
import javafx.scene.effect.Lighting
import javafx.scene.paint.Color
import javafx.scene.text.Text
import javafx.stage.Stage
import fr.geocite.simprocess.javafx.ui.tableview.JFXTableView
import javafx.scene.layout._
import javafx.geometry.{ Orientation, HPos, Insets }
import javafx.scene.control._
import javafx.collections.{ ObservableList, FXCollections }
import fr.geocite.simprocess.javafx.ui.doubleslider.DoubleSlider
import fr.geocite.simprocess.javafx.ui.textfield.DoubleTextField
import javafx.beans.value.{ ObservableValue, ChangeListener }
import javafx.event.{ ActionEvent, EventHandler }
import javafx.scene.{ Node, Scene, input }
// We create a list of columns, that will contain all the variables to be filtred.
val buffer = new scala.collection.mutable.ListBuffer[Array[_]]
buffer += valueVariableX
buffer += valueVariableY
listFiltre.foreach { v ⇒ v
val columnName = v.name.toString
val columnVariable = getVariableFromColumn(columnName)
val columnValue = get[Array[Double]](columnVariable) match {
case Some(i: Array[Double]) ⇒ i
val abc = scala.collection.mutable.ListBuffer[Double]
abc += 45
abc += 87
def f(l: List[_]) = l
f(abc)
implicit def arrayToList[T](a:scala.collection.mutable.ListBuffer[T]): List[T] = a.toList
def createColumnNamesList(): List[String] =
{
val columnsToAdd = new ListBuffer[String]
val tmpXCol = mappedVar.get("X") match {
case Some(x: String) ⇒ x
case _ ⇒ ""
}
if (tmpXCol != "") {
columnsToAdd += tmpXCol
}
package fr.geocite.simprocess.hook.xylinecharts
import org.openmole.core.model.data._
import fr.geocite.simprocess.javafx.ui.{ filter, IVariableData }
import org.openmole.misc.exception.UserBadDataError
import filter.FilterLine
import scala.collection.JavaConversions._
import spray.json._
import scala.Array
import javafx.collections.FXCollections
# -*- coding: utf-8 -*-
from osgeo import ogr
roadShpPath = "D:\\DonneesM2\\UMZ_2000_Cut.shp"
fieldToUse = 'Type'
driver = ogr.GetDriverByName("ESRI Shapefile")
datasource = driver.Open(roadShpPath)
layer = datasource.GetLayer()
myFolder <- "/home/robin/imagesR"
test <- runif(n=10)
for(i in 1:10){
png(filename=paste(myFolder, "/test_", i, ".png",sep=""),
units="in",
width=5,
height=4,
pointsize=12,