FAQ
Dear all,

Is there a straightforward way of changing the shape of a polygon "A", by superimposing another polygon "B", and keeping only that part of "A" which is not overlapped by "B"?

In brief, and as a reproducible example, I'm trying to get a polygon for Greek Cyprus. It's easy to get a polygon for the whole island, and I've found a polygon of just the Turkish part of Cyprus. But I can't find a polygon for the Greek part alone, and it seems like there might be a way to create one by carving out the Turkish part from the whole island:

library(cshapes)
world <- cshp(date=as.Date("2008-6-30"))
cy <- world[world$CNTRY_NAME=="Cyprus",]

library(maptools)
download.file(url="http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/50m-admin-0-breakaway-disputed-areas.zip", dest="50m-admin-0-breakaway-disputed-areas.zip")
unzip("50m-admin-0-breakaway-disputed-areas.zip")
brk <- readShapeSpatial("50m-admin-0-breakaway-disputed-areas.shp", proj4string=CRS("+proj=longlat +ellps=WGS84"))
tuc <- brk[brk$Name=="Turkish Republic of Northern Cyprus",]

plot(cy)
plot(tuc, add=T)

Any assistance/suggestions would be much appreciated. Apologies if I've overlooked anything obvious.

- Malcolm

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupr-sig-geo @
categoriesr
postedJan 6, '11 at 11:15a
activeJan 7, '11 at 2:31a
posts2
users2
websiter-project.org
irc#r

2 users in discussion

Malcolm Fairbrother: 1 post Rundel: 1 post

People

Translate

site design / logo © 2022 Grokbase