Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.


I have exported an ESRI shapefile (polygon) to KML using R, but the resulting layer shows only the outer extent of the polygon. How can I fill in the area with a color? Any help is greatly appreciated.

The code is as follows:

setwd("G:\\GIS_SJR\\GIS Shapefiles\\Boundaries")
polygon <- readOGR(".", "20km_buffer_albers")
polygonWGS <- spTransform(polygon, CRS("+proj=longlat +ellps=WGS84 +datum=WGS84"))  
writeOGR(polygonWGS, dsn="polygonWGS.kml", layer="polygonWGS", driver="KML")
share|improve this question
"Limited support is available for fills, line color and other styling attributes" check their website –  A.R Jan 15 '13 at 9:17
I have a similar issue. I am studying this web site, gsif.isric.org/doku.php?id=wiki:tutorial_plotkml, my files are in a raster format. try with KML(RAD.all[[100]], file='1998.kml', col=rev(terrain.colors(255)),alpha = 0.5,colNA=NA, maxpixels=100000, blur=2,overwrite=TRUE ) and plotKML(RAD.all[[100]], colour_scale = rev(c(terrain.colors(255))),alpha = 0.5) plotKML works better for me –  Nahm Aug 22 '14 at 21:22
That web site has soil example too. –  Nahm Aug 22 '14 at 21:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.