
source('LinkReduce.R')

DEasp <- 1
DElnk <- read.link('de.tri')
DEcoo <- read.table('de.coo', col.names=c('x', 'y', 'lx', 'ly', 'lbl'), row.names=5)[labels(DElnk), 1:2]
DEmap <- read.table('de.lines')
DEnewlnk <- link.reduce(DElnk, DEcoo, DEmap)
plot.link(DElnk, DEcoo, DEmap, asp=DEasp, col="gray", main="Deutschland", sub="full triangulation", xlab="", ylab="", axes=FALSE)
plot.link(DEnewlnk, DEcoo, DEmap, asp=DEasp, col="gray", main="Deutschland", sub="reduced triangulation", xlab="", ylab="", axes=FALSE)
#write.link(DEnewlnk, 'de-reduced.tri')


NLasp <- 1.63
NLlnk <- read.link('nl.tri')
NLcoo <- read.table('nl.coo', col.names=c('x', 'y', 'lx', 'ly', 'lbl'), row.names=5)[labels(NLlnk), 1:2]
NLmap <- read.table('nl.lines')
NLnewlnk <- link.reduce(NLlnk, NLcoo, NLmap, asp=NLasp)
plot.link(NLlnk, NLcoo, NLmap, asp=NLasp, col="gray", main="Nederland", sub="full triangulation", xlab="", ylab="", axes=FALSE)
plot.link(NLnewlnk, NLcoo, NLmap, asp=NLasp, col="gray", main="Nederland", sub="reduced triangulation", xlab="", ylab="", axes=FALSE)
#write.link(NLnewlnk, 'nl-reduced.tri')

