Commit c387e14b by Jan Wijffels

apparently projection was EPSG:31370 and not what was in .prj file

parent 88050c67
......@@ -4,13 +4,14 @@ library(rgeos)
library(tmap)
library(utils)
library(data.table)
library(maptools)
settings <- list()
settings$hierarchy <- list()
settings$hierarchy$municipalities <- file.path(getwd(), "inst", "extdata", "TF_PSNL_INC_TAX_MUNTY_tcm325-272513.zip")
settings$hierarchy$nis.sectors <- file.path(getwd(), "inst", "extdata", "TF_PSNL_INC_TAX_SECTOR_tcm325-278417.zip")
settings$nis.sectors <- file.path(getwd(), "inst", "extdata", "scbel01012011_gen13_tcm325-275679", "scbel01012011_gen13.shp")
settings$agglomeraties <- file.path(getwd(), "inst", "extdata", "SH_CENSUS_2011_AGGLOMERATIONS_200M.shp_tcm325-276234")
settings$agglomeraties <- file.path(getwd(), "inst", "extdata", "SH_CENSUS_2011_AGGLOMERATIONS_200M.shp_tcm325-276234", "SH_CENSUS_2011_AGGLOMERATIONS_200M.shp")
......@@ -44,7 +45,8 @@ BE_ADMIN_HIERARCHY <- hierarchy[, c("CD_REFNIS_SECTOR", "CD_SECTOR", "TX_SECTOR_
ogrListLayers(settings$agglomeraties)
ogrInfo(settings$agglomeraties, layer = "SH_CENSUS_2011_AGGLOMERATIONS_200M")
BE_ADMIN_AGGLOMERATIONS <- readOGR(settings$agglomeraties, layer = "SH_CENSUS_2011_AGGLOMERATIONS_200M", stringsAsFactors = FALSE)
BE_ADMIN_AGGLOMERATIONS <- readShapeSpatial(fn = settings$agglomeraties, proj4string = CRS("+init=EPSG:31370"))
#BE_ADMIN_AGGLOMERATIONS <- readOGR(settings$agglomeraties, layer = "SH_CENSUS_2011_AGGLOMERATIONS_200M", stringsAsFactors = FALSE) ## will need to ask statbel why this is different
colnames(BE_ADMIN_AGGLOMERATIONS@data) <- tolower(make.names(colnames(BE_ADMIN_AGGLOMERATIONS@data), allow_=FALSE))
BE_ADMIN_AGGLOMERATIONS <- spTransform(x=BE_ADMIN_AGGLOMERATIONS, CRSobj = CRS("+proj=longlat +datum=WGS84"))
......@@ -54,8 +56,8 @@ BE_ADMIN_AGGLOMERATIONS <- spTransform(x=BE_ADMIN_AGGLOMERATIONS, CRSobj = CRS("
ogrListLayers(settings$nis.sectors)
ogrInfo(settings$nis.sectors, layer = "scbel01012011_gen13")
BE_ADMIN_SECTORS <- readOGR(settings$nis.sectors, layer = "scbel01012011_gen13", stringsAsFactors = FALSE)
BE_ADMIN_SECTORS <- readShapeSpatial(fn = settings$nis.sectors, proj4string = CRS("+init=EPSG:31370"))
#BE_ADMIN_SECTORS <- readOGR(settings$nis.sectors, layer = "scbel01012011_gen13", stringsAsFactors = FALSE) ## gives a shift when putting in WGS84
colnames(BE_ADMIN_SECTORS@data) <- tolower(make.names(colnames(BE_ADMIN_SECTORS@data), allow_=FALSE))
isutf8 <- function(x){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment