R-sig-geo,

I would like to create a kde map of a point pattern with weights, where 
the bandwidth can be set.

The point data are imported from a csv with BNG coordinates.

My questions are:

1. How can I rescale the density to, say, counts per kilometre square?

2. How can I overlay the density layer with the boundary outlines of the 
shapefile?

Example taken from: 
http://spatialanalysis.co.uk/2010/09/clipping-a-surface-by-a-polygon/

###########################################################################

#create kde of rental bikes in London

#setwd("C:\\... \..")

library(spatstat)

library(sp)

library(maptools)

city_shp <- readShapePoly("lond_city.shp")

city_win <- as(as(city_shp, "SpatialPolygons"), "owin")

plot(city_win)

bikedata <- read.csv("tfl-cycle-hire-locations.csv",header = TRUE)

attach(bikedata)

names(bikedata)

summary(bikedata$Easting)

summary(bikedata$Northing)

summary(bikedata$Capacity)

bikes <- ppp(bikedata$Easting,bikedata$Northing,c(524399, 534699), 
c(177899,183599),marks=bikedata$Capacity,window=city_win)

summary(bikes$Capacity)

k125 <- density.ppp(bikes, sigma =125,weights=bikes$Capacity)

plot(k125)

##################################################################

With many thanks in advance,

Jakob Petersen


	[[alternative HTML version deleted]]

