Welcome to my Open Notebook

This is an Open Notebook with Selected Content - Delayed. All content is licenced with CC-BY. Find out more Here.

ONS-SCD.png

UPDATE to post 'GIS Issues when R is Used for Transforming Coordinate Systems'

infile <- "western_sydney_passive_samplers_site_details.csv"
indir <- "data_derived"

outdir <- indir
outfile <- file.path(outdir, gsub(".csv",".shp",infile))

dat <- read.csv(file.path(indir, infile), as.is=T)
str(dat)
  
dat2 <- SpatialPointsDataFrame(data.frame(x=dat$long, y=dat$lat), dat,
                                proj4string=CRS(epsg$prj4[epsg$code %in% '4283'])
                                )

writeOGR(dat2, outfile,
         outdir, driver='ESRI Shapefile'
         )
# fix the prj file 
download.file("http://spatialreference.org/ref/epsg/4283/prj/",
              gsub(".shp", ".prj", outfile), mode = "wb"
              )

/images/samplers_sydney.png

Posted in  Data Operation spatial


blog comments powered by Disqus