Re: [R-sig-Geo] how to transform Polygons to SpatialPolygons

2010-06-22 Thread Hans-Jörg Bibiko
On Jun 22, 2010, at 10:29 PM, Weidong Gu wrote: > > The question is how to transform 'mainland' back into SpatialPolygons format. Hi, maybe try the following: library(maps) library(maptools) usa=map('usa',plot=F,fill=T) IDs=sapply(strsplit(usa$names,':'), function(x) x[1]) crs=CRS('+proj=lo

Re: [R-sig-Geo] reading kmz file in R

2010-06-07 Thread Hans-Jörg Bibiko
On Jun 7, 2010, at 2:23 PM, Hans-Jörg Bibiko wrote: > On Jun 7, 2010, at 1:36 PM, Heuvelink, Gerard wrote: > I used 'Add polygon' in Google Earth to create a (single) closed polygon. It > was saved with extension kmz. >> >> How can I open such a file in R, suc

Re: [R-sig-Geo] reading kmz file in R

2010-06-07 Thread Hans-Jörg Bibiko
On Jun 7, 2010, at 1:36 PM, Heuvelink, Gerard wrote: > I used 'Add polygon' in Google Earth to create a (single) closed polygon. It > was saved with extension kmz. > > How can I open such a file in R, such that I can for instance do an overlay > with raster maps (SpatialGridDataFrame)? Here

[R-sig-Geo] Coastline data for TM_WORLD_BORDERS 0.2

2010-02-26 Thread Hans-Jörg Bibiko
Hi, My task is to draw a projected map (proj=cea, lon_0=25E) based on data coming from http://mappinghacks.com/data/TM_WORLD_BORDERS-0.2.zip (not wrld_simpl) which should have different colours for political boundaries and coastlines AND some country polygons should be highlighted by a differe

Re: [R-sig-Geo] Is there an annotated river dataset available?

2010-01-08 Thread Hans-Jörg Bibiko
On Jan 8, 2010, at 2:29 PM, Karl Ove Hufthammer wrote: > On Fri, 8 Jan 2010 13:25:24 +0100 Hans-Jörg Bibiko > wrote: >> Thanks for the hint! >> The absolute length can make sense of course but if I need also >> the largest rivers of a smaller island then this fai

Re: [R-sig-Geo] Is there an annotated river dataset available?

2010-01-08 Thread Hans-Jörg Bibiko
On Jan 8, 2010, at 1:41 PM, Barry Rowlingson wrote: > http://www.naturalearthdata.com/downloads/10m-physical-vectors/ > > the one with "scale ranks and tappering" has some metadata which might > relate to size... Ah, yes. Thanks a lot!! This kind of data I looked for :) --Hans __

Re: [R-sig-Geo] Is there an annotated river dataset available?

2010-01-08 Thread Hans-Jörg Bibiko
On Jan 8, 2010, at 12:20 PM, Karl Ove Hufthammer wrote: > On Fri, 8 Jan 2010 10:11:20 +0100 Hans-Jörg Bibiko > wrote: >> I've a tiny question. Is there an annotated river dataset available? >> By 'annotated' I mean that rivers are ranked by a sort of >>

[R-sig-Geo] Is there an annotated river dataset available?

2010-01-08 Thread Hans-Jörg Bibiko
Hi, I've a tiny question. Is there an annotated river dataset available? By 'annotated' I mean that rivers are ranked by a sort of relevance/size/length or whatever. The problem is that I have an huge SpatialLines object called 'rivers' which shows ~23200 rivers but I have to draw a map which

[R-sig-Geo] How to draw a map as PDF which shows the exact given view port only and without any border (PDF crop)

2009-12-10 Thread Hans-Jörg Bibiko
Hi, I tried to find an answer in the net but up to now without success. A simple example made with: R version 2.10.0 (2009-10-26) x86_64-apple-darwin9.8.0 locale: [1] C/en_US.UTF-8/C/C/C/C attached base packages: [1] stats graphics grDevices utils datasets methods base My

Re: [R-sig-Geo] maps with R

2009-10-15 Thread Hans-Jörg Bibiko
Or simply go to http://www.gadm.org/country select China and format R. Cheers, Hans-Jörg ** Hans-Joerg Bibiko Max Planck Institute for Evolutionary Anthropology Department of Linguistics Deutscher Platz 6 phone: +49 (0) 341 3550 34

Re: [R-sig-Geo] maps with R

2009-10-15 Thread Hans-Jörg Bibiko
Just i want to know how to make maps of chinese provinces with R Maybe look at http://ciesin.org/ and look for "China GIS" at http://www.ciesin.columbia.edu/eidata/resources.jsp you get http://sedac.ciesin.columbia.edu/china/ and http://sedac.ciesin.columbia.edu/china/admin/bnd9071/bnd

Re: [R-sig-Geo] SpatialLines to SpatialPolygons convertion

2009-03-03 Thread Hans-Jörg Bibiko
Thanks a lot for the hints. I'll try them. Kind regards --Hans ** Hans-Joerg Bibiko Max Planck Institute for Evolutionary Anthropology Department of Linguistics Deutscher Platz 6 phone: +49 (0) 341 3550 341 D-04103 Leipzig fax

[R-sig-Geo] SpatialLines to SpatialPolygons convertion

2009-03-03 Thread Hans-Jörg Bibiko
Hi, I have a short question. Is there any workaround available which tries to convert a list of SpatialLines to a list of SpatialPolygons objects? In my case I have a list of Lines objects coming from a gshhs (shorelines) file. The list represents 8 polygons of a given xlim/ ylim. Now I'd

[R-sig-Geo] topographic maps

2009-02-25 Thread Hans-Jörg Bibiko
Dear all, I have a tiny problem, I'd like to draw a map showing topographic information (like in a normal atlas) and on top of this map some polygons, points, etc. given by long, lat values. I tried the geomapdata ETOPO5 in conjuction with GEOTOPO which actually works fine but the point i

[R-sig-Geo] Rgshhs shift=true question

2009-02-18 Thread Hans-Jörg Bibiko
Hi, I'm using the river database 'wdb_rivers_l.b' downloaded from ftp://ftp.soest.hawaii.edu/pwessel/gshhs/gshhs_1.11.zip . If I do this: > rivers_low <- Rgshhs("wdb_rivers_l.b") I get a list of rivers as SpatialLines with > bbox(rivers_low[[1]]) min max r1 0.000278 359.9

Re: [R-sig-Geo] seamless maps

2009-01-30 Thread Hans-Jörg Bibiko
Hi, one simple possibility to draw seamless maps based on e.g. TM_WORLD_BORDERS_SIMPL-0.2 is to draw each polygon in question twice meaning first the 'normal' polygon and afterwards the transformed polygon by simply adding 360 to each x-value (for maps with lon from -180 to 540). The fo

Re: [R-sig-Geo] Even simpler TM_WORLD_BORDERS_SIMPLE (AND SP???)

2009-01-29 Thread Hans-Jörg Bibiko
On 30.01.2009, at 07:47, Edzer Pebesma wrote: Jim Burke wrote: OK I am on decaf coffee now. I reinstalled R and all is well now. Now Hans, below is what I get when I run your code. Is this expected? Quick and certainly DIRTY. > library("maptools") Loading required package: foreign > load(url

Re: [R-sig-Geo] Even simpler TM_WORLD_BORDERS_SIMPLE

2009-01-29 Thread Hans-Jörg Bibiko
On 29.01.2009, at 16:49, Jonathan Callahan wrote: Is anyone aware of an even more simplified version of the data that went into creating TM_WORLD_BORDERS_SIMPL-0.2.RData so that we might have TM_WORLD_BORDERS_LOWRES.RData for use cases like my own. A very quick solution would be to filter out

Re: [R-sig-Geo] Problem with SpatialPolygons containing a hole

2009-01-29 Thread Hans-Jörg Bibiko
On 29.01.2009, at 13:08, Roger Bivand wrote: Set the pbg= argument to set the "bg" (background) to something other than "transparent" - if it is transparent, the previously plotted larger and encompassing polygon is still visible. I'm afraid that the documentation, which should be in ?"Spa

[R-sig-Geo] Problem with SpatialPolygons containing a hole

2009-01-29 Thread Hans-Jörg Bibiko
Hi, I'm just preparing a SpatialPolygonsDataFrame for ISO3 = "PSE" which is missing in TM_BORDERS data. I have three polygons: p1 p2 p3 whereby p2 is a hole inside of p1. Then I did this: P1 <- Polygon(p1) P2 <- Polygon(p2) P3 <- Polygon(p3) pse <- list(P1,P2,P3) pseP <- checkPolygonsHoles

[R-sig-Geo] Looking for best practice to share Rdata containing country/prov/county polygons

2009-01-26 Thread Hans-Jörg Bibiko
Hi, due to the fact that I'm just converting some free available data-sets to SpatialPolygonsList objects containing country/province/county polygons (each polygon can be identified by an unique name) I wonder if there is a recommendation/example how to store such data in a single R objec

Re: [R-sig-Geo] e00 to SpatialPolygons: how to set the correct projection

2009-01-26 Thread Hans-Jörg Bibiko
On 26.01.2009, at 12:06, Paul Hiemstra wrote: Please checkout the spTransform() command which allows you to reproject your sp objects (it is located in the rgdal package). On 26.01.2009, at 12:06, Roger Bivand wrote: No. Your data are in a Lambert projection, probably lcc, but possibly lae

[R-sig-Geo] e00 to SpatialPolygons: how to set the correct projection

2009-01-26 Thread Hans-Jörg Bibiko
Hi, I was able to convert an e00 file to a SpatialPolygons object (thanks a lot to everybody who was involved to set up this functionality!) by using 'e00toavc' and 'pal2SpatialPolygons'. But now I'm a bit lost in conversion. How to set the correct projection which is needed for 'pal2Spat

Re: [R-sig-Geo] seamless maps

2009-01-08 Thread Hans-Jörg Bibiko
On 08.01.2009, at 15:05, Roger Bivand wrote: On Thu, 8 Jan 2009, Matt Oliver wrote: Hans, Take a look at the proj4 package, specifically project() Or rather rgdal, which is a fully featured implementation with a proper interface to the PROJ.4 library. Unfortunately, there does not seem

Re: [R-sig-Geo] seamless maps

2009-01-08 Thread Hans-Jörg Bibiko
On 08.01.2009, at 14:27, Roger Bivand wrote: On Thu, 8 Jan 2009, Hans-Jörg Bibiko wrote: Hi, I wonder if there's a workaround to generate seamless maps based on SpatialPolygons objects. E.g. to produce a map showing Australia at the left edge and America at the right one ( xlim :

[R-sig-Geo] seamless maps

2009-01-08 Thread Hans-Jörg Bibiko
Hi, I wonder if there's a workaround to generate seamless maps based on SpatialPolygons objects. E.g. to produce a map showing Australia at the left edge and America at the right one ( xlim := min: 110°E , max: 30°W ). Or the way around, is there a function to re-center a given map by def

Re: [R-sig-Geo] no boundaries between countries by using unionSpatialPolygons

2009-01-07 Thread Hans-Jörg Bibiko
On 07.01.2009, at 15:47, Roger Bivand wrote: Your ID has two unique values: ID [1] (-67.1,-64.6] [-74.4,-71.9] Levels: [-74.4,-71.9] (-71.9,-69.5] (-69.5,-67.1] (-67.1,-64.6] with two country polygons: length(slot(pe_bo_data, "polygons")) [1] 2 so you get two output polygons. If you do:

[R-sig-Geo] no boundaries between countries by using unionSpatialPolygons

2009-01-07 Thread Hans-Jörg Bibiko
Hi, I have a tiny problem. I'm using Roger Bivand's ( http://spatial.nhh.no/R/etc/TM_WORLD_BORDERS_SIMPL-0.2.RData ) to create a plot showing two countries without boundaries. I did this: library("foreign") library("sp") library("maptools") library("gpclib") load("TM_WORLD_BORDERS_SIMPL-