Skip to content
Prev 24401 / 29559 Next

Creating a grid

On 18/05/16 18:22, Andres Diaz wrote:
this should be

require(sp)

as package names are case sensitive.
7300,7.4925002048000,7.7430540668800,8.1577730351600,8.3486091897100,9.0572183036200,9.5371090838500,9.3113911362300,9.8397180851900,9.7902822906800,9.9558362782400,9.7344452366900,9.9305542789000,9.8716631946600,9.4994451694600,9.3983361151900,10.0320820931000,10.0544451784000,10.2522180284000,11.5588911906000,11.9864731952000,7.4637730756100,5.8125002592300,4.2452821739600)
,34.6552090685000,34.1043091513000,33.8875001609000,33.2291641937000,33.0280541727000,32.5333361410000,32.0955541984000,30.2343909823000,30.1272181239000,29.1599999713000,28.2705541457000,27.8462452744000,27.3160360852000,26.8597180666000,26.5141640490000,26.3575000756000,26.1533271396000,25.3294450637000,24.8380539771000,24.6058271463000,24.3025001512000,23.5223090810000,20.8566732593000,19.4461090891000,19.1466642562000)
Although I admit that the error message is far from helpful, you're
making a wrong assumption here: you assume cellsize can be in metres,
where the polygon in question has coordinates in degrees long/lat. You
can do two things:

1. define a meaningful cell size in degrees, e.g. cellsize = 0.1
2. project the polygon using spTransform to a reference system where the
units of coordinates are in metres, and then use cellsize = 1000