1

I am trying to find the number of pubs for each London LSOA.

I do this with London's LSOA boundaries shapefile which I imported as a SpatialPolygonsDataFrame and a SpatialPointsDataFrame of pubs taken from this website with the following query:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“pub in london”
*/
[out:json][timeout:30];
// fetch area “london” to search in
{{geocodeArea:london}}->.searchArea;
// gather results
(
  // query part for: “pub”
  node["amenity"="pub"](area.searchArea);
  way["amenity"="pub"](area.searchArea);
  relation["amenity"="pub"](area.searchArea);
);
// print results
out body;
>;
out skel qt; 

when I run:

result  <- over(pubs, LondonLSOA)

Nothing happens. I think I am supposed to get a new column in results but I dont see that.

Can someone advise?

closed as unclear what you're asking by Spacedman, ThingumaBob, MaryBeth, Dan C, xunilk Dec 18 '18 at 22:10

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    are they both in the same coordinate reference system? – obrl_soil Dec 18 '18 at 6:04
  • 1
    What does summary(pubs) and summary(LondonLSOA) tell you about the coordinates? What about if you plot(LondonLSOA); plot(pubs, add=TRUE);? OpenStreetMap works in lat-long degrees and maybe your LSOA is in Ordnance Survey Grid Coordinates? We can't tell without more information. – Spacedman Dec 18 '18 at 8:20
  • What do you mean by "nothing happens"? How long did you wait? – Edzer Pebesma Dec 18 '18 at 16:51

Browse other questions tagged or ask your own question.