How far away is another Catholic Church in NYC?
[nyc
mathematica
llm
]
Alexei Gannon ‘25 asks: … a slightly different question… and instead I ask what is the distribution of nearest-neighbor parish distances in the Archdiocese of New York?…
Conveniently, Cardinal Dolan made a list for us:
newYork = Import["https://archny.org/our-parishes/", "Plaintext"];
(comment 05 Feb 2025: *alternatively, one could use the Overpass API to perform queries on OpenStreetMap data )
Begin by processing the text. It is rather long, and we want to focus on the city of New York, so we will retain only lines that contain Bronx, New York (i.e., Manhattan), or Staten Island. (Recall that Queens and Brooklyn are in their own diocese.) We include some spaces after Bronx to kick out Bronxville (which is in Yonkers):
lines = StringRiffle[#, "\n"] &@
Select[
StringSplit[newYork, "\n"],
StringContainsQ[{"Bronx ", "Bronx,", "New York", "Staten Island"}]];
Then feed the result into the LLM to clean it up:
result = StringSplit[#, "\n"] &@
LLMSynthesize["Extract only the addresses from the following text. Put each address on its own line. Write the address in the form: 123 Main Street, Anytown, NY 12345. Do not include any other information, such as markdown. Here is the text:\n" <> lines];
Run it through an interpreter to extract the points as GeoPosition items:
locations = Interpreter["StreetAddress"] /@ result;
The following results could not be parsed as addresses, although prima facie they seem to be reasonable addresses (spot checking a few of them on Google Maps shows a location). This is probably a failure of the OpenStreetMap database that is used behind the scenes:
TableForm@ Pick[result, FailureQ /@ locations]
We will just proceed without them. Where are these churches?
churches = DeleteCases[locations, Failure[__]];
GeoListPlot[churches]
Uh oh! Remove the outliers and replot:
churches = DeleteAnomalies[churches];
GeoListPlot[churches]
That looks better. Now compute the distance to the nearest (non-self) church. (By default, 2 gives us self and other, so we retain only the last part):
distances = Last /@ Nearest[churches -> "Distance", churches, 2];
Histogram[distances,
Frame -> True,
FrameLabel -> {"Nearest Neighbor Parish (Miles)", "Count"}]
Median[distance]
OK, maybe you prefer this in some other units:
UnitConvert[%, "Miles"]
UnitConvert[%, "Kilometers"]
Mean[distance]
This is surprisingly closer than I would have expected.
Also in our discussion:
-
Dimes Square Catholicism as a continuation of 20th century aesthetic counter culture Catholicism:
-
Yelp reviews for Catholic masses as a symptom of consumerist culture
-
Dorothy Day, The Long Loneliness
-
Thomas Merton, The Seven Storey Mountain
-
Orthodox flavor: Death to the World
-
-
-
The Vatican had a website contemporaneous with Internet Explorer 1.0 (1995)
ToJekyll["How far away is another Catholic Church in NYC?", "nyc mathematica llm"]