GeoMesa - NYC Taxis(Scala)

Analyzing NYC Taxis with GeoMesa


  1. Review Spatial Search Problems
  2. Review Spatial Indexing
  3. GeoMesa: Geospatial Vector Analytics
  4. Read NYC Taxi Data from Delta Table (Augmented with GeoMesa)
  5. Load & View NYC Neighborhood Polygon Data (WKT)
  6. Spatial join at scale
  7. What about spatiotemporal queries?
  8. Summary: Analyzing geospatial data at scale using Databricks

Install Cluster Libraries:

  • GeoMesa Maven Coordinates: org.locationtech.geomesa:geomesa-spark-jts_2.11:2.3.2
  • LazyLogging Maven Coordinates: com.typesafe.scala-logging:scala-logging_2.11:3.8.0 (for GeohashUtils)
  • Folium PyPI Coordinates: folium

1. Spatial Search Problems

Spatial data has two fundamental query types:

  • K nearest neighbors
  • Range queries

Retrieve the k closest points to a given query point

e.g. find all points inside a polygon or circle

2. Spatial Indexing

Efficient spatial queries at scale requires putting the geometries into a spatial index.

Querying indexed data with geometric predicate pushdown can dramatically improve performance

R Trees and Space Filling Curves are two common spatial indexing techniques

Almost all spatial data structures share the same principle to enable efficient search: branch and bound. It means arranging data in a tree-like structure that allows discarding branches at once if they do not fit our search criteria (data skipping).

R-trees are tree data structures used for spatial access methods, i.e., for indexing multi-dimensional information such as geographical coordinates, rectangles or polygons. The key idea of the data structure is to group nearby objects and represent them with their minimum bounding rectangle in the next higher level of the tree; the "R" in R-tree is for rectangle. Since all objects lie within this bounding rectangle, a query that does not intersect the bounding rectangle also cannot intersect any of the contained objects.

Space Filling Curves are technique to colocate related information in the same set of files

i.e. they allow you to map multidimensional data to one dimension while maintaining locality

Mapping things down to 1 dimension allows for concepts like range queries, which essentially cuts out scanning entire sections of data since we preserve the locality of the data in higher dimensions with the curve.

3. GeoMesa: Geospatial Analytics

There are a number of purpose-built libraries which extend Apache Spark for geospatial analytics. GeoMesa is a a distributed framework especially adept at handling vector data. Others used by Databricks customers include GeoSpark, GeoTrellis, and Rasterframes. While they often come with a bit of a learning curve, these frameworks often offer multiple language bindings and have much better scaling and performance than non-formalized approaches.

import org.locationtech.geomesa.spark.GeoMesaSparkKryoRegistrator
import org.locationtech.jts.geom._
import org.locationtech.geomesa.spark.jts._

import org.apache.spark.sql.types._
import org.apache.spark.sql.functions._
import spark.implicits._
import org.locationtech.geomesa.spark.GeoMesaSparkKryoRegistrator import org.locationtech.jts.geom._ import org.locationtech.geomesa.spark.jts._ import org.apache.spark.sql.types._ import org.apache.spark.sql.functions._ import spark.implicits._

Set serializers for GeoMesa.

spark.conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
spark.conf.set("spark.kryo.registrator", classOf[GeoMesaSparkKryoRegistrator].getName) 
spark.conf.set("spark.kryoserializer.buffer.max","500m")

Add GeoMesa User Defined Types (UDT) and Functions (UDF).

spark.withJTS
res1: org.apache.spark.sql.SparkSession = org.apache.spark.sql.SparkSession@3029c5b3

4. Load NYC Taxi Data from Delta Table

displayHTML("https://www1.nyc.gov/site/tlc/about/tlc-trip-record-data.page")

Since we are dealing with 200M points and some skew, want to increase parallelism.

sqlContext.setConf("spark.sql.shuffle.partitions", "1600") //200 is default
// spark.sharedState.cacheManager.clearCache // cleanup cache as needed
  • Get a DataFrame reference to the nyctaxidelta table and convert the pickup and dropoff string coordinates into Geometry types using GeoMesa.
  • Also, NYC data should be ~-75 LON and ~40 LAT, so we want to filter out bad points which are present in the provided data.
// add some min / max checking for NYC area
val lon_min = -80.0
val lon_max = -70.0
val lat_min = 35.0
val lat_max = 45.0

// get a handle on the nyc delta table
val tripsTable = spark.table("nyctaxidelta")

// add geometry and geohash cols
val trips = tripsTable

  // ignore a few irrelevant columns
  .drop("vendorId")
  .drop("rateCodeId")
  .drop("store_fwd")
  .drop("payment_type")
  .drop("neighborhood")

  // filter erroneous points
  .filter($"pickup_longitude" >= lon_min && $"pickup_longitude" <= lon_max)
  .filter($"pickup_latitude" >= lat_min && $"pickup_latitude" <= lat_max)
  .filter($"dropoff_longitude" >= lon_min && $"dropoff_longitude" <= lon_max)
  .filter($"dropoff_latitude" >= lat_min && $"dropoff_latitude" <= lat_max)

  // add the point geometries
  .withColumn("pickupPoint", st_makePoint($"pickup_longitude",$"pickup_latitude"))
  .withColumn("dropoffPoint", st_makePoint($"dropoff_longitude",$"dropoff_latitude"))

  // add geohash
  .withColumn("pickup_geohash_25", st_geoHash($"pickupPoint", 25))
  .withColumn("dropoff_geohash_25", st_geoHash($"dropoffPoint", 25))

// cache on the cluster
.repartition(sc.defaultParallelism * 20)
.cache
lon_min: Double = -80.0 lon_max: Double = -70.0 lat_min: Double = 35.0 lat_max: Double = 45.0 tripsTable: org.apache.spark.sql.DataFrame = [neighborhood: string, vendorId: string ... 18 more fields] trips: org.apache.spark.sql.Dataset[org.apache.spark.sql.Row] = [pickup_datetime: string, dropoff_datetime: string ... 17 more fields]
val numTrips = trips.count
numTrips: Long = 211684335
display(trips)
2016-03-26 15:39:132016-03-26 15:51:4421.22-73.9974975585937540.756813049316406-73.978904724121140.75257110595703900.51.9600.311.76POINT (-73.99749755859375 40.756813049316406)POINT (-73.9789047241211 40.75257110595703)dr5rudr5ru
2016-03-26 17:33:382016-03-26 17:45:1713.2-73.8632736206054740.76980972290039-73.9107589721679740.7723617553710941210.52.7500.316.55POINT (-73.86327362060547 40.76980972290039)POINT (-73.91075897216797 40.772361755371094)dr5rzdr5ry
2016-03-28 10:47:202016-03-28 11:03:1612-73.9803314208984440.76011276245117-73.9922790527343840.7379760742187511.500.5000.312.3POINT (-73.98033142089844 40.76011276245117)POINT (-73.99227905273438 40.73797607421875)dr5rudr5ru
2015-10-18 02:05:282015-10-18 02:23:5813.81-73.9530639648437540.71426773071289-73.9792022705078140.755279541015625150.50.53.2600.319.56POINT (-73.95306396484375 40.71426773071289)POINT (-73.97920227050781 40.755279541015625)dr5rtdr5ru
2015-07-24 22:42:312015-07-24 22:56:2922.38-73.9919891357421940.73461151123047-73.9789199829101640.76213836669922110.50.52.4600.314.76POINT (-73.99198913574219 40.73461151123047)POINT (-73.97891998291016 40.76213836669922)dr5rsdr5ru
2015-06-17 23:18:452015-06-17 23:32:0112.9-73.982887268066440.75624084472656-73.9494934082031240.77348327636719120.50.5000.313.3POINT (-73.9828872680664 40.75624084472656)POINT (-73.94949340820312 40.77348327636719)dr5rudr5rv
2015-07-24 23:26:132015-07-24 23:55:51615.88-73.7766876220703140.64546585083008-73.9523773193359440.64962005615234444.50.50.5000.345.8POINT (-73.77668762207031 40.64546585083008)POINT (-73.95237731933594 40.649620056152344)dr5x1dr5rm
2015-10-17 17:04:012015-10-17 17:08:3461.07-73.959617614746140.76948547363281-73.9594650268554740.7588462829589845.500.5100.37.3POINT (-73.9596176147461 40.76948547363281)POINT (-73.95946502685547 40.758846282958984)dr5rvdr5rv
2015-06-17 08:14:082015-06-17 08:18:0410.7-73.9636993408203140.76577377319336-73.9612960815429740.77436065673828500.51.1500.36.95POINT (-73.96369934082031 40.76577377319336)POINT (-73.96129608154297 40.77436065673828)dr5rudr5ru
2015-07-25 01:39:142015-07-25 01:57:0229.38-73.98950195312540.75770950317383-73.9235229492187540.867698669433594270.50.5000.328.3POINT (-73.989501953125 40.75770950317383)POINT (-73.92352294921875 40.867698669433594)dr5rudr72m
2015-07-24 09:43:072015-07-24 09:50:2510.76-73.9749145507812540.680667877197266-73.975563049316440.674373626708984600.51.3600.38.16POINT (-73.97491455078125 40.680667877197266)POINT (-73.9755630493164 40.674373626708984)dr5rkdr5rk
2015-10-15 22:06:532015-10-15 22:18:0111.62-73.9702911376953140.754878997802734-73.9893112182617240.7431983947753990.50.52.0600.312.36POINT (-73.97029113769531 40.754878997802734)POINT (-73.98931121826172 40.74319839477539)dr5rudr5ru
2015-07-25 08:54:062015-07-25 09:09:5211.8-73.9899597167968840.76689147949219-73.9910964965820340.7506980895996111.500.50.100.312.4POINT (-73.98995971679688 40.76689147949219)POINT (-73.99109649658203 40.75069808959961)dr5rudr5ru
2015-07-25 10:38:122015-07-25 10:52:2912-74.0046768188476640.7415771484375-73.9827270507812540.742816925048831100.5000.311.8POINT (-74.00467681884766 40.7415771484375)POINT (-73.98272705078125 40.74281692504883)dr5rgdr5ru
2015-01-28 20:08:242015-01-28 20:29:10310.73-73.8652801513671940.7712287902832-73.8576507568359440.840919494628906310.50.525.330.339.63POINT (-73.86528015136719 40.7712287902832)POINT (-73.85765075683594 40.840919494628906)dr5rzdr72r
2015-10-16 11:02:362015-10-16 11:07:3011.34-73.9458923339843840.77320861816406-73.940040588378940.786590576171875600.5000.36.8POINT (-73.94589233398438 40.77320861816406)POINT (-73.9400405883789 40.786590576171875)dr5rvdr72j
2016-03-28 18:19:562016-03-28 18:38:3513.03-73.981056213378940.78424835205078-73.9690628051757840.754680633544921410.50.300.316.1POINT (-73.9810562133789 40.78424835205078)POINT (-73.96906280517578 40.75468063354492)dr72hdr5ru
2015-01-29 12:30:122015-01-29 13:03:0142.83-74.0004425048828140.726409912109375-73.9795608520507840.7612266540527342000.54.1600.324.96POINT (-74.00044250488281 40.726409912109375)POINT (-73.97956085205078 40.761226654052734)dr5rsdr5ru
2015-02-09 08:30:182015-02-09 08:36:1210.4-73.9629974365234440.77511978149414-73.9559402465820340.7727432250976565.500.51.2500.37.55POINT (-73.96299743652344 40.77511978149414)POINT (-73.95594024658203 40.772743225097656)dr5rudr5rv
2015-06-17 06:41:072015-06-17 06:54:3413.9-73.9549713134765640.777645111083984-74.0027770996093840.760532379150391400.52.9500.317.75POINT (-73.95497131347656 40.777645111083984)POINT (-74.00277709960938 40.76053237915039)dr5rvdr5ru
2015-02-10 15:17:102015-02-10 15:20:2310.6-73.9598312377929740.771060943603516-73.9543609619140640.778015136718754.500.51.0500.36.35POINT (-73.95983123779297 40.771060943603516)POINT (-73.95436096191406 40.77801513671875)dr5rvdr5rv
2015-10-15 07:19:082015-10-15 07:20:4610.3-73.989891052246140.75679016113281-73.9866638183593840.761631011962893.500.5000.34.3POINT (-73.9898910522461 40.75679016113281)POINT (-73.98666381835938 40.76163101196289)dr5rudr5ru
2015-02-10 23:52:552015-02-11 00:03:5011.9-74.0076522827148440.740535736083984-73.98559570312540.7328071594238390.50.52.0500.312.35POINT (-74.00765228271484 40.740535736083984)POINT (-73.985595703125 40.73280715942383)dr5rgdr5rs
2016-03-26 16:27:232016-03-26 16:32:5020.6-73.976051330566440.76039505004883-73.968849182128940.75501632690435.500.5000.36.3POINT (-73.9760513305664 40.76039505004883)POINT (-73.9688491821289 40.7550163269043)dr5rudr5ru
2015-10-18 01:25:232015-10-18 01:32:4951.73-73.9823379516601640.75114059448242-73.961448669433640.7604484558105580.50.51.8600.311.16POINT (-73.98233795166016 40.75114059448242)POINT (-73.9614486694336 40.76044845581055)dr5rudr5ru
2016-03-26 13:45:512016-03-26 13:55:4110.78-73.9777221679687540.759483337402344-73.9784240722656240.7635536193847667.500.51.6600.39.96POINT (-73.97772216796875 40.759483337402344)POINT (-73.97842407226562 40.763553619384766)dr5rudr5ru
2016-03-27 17:35:112016-03-27 17:42:3511.6-73.94897460937540.78845977783203-73.941993713378940.8063659667968757.500.5000.38.3POINT (-73.948974609375 40.78845977783203)POINT (-73.9419937133789 40.806365966796875)dr72jdr72j
2015-01-28 10:09:412015-01-28 10:17:0012.37-74.0132904052734440.716796875-74.0031814575195340.74903106689453900.5200.311.8POINT (-74.01329040527344 40.716796875)POINT (-74.00318145751953 40.74903106689453)dr5redr5ru
2015-10-15 05:56:502015-10-15 06:01:4010.9-73.9970092773437540.737449645996094-74.0082702636718840.737625122070315.50.50.5000.36.8POINT (-73.99700927734375 40.737449645996094)POINT (-74.00827026367188 40.73762512207031)dr5rudr5rg
2015-02-10 19:55:112015-02-10 20:10:4022.5-73.9873504638671940.73971939086914-74.0103302001953140.7189559936523441210.5000.313.8POINT (-73.98735046386719 40.73971939086914)POINT (-74.01033020019531 40.718955993652344)dr5rudr5re
2016-03-26 21:50:142016-03-26 22:02:1521.9-73.961059570312540.75942611694336-73.981422424316440.749893188476569.50.50.5000.310.8POINT (-73.9610595703125 40.75942611694336)POINT (-73.9814224243164 40.74989318847656)dr5rudr5ru
2015-10-15 13:04:022015-10-15 13:20:0212.86-73.9486999511718840.781829833984375-73.9819412231445340.7704772949218751300.52.7600.316.56POINT (-73.94869995117188 40.781829833984375)POINT (-73.98194122314453 40.770477294921875)dr72jdr5ru
2015-07-24 21:25:322015-07-24 21:40:2714.07-73.953712463378940.775089263916016-73.9875411987304740.74087905883789150.50.53.2600.319.56POINT (-73.9537124633789 40.775089263916016)POINT (-73.98754119873047 40.74087905883789)dr5rvdr5ru
2015-06-17 22:22:542015-06-17 22:34:0912.78-74.0076141357421940.731101989746094-73.9822921752929740.7540702819824210.50.50.52.3600.314.16POINT (-74.00761413574219 40.731101989746094)POINT (-73.98229217529297 40.75407028198242)dr5redr5ru
2015-10-15 12:40:592015-10-15 12:45:1410.5-73.9960861206054740.74435043334961-74.0048217773437540.747947692871094500.51.500.37.3POINT (-73.99608612060547 40.74435043334961)POINT (-74.00482177734375 40.747947692871094)dr5rudr5rg
2015-10-16 12:36:392015-10-16 12:48:1222.15-73.9941482543945340.74506759643555-74.0111923217773440.729167938232421000.5000.310.8POINT (-73.99414825439453 40.74506759643555)POINT (-74.01119232177734 40.72916793823242)dr5rudr5re
2015-10-17 08:29:142015-10-17 08:43:5913.4-73.9596481323242240.776771545410156-73.9748458862304740.741836547851561300.5000.313.8POINT (-73.95964813232422 40.776771545410156)POINT (-73.97484588623047 40.74183654785156)dr5rvdr5ru
2015-10-15 06:52:542015-10-15 06:59:3811.22-73.9886016845703140.76892852783203-73.998191833496140.76076126098633700.51.5600.39.36POINT (-73.98860168457031 40.76892852783203)POINT (-73.9981918334961 40.76076126098633)dr5rudr5ru
2015-06-15 21:30:422015-06-15 21:44:1312.8-73.972290039062540.75907897949219-74.0030136108398440.734127044677734120.50.52.6500.315.95POINT (-73.9722900390625 40.75907897949219)POINT (-74.00301361083984 40.734127044677734)dr5rudr5rs
2015-06-17 11:19:072015-06-17 11:38:4311.99-73.9828186035156240.76007080078125-74.0041046142578140.7427711486816413.500.5000.314.3POINT (-73.98281860351562 40.76007080078125)POINT (-74.00410461425781 40.74277114868164)dr5rudr5rg
2016-03-26 14:11:252016-03-26 14:17:4930.82-73.9705505371093840.76750183105469-73.9586105346679740.76060104370117600.5000.36.8POINT (-73.97055053710938 40.76750183105469)POINT (-73.95861053466797 40.76060104370117)dr5rudr5rv
2016-03-26 15:19:082016-03-26 15:37:0413.63-73.9798660278320340.765586853027344-73.930297851562540.7589416503906251500.5000.315.8POINT (-73.97986602783203 40.765586853027344)POINT (-73.9302978515625 40.758941650390625)dr5rudr5rv
2015-10-17 16:37:402015-10-17 16:41:4720.7-73.9618835449218840.77080535888672-73.9700469970703140.76715850830078500.5000.35.8POINT (-73.96188354492188 40.77080535888672)POINT (-73.97004699707031 40.76715850830078)dr5rudr5ru
2015-06-16 19:32:152015-06-16 19:35:4651.03-73.943748474121140.77629852294922-73.9539718627929740.7659912109375510.51.700.38.5POINT (-73.9437484741211 40.77629852294922)POINT (-73.95397186279297 40.7659912109375)dr5rvdr5rv
2015-01-28 16:55:212015-01-28 17:13:0211.71-73.9772796630859440.75563049316406-73.9562911987304740.764659881591811.510.52.6600.315.96POINT (-73.97727966308594 40.75563049316406)POINT (-73.95629119873047 40.7646598815918)dr5rudr5rv
2015-07-24 09:36:202015-07-24 09:50:4212.1-73.987426757812540.73880386352539-73.9706420898437540.764755249023441100.52.3500.314.15POINT (-73.9874267578125 40.73880386352539)POINT (-73.97064208984375 40.76475524902344)dr5rudr5ru
2015-10-18 02:31:262015-10-18 02:45:3922-73.987426757812540.720726013183594-74.0048904418945340.7374458312988310.50.50.52.3500.314.15POINT (-73.9874267578125 40.720726013183594)POINT (-74.00489044189453 40.73744583129883)dr5rsdr5rg
2015-10-16 00:35:472015-10-16 00:51:1215-73.98754882812540.76292037963867-73.9454040527343840.82824325561523416.50.50.53.200.321POINT (-73.987548828125 40.76292037963867)POINT (-73.94540405273438 40.828243255615234)dr5rudr72m
2015-10-16 19:58:142015-10-16 20:05:4211.1-74.0088577270507840.71388626098633-73.9964141845703140.721553802490234710.51.7500.310.55POINT (-74.00885772705078 40.71388626098633)POINT (-73.99641418457031 40.721553802490234)dr5redr5rs
2015-10-17 22:57:022015-10-17 23:00:1210.63-73.975730895996140.752220153808594-73.9765014648437540.74597167968754.50.50.51.1600.36.96POINT (-73.9757308959961 40.752220153808594)POINT (-73.97650146484375 40.7459716796875)dr5rudr5ru
2015-06-17 04:15:322015-06-17 04:24:5913.8-73.985450744628940.719383239746094-73.9548034667968840.6877861022949212.50.50.5000.313.8POINT (-73.9854507446289 40.719383239746094)POINT (-73.95480346679688 40.68778610229492)dr5rsdr5rm
2015-07-24 21:19:302015-07-24 21:34:1922.66-73.9819183349609440.7681770324707-73.9679489135742240.8013763427734412.50.50.5000.313.8POINT (-73.98191833496094 40.7681770324707)POINT (-73.96794891357422 40.80137634277344)dr5rudr72h
2015-10-14 23:51:492015-10-15 00:01:2711.38-73.9714050292968840.75712585449219-73.9897079467773440.7671318054199280.50.51.500.310.8POINT (-73.97140502929688 40.75712585449219)POINT (-73.98970794677734 40.76713180541992)dr5rudr5ru
2016-03-27 11:18:562016-03-27 11:28:1621.6-73.9495391845703140.77260971069336-73.9702682495117240.784229278564458.500.51.8500.311.15POINT (-73.94953918457031 40.77260971069336)POINT (-73.97026824951172 40.78422927856445)dr5rvdr72h
2015-10-15 20:23:192015-10-15 20:29:1311.32-73.9867019653320340.76142883300781-73.9799041748046940.77616119384765670.50.5100.39.3POINT (-73.98670196533203 40.76142883300781)POINT (-73.97990417480469 40.776161193847656)dr5rudr5ru
2015-02-10 21:40:382015-02-10 21:49:2851.9-73.9794006347656240.76222610473633-74.0005722045898440.747730255126958.50.50.51.9600.311.76POINT (-73.97940063476562 40.76222610473633)POINT (-74.00057220458984 40.74773025512695)dr5rudr5ru
2015-06-17 07:10:262015-06-17 07:18:5911.5-73.978370666503940.76657485961914-73.9731369018554740.7530136108398447.500.51.6500.39.95POINT (-73.9783706665039 40.76657485961914)POINT (-73.97313690185547 40.753013610839844)dr5rudr5ru
2015-10-16 10:11:172015-10-16 10:13:4610.3-73.9507675170898440.77507400512695-73.9530792236328140.7784309387207400.50.9500.35.75POINT (-73.95076751708984 40.77507400512695)POINT (-73.95307922363281 40.7784309387207)dr5rvdr5rv
2015-10-16 08:17:082015-10-16 08:34:5213.5-73.9859466552734440.744300842285156-73.9524765014648440.789047241210941400.5000.314.8POINT (-73.98594665527344 40.744300842285156)POINT (-73.95247650146484 40.78904724121094)dr5rudr72j
2015-02-10 01:01:062015-02-10 01:02:5720.31-73.9497222900390640.80720138549805-73.9537734985351640.8061485290527343.50.50.5100.35.8POINT (-73.94972229003906 40.80720138549805)POINT (-73.95377349853516 40.806148529052734)dr72jdr72j
2015-07-25 23:43:062015-07-26 00:00:0112.8-73.977149963378940.7520751953125-73.9802551269531240.72703552246094130.50.5200.316.3POINT (-73.9771499633789 40.7520751953125)POINT (-73.98025512695312 40.72703552246094)dr5rudr5rs
2015-07-25 00:06:312015-07-25 00:07:3010.3-73.9958953857421940.738861083984375-73.9928894042968840.7426567077636730.50.5000.34.3POINT (-73.99589538574219 40.738861083984375)POINT (-73.99288940429688 40.74265670776367)dr5rudr5ru
2015-10-17 15:52:192015-10-17 16:09:2822.24-74.0081634521484440.73746109008789-74.0093078613281240.7104225158691412.500.5000.313.3POINT (-74.00816345214844 40.73746109008789)POINT (-74.00930786132812 40.71042251586914)dr5rgdr5re
2015-10-16 05:56:392015-10-16 06:00:4511.73-73.9798965454101640.7758903503418-73.9771804809570340.75937652587890670.50.51.6600.39.96POINT (-73.97989654541016 40.7758903503418)POINT (-73.97718048095703 40.759376525878906)dr5rudr5ru
2015-02-10 18:39:272015-02-10 18:45:4410.6-73.9832153320312540.6967887878418-73.98754882812540.691318511962895.510.5000.37.3POINT (-73.98321533203125 40.6967887878418)POINT (-73.987548828125 40.69131851196289)dr5rsdr5rk
2015-10-14 20:50:002015-10-14 20:50:0315.7-74.0059280395507840.705989837646484-74.0059509277343840.70594024658203200.50.5400.325.3POINT (-74.00592803955078 40.705989837646484)POINT (-74.00595092773438 40.70594024658203)dr5redr5re
2016-03-27 11:51:562016-03-27 12:18:0812.48-73.9620971679687540.76386642456055-73.9864807128906240.7580184936523441700.53.5600.321.36POINT (-73.96209716796875 40.76386642456055)POINT (-73.98648071289062 40.758018493652344)dr5rudr5ru
2015-06-16 11:52:592015-06-16 11:59:1021.04-73.9917755126953140.76054382324219-73.9947204589843840.7554817199707600.51.700.38.5POINT (-73.99177551269531 40.76054382324219)POINT (-73.99472045898438 40.7554817199707)dr5rudr5ru
2015-02-10 19:38:112015-02-10 19:52:3522.08-74.0056228637695340.73820114135742-74.0068206787109440.715080261230471110.5000.312.8POINT (-74.00562286376953 40.73820114135742)POINT (-74.00682067871094 40.71508026123047)dr5rgdr5re
2016-03-26 14:33:502016-03-26 15:14:4115.6-74.0157318115234440.714759826660156-73.9861221313476640.7589988708496127.500.5000.328.3POINT (-74.01573181152344 40.714759826660156)POINT (-73.98612213134766 40.75899887084961)dr5redr5ru
2015-10-17 20:46:002015-10-17 20:54:2011.62-73.97387695312540.79372024536133-73.9526977539062540.803211212158280.50.5000.39.3POINT (-73.973876953125 40.79372024536133)POINT (-73.95269775390625 40.8032112121582)dr72hdr72j
2015-07-25 18:58:112015-07-25 19:36:5114.39-74.0011825561523440.71985626220703-73.9837493896484440.76062393188476624.500.5000.325.3POINT (-74.00118255615234 40.71985626220703)POINT (-73.98374938964844 40.760623931884766)dr5rsdr5ru
2015-07-24 13:32:052015-07-24 13:44:1910.9-73.9883575439453140.76411437988281-73.9911956787109440.755302429199228.500.52.300.311.6POINT (-73.98835754394531 40.76411437988281)POINT (-73.99119567871094 40.75530242919922)dr5rudr5ru
2015-07-25 14:09:512015-07-25 14:21:0112.51-73.9768600463867240.790122985839844-73.9641723632812540.7654342651367210.500.52.2600.313.56POINT (-73.97686004638672 40.790122985839844)POINT (-73.96417236328125 40.76543426513672)dr72hdr5ru
2015-01-28 17:10:262015-01-28 17:30:1512.67-74.0056915283203140.74040985107422-73.9763336181640640.752048492431641410.53.9500.319.75POINT (-74.00569152832031 40.74040985107422)POINT (-73.97633361816406 40.75204849243164)dr5rgdr5ru
2016-03-26 15:16:052016-03-26 15:25:4011.4-73.9827499389648440.75143814086914-73.9680099487304740.7623291015625800.51.7600.310.56POINT (-73.98274993896484 40.75143814086914)POINT (-73.96800994873047 40.7623291015625)dr5rudr5ru
2015-07-23 20:09:142015-07-23 20:19:4521.24-74.00976562540.71452331542969-73.9983825683593840.7262229919433680.50.52.3200.311.62POINT (-74.009765625 40.71452331542969)POINT (-73.99838256835938 40.72622299194336)dr5redr5rs
2015-10-16 14:22:452015-10-16 14:38:5713.3-73.9914627075195340.751136779785156-73.973533630371140.7894668579101561300.52.7500.316.55POINT (-73.99146270751953 40.751136779785156)POINT (-73.9735336303711 40.789466857910156)dr5rudr72h
2015-06-17 18:46:482015-06-17 19:11:1823.39-73.9754257202148440.755226135253906-73.9739913940429740.7916183471679717.510.5200.321.3POINT (-73.97542572021484 40.755226135253906)POINT (-73.97399139404297 40.79161834716797)dr5rudr72h
2016-03-27 18:48:322016-03-27 19:17:20411.3-73.8731307983398440.774169921875-73.9888610839843840.7775726318359433.500.57.955.540.347.79POINT (-73.87313079833984 40.774169921875)POINT (-73.98886108398438 40.77757263183594)dr5rydr5ru
2015-02-09 16:01:302015-02-09 16:10:3221.09-73.9821853637695340.768333435058594-73.9714279174804740.7660903930664067.510.5100.310.3POINT (-73.98218536376953 40.768333435058594)POINT (-73.97142791748047 40.766090393066406)dr5rudr5ru
2015-01-29 09:07:202015-01-29 09:31:4162.94-73.991188049316440.75001907348633-73.9595870971679740.7713584899902341600.54.200.321POINT (-73.9911880493164 40.75001907348633)POINT (-73.95958709716797 40.771358489990234)dr5rudr5rv
2015-10-17 19:10:032015-10-17 19:20:5321.6-73.989723205566440.75254440307617-73.9777145385742240.76387023925781900.51.9500.311.75POINT (-73.9897232055664 40.75254440307617)POINT (-73.97771453857422 40.76387023925781)dr5rudr5ru
2015-01-28 14:55:222015-01-28 15:15:2562.12-73.9742736816406240.74709701538086-74.000587463378940.73900985717773413.500.5100.315.3POINT (-73.97427368164062 40.74709701538086)POINT (-74.0005874633789 40.739009857177734)dr5rudr5ru
2015-02-11 10:15:192015-02-11 10:32:4915.77-73.9811630249023440.74454116821289-73.9900970458984440.6951332092285161900.54.9500.324.75POINT (-73.98116302490234 40.74454116821289)POINT (-73.99009704589844 40.695133209228516)dr5rudr5rs
2015-10-16 17:35:442015-10-16 17:39:4110.7-73.9798889160156240.71788787841797-73.9777069091796940.72568130493164510.5000.36.8POINT (-73.97988891601562 40.71788787841797)POINT (-73.97770690917969 40.72568130493164)dr5rsdr5rs
2016-03-26 17:40:002016-03-26 17:54:5622.6-73.9881134033203140.759586334228516-73.9618225097656240.7796707153320312.500.52.6500.315.95POINT (-73.98811340332031 40.759586334228516)POINT (-73.96182250976562 40.77967071533203)dr5rudr5ru
2015-07-24 01:43:072015-07-24 02:03:2514.6-74.0051956176757840.71916198730469-73.964576721191440.77293395996094180.50.5200.321.3POINT (-74.00519561767578 40.71916198730469)POINT (-73.9645767211914 40.77293395996094)dr5redr5ru
2016-03-28 14:11:052016-03-28 14:25:2118.7-73.8734283447265640.774078369140625-73.76831054687540.7248115539550824.500.5000.325.3POINT (-73.87342834472656 40.774078369140625)POINT (-73.768310546875 40.72481155395508)dr5rydr5x9
2015-10-15 07:09:222015-10-15 07:12:4810.5-73.9770584106445340.755821228027344-73.9832611083984440.760421752929694.500.5000.35.3POINT (-73.97705841064453 40.755821228027344)POINT (-73.98326110839844 40.76042175292969)dr5rudr5ru
2015-10-16 13:29:412015-10-16 13:33:0730.29-73.9756698608398440.793853759765625-73.9731063842773440.79365539550781400.5000.34.8POINT (-73.97566986083984 40.793853759765625)POINT (-73.97310638427734 40.79365539550781)dr72hdr72h
2015-02-09 17:51:032015-02-09 17:57:3811.13-73.9614944458007840.77125930786133-73.9752731323242240.765190124511726.510.51.6600.39.96POINT (-73.96149444580078 40.77125930786133)POINT (-73.97527313232422 40.76519012451172)dr5rudr5ru
2016-03-26 23:25:552016-03-26 23:40:4112.7-73.9926376342773440.71865463256836-73.9965209960937540.74795913696289120.50.52.6500.315.95POINT (-73.99263763427734 40.71865463256836)POINT (-73.99652099609375 40.74795913696289)dr5rsdr5ru
2015-06-17 05:37:192015-06-17 05:44:3912.85-73.9976425170898440.683692932128906-74.0125885009765640.70781326293945100.50.525.540.318.84POINT (-73.99764251708984 40.683692932128906)POINT (-74.01258850097656 40.70781326293945)dr5rkdr5re
2015-07-24 10:28:452015-07-24 10:38:2511.1-73.9920806884765640.74410629272461-73.979225158691440.749462127685557.500.52.0500.310.35POINT (-73.99208068847656 40.74410629272461)POINT (-73.9792251586914 40.74946212768555)dr5rudr5ru
2015-06-17 09:16:112015-06-17 09:21:3910.86-73.9836349487304740.76962661743164-73.9818725585937540.7783241271972665.500.5000.36.3POINT (-73.98363494873047 40.76962661743164)POINT (-73.98187255859375 40.778324127197266)dr5rudr5ru
2015-10-17 19:41:092015-10-17 19:57:4712-73.978172302246140.72955322265625-73.9855117797851640.7496910095214841200.5100.313.8POINT (-73.9781723022461 40.72955322265625)POINT (-73.98551177978516 40.749691009521484)dr5rsdr5ru
2015-02-09 16:54:122015-02-09 17:08:5512.73-73.9940872192382840.751220703125-73.9786224365234440.783248901367191210.52.7600.316.56POINT (-73.99408721923828 40.751220703125)POINT (-73.97862243652344 40.78324890136719)dr5rudr72h
2016-03-26 18:50:462016-03-26 19:05:0722.1-73.9889373779296940.721649169921875-73.9850692749023440.7448196411132811.500.52.4500.314.75POINT (-73.98893737792969 40.721649169921875)POINT (-73.98506927490234 40.74481964111328)dr5rsdr5ru
2015-10-16 21:16:142015-10-16 21:32:5512.3-73.983787536621140.76040267944336-74.0039367675781240.73737335205078120.50.5000.313.3POINT (-73.9837875366211 40.76040267944336)POINT (-74.00393676757812 40.73737335205078)dr5rudr5rg

Showing the first 1000 rows.

Geohashing at precision 25 allows us to divide the NYC area into ~70 bins.

trips.select("pickup_geohash_25").distinct.count
res6: Long = 72

Let's consider the skew for pickups, notice ~110M pickups are in a single geohash (Manhattan).

display(
  trips
    .select("pickup_geohash_25")
    .groupBy("pickup_geohash_25")
      .count()
    .orderBy(desc("count")).limit(25)
)
0.0020M40M60M80M100M120Mdr5rudr5rsdr5rvdr5redr72hdr72jdr5rgdr5rzdr5x1dr5rydr5x0dr5rkdr5rtdr72mdr5rmdr5x2dr5rxdr5rwdr5x8dr5rhdr72qdr5r7dr5rjdr5rqdr5r5TOOLTIPpickup_geohash_25count

5. Load & View NYC Neighborhood Polygon Data (WKT)

val wktDF = sqlContext.read.format("csv")
  .option("header", "true")
  .option("inferSchema", "true")
  .load("/ml/blogs/geospatial/nyc_taxi_zones.wkt.csv")

display(wktDF)
10.116357453189MULTIPOLYGON (((-74.18445299999996 40.694995999999904, -74.18448899999999 40.69509499999987, -74.18449799999996 40.69518499999987, -74.18438099999997 40.69587799999989, -74.18428199999994 40.6962109999999, -74.18402099999997 40.697074999999884, -74.18391299999996 40.69750699999986, -74.18375099999997 40.69779499999988, -74.18363399999998 40.6983259999999, -74.18356199999994 40.698451999999875, -74.18354399999998 40.69855999999988, -74.18350799999996 40.69870399999992, -74.18327399999998 40.70008999999988, -74.18315699999994 40.701214999999884, -74.18316599999997 40.702384999999886, -74.18313899999998 40.7026279999999, -74.18309399999998 40.7028529999999, -74.18299499999995 40.70315899999985, -74.18284199999994 40.70346499999989, -74.18264399999998 40.70373499999988, -74.18242799999996 40.70395099999992, -74.18220299999996 40.704139999999896, -74.18203199999994 40.70425699999987, -74.18180699999994 40.7043919999999, -74.18157299999996 40.70449999999988, -74.18132099999997 40.70460799999...0.0007823067885Newark Airport1EWR
20.43346966679MULTIPOLYGON (((-73.82337597260663 40.63898704717672, -73.82277105438692 40.63557691408512, -73.82265046764824 40.63536884414309, -73.82253791037438 40.6351581797112, -73.82243347854202 40.63494510056532, -73.8223372611914 40.63472978853998, -73.82224934035098 40.63451242737345, -73.82216979096668 40.634293202551085, -73.82209868083864 40.6340723011465, -73.82203607056276 40.63384991166226, -73.82198201348177 40.63362622386902, -73.82193655563644 40.63340142864301, -73.82189973572993 40.63317571780408, -73.82187158509224 40.63294928395111, -73.82185212765629 40.63272232029806, -73.82184137993583 40.6324950205089, -73.82183935101227 40.63226757853259, -73.8218460425281 40.63204018843732, -73.82107505533321 40.62973377456623, -73.82081417085445 40.629390439641234, -73.82059122816396 40.62892422501729, -73.8202234085928 40.62844358255744, -73.8200841811797 40.6282616395263, -73.8199971542669 40.62805115103772, -73.81991014068153 40.62784065311699, -73.81973384601805 40.6277123040871, -73....0.00486634037837Jamaica Bay2Queens
30.0843411059012MULTIPOLYGON (((-73.84792614099985 40.87134223399991, -73.84725144800001 40.870987051999926, -73.84699273699992 40.87085288799987, -73.84640766399981 40.8705543009999, -73.84608957099984 40.870389771999946, -73.84578147499997 40.870227695999894, -73.845172567 40.86991469799994, -73.84487737499975 40.86976050699997, -73.84442133700003 40.86952229899991, -73.84423146999998 40.86942034999993, -73.84358581499981 40.86908763699991, -73.84315715499991 40.868863265999934, -73.84280443499989 40.868680752999886, -73.842406294 40.86847474399992, -73.84185186499998 40.86819192599989, -73.84122362600002 40.867858150999915, -73.84064364799987 40.867554175999935, -73.83974233399985 40.8670879309999, -73.83954475699979 40.86698673799988, -73.83922085399998 40.866820839999924, -73.83875223499997 40.86657277699996, -73.83784380199984 40.86609918799994, -73.83697021099982 40.86564313599992, -73.83678824299999 40.86554590599999, -73.83618601399989 40.86522409899994, -73.83578436699997 40.86501601099997, ...0.000314414156821Allerton/Pelham Gardens3Bronx
40.0435665270921MULTIPOLYGON (((-73.97177410965318 40.72582128133706, -73.97179142961485 40.72581422114911, -73.97181650587731 40.72581496675257, -73.97185935830923 40.72558296903031, -73.97187437695213 40.72550311607975, -73.97188490951473 40.725424405065766, -73.97191120732053 40.72529037069992, -73.97193374501082 40.72517629035117, -73.97193975456328 40.725158038610054, -73.97196154778591 40.725039978810884, -73.97200511841213 40.72484148970817, -73.97203666966882 40.724684070020096, -73.97206595867397 40.72455915832874, -73.97207196960339 40.724536350858095, -73.97208098151926 40.72449756793038, -73.97208400057282 40.72446790554567, -73.97209751290906 40.72442341523472, -73.97215609001734 40.7241701782781, -73.97216585996632 40.724131963273145, -73.9722169237619 40.723930054646765, -73.97223344676958 40.723846779926305, -73.97226499868246 40.72371445733361, -73.97232507731592 40.723463499327295, -73.97236115744644 40.72331206047645, -73.97239945748277 40.72314881636663, -73.97251011180381 40.72269...0.000111871946192Alphabet City4Manhattan
50.0921464898574MULTIPOLYGON (((-74.17421738099989 40.5625680859999, -74.17348507999998 40.56226748999995, -74.17225507699992 40.56170483699991, -74.17191921399996 40.56155171899995, -74.17185166499996 40.56152092299992, -74.17222993499992 40.56113585799992, -74.17245326199999 40.56088825699991, -74.17321541599998 40.5600776619999, -74.17358785199997 40.55969842799993, -74.17437344399991 40.55870866599984, -74.17475740499992 40.55816798199986, -74.1750629909999 40.55771126399991, -74.17512402999996 40.557620037999925, -74.17547297999988 40.557065311999914, -74.17559957599995 40.55685071199992, -74.17579913099998 40.55651243799986, -74.1761165979999 40.55593754099987, -74.17661991899996 40.55499100699994, -74.17746276899993 40.55341114599985, -74.17815548499992 40.552112789999896, -74.17874485199994 40.550995868999905, -74.1793348139999 40.54988835199988, -74.17991198599996 40.54883445299993, -74.18018524699995 40.54837960899992, -74.18128532999992 40.54695757299989, -74.18206740899993 40.5460448389998...0.000497957489363Arden Heights5Staten Island
60.150490542523MULTIPOLYGON (((-74.06367318899999 40.60219816599994, -74.06350565699998 40.60215005399992, -74.06383152699986 40.602588967999964, -74.0651709129999 40.6042135079999, -74.06046429699992 40.606405823999864, -74.06042867199996 40.6063527299999, -74.05801067099993 40.60736879199994, -74.05778710399987 40.60744959099992, -74.0578901689999 40.607580753999905, -74.05685812390232 40.608056357772554, -74.05677183367786 40.607899470387395, -74.05674934830238 40.607798757335814, -74.05665999852928 40.607555930875925, -74.05649565936757 40.6072476482562, -74.05640693287154 40.60718873802623, -74.0560104141088 40.606780566131995, -74.05552126122357 40.6064828925687, -74.05543198004166 40.60648249104071, -74.05537932434086 40.60649422352233, -74.05528719697126 40.606538890078745, -74.05516001122312 40.60673049135086, -74.05498867839447 40.60666069691175, -74.05499916476879 40.60664574478401, -74.05503373135794 40.60665982664601, -74.05505194098775 40.60663386047028, -74.0550195433675 40.60662066296...0.000606460984581Arrochar/Fort Wadsworth6Staten Island
70.107417171123MULTIPOLYGON (((-73.90413637799996 40.767520316999864, -73.90325211599989 40.767504322999905, -73.9030052879999 40.767509662999885, -73.90275780099982 40.767503546999855, -73.90251104099987 40.76748594099992, -73.90226637199994 40.76745694399991, -73.90202516599992 40.7674167839999, -73.90217951699996 40.76731584199997, -73.90255919500005 40.766940786999896, -73.90341888199997 40.765957306999944, -73.90351227799994 40.76584945999989, -73.90356915599997 40.76578178899994, -73.90361058299999 40.765726577999956, -73.90370771099997 40.765597148999866, -73.90451229899999 40.76458906399989, -73.90519286699994 40.76375094099996, -73.90566075299986 40.763167987999914, -73.90606811199996 40.762660444999916, -73.90625691699982 40.76242520699992, -73.90651032099997 40.76210946999992, -73.90677808699982 40.761777481999886, -73.90703976399989 40.76145304399993, -73.907419729 40.76098192599994, -73.90753042700004 40.76084467799991, -73.90779405499987 40.76051779999991, -73.90740334999987 40.76033397...0.000389787989274Astoria7Queens
80.0275906911574MULTIPOLYGON (((-73.92334041500001 40.775128911999936, -73.92398142899997 40.774615111999886, -73.92523246199983 40.775298853999885, -73.92531479799985 40.77534385099991, -73.92602208199996 40.77573039899992, -73.92658081899984 40.776039258999916, -73.92737641899994 40.77646661099989, -73.92782147400004 40.77669752699993, -73.92827730816353 40.77689897516218, -73.92708229009109 40.77771978109685, -73.92631833401951 40.77824177509243, -73.9258220122297 40.77838590613155, -73.92574521623307 40.77840537091916, -73.9256507618914 40.778430811916465, -73.92557304281429 40.77845885141435, -73.92481615523091 40.77875769181163, -73.92423363003755 40.77910119388272, -73.92318694398986 40.78024839306262, -73.92295652695056 40.78044100806101, -73.9226301381542 40.78056478536395, -73.92209965499714 40.78085187481845, -73.92097562099832 40.7817676912532, -73.91996458796496 40.78263506876824, -73.91975969999989 40.782514177999886, -73.91796581399997 40.78125629099988, -73.91861823099985 40.7807328679...0.000026587716279Astoria Park8Queens
90.0997840924705MULTIPOLYGON (((-73.78502434699996 40.76103651599987, -73.78486059299999 40.76064436299992, -73.78467742500003 40.76025720799989, -73.78447529299982 40.75987586199995, -73.78430628699978 40.759483644999904, -73.78428991899993 40.75944029899991, -73.78425940899996 40.75938264599993, -73.78407792999997 40.75903964399988, -73.78382076099993 40.75853003399991, -73.78346111099987 40.757864063999904, -73.78338071499984 40.75775389699993, -73.78316157699985 40.75732618499991, -73.78303191299983 40.75708319099991, -73.78281576399985 40.75666634299991, -73.78264852999988 40.75633190399988, -73.7824813079998 40.75599745499987, -73.78212461999979 40.75533931199993, -73.78165171799995 40.754707752999956, -73.78113322699984 40.7540893259999, -73.78052037799992 40.753330742999886, -73.78009357400003 40.7525075039999, -73.77980639299983 40.75189500499989, -73.77944066999987 40.75112269599993, -73.77906558899984 40.75033257399993, -73.77831180799991 40.748745013999944, -73.77753347599982 40.7471483419...0.000338443803197Auburndale9Queens
240.0469999619287MULTIPOLYGON (((-73.95953658899997 40.7987185259999, -73.96004456499999 40.79804123499991, -73.96147779999993 40.79865415599994, -73.96286980099991 40.799239676999946, -73.96571144299992 40.80043806999988, -73.96775900399992 40.80130351599994, -73.96787379699998 40.80135169799993, -73.96798415999996 40.80139826599985, -73.96858360799983 40.80163546999991, -73.97004742199995 40.80226500999991, -73.97021594799989 40.80233585099994, -73.97027400499987 40.802359035999885, -73.97032589799987 40.80238456099995, -73.97150381000002 40.80283773599996, -73.97250022199995 40.80321661299997, -73.97257779799996 40.803247183999915, -73.9726574479999 40.803276513999926, -73.97279907800002 40.803329158999894, -73.97287179090726 40.803356187573904, -73.97255429829633 40.80379863465013, -73.97217237241792 40.80431907695909, -73.97205095521862 40.80453037600999, -73.9719529243853 40.804619709051586, -73.97181849483539 40.80471754320449, -73.97179980150743 40.80478561548601, -73.97171200727101 40.80493169...0.000060723573775Bloomingdale24Manhattan
100.0998394794152MULTIPOLYGON (((-73.78326624999988 40.68999429299992, -73.78234452799988 40.68840743699995, -73.78148675699995 40.6886971829999, -73.78051569899989 40.687036519999914, -73.77976509199979 40.68574360199992, -73.77966850599998 40.68537712299996, -73.77957347199998 40.68541503299992, -73.77870794599994 40.685700419999876, -73.77784971099992 40.68598927299988, -73.77699767599997 40.6862826889999, -73.77697494099996 40.686246713999935, -73.7767991239999 40.68596846499985, -73.77632402199986 40.6852165559999, -73.77567289899983 40.68474158899993, -73.77501231399985 40.68427557899985, -73.77462061100005 40.683990969999854, -73.7745579039998 40.683885621999906, -73.77441975399975 40.683653521999915, -73.77418414899984 40.68323792099991, -73.773499153 40.68348222699996, -73.77328703999997 40.68345473099989, -73.77297749099996 40.68293379299996, -73.77256209599992 40.682209496999846, -73.77220275299987 40.68161033899991, -73.77232211299984 40.681490967999935, -73.77299539399996 40.6812088249999,...0.000435823818081Baisley Park10Queens
110.0792110389596MULTIPOLYGON (((-74.00109809499993 40.60303462599993, -74.00032353799993 40.60262029199992, -74.00002266099992 40.60290731599988, -73.99927902000003 40.60245801699991, -73.998563851 40.60202843399991, -73.99782332499991 40.601578178999915, -73.99708036399986 40.60112882899989, -73.9963651649999 40.600696053999904, -73.99559320799995 40.6002322219999, -73.99733919599988 40.5985516119999, -73.99865586599988 40.59726856199988, -73.99931921399997 40.596640750999924, -73.99951049399985 40.59644180899987, -73.99996502999996 40.59599430299989, -73.999997695 40.59596779199991, -74.00004233899988 40.59594037099991, -74.00027871999994 40.595702668999905, -74.00200394754667 40.594132371137796, -74.00219143075543 40.59435645428151, -74.00230298841333 40.594543340564904, -74.00242215707556 40.59472747670866, -74.00254882028027 40.59490868266267, -74.0026828542343 40.59508678124065, -74.0028241279343 40.59526159829329, -74.00297250329423 40.595432962878775, -74.00312783528081 40.59560070742998, -74....0.00026452053504Bath Beach11Brooklyn
120.0366613013579MULTIPOLYGON (((-74.01565756599994 40.704833087999944, -74.01539758699995 40.704800148999894, -74.01527219799995 40.70483003699998, -74.01516257 40.704805094999884, -74.01496125199992 40.70475979699995, -74.01489542099996 40.70469751799991, -74.01478059499995 40.70467411299992, -74.0146670989999 40.704647212999916, -74.01451712299998 40.704605674999854, -74.014370312 40.70455803799994, -74.01428922899998 40.70454907499989, -74.01427065899998 40.70452022899989, -74.01425861399994 40.70448944299991, -74.01425342599994 40.70445756399993, -74.01425523899994 40.70442547199991, -74.014391769 40.70359878299993, -74.01442983199998 40.70315064799989, -74.014192151 40.70275671099996, -74.01389890399994 40.70227066999996, -74.01379120799997 40.70130547599995, -74.01378191199989 40.70122215499992, -74.01377528899992 40.7011827129999, -74.01376867799992 40.7011432629999, -74.01415893499998 40.701096289999896, -74.01395152778244 40.70099098222994, -74.0140919838548 40.70055161832718, -74.01410490300...0.000041511623673Battery Park12Manhattan
130.0502813228631MULTIPOLYGON (((-74.01244109299991 40.7190576729999, -74.01281566799992 40.71735629799987, -74.01286663199994 40.71717610099995, -74.0130514639999 40.71645477099989, -74.01323384899992 40.715656187999855, -74.0133512149999 40.71523331199993, -74.01347524299993 40.715110710999895, -74.01359239999995 40.71449431599993, -74.01375388499997 40.71369055499988, -74.01404744699995 40.7124378149999, -74.01417753399997 40.71188266599997, -74.0142689369999 40.711467815999924, -74.01445559399995 40.71090715299987, -74.01466507099994 40.71042693799993, -74.01482432799997 40.70982336799991, -74.01487257099997 40.70968487399991, -74.01495415399995 40.70943269199994, -74.01534330799996 40.70849681699987, -74.01559220199994 40.70788324299987, -74.015643777 40.70775609899987, -74.01568829399997 40.70766382499988, -74.01571815199996 40.707585310999924, -74.01584985499994 40.70724726799988, -74.01586395999995 40.70720018299993, -74.01588574099995 40.707142175999934, -74.01590498299998 40.70709269499987, -...0.000149358592917Battery Park City13Manhattan
180.0697995498569MULTIPOLYGON (((-73.88513907699999 40.86638287399992, -73.88593703500003 40.86592439799995, -73.88683316999993 40.86538999399989, -73.8881227879999 40.8642545709999, -73.88889566099989 40.86475415299988, -73.890161637 40.863476362999954, -73.89065392999989 40.86295483399993, -73.89114803099996 40.862476137999934, -73.8917325659999 40.861909814999905, -73.89177188799992 40.86187171599992, -73.89138023399983 40.86170058799992, -73.89141802399983 40.86166298399995, -73.89256392599998 40.86052272899994, -73.89321520799987 40.85987420599987, -73.89381026099987 40.85898656499994, -73.8946932639999 40.85942628199992, -73.89573924699978 40.858138206999875, -73.89636314599984 40.85837531899993, -73.89735765499988 40.85876273499986, -73.89818244699991 40.85908368099994, -73.89866157499996 40.859246901999924, -73.89883814599983 40.859307307999906, -73.89880457699982 40.8593642709999, -73.89859097199998 40.859766782999955, -73.89828973399992 40.86033442099993, -73.89822728999994 40.8604488639999, ...0.000148850163948Bedford Park18Bronx
250.0471458199319MULTIPOLYGON (((-73.98155298299992 40.689146163999936, -73.98101786899988 40.68893792699991, -73.98092822899991 40.68890247699988, -73.9808430809999 40.688761361999916, -73.980691182 40.68851581099994, -73.98064972099984 40.688459476999874, -73.98012756199996 40.68775000899994, -73.97984055799984 40.68734433199992, -73.97959037699985 40.687003901999965, -73.97936297699995 40.686682000999916, -73.97909065799993 40.68629386599988, -73.97899402899994 40.686156131999894, -73.97827416099987 40.68519595199996, -73.97804289599988 40.68485661499989, -73.97838862599984 40.68442334199988, -73.97842970699993 40.684355612999866, -73.97876022499986 40.68376544399991, -73.97918390599997 40.68312883799993, -73.97961592499983 40.682493556999916, -73.98003510099997 40.68185262699988, -73.98046155400003 40.681222546999926, -73.98088932299994 40.6805933489999, -73.98132413699994 40.67995210099992, -73.98175642299985 40.67931462399988, -73.98185715599982 40.67935261499986, -73.98413878099997 40.6802453709...0.000124168267356Boerum Hill25Brooklyn
140.175213698053MULTIPOLYGON (((-74.03407329297129 40.644313932981866, -74.03284292006926 40.64356371017527, -74.03266558998958 40.64372034489007, -74.03260644399994 40.64369891099996, -74.02905968899994 40.64172667299992, -74.02889666799992 40.64121402199986, -74.02890829899998 40.641173410999905, -74.02839277799997 40.640963136999865, -74.02802775299989 40.640793489999915, -74.02742711399993 40.640514336999956, -74.02703439399988 40.64034998599989, -74.02691981299992 40.640308507999876, -74.02674292499995 40.640244467999935, -74.02662323799991 40.6402011359999, -74.02626267299999 40.64009438099988, -74.02628611999998 40.64007452899989, -74.02635007599996 40.640018464999905, -74.02646434999998 40.639918292999916, -74.02659984399993 40.63978656099993, -74.02664251499989 40.63974743299988, -74.02686129399991 40.6395362909999, -74.02695244699993 40.63944606499998, -74.02475437599998 40.63812141799988, -74.0245384189999 40.63832493699994, -74.02417094699994 40.63866937099987, -74.02392610699991 40.638898...0.00138177826442Bay Ridge14Brooklyn
150.14433622262MULTIPOLYGON (((-73.7774039129087 40.79659824126783, -73.77738937457792 40.79659450183192, -73.77737533353579 40.796590638548075, -73.77736151739849 40.796587154639624, -73.77734722706326 40.79658341668249, -73.77732802081981 40.79657950739745, -73.77730831725226 40.79657527248403, -73.77729522076002 40.796572608989926, -73.77727883366029 40.79656898558112, -73.77726240942357 40.79656565694303, -73.77724580769197 40.79656247270167, -73.77722588125384 40.79655751782156, -73.77720481055026 40.796551497944655, -73.77718793343199 40.796545368734854, -73.77717293031017 40.796538703545885, -73.77716048389526 40.79653321245802, -73.77714079232376 40.79652546721039, -73.77712309051303 40.79651796670836, -73.77710551097655 40.796512990043716, -73.77709075818873 40.796509449343056, -73.77707133827573 40.79650570143153, -73.77705491487234 40.79650213169629, -73.77703946639896 40.796497598227674, -73.77702305739517 40.79649361355523, -73.7770085428856 40.796489685818536, -73.77699143346936 40.7964...0.000925219395547Bay Terrace/Fort Totten15Queens
220.126170229196MULTIPOLYGON (((-73.99254973599997 40.62427426799996, -73.99009356099988 40.62278895299992, -73.98785095499996 40.62143503199992, -73.9856935779999 40.62013151399989, -73.98627524699981 40.61956661699989, -73.98406791799982 40.61824073899989, -73.98186818299985 40.61691212699987, -73.98087912799988 40.61631443499988, -73.98003930399985 40.61580692999996, -73.97963821799982 40.61556454699991, -73.98022027499997 40.6150049489999, -73.98080506199987 40.61444712999986, -73.98143750099992 40.61383768799993, -73.98174843299985 40.613554623999946, -73.98206106199993 40.613238418999885, -73.98215550199991 40.613149614999934, -73.98265927499982 40.61269247099993, -73.98322226999993 40.61212220899992, -73.98335142399998 40.61199230099992, -73.98380893599982 40.611559872999855, -73.984162011 40.611217300999876, -73.98438244899988 40.611005419999884, -73.98496383499995 40.61044799399991, -73.98535587499991 40.61007201399988, -73.98554853199988 40.60988724299989, -73.98575987199992 40.6096840839999...0.000472062684608Bensonhurst West22Brooklyn
230.290556028962MULTIPOLYGON (((-74.19568609223377 40.63501686464005, -74.19557688057968 40.63500421857057, -74.1955597527974 40.635023986316575, -74.19248359599999 40.63340507199996, -74.1921598649999 40.633230970999946, -74.18649341199989 40.63021905099988, -74.18368103499995 40.62874067099991, -74.1819023569999 40.62775580699989, -74.18033424799995 40.626834629999905, -74.17993706099998 40.62660129699989, -74.1795447069999 40.626362353999895, -74.17924623499991 40.626180580999886, -74.17918377399995 40.62613788499989, -74.17888390599994 40.625932870999925, -74.17828177399998 40.62545136099991, -74.1780882019999 40.62526042699994, -74.1778150209999 40.624990962999966, -74.17775298599997 40.62493844999993, -74.17610052899997 40.623406241999895, -74.17519625699995 40.62270624399988, -74.17490328599996 40.622529106999885, -74.17459706299995 40.6223640109999, -74.17427887999996 40.62221179199987, -74.17395016799996 40.62207316899987, -74.17361243999996 40.621948740999855, -74.17326730799988 40.621838983...0.00219556576201Bloomfield/Emerson Hill23Staten Island
160.141291873771MULTIPOLYGON (((-73.7685730499999 40.77910542899993, -73.76833788999983 40.7786825249999, -73.76825889099999 40.778702104999915, -73.76807192199988 40.77874844899989, -73.76796073100003 40.778776008999955, -73.76782207615058 40.77881037615661, -73.76760454633784 40.77829903466069, -73.7676189407549 40.77799469391587, -73.76747817366723 40.77765554086643, -73.76713717312357 40.776937753291556, -73.76709113484746 40.776844841109174, -73.76700068069775 40.776695213965446, -73.76658827278405 40.776172594166, -73.76632823258105 40.77584305433083, -73.76627787969171 40.77574118632526, -73.76614233293911 40.77546695978643, -73.76600398326563 40.77506700693254, -73.76572796903912 40.77460332809212, -73.76510436820205 40.77379903872306, -73.76469385424426 40.77334047485452, -73.76436067006205 40.7730285208478, -73.76417633114528 40.77282999044272, -73.7635845659027 40.77235821590673, -73.76223863110448 40.77122066177052, -73.7612630125983 40.770395965074215, -73.76085900055723 40.77002264272332...0.000871889446182Bayside16Queens
170.093522632948MULTIPOLYGON (((-73.94306406899986 40.701424434999886, -73.94220058700002 40.70089066699992, -73.94193078899983 40.7007252339999, -73.94438788599984 40.70042452299993, -73.94424286099989 40.699699279999926, -73.94409591299996 40.698972954999924, -73.94394947200006 40.698221278999895, -73.94391750199989 40.698056201999854, -73.94380383199999 40.69746926499997, -73.94378455600005 40.697369728999924, -73.9437430669999 40.69715549899994, -73.9437245359998 40.69705981199991, -73.94368427099982 40.69685190199992, -73.9436380689999 40.69661331799992, -73.94362121299996 40.69652627899993, -73.94355634200002 40.696191282999926, -73.94354024099975 40.696108141999964, -73.94352527499989 40.6960308549999, -73.943388021 40.69528898999993, -73.94324249099988 40.694557484999955, -73.94312826799984 40.6939670379999, -73.9431142779999 40.6938947199999, -73.94310040999994 40.69382302899988, -73.942951361 40.693090783999885, -73.94280765199987 40.69235779399988, -73.94266181699986 40.69162434399988, -73....0.000322957654799Bedford17Brooklyn
190.101824875452MULTIPOLYGON (((-73.72339596299987 40.750389075999855, -73.72258571899978 40.74885045099993, -73.720144294 40.74976283099995, -73.72010148299994 40.74977568599992, -73.71988664100002 40.749369510999955, -73.71896368299994 40.74699473999995, -73.71894406299995 40.74694425599994, -73.71892134799995 40.74689486899995, -73.71869037499981 40.746392765999936, -73.71853063599995 40.746039329999924, -73.71823250099992 40.74539666299989, -73.71764302999979 40.744070413999964, -73.71762516399986 40.74402847899988, -73.7176030609999 40.743974627999876, -73.71740598499986 40.74351092999988, -73.71656758399989 40.74164908599988, -73.71578267699999 40.739895785999884, -73.71544946799989 40.73921680399994, -73.71511121299982 40.73856840999989, -73.71496199799985 40.73827640999986, -73.71494063099992 40.73823459999989, -73.71476982799997 40.7379003479999, -73.71436629299991 40.737243891999896, -73.71370155699985 40.736160121999944, -73.71328662099985 40.735473124999935, -73.71289825099976 40.734851136...0.000546661094782Bellerose19Queens
200.0514401924362MULTIPOLYGON (((-73.88386792099986 40.8642908889999, -73.88379386499992 40.86417182299991, -73.8837937109999 40.86417157099989, -73.88200794099986 40.862046852999946, -73.88103469099984 40.8612752949999, -73.88092572600007 40.861162287999925, -73.88083055899997 40.861040343999946, -73.88075099099991 40.86091098799991, -73.88068839499986 40.86077599299989, -73.88064370299989 40.86063731599991, -73.88061726900006 40.860497010999936, -73.88060896899991 40.8603570929999, -73.88075871500001 40.85949442499993, -73.880965862 40.85854520499987, -73.88098942799995 40.858459358999895, -73.88100678999979 40.85826802299992, -73.88100464399997 40.85807565699992, -73.88098293799995 40.85788399199989, -73.88094199099993 40.857694990999974, -73.880941932 40.857694738999925, -73.88094184999993 40.85769449599996, -73.88088225100002 40.85750954499986, -73.88080810099991 40.857198447999885, -73.88079155299991 40.85712750799994, -73.88077132199986 40.8570397609999, -73.88072954099998 40.85680727499992, -73...0.000134512633032Belmont20Bronx
210.115973569062MULTIPOLYGON (((-73.97418385499991 40.60946350199992, -73.97403097799986 40.608702309999906, -73.97316643599986 40.60879557699993, -73.97299433999983 40.608814141999886, -73.97258982399998 40.6066715329999, -73.97239735499981 40.605651889999876, -73.97217742800002 40.60419471199986, -73.97235152099995 40.60334811899988, -73.972452617 40.6026170539999, -73.9725653369999 40.601794372999905, -73.97291116900001 40.59931580399996, -73.9719108049999 40.599423058999896, -73.97176105299991 40.59865193199991, -73.97163038199992 40.59794401699991, -73.97148350899987 40.59717158499997, -73.97323983499986 40.59697881799985, -73.9740839059999 40.596882943999965, -73.97492695599999 40.596793537999936, -73.97503940399993 40.59678002699996, -73.97558819299998 40.59671920599991, -73.97650934500001 40.59661610899985, -73.97750674199996 40.596506452999904, -73.9785016919999 40.596394852999914, -73.97890571399992 40.596352729999914, -73.9794258679999 40.59629752299988, -73.98035785499995 40.59619154099992...0.000380251345507Bensonhurst East21Brooklyn
260.12354780707MULTIPOLYGON (((-73.98331628499983 40.641478681999914, -73.98299419199992 40.64132499699987, -73.98244454199998 40.6415386259999, -73.98204321799996 40.64170758199987, -73.98123240499983 40.64204491299995, -73.98042057899988 40.64238522699991, -73.98007428599995 40.640539699999906, -73.98000693099998 40.640208836999896, -73.97990983199979 40.639686357999906, -73.97987360300003 40.63951820599989, -73.9796770499999 40.6384647999999, -73.97955441199994 40.63781925899985, -73.9794759209999 40.63743136399991, -73.97938644699988 40.63693216299988, -73.97928591699991 40.63641419399992, -73.97911188699993 40.63544038599991, -73.97802159000001 40.63555270299985, -73.9768886119999 40.63567486199991, -73.97663655999995 40.63435382099991, -73.97655064099989 40.633903508999886, -73.97643342199997 40.63328912299988, -73.97604935699994 40.63127590599987, -73.97716511999984 40.630746653999886, -73.97699848899987 40.62987149599992, -73.97684964299985 40.62908858099995, -73.97669604399998 40.62835456399...0.000534039927626Borough Park26Brooklyn
270.202508808518MULTIPOLYGON (((-73.86522555399998 40.57045847199989, -73.86454176099993 40.56924292199992, -73.86410310099991 40.56935460999994, -73.86406802399988 40.569297978999934, -73.86316930199989 40.56773927199992, -73.86308767499982 40.567597728999914, -73.86286892288632 40.56683057177313, -73.86267372829568 40.56651956610252, -73.86267607982793 40.5665130138054, -73.86268391251235 40.56650565604354, -73.86269356691223 40.56650219217743, -73.86270424269793 40.5665019973689, -73.8627141083374 40.56650509874634, -73.86277353301229 40.56657186205274, -73.86295920590028 40.566815983072175, -73.86300482943778 40.56687595773083, -73.86319883665384 40.56697222108388, -73.86335482591628 40.56701963007009, -73.8634236098639 40.567031743533946, -73.86349306360215 40.567034311734034, -73.86355862677969 40.567027194390754, -73.8637303990016 40.56697901282819, -73.86387639829695 40.56693428525781, -73.86402791878817 40.56688561150596, -73.86449981054494 40.5667240744525, -73.86459949094905 40.566692997769...0.00134088762746Breezy Point/Fort Tilden/Riis Beach27Queens
280.097960782214MULTIPOLYGON (((-73.79240413399991 40.71619304099993, -73.7926872159999 40.71568003299994, -73.79314903799985 40.71493342999985, -73.79346012399989 40.714419191999895, -73.7935315959999 40.714277345999925, -73.7935316439998 40.71427725599991, -73.7935316789999 40.71427716599994, -73.79358570299998 40.71412867799988, -73.79362091299996 40.713975346999895, -73.79363634199993 40.71381958599996, -73.79363636699993 40.7138193969999, -73.79363635499982 40.71381920899989, -73.79363166700001 40.713663041999894, -73.79360706699993 40.713508577999924, -73.79360705599984 40.71350852299992, -73.79360704399981 40.713508469999915, -73.79356328499998 40.71335799599988, -73.79350163599987 40.71321339799988, -73.79321635699988 40.71261327999989, -73.79313224999994 40.71240723599991, -73.79306872799985 40.71219599599993, -73.79302654199988 40.71198136399988, -73.79300604199986 40.71176522199993, -73.79300721999992 40.711549469999916, -73.79303800099989 40.71071107499989, -73.79389609999994 40.7103523289...0.000291203927662Briarwood/Jamaica Hills28Queens
330.0532702931967MULTIPOLYGON (((-73.99619227264343 40.70337714093203, -73.99513826820316 40.702974114861405, -73.99506438495756 40.70310031332676, -73.99504592724139 40.70313183989976, -73.99490815999987 40.70304734099988, -73.99470923399984 40.702993885999895, -73.9944400939999 40.702909269999964, -73.99417681200005 40.70282465399987, -73.99380996599997 40.70267441199997, -73.99325388199995 40.70241197099989, -73.99286016299997 40.702202766999896, -73.99261204999985 40.70206112899992, -73.99232767899991 40.70185536999986, -73.99221871100002 40.70177257799987, -73.9921106779999 40.701693442999925, -73.99206681900003 40.70165885999989, -73.99202772899994 40.70162814199991, -73.99193644899997 40.701556408999856, -73.99126294499995 40.701027101999905, -73.99093201799984 40.7007662159999, -73.99087453800003 40.70067311699993, -73.99083516199983 40.700569761999915, -73.99081766499997 40.70046229299991, -73.99082272099989 40.70035475399991, -73.99084157899988 40.70028125699985, -73.9910295809998 40.69984716...0.000147416802448Brooklyn Heights33Brooklyn
290.0714083127733MULTIPOLYGON (((-73.96004798699995 40.58326987199995, -73.95900739999992 40.58283812799991, -73.95733608399979 40.58302513399991, -73.95723610100002 40.58304227099991, -73.9571329139998 40.583045725999966, -73.95703134199992 40.58303533199994, -73.95695595999992 40.58298226299991, -73.95689047299997 40.58293397899993, -73.95682583599991 40.5828863089999, -73.95675618299992 40.58283496999994, -73.95645729099982 40.58265885099992, -73.95604146799998 40.58273625399989, -73.95571160099988 40.58280458499993, -73.95517441499999 40.582915870999955, -73.954365727 40.583081076999875, -73.95414287899986 40.58310613999991, -73.95412132099985 40.58298298499989, -73.95411176199985 40.582919917999966, -73.95407172899988 40.582702397999896, -73.95403970599988 40.58251639099995, -73.95392000699991 40.58186979399993, -73.9538380169999 40.581745551999916, -73.9537406319999 40.58135589199988, -73.95334153899985 40.579267127999884, -73.95309963899994 40.57799415599989, -73.95303970899995 40.5776795869999,...0.000201673837402Brighton Beach29Brooklyn
310.0964245666516MULTIPOLYGON (((-73.87094462199981 40.85726608099992, -73.87094413599989 40.857265988999906, -73.87094366199995 40.85726605199995, -73.87089011199996 40.85727278099993, -73.87088983900003 40.85727281799995, -73.87088962499988 40.85727291599995, -73.87087754099998 40.85727822399986, -73.87084887399999 40.85729081699992, -73.86954868099988 40.85772602999987, -73.86889622799993 40.85777277299997, -73.86841539699994 40.85778035799996, -73.86876752999989 40.85734077999995, -73.86887858999994 40.85720213799993, -73.86907624599999 40.85694556099987, -73.86927391299994 40.8566889829999, -73.86988842299996 40.85597106699988, -73.86990379599993 40.85587302199991, -73.86990421600002 40.85577329299987, -73.86988939599995 40.855673861999925, -73.86985960399987 40.85557672799994, -73.86981576299978 40.85548377399993, -73.86937675499983 40.85426572299986, -73.86916668699996 40.85368604599991, -73.86872263199984 40.85242385199994, -73.86860515599989 40.852068645999914, -73.86853091299999 40.8517767559...0.000333975927329Bronx Park31Bronx
320.05426721601MULTIPOLYGON (((-73.85882515999995 40.858061356999876, -73.8617906939999 40.857982903999925, -73.86287784399995 40.85795359099992, -73.8629585349999 40.857951413999956, -73.86318907699996 40.85794519699993, -73.86326398600002 40.8579431759999, -73.86387047899979 40.85792681599984, -73.86395713499984 40.857924478999955, -73.86455073499997 40.85790846299995, -73.86467028199996 40.857905236999976, -73.86564157999992 40.85788154599993, -73.8665833139999 40.85785535399993, -73.86758752499986 40.857830089999894, -73.86802029299992 40.85783059499988, -73.86807772399996 40.85784684199992, -73.86813140299985 40.8578765929999, -73.86817334099987 40.85791854899991, -73.86819723700003 40.857967986999896, -73.86820126399982 40.85801835599993, -73.8681883059999 40.858063833999964, -73.86841539699994 40.85778035799996, -73.86889622699992 40.85777277299994, -73.86954868099988 40.85772602999987, -73.87084887399999 40.85729081699992, -73.87087754099998 40.85727822399986, -73.87088962499988 40.8572729159...0.000150879171971Bronxdale32Bronx
300.0945097669793MULTIPOLYGON (((-73.82075892499992 40.61523267899992, -73.81768666599999 40.614932997999844, -73.81652681189118 40.61494701007998, -73.81655519586245 40.614881068359615, -73.81657527753201 40.61481337831561, -73.8165868765815 40.61474454525, -73.81658988963738 40.61467518507706, -73.81658428973421 40.61460591806853, -73.8165701269355 40.61453736407744, -73.8165475286072 40.614470136266654, -73.81651669585267 40.614404836864594, -73.81647790560582 40.61434204897534, -73.81643150389779 40.614282334964926, -73.81615626616234 40.6129421157549, -73.81604375315976 40.61275962622101, -73.81602636695548 40.61236542423196, -73.81595301908956 40.612168218936766, -73.81586106373182 40.61202025698769, -73.81588914214508 40.61188656365409, -73.81585258478174 40.61174572809621, -73.81581602898463 40.61160489311677, -73.81573329159819 40.61146398411757, -73.81563522523048 40.61119560007353, -73.81559405486736 40.61086335714752, -73.81559858789666 40.610672516164726, -73.81520720849484 40.609816733796...0.000145862107626Broad Channel30Queens
340.0657059323545MULTIPOLYGON (((-73.97232032119902 40.709082883152185, -73.97066975742996 40.70725970882148, -73.97054062182238 40.707316076353834, -73.9702621853228 40.706887504284005, -73.97048881848585 40.70540066562183, -73.97016894509909 40.705361853407325, -73.97018075572805 40.70492927056685, -73.96762114779945 40.703348505194356, -73.96751516691086 40.70343735687813, -73.96747674493034 40.70394987095623, -73.96833263747038 40.70448338458415, -73.96929693837701 40.705088331229625, -73.96923632685235 40.70599431249845, -73.96929296374243 40.707093331047766, -73.96838933699995 40.70682918699989, -73.96795139100001 40.7057312169999, -73.96761547799979 40.7049616349999, -73.96720961999985 40.70425570899993, -73.96653747199994 40.70369661299985, -73.96607413599992 40.70332015299993, -73.96587418600001 40.703157694999895, -73.96520438999994 40.70262274499987, -73.96451844799995 40.70207497799988, -73.96386889399994 40.701541888999934, -73.96318252099992 40.701000094999905, -73.9625725539999 40.700512...0.000173946146651Brooklyn Navy Yard34Brooklyn
350.085787918592MULTIPOLYGON (((-73.90105329800004 40.662124820999956, -73.90066118699986 40.66058615799992, -73.900146584 40.660653276999874, -73.89988908799995 40.66063980699986, -73.89972880499995 40.66070453499987, -73.89965233299985 40.66073541599994, -73.89921760899985 40.65911140399995, -73.89883571499976 40.65752594199996, -73.89881834799998 40.657453812999925, -73.89880698499995 40.65740666199987, -73.89891727499989 40.6573902249999, -73.899041804 40.657371657999875, -73.89948109299995 40.65732134299993, -73.89968548099989 40.65729793699993, -73.89988986899985 40.6572745209999, -73.90002679299982 40.657253847999876, -73.9002942619999 40.657208882999925, -73.9003948669999 40.65718420499992, -73.90048767199994 40.65714867899988, -73.900574915 40.65709994699991, -73.90064904799996 40.657041557999904, -73.901185599 40.6565145509999, -73.90230238299979 40.65578061099992, -73.9024538329999 40.65566436599986, -73.90261911399996 40.65555810999991, -73.90279641599982 40.655463210999876, -73.9029836669...0.000323825195932Brownsville35Brooklyn
360.0870507867063MULTIPOLYGON (((-73.91254913799993 40.7038734199999, -73.91180710099985 40.70343495199994, -73.912904041 40.70236189099993, -73.91216169799988 40.701923163999915, -73.91142242699996 40.70148658799998, -73.91067882699998 40.701045968999914, -73.91180820099987 40.699938002999865, -73.91103489599992 40.6995321139999, -73.90953273199997 40.69867510499995, -73.90877366099991 40.69825522699988, -73.9080224919999 40.69782540899994, -73.9075698519999 40.69757174999995, -73.90727452399994 40.69739918999991, -73.90684583499988 40.697163548999875, -73.90652350699987 40.69697614399997, -73.906116261 40.6967505569999, -73.90576535999983 40.6965485549999, -73.90540127699988 40.69635030599994, -73.90500484799992 40.696118745999904, -73.90466384799993 40.69593224699988, -73.9042601839999 40.6957003709999, -73.90480435399992 40.695148168999914, -73.90491424299982 40.69507357099999, -73.90579597099993 40.69412715499988, -73.90504295399994 40.6937040059999, -73.90428792799995 40.69327806799992, -73.90386...0.000247666139269Bushwick North36Brooklyn
370.142810040466MULTIPOLYGON (((-73.93312548700004 40.70470086199992, -73.93301076599988 40.70427708599989, -73.93293503499982 40.70399456099993, -73.93281494999994 40.70357711199993, -73.93269784899994 40.703170390999894, -73.93172871799996 40.7035459909999, -73.93115533899987 40.70377233499987, -73.93059386199991 40.70347330799992, -73.92984252699986 40.70304680999989, -73.92909071699984 40.70261967799992, -73.92833850299998 40.70219163999997, -73.92758774299998 40.70176258099985, -73.92683805799987 40.70133420999986, -73.92608301599982 40.700910144999945, -73.92532959999984 40.70048119499994, -73.92458241299997 40.700055251999906, -73.92383267099994 40.699627797999916, -73.92308169399985 40.6992006719999, -73.92268944899992 40.69897762199984, -73.92232801999992 40.69877209799996, -73.92175647299993 40.6984533169999, -73.92157402199997 40.69834550899992, -73.92082397399983 40.697917657999916, -73.9204962049999 40.697730838999924, -73.92043053999987 40.69769341199991, -73.92007372399986 40.6974900339...0.000452062644782Bushwick South37Brooklyn
380.0832175685234MULTIPOLYGON (((-73.73624941199995 40.7025369779999, -73.73430403699984 40.702478130999936, -73.73426739299985 40.70316624699992, -73.73426455399982 40.703219541999935, -73.7333187329999 40.70319051999997, -73.73245633499985 40.703164050999874, -73.732314832 40.70315970599992, -73.73036969899985 40.70309853299995, -73.7277679189999 40.70302063799988, -73.7273634669998 40.70303714099988, -73.72725657600003 40.703041498999916, -73.72713924599991 40.703046271999895, -73.72677759516957 40.703059291199416, -73.72672841210559 40.7021457358777, -73.72678346816939 40.70198712397415, -73.72673796384797 40.701587951893714, -73.72665409175166 40.70111265819504, -73.72654435079282 40.698982640083074, -73.72652452210123 40.69825809218731, -73.72651147511033 40.69778119231719, -73.72650934112171 40.69751670520512, -73.72650630194262 40.69713880500901, -73.72650617482721 40.69712356793277, -73.72650576920825 40.69707238185048, -73.72650566904106 40.69705938782329, -73.72650562109436 40.69705367791968...0.000327392684821Cambria Heights38Queens
390.132369620757MULTIPOLYGON (((-73.89121853499988 40.64998769899988, -73.89056792961276 40.64920863296716, -73.89058122439944 40.64921017109779, -73.89058918285595 40.64921144015786, -73.89059695454304 40.64921326406146, -73.8906044702013 40.649215626827385, -73.89060767237343 40.64921690945509, -73.89061166783519 40.64921850963346, -73.89061848326281 40.64922188561437, -73.89063192466081 40.64922653926892, -73.89064497244473 40.64923180302112, -73.89065757649318 40.64923765973555, -73.89069206343918 40.64925829432288, -73.8907082114337 40.649268550512616, -73.89072347249865 40.649284766350156, -73.89073969963145 40.64930042925473, -73.89075685659586 40.64931550518285, -73.89076294103755 40.64932310569433, -73.89076981092721 40.649330307396376, -73.89077742674992 40.64933706351061, -73.89078573315822 40.64934332456375, -73.89079467610247 40.649349054820526, -73.89080352489603 40.64935465816823, -73.89081292865663 40.64935970986858, -73.8908228295893 40.64936417736595, -73.89083316373392 40.6493680326...0.00090028293862Canarsie39Brooklyn
400.0518506648762MULTIPOLYGON (((-73.998192111 40.68228732999989, -73.9962084629999 40.681723424999916, -73.99588110299992 40.68239495399995, -73.99555742799987 40.68306853499997, -73.99523240699986 40.68374079099995, -73.99490113599975 40.68443023799992, -73.99262292599985 40.68354371199993, -73.99042374299992 40.68269393299994, -73.98827189199999 40.68186309999987, -73.98722413899985 40.68144730199988, -73.9876680399999 40.68081780999993, -73.98808029299991 40.68017216599986, -73.98850509899981 40.6795371569999, -73.98897369299986 40.67884987699995, -73.98931813699981 40.67834938899991, -73.98931805499996 40.67825393999993, -73.98940896399986 40.67745451699991, -73.98986566199996 40.676826601999934, -73.99036651399997 40.676218320999965, -73.99069861899994 40.67580741899994, -73.99256575599999 40.67610581999992, -73.99279927099997 40.67613190599996, -73.99280910199987 40.676148749999854, -73.9931237449998 40.67617871399996, -73.99317836299984 40.676161657999906, -73.9933342719999 40.67617601299986, -...0.000108949211644Carroll Gardens40Brooklyn
410.052793109453MULTIPOLYGON (((-73.94773985499985 40.80959972099989, -73.94506102999992 40.808474499999875, -73.94499360699993 40.808446183999955, -73.94491601899982 40.80841350399989, -73.9417714019999 40.80708899999997, -73.9422631119999 40.80641573799991, -73.94275367199994 40.80574401299986, -73.94430194599991 40.80639082499993, -73.94478208199993 40.80576125599991, -73.94523965199991 40.80513601399989, -73.9456926129999 40.804514948999916, -73.94613131 40.80387735799992, -73.94459751299998 40.80322814499992, -73.94475976499989 40.803003040999954, -73.94505128000003 40.80259859899995, -73.94550863900001 40.80197023099991, -73.9459678969998 40.801342394999935, -73.94646133899998 40.80066530499988, -73.94697366799987 40.79996170299987, -73.94728018299999 40.799541788999896, -73.94732771499984 40.79947667099992, -73.94737599799991 40.799410523999924, -73.94741996199991 40.79935029499992, -73.94771056 40.79895218099991, -73.94775716499986 40.79888833199987, -73.94781663099997 40.798806862999925, -73....0.000143093037737Central Harlem41Manhattan
450.0459068626235MULTIPOLYGON (((-73.99750445299988 40.71406913199994, -73.99744448599988 40.71406687299986, -73.99647830999992 40.7141072639999, -73.99484048899991 40.71420935199993, -73.99472479499984 40.71421571299988, -73.99465684999993 40.714219446999884, -73.99450033499993 40.71423116399996, -73.99434786700003 40.71424791599986, -73.99431855699987 40.71425088499997, -73.99414039099992 40.71426893199987, -73.99395033499991 40.71429083199993, -73.99301588399996 40.71435562499989, -73.99282173499992 40.71436522999988, -73.99256242199989 40.714388076999974, -73.99246827699984 40.71385682499988, -73.9924556359999 40.71376288199985, -73.99239157000001 40.71319080999998, -73.99226747499985 40.712467556999925, -73.99225369399991 40.712354325999854, -73.99224319399994 40.71226805499987, -73.99221855999997 40.71206565499991, -73.99220577900002 40.71196063499989, -73.99218322399993 40.71177531099993, -73.99216806999992 40.71171189899994, -73.99215484499997 40.71165655599985, -73.99213550299994 40.7115756149...0.000091359468856Chinatown45Manhattan
460.134475429879MULTIPOLYGON (((-73.78452431937963 40.86047706314786, -73.7844902538973 40.86041295004045, -73.78448776047776 40.86036891095489, -73.7844800977429 40.860292836382015, -73.78447503221115 40.8602287764298, -73.78446994161976 40.860172724395454, -73.78446215634142 40.860134679134525, -73.78442797497668 40.86010659359294, -73.78437534588969 40.860076471323275, -73.78435963136363 40.86004441729388, -73.78436247019211 40.85998237351182, -73.78436267137351 40.859920325971984, -73.78436807918104 40.859878303052135, -73.78438676719426 40.85980628169408, -73.78440007895895 40.859766274445036, -73.78442391602212 40.85973229342179, -73.78449516071953 40.85971241045508, -73.7845715637229 40.85971548228986, -73.78456904816244 40.85969053097362, -73.78455594466404 40.85966648813517, -73.78454815872834 40.859628444550694, -73.78455623644251 40.85957641773656, -73.7845643074365 40.859526393486924, -73.78460404682812 40.85946642116827, -73.78462528561683 40.85942042497647, -73.78460172751247 40.85936834...0.000926391677672City Island46Bronx
420.0927092274616MULTIPOLYGON (((-73.93436121591056 40.83620061961779, -73.93445239398683 40.83598096007491, -73.93456051826952 40.83586608172803, -73.934754664506 40.835589300341795, -73.93475368707831 40.83556982111418, -73.93480514039254 40.835427472645925, -73.93481898168233 40.83539825039474, -73.93483181137556 40.83538552549233, -73.93484813571942 40.83535143220742, -73.934869850678 40.835332715131045, -73.9348946004199 40.83525404312232, -73.93491533578629 40.835230821938744, -73.93493620828455 40.83508021765153, -73.9349422585534 40.835026875417256, -73.93495859566912 40.83488277904472, -73.9349794120861 40.834789121453554, -73.93498833140688 40.83474865789363, -73.9349508717845 40.83470667336768, -73.93495775984093 40.83468276036335, -73.93496523015544 40.83465684795366, -73.93496624164149 40.83462912364824, -73.93497316061179 40.83462163504156, -73.93497219073525 40.83460814479754, -73.93499389736655 40.834597666183, -73.93503060323974 40.834392365341266, -73.93503612427708 40.834298320343365...0.000263896952605Central Harlem North42Manhattan
430.0997386183576MULTIPOLYGON (((-73.97255352299985 40.76489773199991, -73.97301487199995 40.76427887899991, -73.9736358469999 40.76456991299992, -73.9741922899999 40.764806527999916, -73.97623388799995 40.765674630999854, -73.97836113000002 40.766573710999886, -73.97907658799991 40.76687608599993, -73.98136213699995 40.76783673899992, -73.98131853299991 40.76789900199987, -73.9812909039998 40.76796936299995, -73.98129086899992 40.76796945299993, -73.98129085699999 40.76796955199996, -73.98128253299977 40.76804427399991, -73.98129467599998 40.7681188019999, -73.98132588999982 40.76818837999983, -73.98137263399991 40.768249315999924, -73.98145320300002 40.76832036999991, -73.98145334499989 40.768320494999934, -73.98145349899993 40.768320602999935, -73.98154591499996 40.76838333899988, -73.98154597399994 40.76838337499988, -73.98164804599995 40.76843632199994, -73.9810229009999 40.76927283399994, -73.980563707 40.769905324999904, -73.98011181599992 40.770528368999884, -73.97965233399994 40.77115532699992...0.000379662912054Central Park43Manhattan
440.235688967594MULTIPOLYGON (((-74.21220034099993 40.55644342999989, -74.213501756 40.55566761799985, -74.21437138899988 40.5555880659999, -74.21455413999996 40.55559031799992, -74.21455422199988 40.55559031799988, -74.21455430499994 40.5555903089999, -74.21473791099994 40.55557614399985, -74.21473802999996 40.55557613299987, -74.21473815899992 40.555576114999965, -74.21491900899998 40.555545456999916, -74.21509339699995 40.55549893299997, -74.21525777199992 40.555437837999925, -74.21721338099994 40.55471485899989, -74.21784397899994 40.55443271799991, -74.21787855399997 40.55423566199992, -74.21789469299988 40.554036199999906, -74.21789204399995 40.55383585499987, -74.2178705549999 40.5536361769999, -74.21783047799995 40.553438685999886, -74.21777232699998 40.5532448849999, -74.21778377699997 40.55304918799994, -74.21877630399993 40.552473628999955, -74.219115764 40.55223231399988, -74.21931406599998 40.552055134999875, -74.22106803199998 40.550554733999945, -74.2211486979999 40.55048965799989, -74....0.00194465649192Charleston/Tottenville44Staten Island
470.0898275563294MULTIPOLYGON (((-73.89090203399996 40.854116885999886, -73.89216687399981 40.85276946199989, -73.89307140900002 40.8532499869999, -73.89431774099977 40.851891310999854, -73.89478764999993 40.85108166699989, -73.89407258999991 40.85071318999995, -73.89494627999981 40.84910485299988, -73.89557755999984 40.847854641999895, -73.89611702199986 40.84677851899995, -73.89617712999998 40.8466583209999, -73.89535848999982 40.84651803199993, -73.89433599299984 40.84648668099986, -73.8940930149999 40.846488222999945, -73.89384985999999 40.84647439399989, -73.89360906599997 40.84644525599989, -73.89337309899987 40.84640119399996, -73.89290102299996 40.84626832999992, -73.89398467599996 40.84470395899991, -73.89464252699995 40.843904139999964, -73.89479022099985 40.84372032199992, -73.89481942600001 40.84368377099986, -73.894847588 40.84364636299996, -73.89537836199995 40.842938778999965, -73.89564979700005 40.84303553999991, -73.89591487099987 40.84314291899991, -73.8961725309998 40.8432605479999, ...0.000163198117339Claremont/Bathgate47Bronx
480.0437467441431MULTIPOLYGON (((-73.99117738199989 40.75532984899993, -73.99163271299996 40.75470680499996, -73.99446824699999 40.75590886199993, -73.99500601599988 40.756136713999865, -73.99511286399995 40.756175773999864, -73.99577488199998 40.75645451499986, -73.99730671499998 40.757110506999894, -73.997233738 40.7572095429999, -73.99692177899989 40.757637581999894, -73.99685244899985 40.75773270899988, -73.996800897 40.757789159999945, -73.99663529299984 40.75801292199992, -73.99640941599995 40.75833915899992, -73.99594236599988 40.75898097899996, -73.99547450199992 40.7596268569999, -73.99498358099996 40.760300161999986, -73.9945259329999 40.760927044999924, -73.99406959 40.761552584999926, -73.99360930599991 40.76218343599989, -73.99315623899986 40.76280636099991, -73.9927014349998 40.76343080599987, -73.99224402800002 40.764056778999894, -73.99178834099983 40.76468386799991, -73.99133264599988 40.765309269999925, -73.99087599499985 40.7659342209999, -73.99042167999981 40.766561257999854, -73.98...0.000094253842538Clinton East48Manhattan
490.0752900183427MULTIPOLYGON (((-73.96062056499981 40.69632013999994, -73.96015854699986 40.694117308999914, -73.95931047999983 40.694215086999876, -73.95799732999993 40.69436583899993, -73.957087019 40.69447043999991, -73.95614239299985 40.69457901899991, -73.95582662799985 40.69299238299994, -73.95541057999996 40.69090829199994, -73.95635602999991 40.69079978199989, -73.95727249099987 40.69069347799987, -73.95808563499989 40.69060146399989, -73.95818048699985 40.690590729999876, -73.95857844799987 40.69054569399986, -73.95886713600001 40.69051224799996, -73.9589933049999 40.690497628999886, -73.95928133699987 40.69046425699991, -73.959348624 40.69045646099992, -73.95942791399997 40.69044727499993, -73.95957591899987 40.69042998799993, -73.96008336799996 40.69037071599989, -73.96013760799985 40.690364379999906, -73.96029281699998 40.690346249999955, -73.96023740299987 40.69006222199988, -73.9602230449999 40.6899886269999, -73.96018691899992 40.6898034559999, -73.96017256100002 40.68972986199987, -73....0.000203185525471Clinton Hill49Brooklyn
500.0557479867536MULTIPOLYGON (((-73.99667705784736 40.77351005394221, -73.99434191991617 40.772524781943375, -73.9942497922864 40.7725264851381, -73.99416328456306 40.772487191523865, -73.99383108201548 40.77293178742534, -73.9937873699999 40.77290384599992, -73.99372534699988 40.772864197999915, -73.9935908639999 40.77279007999994, -73.9935026219999 40.772751632999885, -73.99387445099994 40.77223816799995, -73.99378189799992 40.77219909099988, -73.99365606199987 40.772145961999854, -73.990913076 40.77098775899989, -73.99059644699987 40.770854809999946, -73.98806289599996 40.769790799999925, -73.98855898599986 40.7691158169999, -73.98905077199991 40.768440091999906, -73.98950498199986 40.76781538299985, -73.98996382699985 40.7671874749999, -73.99042167999981 40.766561257999854, -73.99087599499985 40.7659342209999, -73.99133264599988 40.765309269999925, -73.9917883399999 40.76468386799994, -73.99224402800002 40.764056778999894, -73.9927014349998 40.76343080599987, -73.99315623899986 40.76280636099991, ...0.000173249283326Clinton West50Manhattan
510.0953613442277MULTIPOLYGON (((-73.82091617199997 40.86891693399989, -73.81940759199995 40.867999270999874, -73.81938761399987 40.86798690199988, -73.81578764099999 40.86575806099991, -73.81641455899984 40.86515149799992, -73.81699760299986 40.86445903099996, -73.8168449589999 40.86430679299993, -73.81761651299989 40.86362634299998, -73.81884300999991 40.8625682099999, -73.82037552999996 40.86103300499991, -73.82450575099989 40.85976402099996, -73.82444012099991 40.85950138399989, -73.82632571099997 40.85929799699995, -73.82699653199998 40.859087785999876, -73.82714556299992 40.85923239499993, -73.82720794099991 40.85941373899988, -73.82732348799999 40.85968688699988, -73.82741458099993 40.85995987299993, -73.82759107999996 40.86007855099994, -73.82787032399982 40.860678212999915, -73.82799444999982 40.860840185999905, -73.82826796599981 40.860837332999935, -73.82834347399992 40.860892025999895, -73.82840758999997 40.860948300999894, -73.82954731199996 40.86216408699993, -73.83022388499991 40.8634295...0.000395756553505Co-Op City51Bronx
520.0289076710093MULTIPOLYGON (((-73.99588110299992 40.68239495399995, -73.9962084629999 40.681723424999916, -73.998192111 40.68228732999989, -74.00004865199998 40.682803355999965, -73.9997255609999 40.683473148999944, -73.99940054699985 40.68414456199985, -73.99908066099994 40.68481599199986, -73.99986579399993 40.685036468999954, -74.00064737999996 40.685253946999914, -73.99969626699995 40.68719803399989, -73.99963768399985 40.687314767999965, -73.99937882999994 40.68785319299997, -73.99906961899994 40.68849807499985, -73.99874207699997 40.68917701399995, -73.99841229299983 40.68985608799994, -73.99808645299991 40.690535077999854, -73.99776924399993 40.69119469799997, -73.99623278099982 40.69075777399993, -73.99436092799984 40.69023947999991, -73.99236366999985 40.689690123999924, -73.99262286099999 40.68916054899988, -73.99268552799995 40.68903324699993, -73.99293238499986 40.68851457599991, -73.99300451699985 40.68836463599994, -73.99326829999998 40.68782445099992, -73.99333822999985 40.68767879699...0.00004520275096Cobble Hill52Brooklyn
530.161500913385MULTIPOLYGON (((-73.83839013354552 40.798304872075995, -73.83919004727183 40.79777726644771, -73.84022425799824 40.79761115131156, -73.84025860809128 40.7975888584321, -73.83997099590027 40.796905641892224, -73.83903676806116 40.79705247704045, -73.83843368293606 40.796786758946396, -73.83840083088981 40.796755258653434, -73.83736225294896 40.79426352412382, -73.83730248787447 40.79421958581836, -73.83722791411225 40.794111384246534, -73.83717497419711 40.794023700013284, -73.8370840678496 40.793903461985295, -73.83706498890116 40.79385109821308, -73.83707146788825 40.79379892222571, -73.83712604698766 40.79369555002054, -73.83686308614463 40.79306679805601, -73.83663288911686 40.79251637576928, -73.83818069199988 40.79274850199993, -73.83887362400004 40.792949805999854, -73.83905064799991 40.79298782099989, -73.83905076599997 40.79298784899993, -73.83905088399997 40.79298788499989, -73.83922303099996 40.793043045999916, -73.83938616999993 40.79311469299992, -73.8395361909999 40.793201...0.000947530980821College Point53Queens
540.0762192448554MULTIPOLYGON (((-74.00174362072502 40.69240674985267, -74.00400795971088 40.69320819963236, -74.00374561906422 40.69361620298103, -74.0034621809253 40.694057015074726, -74.00127014951309 40.693296061836925, -74.0015417289999 40.692785962999956, -74.00174362072502 40.69240674985267)), ((-74.00174362072502 40.69240674985267, -74.0016998939999 40.69238276699991, -74.00110519399988 40.692056594999954, -74.00031547799995 40.69187465199994, -74.00021419499998 40.691851760999896, -73.99991517399985 40.69176722999993, -73.99951274099993 40.6916514499999, -73.99936540199982 40.691613077999904, -73.99928819599991 40.69159395999992, -73.99920161899989 40.69157183399994, -73.99910057299985 40.69153697399986, -73.9984330559999 40.691364914999895, -73.99803048599995 40.691253722999896, -73.99776924399993 40.69119469799997, -73.99808645399993 40.690535077999876, -73.99841229299983 40.68985608799994, -73.99874207699997 40.68917701399995, -73.99906961899994 40.68849807499985, -73.99937882999994 40.6878...0.000132452130536Columbia Street54Brooklyn
550.149956807524MULTIPOLYGON (((-73.98671582299981 40.58456849999991, -73.98627573699999 40.58447998099991, -73.9858605929999 40.58452571299991, -73.98548157999991 40.584519676999925, -73.98492730999999 40.58459595299991, -73.98482192899988 40.58416852299991, -73.983875933 40.58397574499992, -73.98281157699994 40.58379238799989, -73.98175452099981 40.58358376399985, -73.98044790899985 40.58341064299993, -73.98006567999988 40.58331786399986, -73.97742525299988 40.58290659299994, -73.97468194399983 40.58312411799989, -73.97461091899993 40.58312987599992, -73.97449712999993 40.5831533899999, -73.97308506499995 40.5834298259999, -73.97174499599997 40.58366274899992, -73.970846422 40.583820214999946, -73.97045373499985 40.583892278999876, -73.970055463 40.583947729999856, -73.9698544559998 40.58396698199992, -73.96899979299997 40.584063502999896, -73.96781584999998 40.58453905099991, -73.96684429799988 40.584569328999876, -73.96670868800001 40.58456908299991, -73.96661531499983 40.58457103699992, -73.96670...0.000736274713586Coney Island55Brooklyn
560.0568478126677MULTIPOLYGON (((-73.85360568399982 40.74749682799991, -73.853254932 40.74682354999988, -73.8529235349999 40.74618194799996, -73.85257733899984 40.74550564699991, -73.85224097499999 40.744840965999856, -73.85189537499991 40.74417973899995, -73.85155107299987 40.74350722699996, -73.85135102799988 40.743119056999895, -73.85120929199985 40.74284402099991, -73.850869175 40.742180411999875, -73.85051160899988 40.74151885699997, -73.85020444599992 40.740902033999895, -73.85011556599989 40.74072356299996, -73.8499642599999 40.74070177199998, -73.84984431299986 40.74066554999991, -73.84965207399982 40.74061466399994, -73.8493530509999 40.74052324999996, -73.84892344899993 40.74039191499986, -73.84795885999989 40.74009701599994, -73.84780164699998 40.74004967699989, -73.84794174099986 40.73981640499991, -73.84823627999982 40.739290400999955, -73.84777844199982 40.7393448349999, -73.84775740199994 40.739299088999864, -73.84767033700003 40.7391952349999, -73.8475557979999 40.7390639149999, -73.847...0.000180907844436Corona56Queens
570.0192705048557MULTIPOLYGON (((-73.8513110499998 40.749843375999895, -73.85442575299999 40.748851725999884, -73.8544701179998 40.748939347999936, -73.85479286699997 40.74956323099989, -73.85513928899988 40.75022639499992, -73.85547890700003 40.750891233999866, -73.855834956 40.7515772719999, -73.85455552299993 40.75196191899991, -73.85497762399996 40.75278221699993, -73.85538540499991 40.753571059999935, -73.85579909099987 40.75440952799994, -73.85478630699988 40.75470744899992, -73.85383081399982 40.75495833699992, -73.85323754899999 40.75509560099989, -73.85312635499994 40.7551093429999, -73.85302119999993 40.75461800199988, -73.85300762299991 40.75455456499989, -73.8526172539999 40.75340506499992, -73.85246329699996 40.75312740899989, -73.85220450599996 40.752660681999934, -73.85185614699996 40.75196793299993, -73.85171508699987 40.751687413999875, -73.85151883499987 40.751297136999916, -73.85118150899993 40.75062629599987, -73.85098691399993 40.750239297999904, -73.85086439699991 40.7499956419998...0.000018025980792Corona56Queens
580.0598554094851MULTIPOLYGON (((-73.8156138206772 40.848189557582444, -73.81568607715445 40.84816530989142, -73.81575017833134 40.848189775457044, -73.81579073434887 40.848164221136976, -73.8157983885727 40.84815939778306, -73.81586274203565 40.84809250102881, -73.81590281420543 40.84801312198427, -73.81589711649299 40.84789897954558, -73.81589732510677 40.84782360519032, -73.81586136315966 40.84777558185126, -73.81577576231183 40.84773090610564, -73.8156945975249 40.847713645630954, -73.81563145161934 40.847706692829895, -73.81560442844047 40.84768951881168, -73.81560451391982 40.84765868316219, -73.81564516681594 40.84764161781635, -73.81569476839675 40.84765197550432, -73.81575340325438 40.847658921065964, -73.81580298434562 40.84767613107148, -73.81587968574792 40.84767625352132, -73.81595734753984 40.84765673360196, -73.81597449927862 40.847652422096665, -73.8160558923281 40.8475874556508, -73.81609670609068 40.8475121465354, -73.81612862993478 40.84738885611984, -73.81614705574094 40.84725184039...0.000204980931361Country Club58Bronx
590.0377948070893MULTIPOLYGON (((-73.88941724899998 40.839422732999864, -73.88869040799986 40.83915802599989, -73.88813752199992 40.83986200199991, -73.88754251799996 40.83964065799996, -73.88659802299989 40.83927904999991, -73.88730373200002 40.838127190999955, -73.88841187199996 40.838553390999905, -73.88874067899994 40.83796845899992, -73.89057363299983 40.83690104799993, -73.8907397549999 40.836829308999945, -73.89091660699987 40.83677103399993, -73.89110124799988 40.83672748199994, -73.89129045299998 40.83669941999994, -73.8914808639999 40.836687063999946, -73.89337676299994 40.836540007999886, -73.89361903299995 40.8364761079999, -73.89385624299995 40.8363951019999, -73.89408527499981 40.8362973469999, -73.89430313999998 40.83618364399992, -73.89450698899992 40.8360551939999, -73.89469434299991 40.83591357399994, -73.89486311099988 40.83576065299992, -73.89501173599986 40.83559855499988, -73.89513914999998 40.83542950399993, -73.89526368299991 40.83531509799996, -73.89539409500006 40.835204534999...0.000062876523065Crotona Park59Bronx
600.0786482878226MULTIPOLYGON (((-73.87823856799989 40.839985917999854, -73.87791380399995 40.8399703279999, -73.87747229399999 40.839983546999925, -73.87561285199983 40.83990252099989, -73.87359713599987 40.83979855499992, -73.87283453899995 40.83975486299994, -73.87277204699981 40.83975128199996, -73.87298042899991 40.83895248499995, -73.87312728200003 40.83833509599989, -73.87314714699997 40.83826389899994, -73.87322928299983 40.83815590199992, -73.87347510499988 40.8377463399999, -73.87353901799992 40.83766841799995, -73.87367306200004 40.837541539999926, -73.87379590199993 40.83744513299991, -73.87401051299989 40.83731000499993, -73.87407495699992 40.8372896169999, -73.87419768599986 40.837250794999896, -73.87430028599992 40.8372424419999, -73.87437386800003 40.837242521999904, -73.87454332199997 40.83726133799989, -73.87471801499991 40.83731259599988, -73.874908511 40.837359609999986, -73.87472739999993 40.83723397399998, -73.87470145099985 40.83716231099988, -73.87469588499998 40.83708331399992,...0.000161833284912Crotona Park East60Bronx
610.117310808097MULTIPOLYGON (((-73.92916130699992 40.68343632399992, -73.92900883999985 40.68270290499991, -73.92609461699992 40.68303870999989, -73.92281374299995 40.68341442999991, -73.92267012199994 40.68268151199991, -73.9225447959999 40.68193561299989, -73.92250799299985 40.68171006999997, -73.92249266199997 40.681616108999926, -73.92242652099985 40.68121074499994, -73.92240197099996 40.68108955299994, -73.92238256000003 40.68099373699995, -73.92236962399983 40.68092987999992, -73.92235458599998 40.68085564499992, -73.92233849599998 40.680776217999885, -73.92231261899987 40.68064847299997, -73.92227774199988 40.6804762929999, -73.92225617599988 40.68036776399987, -73.92223681799994 40.680270342999904, -73.92221626999996 40.68016693499992, -73.92217715699984 40.6799700849999, -73.92215222999988 40.679844634999895, -73.92213242899994 40.67974497799986, -73.92211149999984 40.67965755699987, -73.92208787199982 40.679558857999915, -73.92205453499997 40.67941960399992, -73.92203214100005 40.6793260589...0.000510772092295Crown Heights North61Brooklyn
620.0822593359838MULTIPOLYGON (((-73.92916752199997 40.66429953199991, -73.9294035289999 40.664199845999846, -73.92987364799984 40.66399077299993, -73.93068465499985 40.663620476999924, -73.93160743400001 40.66355672299988, -73.93437459299999 40.663372810999896, -73.93455236699992 40.6633622859999, -73.93726377600001 40.66319183299991, -73.94002976999997 40.66302074299991, -73.94282892199992 40.6628474859999, -73.94269628999989 40.664055128999955, -73.94408198699985 40.664128572999914, -73.94489227700002 40.66417414399994, -73.94546293699983 40.6642261039999, -73.94816604199978 40.664081821999964, -73.9494063899999 40.66400530799991, -73.9509741009999 40.66390486799992, -73.95384851099975 40.66372780899991, -73.95720935499996 40.66351739699992, -73.95729172699991 40.66430263299986, -73.95787061899992 40.66427335799993, -73.95934422499984 40.664175646999915, -73.96033682899981 40.664108697999964, -73.96061544799986 40.663302749999936, -73.96095595499996 40.66328505499992, -73.96110886899996 40.664062323...0.000158238169004Crown Heights South62Brooklyn
630.119100721883MULTIPOLYGON (((-73.86650407899992 40.68447405199987, -73.86631496899999 40.683248942999924, -73.86630263900003 40.68318669399985, -73.86629002999987 40.68311500699992, -73.86602666799992 40.68191805199995, -73.8649940449999 40.68212896999992, -73.86410096700003 40.682372849999894, -73.86399008800004 40.681928575999954, -73.86378674500001 40.68111374699991, -73.86334943599995 40.6793516399999, -73.86330964200002 40.679167969999874, -73.86328640800004 40.679077196999856, -73.86296470699986 40.67911281599991, -73.86234580499983 40.67916478599995, -73.86225943099993 40.67881678599989, -73.86202843099984 40.677886113999875, -73.86171238699991 40.676610595999854, -73.86139775899983 40.67533658999988, -73.86131863599985 40.6750212689999, -73.86106294999989 40.67434293499984, -73.86176409699985 40.67423225999992, -73.86310051 40.674647212999936, -73.86413333499986 40.67499725199989, -73.86455313199994 40.67515112199992, -73.86521514199991 40.675386573999944, -73.86627349499993 40.675764044999...0.000353190910142Cypress Hills63Brooklyn
640.18445188474MULTIPOLYGON (((-73.74412314584049 40.77863865777707, -73.74153532911313 40.77711063108628, -73.74075991577695 40.77669471074994, -73.74036629409531 40.776389704224734, -73.74007973985933 40.7762087951981, -73.73937598893414 40.77601366983492, -73.73912362001862 40.775704143036336, -73.73886227381915 40.775573157950646, -73.73770283611138 40.77479358586612, -73.73688222993059 40.77433096117151, -73.73389261595659 40.772527178879685, -73.73304215822819 40.771954434183826, -73.73191230278991 40.7713532077885, -73.73113636491937 40.77086955609971, -73.73030460922762 40.770410605760915, -73.72970531807846 40.770053446074, -73.72870722109356 40.769461484046296, -73.7277187531248 40.76879613592288, -73.72658720816285 40.76811459879865, -73.72554599082781 40.76749535591531, -73.72356002293202 40.76612876183406, -73.72305924186259 40.76614440615705, -73.722484384059 40.765527210177886, -73.72114272775374 40.76487260693402, -73.7209758841712 40.76476015914438, -73.72080904877663 40.764647715919...0.00105790284614Douglaston64Queens
650.0446070683658MULTIPOLYGON (((-73.98712491499988 40.70063447999997, -73.98705765100006 40.70063138099993, -73.98692304599989 40.70063356299991, -73.98679382899992 40.7006332229999, -73.98679814299999 40.700405223999915, -73.98679868199991 40.700192297999926, -73.98680917799996 40.70007095599988, -73.98681513199986 40.69993433099993, -73.98686354799999 40.69922012199989, -73.98694749699983 40.698734673999866, -73.98696892299994 40.69850361399997, -73.98615985099988 40.69847850399993, -73.98584009799997 40.69845759999988, -73.98571222099984 40.6984492459999, -73.98557305399999 40.698447039999955, -73.98537892999997 40.69844056799991, -73.98496067199994 40.69844496199991, -73.98399562199991 40.69841397099991, -73.98314891699987 40.698381656999906, -73.98305147099988 40.69837793399991, -73.98305797599978 40.69829607699995, -73.98311793999989 40.697542042999935, -73.98227354299986 40.697506299999915, -73.98220436299987 40.69750337199987, -73.98210986499997 40.69749936799996, -73.9820190099999 40.69749657...0.000081803882541Downtown Brooklyn/MetroTech65Brooklyn
720.0952020695166MULTIPOLYGON (((-73.92021313099984 40.65997544099987, -73.92008167099986 40.659857632999866, -73.919986348 40.6601154659999, -73.91990440499988 40.66033711699987, -73.91974399499988 40.660770972999885, -73.91966280899982 40.66140503299994, -73.91962719199988 40.6617080589999, -73.9195947979998 40.661995678999865, -73.91945727799987 40.66188078499988, -73.91920450999991 40.661655199999856, -73.91893607399996 40.661416010999936, -73.91860168199995 40.66111804899986, -73.91829936299985 40.66116125699987, -73.91818493100003 40.66072620899997, -73.91741819199994 40.66005119199989, -73.91707363499995 40.65974535399988, -73.91572803800001 40.65855012799989, -73.91556629599982 40.658392571999876, -73.91441247700004 40.657362418999845, -73.91402878099997 40.65700370899985, -73.91377943699983 40.65678367899994, -73.91314356299998 40.65622086399992, -73.91236458899995 40.655513564999865, -73.91199538399984 40.65556155999992, -73.91108323599995 40.655702392999935, -73.91012255699995 40.65585177099...0.000323532461947East Flatbush/Remsen Village72Brooklyn
660.0546334593634MULTIPOLYGON (((-73.97906084869959 40.7059460290057, -73.97924508744678 40.70554838913701, -73.97912179285028 40.70552703403615, -73.97932762499988 40.70474627599989, -73.97960292799985 40.704176399999916, -73.97998854 40.703541057999935, -73.98022432 40.7030633239999, -73.9806490779999 40.70156087299994, -73.98074079499993 40.70127730999999, -73.98040482499984 40.700699005999915, -73.98041744299996 40.70051815299991, -73.98044078599986 40.7001836309999, -73.98046217199987 40.69970315799986, -73.98048077899998 40.6993727139999, -73.98048604199988 40.69927922799994, -73.98054419199988 40.69824651199987, -73.98050926199988 40.69744627499991, -73.98201901099986 40.697496579999886, -73.98210986499997 40.69749936799996, -73.98220436399998 40.697503371999865, -73.98227354299996 40.69750630099993, -73.983117941 40.69754204299993, -73.98305797499985 40.69829607699988, -73.98305147099988 40.69837793399991, -73.98314891699982 40.698381657999924, -73.98399562199991 40.69841397099991, -73.98496067...0.000108378855948DUMBO/Vinegar Hill66Brooklyn
670.0997470781551MULTIPOLYGON (((-74.0109702639999 40.6306818689999, -74.01000340799995 40.63011308899991, -74.00922358699998 40.630633933999924, -74.0084560119999 40.631150269999914, -74.00773968299988 40.63163008999992, -74.00702302499997 40.63210999499996, -74.00633870699993 40.63169362599994, -74.00413727999998 40.63036396599992, -74.00368597199991 40.63009178099988, -74.00306153999993 40.6297151749999, -74.00193011399998 40.629032766999885, -74.00222793499994 40.62875116999988, -74.00251454799997 40.62847420999989, -74.00031369499995 40.627144582999925, -73.99811614300002 40.62581570699993, -73.99724067099987 40.62528868699994, -73.99748403999989 40.62451984599993, -73.99771358999998 40.62368026999996, -73.99932090299998 40.62465524699996, -73.99994665 40.62405062199985, -74.00052987499996 40.623489938999946, -74.00120222399994 40.62284271199991, -74.00169380199992 40.62237242699998, -74.00227586299998 40.621814273999874, -74.00285701599996 40.62125364299992, -74.0034355699999 40.620695403999925, ...0.000394282272487Dyker Heights67Brooklyn
680.0493373795569MULTIPOLYGON (((-74.00201937799989 40.740444088999894, -74.00252381399994 40.739752643999886, -74.00310733899988 40.73999752099994, -74.00515808199998 40.74085808099991, -74.00536591799992 40.74094529499997, -74.00697077699994 40.7416271269999, -74.00779116099989 40.74197084499985, -74.00820401899988 40.74214751799986, -74.00789568799995 40.74257005099985, -74.00770461499994 40.74283381299992, -74.00723774599994 40.743470231999865, -74.00696604399992 40.74384701399987, -74.00681149999996 40.74406132399992, -74.00638477199996 40.74464590299987, -74.00595977599997 40.745230984999935, -74.00553403999999 40.74581556899989, -74.0051071349999 40.74640277299988, -74.00465274299988 40.74702295299991, -74.004168307 40.7476892929999, -74.0039029229999 40.74805366099988, -74.00368344599993 40.74835499999994, -74.00323561099998 40.748974254999936, -74.00316116799988 40.749076422999906, -74.00312806199996 40.74912185999996, -74.00278526999995 40.74959231999986, -74.002458683 40.75003580599991, -74....0.000111073378655East Chelsea68Manhattan
730.0853020209129MULTIPOLYGON (((-73.79566545000002 40.75023619999991, -73.79644617199999 40.749859216999916, -73.79729524799988 40.74943505299992, -73.79704716099987 40.749332317999915, -73.796581036 40.74897739799995, -73.79598269399985 40.74853189299994, -73.79472264899997 40.74759932999991, -73.7946756879998 40.74721192799996, -73.79826235399989 40.746965655999894, -73.79921673599986 40.74685628199988, -73.80017472200002 40.74675557799992, -73.80327809299982 40.746439510999934, -73.8033521419999 40.74643196499987, -73.80302898599999 40.747194800999935, -73.80294034199993 40.74740891699993, -73.80286300399993 40.74764296999995, -73.80280481399987 40.74788116399994, -73.80276629299996 40.74812214499989, -73.80274770699985 40.74836447599992, -73.802749109 40.748606750999954, -73.80277033699984 40.748847537999936, -73.80280784099993 40.74906666099989, -73.80287666499987 40.74976514899987, -73.80295670699991 40.74977052699988, -73.80353070499987 40.74982541299988, -73.80446953099978 40.749899274999926, ...0.000291799754395East Flushing73Queens
690.0789896450483MULTIPOLYGON (((-73.91179361999995 40.8264281559999, -73.91130974499993 40.824848557999914, -73.91192435199989 40.82504975899994, -73.91316674499997 40.82545645499987, -73.91351191699981 40.824804943999915, -73.91475121099991 40.82520047299994, -73.91527590199993 40.82565539499991, -73.91541108199998 40.82577390899994, -73.91545061499994 40.825747778999855, -73.91592284999992 40.8254400559999, -73.91613011899993 40.825305720999964, -73.91618778499992 40.825268345999895, -73.91624748099997 40.82522965499989, -73.91630388 40.825193101999936, -73.9163666169999 40.82515243999989, -73.91642451899982 40.825114912999936, -73.91661368499985 40.82499230799993, -73.91630917499997 40.82490286699987, -73.91608782899984 40.824837851999895, -73.91677400599986 40.82438708699987, -73.9168919579999 40.824311925999915, -73.917126938 40.82416263099988, -73.91719007399992 40.82412251699993, -73.91725010299993 40.824084376999956, -73.9173178239999 40.82404134999992, -73.9174045909999 40.82398622199988, -73...0.00019905160381East Concourse/Concourse Village69Bronx
700.0638403183367MULTIPOLYGON (((-73.85912375899987 40.76127549899995, -73.8589662809999 40.761158795999904, -73.85880387699986 40.761046063999935, -73.858636721 40.76093742299989, -73.8584649899998 40.760832988999915, -73.85828886699981 40.76073287299992, -73.85810853999996 40.76063718199991, -73.857924202 40.76054601799995, -73.85773604799981 40.760459477999866, -73.85754427999994 40.76037765399996, -73.85734910199996 40.76030063399989, -73.856705981 40.760043865999926, -73.85655895700003 40.75998156099995, -73.85638216199997 40.7599066399999, -73.85603980899994 40.75972578699986, -73.85576997499993 40.75953834299993, -73.85553311699984 40.759342590999935, -73.85525140099982 40.759147529999915, -73.855067026 40.758943277999954, -73.85500920899997 40.758879225999905, -73.85463995799994 40.75846615799992, -73.8545797199998 40.75838761999991, -73.85449593299987 40.75827863899985, -73.85462918699993 40.75830695499997, -73.85476880299996 40.7583281299999, -73.85490872699997 40.758336448999884, -73.8550544...0.000195458476728East Elmhurst70Queens
710.0931694551828MULTIPOLYGON (((-73.93177153199984 40.655273641999905, -73.93160868699992 40.65374163899989, -73.9313911669999 40.6516896079999, -73.93038144399998 40.65173405399986, -73.93020593200004 40.65010866699994, -73.92999915499996 40.64818106399987, -73.9298024389999 40.646320076999885, -73.92974213599982 40.645743383999914, -73.92959986299991 40.64443271899993, -73.9293545129999 40.64213431899986, -73.92910623099985 40.63979510599994, -73.92809818199994 40.63985661599988, -73.92761438900001 40.639887640999866, -73.92716497399995 40.639916461999874, -73.92622007399989 40.6399760949999, -73.92594627399988 40.639998162999866, -73.92574389399985 40.64001446599986, -73.92582711299985 40.639626269999894, -73.925834756 40.63941858799992, -73.92586068599987 40.63921107199993, -73.92590483099994 40.63900510599991, -73.92596691799999 40.63880208899997, -73.92604638799985 40.638603341999904, -73.92606338099993 40.63852406099988, -73.9260813459999 40.63816294599991, -73.9261268489999 40.63774352299989, ...0.000382572587364East Flatbush/Farragut71Brooklyn
790.0426249113144MULTIPOLYGON (((-73.98377990999991 40.72153595399992, -73.9838238729998 40.72147287199987, -73.98467780299995 40.72173060499992, -73.98551686199984 40.72198522499987, -73.98628574000003 40.722241919999874, -73.98713584799998 40.72246981099991, -73.98786491500006 40.72269708899991, -73.98854361399987 40.722903617999904, -73.98863862799996 40.72293371999991, -73.98875683199988 40.72297036599986, -73.98939218099996 40.723174057999884, -73.99027361600001 40.72342601799987, -73.99102410399988 40.72364943199991, -73.99127307099994 40.7237298129999, -73.99135472799998 40.723754618999855, -73.99250385799984 40.72410592499995, -73.99260322199994 40.72413644999988, -73.99257987399992 40.724201554999915, -73.99232642199998 40.72490823199993, -73.99220971099992 40.72523128999992, -73.9920616679999 40.72564244299993, -73.99179379299984 40.72639145899994, -73.99154832699986 40.72708947099994, -73.99136388099987 40.72755978299991, -73.99135869199992 40.72778246999996, -73.99112256699988 40.7285679659...0.000107893068218East Village79Manhattan
800.117212621448MULTIPOLYGON (((-73.93174841322003 40.728053727696675, -73.93168317826739 40.72803172609697, -73.93166858749639 40.72803828280952, -73.93157356186826 40.72801829506091, -73.93120770151332 40.72794133862442, -73.93080479131739 40.72784883926169, -73.93072254234549 40.727841072689614, -73.93032635559956 40.72779514224887, -73.92991812728 40.727638898356346, -73.92983531275382 40.727607889326656, -73.92966308042121 40.72754339771126, -73.92965484905174 40.72754765255141, -73.92963224605802 40.72756459428362, -73.92962400635007 40.72757757457619, -73.92962734303951 40.72760005400567, -73.92961163522367 40.72761121943942, -73.92958020690885 40.72761282070866, -73.9294975342307 40.727559064581975, -73.92942476304782 40.727511752515085, -73.92937588603782 40.72747996953887, -73.92924333948385 40.72739794231863, -73.92926898893549 40.72736521532119, -73.92886953254995 40.72700263162834, -73.92849418540158 40.726614603307866, -73.92833738013012 40.72641758269857, -73.92815870725636 40.726205230...0.00040732245622East Williamsburg80Brooklyn

Showing the first 75 rows.

%python

import folium
import pandas

#neighborhoods = 'https://databricks-demo-bucket.s3-us-west-1.amazonaws.com/tlc/neighborhoods/NYCTaxiZones.geojson.txt'
neighborhoods = 'https://databricks-demo-bucket.s3-us-west-1.amazonaws.com/tlc/neighborhoods/neighborhoods.geojson.txt'

# create empty map zoomed in on NYC
m = folium.Map(location=[40.7594,-73.9549], zoom_start=11, width=1000, height=600)

folium.Choropleth(
    geo_data=neighborhoods,
    name='choropleth',
    fill_color='blue',
    fill_opacity=0.5
).add_to(m)

print("")
displayHTML(m._repr_html_())
val numNeighborhoods = wktDF.distinct.count
numNeighborhoods: Long = 263

6. Let's execute a spatial join at scale!

We want to associate each pickup (point) with the appropriate NYC taxi zone (polygon).

This "if point is within polygon" query predicate would require comparision of >200M points to ~250 polygons in our example. (i.e. worst case 50,000,000,000 expensive comparisons)

To constain joins we are leveraging the precomputed geohash information to significantly "prune" the solution space.

We then evaluate the geospatial predicate st_contains($"polygon", $"pickupPoint") (to filter out false positives)

import scala.util.{Try,Success,Failure}

import org.locationtech.geomesa.utils.geohash.GeohashUtils
import org.locationtech.geomesa.utils.geohash.GeohashUtils._

//This assumes a column which can be coerced to MultiPolygon
val geoHashes = udf( (p: Any) => {
  getUniqueGeohashSubstringsInPolygon(p.asInstanceOf[MultiPolygon],0,5,includeDots=false) match {
  case Success(r) => r.toArray[String]
  case Failure(r) => Array.empty[String]
  }
})
import scala.util.{Try, Success, Failure} import org.locationtech.geomesa.utils.geohash.GeohashUtils import org.locationtech.geomesa.utils.geohash.GeohashUtils._ geoHashes: org.apache.spark.sql.expressions.UserDefinedFunction = UserDefinedFunction(<function1>,ArrayType(StringType,true),None)
val neighborhoodsDF = 
  wktDF
    .select("the_geom", "zone")
    .withColumn("polygon", st_geomFromWKT($"the_geom"))
    .withColumn("geohashes",geoHashes($"polygon")).select($"*",explode($"geohashes").alias("geohash"))
    .withColumnRenamed("zone","neighborhood")
    .drop("the_geom")

display(neighborhoodsDF)
Newark AirportMULTIPOLYGON (((-74.18445299999996 40.694995999999904, -74.18448899999999 40.69509499999987, -74.18449799999996 40.69518499999987, -74.18438099999997 40.69587799999989, -74.18428199999994 40.6962109999999, -74.18402099999997 40.697074999999884, -74.18391299999996 40.69750699999986, -74.18375099999997 40.69779499999988, -74.18363399999998 40.6983259999999, -74.18356199999994 40.698451999999875, -74.18354399999998 40.69855999999988, -74.18350799999996 40.69870399999992, -74.18327399999998 40.70008999999988, -74.18315699999994 40.701214999999884, -74.18316599999997 40.702384999999886, -74.18313899999998 40.7026279999999, -74.18309399999998 40.7028529999999, -74.18299499999995 40.70315899999985, -74.18284199999994 40.70346499999989, -74.18264399999998 40.70373499999988, -74.18242799999996 40.70395099999992, -74.18220299999996 40.704139999999896, -74.18203199999994 40.70425699999987, -74.18180699999994 40.7043919999999, -74.18157299999996 40.70449999999988, -74.18132099999997 40.70460799999...["dr5r8","dr5pr","dr5px","dr5r2"]dr5r8
Newark AirportMULTIPOLYGON (((-74.18445299999996 40.694995999999904, -74.18448899999999 40.69509499999987, -74.18449799999996 40.69518499999987, -74.18438099999997 40.69587799999989, -74.18428199999994 40.6962109999999, -74.18402099999997 40.697074999999884, -74.18391299999996 40.69750699999986, -74.18375099999997 40.69779499999988, -74.18363399999998 40.6983259999999, -74.18356199999994 40.698451999999875, -74.18354399999998 40.69855999999988, -74.18350799999996 40.69870399999992, -74.18327399999998 40.70008999999988, -74.18315699999994 40.701214999999884, -74.18316599999997 40.702384999999886, -74.18313899999998 40.7026279999999, -74.18309399999998 40.7028529999999, -74.18299499999995 40.70315899999985, -74.18284199999994 40.70346499999989, -74.18264399999998 40.70373499999988, -74.18242799999996 40.70395099999992, -74.18220299999996 40.704139999999896, -74.18203199999994 40.70425699999987, -74.18180699999994 40.7043919999999, -74.18157299999996 40.70449999999988, -74.18132099999997 40.70460799999...["dr5r8","dr5pr","dr5px","dr5r2"]dr5pr
Newark AirportMULTIPOLYGON (((-74.18445299999996 40.694995999999904, -74.18448899999999 40.69509499999987, -74.18449799999996 40.69518499999987, -74.18438099999997 40.69587799999989, -74.18428199999994 40.6962109999999, -74.18402099999997 40.697074999999884, -74.18391299999996 40.69750699999986, -74.18375099999997 40.69779499999988, -74.18363399999998 40.6983259999999, -74.18356199999994 40.698451999999875, -74.18354399999998 40.69855999999988, -74.18350799999996 40.69870399999992, -74.18327399999998 40.70008999999988, -74.18315699999994 40.701214999999884, -74.18316599999997 40.702384999999886, -74.18313899999998 40.7026279999999, -74.18309399999998 40.7028529999999, -74.18299499999995 40.70315899999985, -74.18284199999994 40.70346499999989, -74.18264399999998 40.70373499999988, -74.18242799999996 40.70395099999992, -74.18220299999996 40.704139999999896, -74.18203199999994 40.70425699999987, -74.18180699999994 40.7043919999999, -74.18157299999996 40.70449999999988, -74.18132099999997 40.70460799999...["dr5r8","dr5pr","dr5px","dr5r2"]dr5px
Newark AirportMULTIPOLYGON (((-74.18445299999996 40.694995999999904, -74.18448899999999 40.69509499999987, -74.18449799999996 40.69518499999987, -74.18438099999997 40.69587799999989, -74.18428199999994 40.6962109999999, -74.18402099999997 40.697074999999884, -74.18391299999996 40.69750699999986, -74.18375099999997 40.69779499999988, -74.18363399999998 40.6983259999999, -74.18356199999994 40.698451999999875, -74.18354399999998 40.69855999999988, -74.18350799999996 40.69870399999992, -74.18327399999998 40.70008999999988, -74.18315699999994 40.701214999999884, -74.18316599999997 40.702384999999886, -74.18313899999998 40.7026279999999, -74.18309399999998 40.7028529999999, -74.18299499999995 40.70315899999985, -74.18284199999994 40.70346499999989, -74.18264399999998 40.70373499999988, -74.18242799999996 40.70395099999992, -74.18220299999996 40.704139999999896, -74.18203199999994 40.70425699999987, -74.18180699999994 40.7043919999999, -74.18157299999996 40.70449999999988, -74.18132099999997 40.70460799999...["dr5r8","dr5pr","dr5px","dr5r2"]dr5r2
Jamaica BayMULTIPOLYGON (((-73.82337597260663 40.63898704717672, -73.82277105438692 40.63557691408512, -73.82265046764824 40.63536884414309, -73.82253791037438 40.6351581797112, -73.82243347854202 40.63494510056532, -73.8223372611914 40.63472978853998, -73.82224934035098 40.63451242737345, -73.82216979096668 40.634293202551085, -73.82209868083864 40.6340723011465, -73.82203607056276 40.63384991166226, -73.82198201348177 40.63362622386902, -73.82193655563644 40.63340142864301, -73.82189973572993 40.63317571780408, -73.82187158509224 40.63294928395111, -73.82185212765629 40.63272232029806, -73.82184137993583 40.6324950205089, -73.82183935101227 40.63226757853259, -73.8218460425281 40.63204018843732, -73.82107505533321 40.62973377456623, -73.82081417085445 40.629390439641234, -73.82059122816396 40.62892422501729, -73.8202234085928 40.62844358255744, -73.8200841811797 40.6282616395263, -73.8199971542669 40.62805115103772, -73.81991014068153 40.62784065311699, -73.81973384601805 40.6277123040871, -73....["dr5x0","dr5rp","dr5x1","dr5rn","dr5qz","dr5wb"]dr5x0
Jamaica BayMULTIPOLYGON (((-73.82337597260663 40.63898704717672, -73.82277105438692 40.63557691408512, -73.82265046764824 40.63536884414309, -73.82253791037438 40.6351581797112, -73.82243347854202 40.63494510056532, -73.8223372611914 40.63472978853998, -73.82224934035098 40.63451242737345, -73.82216979096668 40.634293202551085, -73.82209868083864 40.6340723011465, -73.82203607056276 40.63384991166226, -73.82198201348177 40.63362622386902, -73.82193655563644 40.63340142864301, -73.82189973572993 40.63317571780408, -73.82187158509224 40.63294928395111, -73.82185212765629 40.63272232029806, -73.82184137993583 40.6324950205089, -73.82183935101227 40.63226757853259, -73.8218460425281 40.63204018843732, -73.82107505533321 40.62973377456623, -73.82081417085445 40.629390439641234, -73.82059122816396 40.62892422501729, -73.8202234085928 40.62844358255744, -73.8200841811797 40.6282616395263, -73.8199971542669 40.62805115103772, -73.81991014068153 40.62784065311699, -73.81973384601805 40.6277123040871, -73....["dr5x0","dr5rp","dr5x1","dr5rn","dr5qz","dr5wb"]dr5rp
Jamaica BayMULTIPOLYGON (((-73.82337597260663 40.63898704717672, -73.82277105438692 40.63557691408512, -73.82265046764824 40.63536884414309, -73.82253791037438 40.6351581797112, -73.82243347854202 40.63494510056532, -73.8223372611914 40.63472978853998, -73.82224934035098 40.63451242737345, -73.82216979096668 40.634293202551085, -73.82209868083864 40.6340723011465, -73.82203607056276 40.63384991166226, -73.82198201348177 40.63362622386902, -73.82193655563644 40.63340142864301, -73.82189973572993 40.63317571780408, -73.82187158509224 40.63294928395111, -73.82185212765629 40.63272232029806, -73.82184137993583 40.6324950205089, -73.82183935101227 40.63226757853259, -73.8218460425281 40.63204018843732, -73.82107505533321 40.62973377456623, -73.82081417085445 40.629390439641234, -73.82059122816396 40.62892422501729, -73.8202234085928 40.62844358255744, -73.8200841811797 40.6282616395263, -73.8199971542669 40.62805115103772, -73.81991014068153 40.62784065311699, -73.81973384601805 40.6277123040871, -73....["dr5x0","dr5rp","dr5x1","dr5rn","dr5qz","dr5wb"]dr5x1
Jamaica BayMULTIPOLYGON (((-73.82337597260663 40.63898704717672, -73.82277105438692 40.63557691408512, -73.82265046764824 40.63536884414309, -73.82253791037438 40.6351581797112, -73.82243347854202 40.63494510056532, -73.8223372611914 40.63472978853998, -73.82224934035098 40.63451242737345, -73.82216979096668 40.634293202551085, -73.82209868083864 40.6340723011465, -73.82203607056276 40.63384991166226, -73.82198201348177 40.63362622386902, -73.82193655563644 40.63340142864301, -73.82189973572993 40.63317571780408, -73.82187158509224 40.63294928395111, -73.82185212765629 40.63272232029806, -73.82184137993583 40.6324950205089, -73.82183935101227 40.63226757853259, -73.8218460425281 40.63204018843732, -73.82107505533321 40.62973377456623, -73.82081417085445 40.629390439641234, -73.82059122816396 40.62892422501729, -73.8202234085928 40.62844358255744, -73.8200841811797 40.6282616395263, -73.8199971542669 40.62805115103772, -73.81991014068153 40.62784065311699, -73.81973384601805 40.6277123040871, -73....["dr5x0","dr5rp","dr5x1","dr5rn","dr5qz","dr5wb"]dr5rn
Jamaica BayMULTIPOLYGON (((-73.82337597260663 40.63898704717672, -73.82277105438692 40.63557691408512, -73.82265046764824 40.63536884414309, -73.82253791037438 40.6351581797112, -73.82243347854202 40.63494510056532, -73.8223372611914 40.63472978853998, -73.82224934035098 40.63451242737345, -73.82216979096668 40.634293202551085, -73.82209868083864 40.6340723011465, -73.82203607056276 40.63384991166226, -73.82198201348177 40.63362622386902, -73.82193655563644 40.63340142864301, -73.82189973572993 40.63317571780408, -73.82187158509224 40.63294928395111, -73.82185212765629 40.63272232029806, -73.82184137993583 40.6324950205089, -73.82183935101227 40.63226757853259, -73.8218460425281 40.63204018843732, -73.82107505533321 40.62973377456623, -73.82081417085445 40.629390439641234, -73.82059122816396 40.62892422501729, -73.8202234085928 40.62844358255744, -73.8200841811797 40.6282616395263, -73.8199971542669 40.62805115103772, -73.81991014068153 40.62784065311699, -73.81973384601805 40.6277123040871, -73....["dr5x0","dr5rp","dr5x1","dr5rn","dr5qz","dr5wb"]dr5qz
Jamaica BayMULTIPOLYGON (((-73.82337597260663 40.63898704717672, -73.82277105438692 40.63557691408512, -73.82265046764824 40.63536884414309, -73.82253791037438 40.6351581797112, -73.82243347854202 40.63494510056532, -73.8223372611914 40.63472978853998, -73.82224934035098 40.63451242737345, -73.82216979096668 40.634293202551085, -73.82209868083864 40.6340723011465, -73.82203607056276 40.63384991166226, -73.82198201348177 40.63362622386902, -73.82193655563644 40.63340142864301, -73.82189973572993 40.63317571780408, -73.82187158509224 40.63294928395111, -73.82185212765629 40.63272232029806, -73.82184137993583 40.6324950205089, -73.82183935101227 40.63226757853259, -73.8218460425281 40.63204018843732, -73.82107505533321 40.62973377456623, -73.82081417085445 40.629390439641234, -73.82059122816396 40.62892422501729, -73.8202234085928 40.62844358255744, -73.8200841811797 40.6282616395263, -73.8199971542669 40.62805115103772, -73.81991014068153 40.62784065311699, -73.81973384601805 40.6277123040871, -73....["dr5x0","dr5rp","dr5x1","dr5rn","dr5qz","dr5wb"]dr5wb
Allerton/Pelham GardensMULTIPOLYGON (((-73.84792614099985 40.87134223399991, -73.84725144800001 40.870987051999926, -73.84699273699992 40.87085288799987, -73.84640766399981 40.8705543009999, -73.84608957099984 40.870389771999946, -73.84578147499997 40.870227695999894, -73.845172567 40.86991469799994, -73.84487737499975 40.86976050699997, -73.84442133700003 40.86952229899991, -73.84423146999998 40.86942034999993, -73.84358581499981 40.86908763699991, -73.84315715499991 40.868863265999934, -73.84280443499989 40.868680752999886, -73.842406294 40.86847474399992, -73.84185186499998 40.86819192599989, -73.84122362600002 40.867858150999915, -73.84064364799987 40.867554175999935, -73.83974233399985 40.8670879309999, -73.83954475699979 40.86698673799988, -73.83922085399998 40.866820839999924, -73.83875223499997 40.86657277699996, -73.83784380199984 40.86609918799994, -73.83697021099982 40.86564313599992, -73.83678824299999 40.86554590599999, -73.83618601399989 40.86522409899994, -73.83578436699997 40.86501601099997, ...["dr72r","dr72x"]dr72r
Allerton/Pelham GardensMULTIPOLYGON (((-73.84792614099985 40.87134223399991, -73.84725144800001 40.870987051999926, -73.84699273699992 40.87085288799987, -73.84640766399981 40.8705543009999, -73.84608957099984 40.870389771999946, -73.84578147499997 40.870227695999894, -73.845172567 40.86991469799994, -73.84487737499975 40.86976050699997, -73.84442133700003 40.86952229899991, -73.84423146999998 40.86942034999993, -73.84358581499981 40.86908763699991, -73.84315715499991 40.868863265999934, -73.84280443499989 40.868680752999886, -73.842406294 40.86847474399992, -73.84185186499998 40.86819192599989, -73.84122362600002 40.867858150999915, -73.84064364799987 40.867554175999935, -73.83974233399985 40.8670879309999, -73.83954475699979 40.86698673799988, -73.83922085399998 40.866820839999924, -73.83875223499997 40.86657277699996, -73.83784380199984 40.86609918799994, -73.83697021099982 40.86564313599992, -73.83678824299999 40.86554590599999, -73.83618601399989 40.86522409899994, -73.83578436699997 40.86501601099997, ...["dr72r","dr72x"]dr72x
Alphabet CityMULTIPOLYGON (((-73.97177410965318 40.72582128133706, -73.97179142961485 40.72581422114911, -73.97181650587731 40.72581496675257, -73.97185935830923 40.72558296903031, -73.97187437695213 40.72550311607975, -73.97188490951473 40.725424405065766, -73.97191120732053 40.72529037069992, -73.97193374501082 40.72517629035117, -73.97193975456328 40.725158038610054, -73.97196154778591 40.725039978810884, -73.97200511841213 40.72484148970817, -73.97203666966882 40.724684070020096, -73.97206595867397 40.72455915832874, -73.97207196960339 40.724536350858095, -73.97208098151926 40.72449756793038, -73.97208400057282 40.72446790554567, -73.97209751290906 40.72442341523472, -73.97215609001734 40.7241701782781, -73.97216585996632 40.724131963273145, -73.9722169237619 40.723930054646765, -73.97223344676958 40.723846779926305, -73.97226499868246 40.72371445733361, -73.97232507731592 40.723463499327295, -73.97236115744644 40.72331206047645, -73.97239945748277 40.72314881636663, -73.97251011180381 40.72269...["dr5rs"]dr5rs
Arden HeightsMULTIPOLYGON (((-74.17421738099989 40.5625680859999, -74.17348507999998 40.56226748999995, -74.17225507699992 40.56170483699991, -74.17191921399996 40.56155171899995, -74.17185166499996 40.56152092299992, -74.17222993499992 40.56113585799992, -74.17245326199999 40.56088825699991, -74.17321541599998 40.5600776619999, -74.17358785199997 40.55969842799993, -74.17437344399991 40.55870866599984, -74.17475740499992 40.55816798199986, -74.1750629909999 40.55771126399991, -74.17512402999996 40.557620037999925, -74.17547297999988 40.557065311999914, -74.17559957599995 40.55685071199992, -74.17579913099998 40.55651243799986, -74.1761165979999 40.55593754099987, -74.17661991899996 40.55499100699994, -74.17746276899993 40.55341114599985, -74.17815548499992 40.552112789999896, -74.17874485199994 40.550995868999905, -74.1793348139999 40.54988835199988, -74.17991198599996 40.54883445299993, -74.18018524699995 40.54837960899992, -74.18128532999992 40.54695757299989, -74.18206740899993 40.5460448389998...["dr5qb","dr5q8","dr5nz","dr5nx"]dr5qb
Arden HeightsMULTIPOLYGON (((-74.17421738099989 40.5625680859999, -74.17348507999998 40.56226748999995, -74.17225507699992 40.56170483699991, -74.17191921399996 40.56155171899995, -74.17185166499996 40.56152092299992, -74.17222993499992 40.56113585799992, -74.17245326199999 40.56088825699991, -74.17321541599998 40.5600776619999, -74.17358785199997 40.55969842799993, -74.17437344399991 40.55870866599984, -74.17475740499992 40.55816798199986, -74.1750629909999 40.55771126399991, -74.17512402999996 40.557620037999925, -74.17547297999988 40.557065311999914, -74.17559957599995 40.55685071199992, -74.17579913099998 40.55651243799986, -74.1761165979999 40.55593754099987, -74.17661991899996 40.55499100699994, -74.17746276899993 40.55341114599985, -74.17815548499992 40.552112789999896, -74.17874485199994 40.550995868999905, -74.1793348139999 40.54988835199988, -74.17991198599996 40.54883445299993, -74.18018524699995 40.54837960899992, -74.18128532999992 40.54695757299989, -74.18206740899993 40.5460448389998...["dr5qb","dr5q8","dr5nz","dr5nx"]dr5q8
Arden HeightsMULTIPOLYGON (((-74.17421738099989 40.5625680859999, -74.17348507999998 40.56226748999995, -74.17225507699992 40.56170483699991, -74.17191921399996 40.56155171899995, -74.17185166499996 40.56152092299992, -74.17222993499992 40.56113585799992, -74.17245326199999 40.56088825699991, -74.17321541599998 40.5600776619999, -74.17358785199997 40.55969842799993, -74.17437344399991 40.55870866599984, -74.17475740499992 40.55816798199986, -74.1750629909999 40.55771126399991, -74.17512402999996 40.557620037999925, -74.17547297999988 40.557065311999914, -74.17559957599995 40.55685071199992, -74.17579913099998 40.55651243799986, -74.1761165979999 40.55593754099987, -74.17661991899996 40.55499100699994, -74.17746276899993 40.55341114599985, -74.17815548499992 40.552112789999896, -74.17874485199994 40.550995868999905, -74.1793348139999 40.54988835199988, -74.17991198599996 40.54883445299993, -74.18018524699995 40.54837960899992, -74.18128532999992 40.54695757299989, -74.18206740899993 40.5460448389998...["dr5qb","dr5q8","dr5nz","dr5nx"]dr5nz
Arden HeightsMULTIPOLYGON (((-74.17421738099989 40.5625680859999, -74.17348507999998 40.56226748999995, -74.17225507699992 40.56170483699991, -74.17191921399996 40.56155171899995, -74.17185166499996 40.56152092299992, -74.17222993499992 40.56113585799992, -74.17245326199999 40.56088825699991, -74.17321541599998 40.5600776619999, -74.17358785199997 40.55969842799993, -74.17437344399991 40.55870866599984, -74.17475740499992 40.55816798199986, -74.1750629909999 40.55771126399991, -74.17512402999996 40.557620037999925, -74.17547297999988 40.557065311999914, -74.17559957599995 40.55685071199992, -74.17579913099998 40.55651243799986, -74.1761165979999 40.55593754099987, -74.17661991899996 40.55499100699994, -74.17746276899993 40.55341114599985, -74.17815548499992 40.552112789999896, -74.17874485199994 40.550995868999905, -74.1793348139999 40.54988835199988, -74.17991198599996 40.54883445299993, -74.18018524699995 40.54837960899992, -74.18128532999992 40.54695757299989, -74.18206740899993 40.5460448389998...["dr5qb","dr5q8","dr5nz","dr5nx"]dr5nx
Arrochar/Fort WadsworthMULTIPOLYGON (((-74.06367318899999 40.60219816599994, -74.06350565699998 40.60215005399992, -74.06383152699986 40.602588967999964, -74.0651709129999 40.6042135079999, -74.06046429699992 40.606405823999864, -74.06042867199996 40.6063527299999, -74.05801067099993 40.60736879199994, -74.05778710399987 40.60744959099992, -74.0578901689999 40.607580753999905, -74.05685812390232 40.608056357772554, -74.05677183367786 40.607899470387395, -74.05674934830238 40.607798757335814, -74.05665999852928 40.607555930875925, -74.05649565936757 40.6072476482562, -74.05640693287154 40.60718873802623, -74.0560104141088 40.606780566131995, -74.05552126122357 40.6064828925687, -74.05543198004166 40.60648249104071, -74.05537932434086 40.60649422352233, -74.05528719697126 40.606538890078745, -74.05516001122312 40.60673049135086, -74.05498867839447 40.60666069691175, -74.05499916476879 40.60664574478401, -74.05503373135794 40.60665982664601, -74.05505194098775 40.60663386047028, -74.0550195433675 40.60662066296...["dr5r1","dr5r4","dr5qc","dr5qf"]dr5r1
Arrochar/Fort WadsworthMULTIPOLYGON (((-74.06367318899999 40.60219816599994, -74.06350565699998 40.60215005399992, -74.06383152699986 40.602588967999964, -74.0651709129999 40.6042135079999, -74.06046429699992 40.606405823999864, -74.06042867199996 40.6063527299999, -74.05801067099993 40.60736879199994, -74.05778710399987 40.60744959099992, -74.0578901689999 40.607580753999905, -74.05685812390232 40.608056357772554, -74.05677183367786 40.607899470387395, -74.05674934830238 40.607798757335814, -74.05665999852928 40.607555930875925, -74.05649565936757 40.6072476482562, -74.05640693287154 40.60718873802623, -74.0560104141088 40.606780566131995, -74.05552126122357 40.6064828925687, -74.05543198004166 40.60648249104071, -74.05537932434086 40.60649422352233, -74.05528719697126 40.606538890078745, -74.05516001122312 40.60673049135086, -74.05498867839447 40.60666069691175, -74.05499916476879 40.60664574478401, -74.05503373135794 40.60665982664601, -74.05505194098775 40.60663386047028, -74.0550195433675 40.60662066296...["dr5r1","dr5r4","dr5qc","dr5qf"]dr5r4
Arrochar/Fort WadsworthMULTIPOLYGON (((-74.06367318899999 40.60219816599994, -74.06350565699998 40.60215005399992, -74.06383152699986 40.602588967999964, -74.0651709129999 40.6042135079999, -74.06046429699992 40.606405823999864, -74.06042867199996 40.6063527299999, -74.05801067099993 40.60736879199994, -74.05778710399987 40.60744959099992, -74.0578901689999 40.607580753999905, -74.05685812390232 40.608056357772554, -74.05677183367786 40.607899470387395, -74.05674934830238 40.607798757335814, -74.05665999852928 40.607555930875925, -74.05649565936757 40.6072476482562, -74.05640693287154 40.60718873802623, -74.0560104141088 40.606780566131995, -74.05552126122357 40.6064828925687, -74.05543198004166 40.60648249104071, -74.05537932434086 40.60649422352233, -74.05528719697126 40.606538890078745, -74.05516001122312 40.60673049135086, -74.05498867839447 40.60666069691175, -74.05499916476879 40.60664574478401, -74.05503373135794 40.60665982664601, -74.05505194098775 40.60663386047028, -74.0550195433675 40.60662066296...["dr5r1","dr5r4","dr5qc","dr5qf"]dr5qc
Arrochar/Fort WadsworthMULTIPOLYGON (((-74.06367318899999 40.60219816599994, -74.06350565699998 40.60215005399992, -74.06383152699986 40.602588967999964, -74.0651709129999 40.6042135079999, -74.06046429699992 40.606405823999864, -74.06042867199996 40.6063527299999, -74.05801067099993 40.60736879199994, -74.05778710399987 40.60744959099992, -74.0578901689999 40.607580753999905, -74.05685812390232 40.608056357772554, -74.05677183367786 40.607899470387395, -74.05674934830238 40.607798757335814, -74.05665999852928 40.607555930875925, -74.05649565936757 40.6072476482562, -74.05640693287154 40.60718873802623, -74.0560104141088 40.606780566131995, -74.05552126122357 40.6064828925687, -74.05543198004166 40.60648249104071, -74.05537932434086 40.60649422352233, -74.05528719697126 40.606538890078745, -74.05516001122312 40.60673049135086, -74.05498867839447 40.60666069691175, -74.05499916476879 40.60664574478401, -74.05503373135794 40.60665982664601, -74.05505194098775 40.60663386047028, -74.0550195433675 40.60662066296...["dr5r1","dr5r4","dr5qc","dr5qf"]dr5qf
AstoriaMULTIPOLYGON (((-73.90413637799996 40.767520316999864, -73.90325211599989 40.767504322999905, -73.9030052879999 40.767509662999885, -73.90275780099982 40.767503546999855, -73.90251104099987 40.76748594099992, -73.90226637199994 40.76745694399991, -73.90202516599992 40.7674167839999, -73.90217951699996 40.76731584199997, -73.90255919500005 40.766940786999896, -73.90341888199997 40.765957306999944, -73.90351227799994 40.76584945999989, -73.90356915599997 40.76578178899994, -73.90361058299999 40.765726577999956, -73.90370771099997 40.765597148999866, -73.90451229899999 40.76458906399989, -73.90519286699994 40.76375094099996, -73.90566075299986 40.763167987999914, -73.90606811199996 40.762660444999916, -73.90625691699982 40.76242520699992, -73.90651032099997 40.76210946999992, -73.90677808699982 40.761777481999886, -73.90703976399989 40.76145304399993, -73.907419729 40.76098192599994, -73.90753042700004 40.76084467799991, -73.90779405499987 40.76051779999991, -73.90740334999987 40.76033397...["dr5ry","dr5rv"]dr5ry
AstoriaMULTIPOLYGON (((-73.90413637799996 40.767520316999864, -73.90325211599989 40.767504322999905, -73.9030052879999 40.767509662999885, -73.90275780099982 40.767503546999855, -73.90251104099987 40.76748594099992, -73.90226637199994 40.76745694399991, -73.90202516599992 40.7674167839999, -73.90217951699996 40.76731584199997, -73.90255919500005 40.766940786999896, -73.90341888199997 40.765957306999944, -73.90351227799994 40.76584945999989, -73.90356915599997 40.76578178899994, -73.90361058299999 40.765726577999956, -73.90370771099997 40.765597148999866, -73.90451229899999 40.76458906399989, -73.90519286699994 40.76375094099996, -73.90566075299986 40.763167987999914, -73.90606811199996 40.762660444999916, -73.90625691699982 40.76242520699992, -73.90651032099997 40.76210946999992, -73.90677808699982 40.761777481999886, -73.90703976399989 40.76145304399993, -73.907419729 40.76098192599994, -73.90753042700004 40.76084467799991, -73.90779405499987 40.76051779999991, -73.90740334999987 40.76033397...["dr5ry","dr5rv"]dr5rv
Astoria ParkMULTIPOLYGON (((-73.92334041500001 40.775128911999936, -73.92398142899997 40.774615111999886, -73.92523246199983 40.775298853999885, -73.92531479799985 40.77534385099991, -73.92602208199996 40.77573039899992, -73.92658081899984 40.776039258999916, -73.92737641899994 40.77646661099989, -73.92782147400004 40.77669752699993, -73.92827730816353 40.77689897516218, -73.92708229009109 40.77771978109685, -73.92631833401951 40.77824177509243, -73.9258220122297 40.77838590613155, -73.92574521623307 40.77840537091916, -73.9256507618914 40.778430811916465, -73.92557304281429 40.77845885141435, -73.92481615523091 40.77875769181163, -73.92423363003755 40.77910119388272, -73.92318694398986 40.78024839306262, -73.92295652695056 40.78044100806101, -73.9226301381542 40.78056478536395, -73.92209965499714 40.78085187481845, -73.92097562099832 40.7817676912532, -73.91996458796496 40.78263506876824, -73.91975969999989 40.782514177999886, -73.91796581399997 40.78125629099988, -73.91861823099985 40.7807328679...["dr72j","dr5rv"]dr72j
Astoria ParkMULTIPOLYGON (((-73.92334041500001 40.775128911999936, -73.92398142899997 40.774615111999886, -73.92523246199983 40.775298853999885, -73.92531479799985 40.77534385099991, -73.92602208199996 40.77573039899992, -73.92658081899984 40.776039258999916, -73.92737641899994 40.77646661099989, -73.92782147400004 40.77669752699993, -73.92827730816353 40.77689897516218, -73.92708229009109 40.77771978109685, -73.92631833401951 40.77824177509243, -73.9258220122297 40.77838590613155, -73.92574521623307 40.77840537091916, -73.9256507618914 40.778430811916465, -73.92557304281429 40.77845885141435, -73.92481615523091 40.77875769181163, -73.92423363003755 40.77910119388272, -73.92318694398986 40.78024839306262, -73.92295652695056 40.78044100806101, -73.9226301381542 40.78056478536395, -73.92209965499714 40.78085187481845, -73.92097562099832 40.7817676912532, -73.91996458796496 40.78263506876824, -73.91975969999989 40.782514177999886, -73.91796581399997 40.78125629099988, -73.91861823099985 40.7807328679...["dr72j","dr5rv"]dr5rv
AuburndaleMULTIPOLYGON (((-73.78502434699996 40.76103651599987, -73.78486059299999 40.76064436299992, -73.78467742500003 40.76025720799989, -73.78447529299982 40.75987586199995, -73.78430628699978 40.759483644999904, -73.78428991899993 40.75944029899991, -73.78425940899996 40.75938264599993, -73.78407792999997 40.75903964399988, -73.78382076099993 40.75853003399991, -73.78346111099987 40.757864063999904, -73.78338071499984 40.75775389699993, -73.78316157699985 40.75732618499991, -73.78303191299983 40.75708319099991, -73.78281576399985 40.75666634299991, -73.78264852999988 40.75633190399988, -73.7824813079998 40.75599745499987, -73.78212461999979 40.75533931199993, -73.78165171799995 40.754707752999956, -73.78113322699984 40.7540893259999, -73.78052037799992 40.753330742999886, -73.78009357400003 40.7525075039999, -73.77980639299983 40.75189500499989, -73.77944066999987 40.75112269599993, -73.77906558899984 40.75033257399993, -73.77831180799991 40.748745013999944, -73.77753347599982 40.7471483419...["dr5xc","dr5xb"]dr5xc
AuburndaleMULTIPOLYGON (((-73.78502434699996 40.76103651599987, -73.78486059299999 40.76064436299992, -73.78467742500003 40.76025720799989, -73.78447529299982 40.75987586199995, -73.78430628699978 40.759483644999904, -73.78428991899993 40.75944029899991, -73.78425940899996 40.75938264599993, -73.78407792999997 40.75903964399988, -73.78382076099993 40.75853003399991, -73.78346111099987 40.757864063999904, -73.78338071499984 40.75775389699993, -73.78316157699985 40.75732618499991, -73.78303191299983 40.75708319099991, -73.78281576399985 40.75666634299991, -73.78264852999988 40.75633190399988, -73.7824813079998 40.75599745499987, -73.78212461999979 40.75533931199993, -73.78165171799995 40.754707752999956, -73.78113322699984 40.7540893259999, -73.78052037799992 40.753330742999886, -73.78009357400003 40.7525075039999, -73.77980639299983 40.75189500499989, -73.77944066999987 40.75112269599993, -73.77906558899984 40.75033257399993, -73.77831180799991 40.748745013999944, -73.77753347599982 40.7471483419...["dr5xc","dr5xb"]dr5xb
BloomingdaleMULTIPOLYGON (((-73.95953658899997 40.7987185259999, -73.96004456499999 40.79804123499991, -73.96147779999993 40.79865415599994, -73.96286980099991 40.799239676999946, -73.96571144299992 40.80043806999988, -73.96775900399992 40.80130351599994, -73.96787379699998 40.80135169799993, -73.96798415999996 40.80139826599985, -73.96858360799983 40.80163546999991, -73.97004742199995 40.80226500999991, -73.97021594799989 40.80233585099994, -73.97027400499987 40.802359035999885, -73.97032589799987 40.80238456099995, -73.97150381000002 40.80283773599996, -73.97250022199995 40.80321661299997, -73.97257779799996 40.803247183999915, -73.9726574479999 40.803276513999926, -73.97279907800002 40.803329158999894, -73.97287179090726 40.803356187573904, -73.97255429829633 40.80379863465013, -73.97217237241792 40.80431907695909, -73.97205095521862 40.80453037600999, -73.9719529243853 40.804619709051586, -73.97181849483539 40.80471754320449, -73.97179980150743 40.80478561548601, -73.97171200727101 40.80493169...["dr72j","dr72h"]dr72j
BloomingdaleMULTIPOLYGON (((-73.95953658899997 40.7987185259999, -73.96004456499999 40.79804123499991, -73.96147779999993 40.79865415599994, -73.96286980099991 40.799239676999946, -73.96571144299992 40.80043806999988, -73.96775900399992 40.80130351599994, -73.96787379699998 40.80135169799993, -73.96798415999996 40.80139826599985, -73.96858360799983 40.80163546999991, -73.97004742199995 40.80226500999991, -73.97021594799989 40.80233585099994, -73.97027400499987 40.802359035999885, -73.97032589799987 40.80238456099995, -73.97150381000002 40.80283773599996, -73.97250022199995 40.80321661299997, -73.97257779799996 40.803247183999915, -73.9726574479999 40.803276513999926, -73.97279907800002 40.803329158999894, -73.97287179090726 40.803356187573904, -73.97255429829633 40.80379863465013, -73.97217237241792 40.80431907695909, -73.97205095521862 40.80453037600999, -73.9719529243853 40.804619709051586, -73.97181849483539 40.80471754320449, -73.97179980150743 40.80478561548601, -73.97171200727101 40.80493169...["dr72j","dr72h"]dr72h
Baisley ParkMULTIPOLYGON (((-73.78326624999988 40.68999429299992, -73.78234452799988 40.68840743699995, -73.78148675699995 40.6886971829999, -73.78051569899989 40.687036519999914, -73.77976509199979 40.68574360199992, -73.77966850599998 40.68537712299996, -73.77957347199998 40.68541503299992, -73.77870794599994 40.685700419999876, -73.77784971099992 40.68598927299988, -73.77699767599997 40.6862826889999, -73.77697494099996 40.686246713999935, -73.7767991239999 40.68596846499985, -73.77632402199986 40.6852165559999, -73.77567289899983 40.68474158899993, -73.77501231399985 40.68427557899985, -73.77462061100005 40.683990969999854, -73.7745579039998 40.683885621999906, -73.77441975399975 40.683653521999915, -73.77418414899984 40.68323792099991, -73.773499153 40.68348222699996, -73.77328703999997 40.68345473099989, -73.77297749099996 40.68293379299996, -73.77256209599992 40.682209496999846, -73.77220275299987 40.68161033899991, -73.77232211299984 40.681490967999935, -73.77299539399996 40.6812088249999,...["dr5x3","dr5x2"]dr5x3
Baisley ParkMULTIPOLYGON (((-73.78326624999988 40.68999429299992, -73.78234452799988 40.68840743699995, -73.78148675699995 40.6886971829999, -73.78051569899989 40.687036519999914, -73.77976509199979 40.68574360199992, -73.77966850599998 40.68537712299996, -73.77957347199998 40.68541503299992, -73.77870794599994 40.685700419999876, -73.77784971099992 40.68598927299988, -73.77699767599997 40.6862826889999, -73.77697494099996 40.686246713999935, -73.7767991239999 40.68596846499985, -73.77632402199986 40.6852165559999, -73.77567289899983 40.68474158899993, -73.77501231399985 40.68427557899985, -73.77462061100005 40.683990969999854, -73.7745579039998 40.683885621999906, -73.77441975399975 40.683653521999915, -73.77418414899984 40.68323792099991, -73.773499153 40.68348222699996, -73.77328703999997 40.68345473099989, -73.77297749099996 40.68293379299996, -73.77256209599992 40.682209496999846, -73.77220275299987 40.68161033899991, -73.77232211299984 40.681490967999935, -73.77299539399996 40.6812088249999,...["dr5x3","dr5x2"]dr5x2
Bath BeachMULTIPOLYGON (((-74.00109809499993 40.60303462599993, -74.00032353799993 40.60262029199992, -74.00002266099992 40.60290731599988, -73.99927902000003 40.60245801699991, -73.998563851 40.60202843399991, -73.99782332499991 40.601578178999915, -73.99708036399986 40.60112882899989, -73.9963651649999 40.600696053999904, -73.99559320799995 40.6002322219999, -73.99733919599988 40.5985516119999, -73.99865586599988 40.59726856199988, -73.99931921399997 40.596640750999924, -73.99951049399985 40.59644180899987, -73.99996502999996 40.59599430299989, -73.999997695 40.59596779199991, -74.00004233899988 40.59594037099991, -74.00027871999994 40.595702668999905, -74.00200394754667 40.594132371137796, -74.00219143075543 40.59435645428151, -74.00230298841333 40.594543340564904, -74.00242215707556 40.59472747670866, -74.00254882028027 40.59490868266267, -74.0026828542343 40.59508678124065, -74.0028241279343 40.59526159829329, -74.00297250329423 40.595432962878775, -74.00312783528081 40.59560070742998, -74....["dr5r5","dr5qu","dr5rh","dr5qg"]dr5r5
Bath BeachMULTIPOLYGON (((-74.00109809499993 40.60303462599993, -74.00032353799993 40.60262029199992, -74.00002266099992 40.60290731599988, -73.99927902000003 40.60245801699991, -73.998563851 40.60202843399991, -73.99782332499991 40.601578178999915, -73.99708036399986 40.60112882899989, -73.9963651649999 40.600696053999904, -73.99559320799995 40.6002322219999, -73.99733919599988 40.5985516119999, -73.99865586599988 40.59726856199988, -73.99931921399997 40.596640750999924, -73.99951049399985 40.59644180899987, -73.99996502999996 40.59599430299989, -73.999997695 40.59596779199991, -74.00004233899988 40.59594037099991, -74.00027871999994 40.595702668999905, -74.00200394754667 40.594132371137796, -74.00219143075543 40.59435645428151, -74.00230298841333 40.594543340564904, -74.00242215707556 40.59472747670866, -74.00254882028027 40.59490868266267, -74.0026828542343 40.59508678124065, -74.0028241279343 40.59526159829329, -74.00297250329423 40.595432962878775, -74.00312783528081 40.59560070742998, -74....["dr5r5","dr5qu","dr5rh","dr5qg"]dr5qu
Bath BeachMULTIPOLYGON (((-74.00109809499993 40.60303462599993, -74.00032353799993 40.60262029199992, -74.00002266099992 40.60290731599988, -73.99927902000003 40.60245801699991, -73.998563851 40.60202843399991, -73.99782332499991 40.601578178999915, -73.99708036399986 40.60112882899989, -73.9963651649999 40.600696053999904, -73.99559320799995 40.6002322219999, -73.99733919599988 40.5985516119999, -73.99865586599988 40.59726856199988, -73.99931921399997 40.596640750999924, -73.99951049399985 40.59644180899987, -73.99996502999996 40.59599430299989, -73.999997695 40.59596779199991, -74.00004233899988 40.59594037099991, -74.00027871999994 40.595702668999905, -74.00200394754667 40.594132371137796, -74.00219143075543 40.59435645428151, -74.00230298841333 40.594543340564904, -74.00242215707556 40.59472747670866, -74.00254882028027 40.59490868266267, -74.0026828542343 40.59508678124065, -74.0028241279343 40.59526159829329, -74.00297250329423 40.595432962878775, -74.00312783528081 40.59560070742998, -74....["dr5r5","dr5qu","dr5rh","dr5qg"]dr5rh
Bath BeachMULTIPOLYGON (((-74.00109809499993 40.60303462599993, -74.00032353799993 40.60262029199992, -74.00002266099992 40.60290731599988, -73.99927902000003 40.60245801699991, -73.998563851 40.60202843399991, -73.99782332499991 40.601578178999915, -73.99708036399986 40.60112882899989, -73.9963651649999 40.600696053999904, -73.99559320799995 40.6002322219999, -73.99733919599988 40.5985516119999, -73.99865586599988 40.59726856199988, -73.99931921399997 40.596640750999924, -73.99951049399985 40.59644180899987, -73.99996502999996 40.59599430299989, -73.999997695 40.59596779199991, -74.00004233899988 40.59594037099991, -74.00027871999994 40.595702668999905, -74.00200394754667 40.594132371137796, -74.00219143075543 40.59435645428151, -74.00230298841333 40.594543340564904, -74.00242215707556 40.59472747670866, -74.00254882028027 40.59490868266267, -74.0026828542343 40.59508678124065, -74.0028241279343 40.59526159829329, -74.00297250329423 40.595432962878775, -74.00312783528081 40.59560070742998, -74....["dr5r5","dr5qu","dr5rh","dr5qg"]dr5qg
Battery ParkMULTIPOLYGON (((-74.01565756599994 40.704833087999944, -74.01539758699995 40.704800148999894, -74.01527219799995 40.70483003699998, -74.01516257 40.704805094999884, -74.01496125199992 40.70475979699995, -74.01489542099996 40.70469751799991, -74.01478059499995 40.70467411299992, -74.0146670989999 40.704647212999916, -74.01451712299998 40.704605674999854, -74.014370312 40.70455803799994, -74.01428922899998 40.70454907499989, -74.01427065899998 40.70452022899989, -74.01425861399994 40.70448944299991, -74.01425342599994 40.70445756399993, -74.01425523899994 40.70442547199991, -74.014391769 40.70359878299993, -74.01442983199998 40.70315064799989, -74.014192151 40.70275671099996, -74.01389890399994 40.70227066999996, -74.01379120799997 40.70130547599995, -74.01378191199989 40.70122215499992, -74.01377528899992 40.7011827129999, -74.01376867799992 40.7011432629999, -74.01415893499998 40.701096289999896, -74.01395152778244 40.70099098222994, -74.0140919838548 40.70055161832718, -74.01410490300...["dr5re"]dr5re
Battery Park CityMULTIPOLYGON (((-74.01244109299991 40.7190576729999, -74.01281566799992 40.71735629799987, -74.01286663199994 40.71717610099995, -74.0130514639999 40.71645477099989, -74.01323384899992 40.715656187999855, -74.0133512149999 40.71523331199993, -74.01347524299993 40.715110710999895, -74.01359239999995 40.71449431599993, -74.01375388499997 40.71369055499988, -74.01404744699995 40.7124378149999, -74.01417753399997 40.71188266599997, -74.0142689369999 40.711467815999924, -74.01445559399995 40.71090715299987, -74.01466507099994 40.71042693799993, -74.01482432799997 40.70982336799991, -74.01487257099997 40.70968487399991, -74.01495415399995 40.70943269199994, -74.01534330799996 40.70849681699987, -74.01559220199994 40.70788324299987, -74.015643777 40.70775609899987, -74.01568829399997 40.70766382499988, -74.01571815199996 40.707585310999924, -74.01584985499994 40.70724726799988, -74.01586395999995 40.70720018299993, -74.01588574099995 40.707142175999934, -74.01590498299998 40.70709269499987, -...["dr5re"]dr5re
Bedford ParkMULTIPOLYGON (((-73.88513907699999 40.86638287399992, -73.88593703500003 40.86592439799995, -73.88683316999993 40.86538999399989, -73.8881227879999 40.8642545709999, -73.88889566099989 40.86475415299988, -73.890161637 40.863476362999954, -73.89065392999989 40.86295483399993, -73.89114803099996 40.862476137999934, -73.8917325659999 40.861909814999905, -73.89177188799992 40.86187171599992, -73.89138023399983 40.86170058799992, -73.89141802399983 40.86166298399995, -73.89256392599998 40.86052272899994, -73.89321520799987 40.85987420599987, -73.89381026099987 40.85898656499994, -73.8946932639999 40.85942628199992, -73.89573924699978 40.858138206999875, -73.89636314599984 40.85837531899993, -73.89735765499988 40.85876273499986, -73.89818244699991 40.85908368099994, -73.89866157499996 40.859246901999924, -73.89883814599983 40.859307307999906, -73.89880457699982 40.8593642709999, -73.89859097199998 40.859766782999955, -73.89828973399992 40.86033442099993, -73.89822728999994 40.8604488639999, ...["dr72q","dr72w"]dr72q
Bedford ParkMULTIPOLYGON (((-73.88513907699999 40.86638287399992, -73.88593703500003 40.86592439799995, -73.88683316999993 40.86538999399989, -73.8881227879999 40.8642545709999, -73.88889566099989 40.86475415299988, -73.890161637 40.863476362999954, -73.89065392999989 40.86295483399993, -73.89114803099996 40.862476137999934, -73.8917325659999 40.861909814999905, -73.89177188799992 40.86187171599992, -73.89138023399983 40.86170058799992, -73.89141802399983 40.86166298399995, -73.89256392599998 40.86052272899994, -73.89321520799987 40.85987420599987, -73.89381026099987 40.85898656499994, -73.8946932639999 40.85942628199992, -73.89573924699978 40.858138206999875, -73.89636314599984 40.85837531899993, -73.89735765499988 40.85876273499986, -73.89818244699991 40.85908368099994, -73.89866157499996 40.859246901999924, -73.89883814599983 40.859307307999906, -73.89880457699982 40.8593642709999, -73.89859097199998 40.859766782999955, -73.89828973399992 40.86033442099993, -73.89822728999994 40.8604488639999, ...["dr72q","dr72w"]dr72w
Boerum HillMULTIPOLYGON (((-73.98155298299992 40.689146163999936, -73.98101786899988 40.68893792699991, -73.98092822899991 40.68890247699988, -73.9808430809999 40.688761361999916, -73.980691182 40.68851581099994, -73.98064972099984 40.688459476999874, -73.98012756199996 40.68775000899994, -73.97984055799984 40.68734433199992, -73.97959037699985 40.687003901999965, -73.97936297699995 40.686682000999916, -73.97909065799993 40.68629386599988, -73.97899402899994 40.686156131999894, -73.97827416099987 40.68519595199996, -73.97804289599988 40.68485661499989, -73.97838862599984 40.68442334199988, -73.97842970699993 40.684355612999866, -73.97876022499986 40.68376544399991, -73.97918390599997 40.68312883799993, -73.97961592499983 40.682493556999916, -73.98003510099997 40.68185262699988, -73.98046155400003 40.681222546999926, -73.98088932299994 40.6805933489999, -73.98132413699994 40.67995210099992, -73.98175642299985 40.67931462399988, -73.98185715599982 40.67935261499986, -73.98413878099997 40.6802453709...["dr5rk"]dr5rk
Bay RidgeMULTIPOLYGON (((-74.03407329297129 40.644313932981866, -74.03284292006926 40.64356371017527, -74.03266558998958 40.64372034489007, -74.03260644399994 40.64369891099996, -74.02905968899994 40.64172667299992, -74.02889666799992 40.64121402199986, -74.02890829899998 40.641173410999905, -74.02839277799997 40.640963136999865, -74.02802775299989 40.640793489999915, -74.02742711399993 40.640514336999956, -74.02703439399988 40.64034998599989, -74.02691981299992 40.640308507999876, -74.02674292499995 40.640244467999935, -74.02662323799991 40.6402011359999, -74.02626267299999 40.64009438099988, -74.02628611999998 40.64007452899989, -74.02635007599996 40.640018464999905, -74.02646434999998 40.639918292999916, -74.02659984399993 40.63978656099993, -74.02664251499989 40.63974743299988, -74.02686129399991 40.6395362909999, -74.02695244699993 40.63944606499998, -74.02475437599998 40.63812141799988, -74.0245384189999 40.63832493699994, -74.02417094699994 40.63866937099987, -74.02392610699991 40.638898...["dr5r5","dr5qg"]dr5r5
Bay RidgeMULTIPOLYGON (((-74.03407329297129 40.644313932981866, -74.03284292006926 40.64356371017527, -74.03266558998958 40.64372034489007, -74.03260644399994 40.64369891099996, -74.02905968899994 40.64172667299992, -74.02889666799992 40.64121402199986, -74.02890829899998 40.641173410999905, -74.02839277799997 40.640963136999865, -74.02802775299989 40.640793489999915, -74.02742711399993 40.640514336999956, -74.02703439399988 40.64034998599989, -74.02691981299992 40.640308507999876, -74.02674292499995 40.640244467999935, -74.02662323799991 40.6402011359999, -74.02626267299999 40.64009438099988, -74.02628611999998 40.64007452899989, -74.02635007599996 40.640018464999905, -74.02646434999998 40.639918292999916, -74.02659984399993 40.63978656099993, -74.02664251499989 40.63974743299988, -74.02686129399991 40.6395362909999, -74.02695244699993 40.63944606499998, -74.02475437599998 40.63812141799988, -74.0245384189999 40.63832493699994, -74.02417094699994 40.63866937099987, -74.02392610699991 40.638898...["dr5r5","dr5qg"]dr5qg
Bay Terrace/Fort TottenMULTIPOLYGON (((-73.7774039129087 40.79659824126783, -73.77738937457792 40.79659450183192, -73.77737533353579 40.796590638548075, -73.77736151739849 40.796587154639624, -73.77734722706326 40.79658341668249, -73.77732802081981 40.79657950739745, -73.77730831725226 40.79657527248403, -73.77729522076002 40.796572608989926, -73.77727883366029 40.79656898558112, -73.77726240942357 40.79656565694303, -73.77724580769197 40.79656247270167, -73.77722588125384 40.79655751782156, -73.77720481055026 40.796551497944655, -73.77718793343199 40.796545368734854, -73.77717293031017 40.796538703545885, -73.77716048389526 40.79653321245802, -73.77714079232376 40.79652546721039, -73.77712309051303 40.79651796670836, -73.77710551097655 40.796512990043716, -73.77709075818873 40.796509449343056, -73.77707133827573 40.79650570143153, -73.77705491487234 40.79650213169629, -73.77703946639896 40.796497598227674, -73.77702305739517 40.79649361355523, -73.7770085428856 40.796489685818536, -73.77699143346936 40.7964...["dr5xc","dr780","dr781","dr5xb"]dr5xc
Bay Terrace/Fort TottenMULTIPOLYGON (((-73.7774039129087 40.79659824126783, -73.77738937457792 40.79659450183192, -73.77737533353579 40.796590638548075, -73.77736151739849 40.796587154639624, -73.77734722706326 40.79658341668249, -73.77732802081981 40.79657950739745, -73.77730831725226 40.79657527248403, -73.77729522076002 40.796572608989926, -73.77727883366029 40.79656898558112, -73.77726240942357 40.79656565694303, -73.77724580769197 40.79656247270167, -73.77722588125384 40.79655751782156, -73.77720481055026 40.796551497944655, -73.77718793343199 40.796545368734854, -73.77717293031017 40.796538703545885, -73.77716048389526 40.79653321245802, -73.77714079232376 40.79652546721039, -73.77712309051303 40.79651796670836, -73.77710551097655 40.796512990043716, -73.77709075818873 40.796509449343056, -73.77707133827573 40.79650570143153, -73.77705491487234 40.79650213169629, -73.77703946639896 40.796497598227674, -73.77702305739517 40.79649361355523, -73.7770085428856 40.796489685818536, -73.77699143346936 40.7964...["dr5xc","dr780","dr781","dr5xb"]dr780
Bay Terrace/Fort TottenMULTIPOLYGON (((-73.7774039129087 40.79659824126783, -73.77738937457792 40.79659450183192, -73.77737533353579 40.796590638548075, -73.77736151739849 40.796587154639624, -73.77734722706326 40.79658341668249, -73.77732802081981 40.79657950739745, -73.77730831725226 40.79657527248403, -73.77729522076002 40.796572608989926, -73.77727883366029 40.79656898558112, -73.77726240942357 40.79656565694303, -73.77724580769197 40.79656247270167, -73.77722588125384 40.79655751782156, -73.77720481055026 40.796551497944655, -73.77718793343199 40.796545368734854, -73.77717293031017 40.796538703545885, -73.77716048389526 40.79653321245802, -73.77714079232376 40.79652546721039, -73.77712309051303 40.79651796670836, -73.77710551097655 40.796512990043716, -73.77709075818873 40.796509449343056, -73.77707133827573 40.79650570143153, -73.77705491487234 40.79650213169629, -73.77703946639896 40.796497598227674, -73.77702305739517 40.79649361355523, -73.7770085428856 40.796489685818536, -73.77699143346936 40.7964...["dr5xc","dr780","dr781","dr5xb"]dr781
Bay Terrace/Fort TottenMULTIPOLYGON (((-73.7774039129087 40.79659824126783, -73.77738937457792 40.79659450183192, -73.77737533353579 40.796590638548075, -73.77736151739849 40.796587154639624, -73.77734722706326 40.79658341668249, -73.77732802081981 40.79657950739745, -73.77730831725226 40.79657527248403, -73.77729522076002 40.796572608989926, -73.77727883366029 40.79656898558112, -73.77726240942357 40.79656565694303, -73.77724580769197 40.79656247270167, -73.77722588125384 40.79655751782156, -73.77720481055026 40.796551497944655, -73.77718793343199 40.796545368734854, -73.77717293031017 40.796538703545885, -73.77716048389526 40.79653321245802, -73.77714079232376 40.79652546721039, -73.77712309051303 40.79651796670836, -73.77710551097655 40.796512990043716, -73.77709075818873 40.796509449343056, -73.77707133827573 40.79650570143153, -73.77705491487234 40.79650213169629, -73.77703946639896 40.796497598227674, -73.77702305739517 40.79649361355523, -73.7770085428856 40.796489685818536, -73.77699143346936 40.7964...["dr5xc","dr780","dr781","dr5xb"]dr5xb
Bensonhurst WestMULTIPOLYGON (((-73.99254973599997 40.62427426799996, -73.99009356099988 40.62278895299992, -73.98785095499996 40.62143503199992, -73.9856935779999 40.62013151399989, -73.98627524699981 40.61956661699989, -73.98406791799982 40.61824073899989, -73.98186818299985 40.61691212699987, -73.98087912799988 40.61631443499988, -73.98003930399985 40.61580692999996, -73.97963821799982 40.61556454699991, -73.98022027499997 40.6150049489999, -73.98080506199987 40.61444712999986, -73.98143750099992 40.61383768799993, -73.98174843299985 40.613554623999946, -73.98206106199993 40.613238418999885, -73.98215550199991 40.613149614999934, -73.98265927499982 40.61269247099993, -73.98322226999993 40.61212220899992, -73.98335142399998 40.61199230099992, -73.98380893599982 40.611559872999855, -73.984162011 40.611217300999876, -73.98438244899988 40.611005419999884, -73.98496383499995 40.61044799399991, -73.98535587499991 40.61007201399988, -73.98554853199988 40.60988724299989, -73.98575987199992 40.6096840839999...["dr5r5","dr5qu","dr5rh","dr5qg"]dr5r5
Bensonhurst WestMULTIPOLYGON (((-73.99254973599997 40.62427426799996, -73.99009356099988 40.62278895299992, -73.98785095499996 40.62143503199992, -73.9856935779999 40.62013151399989, -73.98627524699981 40.61956661699989, -73.98406791799982 40.61824073899989, -73.98186818299985 40.61691212699987, -73.98087912799988 40.61631443499988, -73.98003930399985 40.61580692999996, -73.97963821799982 40.61556454699991, -73.98022027499997 40.6150049489999, -73.98080506199987 40.61444712999986, -73.98143750099992 40.61383768799993, -73.98174843299985 40.613554623999946, -73.98206106199993 40.613238418999885, -73.98215550199991 40.613149614999934, -73.98265927499982 40.61269247099993, -73.98322226999993 40.61212220899992, -73.98335142399998 40.61199230099992, -73.98380893599982 40.611559872999855, -73.984162011 40.611217300999876, -73.98438244899988 40.611005419999884, -73.98496383499995 40.61044799399991, -73.98535587499991 40.61007201399988, -73.98554853199988 40.60988724299989, -73.98575987199992 40.6096840839999...["dr5r5","dr5qu","dr5rh","dr5qg"]dr5qu
Bensonhurst WestMULTIPOLYGON (((-73.99254973599997 40.62427426799996, -73.99009356099988 40.62278895299992, -73.98785095499996 40.62143503199992, -73.9856935779999 40.62013151399989, -73.98627524699981 40.61956661699989, -73.98406791799982 40.61824073899989, -73.98186818299985 40.61691212699987, -73.98087912799988 40.61631443499988, -73.98003930399985 40.61580692999996, -73.97963821799982 40.61556454699991, -73.98022027499997 40.6150049489999, -73.98080506199987 40.61444712999986, -73.98143750099992 40.61383768799993, -73.98174843299985 40.613554623999946, -73.98206106199993 40.613238418999885, -73.98215550199991 40.613149614999934, -73.98265927499982 40.61269247099993, -73.98322226999993 40.61212220899992, -73.98335142399998 40.61199230099992, -73.98380893599982 40.611559872999855, -73.984162011 40.611217300999876, -73.98438244899988 40.611005419999884, -73.98496383499995 40.61044799399991, -73.98535587499991 40.61007201399988, -73.98554853199988 40.60988724299989, -73.98575987199992 40.6096840839999...["dr5r5","dr5qu","dr5rh","dr5qg"]dr5rh

Showing the first 49 rows.

First we figure out geohash values with more than 1M pickups. (used as a "skew hint" to optimize performance below)

val pickup_skews = trips
    .select("pickup_geohash_25")
    .groupBy("pickup_geohash_25")
      .count()
    .orderBy(desc("count"))
    .filter($"count" > 1000 * 1000)
    .select("pickup_geohash_25")
    .as[String].collect
pickup_skews: Array[String] = Array(dr5ru, dr5rs, dr5rv, dr5re, dr72h, dr72j, dr5rg, dr5rz, dr5x1, dr5ry, dr5x0, dr5rk, dr5rt)
val joined = 
  trips
    .hint("skew","pickup_geohash_25", pickup_skews).as("L")
    .join(
      neighborhoodsDF.as("R"),
      // short circuit on geohash and apply geospatial predicate when necessary
      $"L.pickup_geohash_25" === $"R.geohash" && st_contains($"polygon", $"pickupPoint")
    )
    .drop("geohashes")
    .drop("geohash")
    .drop("polygon")
joined: org.apache.spark.sql.DataFrame = [pickup_datetime: string, dropoff_datetime: string ... 18 more fields]
display(joined)
2016-03-26 15:39:132016-03-26 15:51:4421.22-73.9974975585937540.756813049316406-73.978904724121140.75257110595703900.51.9600.311.76POINT (-73.99749755859375 40.756813049316406)POINT (-73.9789047241211 40.75257110595703)dr5rudr5ruEast Chelsea
2016-03-26 17:33:382016-03-26 17:45:1713.2-73.8632736206054740.76980972290039-73.9107589721679740.7723617553710941210.52.7500.316.55POINT (-73.86327362060547 40.76980972290039)POINT (-73.91075897216797 40.772361755371094)dr5rzdr5ryLaGuardia Airport
2016-03-28 10:47:202016-03-28 11:03:1612-73.9803314208984440.76011276245117-73.9922790527343840.7379760742187511.500.5000.312.3POINT (-73.98033142089844 40.76011276245117)POINT (-73.99227905273438 40.73797607421875)dr5rudr5ruTimes Sq/Theatre District
2015-10-18 02:05:282015-10-18 02:23:5813.81-73.9530639648437540.71426773071289-73.9792022705078140.755279541015625150.50.53.2600.319.56POINT (-73.95306396484375 40.71426773071289)POINT (-73.97920227050781 40.755279541015625)dr5rtdr5ruEast Williamsburg
2015-07-24 22:42:312015-07-24 22:56:2922.38-73.9919891357421940.73461151123047-73.9789199829101640.76213836669922110.50.52.4600.314.76POINT (-73.99198913574219 40.73461151123047)POINT (-73.97891998291016 40.76213836669922)dr5rsdr5ruGreenwich Village North
2015-06-17 23:18:452015-06-17 23:32:0112.9-73.982887268066440.75624084472656-73.9494934082031240.77348327636719120.50.5000.313.3POINT (-73.9828872680664 40.75624084472656)POINT (-73.94949340820312 40.77348327636719)dr5rudr5rvMidtown Center
2015-07-24 23:26:132015-07-24 23:55:51615.88-73.7766876220703140.64546585083008-73.9523773193359440.64962005615234444.50.50.5000.345.8POINT (-73.77668762207031 40.64546585083008)POINT (-73.95237731933594 40.649620056152344)dr5x1dr5rmJFK Airport
2015-10-17 17:04:012015-10-17 17:08:3461.07-73.959617614746140.76948547363281-73.9594650268554740.7588462829589845.500.5100.37.3POINT (-73.9596176147461 40.76948547363281)POINT (-73.95946502685547 40.758846282958984)dr5rvdr5rvLenox Hill West
2015-06-17 08:14:082015-06-17 08:18:0410.7-73.9636993408203140.76577377319336-73.9612960815429740.77436065673828500.51.1500.36.95POINT (-73.96369934082031 40.76577377319336)POINT (-73.96129608154297 40.77436065673828)dr5rudr5ruUpper East Side South
2015-07-25 01:39:142015-07-25 01:57:0229.38-73.98950195312540.75770950317383-73.9235229492187540.867698669433594270.50.5000.328.3POINT (-73.989501953125 40.75770950317383)POINT (-73.92352294921875 40.867698669433594)dr5rudr72mClinton East
2015-07-24 09:43:072015-07-24 09:50:2510.76-73.9749145507812540.680667877197266-73.975563049316440.674373626708984600.51.3600.38.16POINT (-73.97491455078125 40.680667877197266)POINT (-73.9755630493164 40.674373626708984)dr5rkdr5rkPark Slope
2015-10-15 22:06:532015-10-15 22:18:0111.62-73.9702911376953140.754878997802734-73.9893112182617240.7431983947753990.50.52.0600.312.36POINT (-73.97029113769531 40.754878997802734)POINT (-73.98931121826172 40.74319839477539)dr5rudr5ruSutton Place/Turtle Bay North
2015-07-25 08:54:062015-07-25 09:09:5211.8-73.9899597167968840.76689147949219-73.9910964965820340.7506980895996111.500.50.100.312.4POINT (-73.98995971679688 40.76689147949219)POINT (-73.99109649658203 40.75069808959961)dr5rudr5ruClinton East
2015-07-25 10:38:122015-07-25 10:52:2912-74.0046768188476640.7415771484375-73.9827270507812540.742816925048831100.5000.311.8POINT (-74.00467681884766 40.7415771484375)POINT (-73.98272705078125 40.74281692504883)dr5rgdr5ruEast Chelsea
2015-01-28 20:08:242015-01-28 20:29:10310.73-73.8652801513671940.7712287902832-73.8576507568359440.840919494628906310.50.525.330.339.63POINT (-73.86528015136719 40.7712287902832)POINT (-73.85765075683594 40.840919494628906)dr5rzdr72rLaGuardia Airport
2015-10-16 11:02:362015-10-16 11:07:3011.34-73.9458923339843840.77320861816406-73.940040588378940.786590576171875600.5000.36.8POINT (-73.94589233398438 40.77320861816406)POINT (-73.9400405883789 40.786590576171875)dr5rvdr72jYorkville East
2016-03-28 18:19:562016-03-28 18:38:3513.03-73.981056213378940.78424835205078-73.9690628051757840.754680633544921410.50.300.316.1POINT (-73.9810562133789 40.78424835205078)POINT (-73.96906280517578 40.75468063354492)dr72hdr5ruUpper West Side South
2015-01-29 12:30:122015-01-29 13:03:0142.83-74.0004425048828140.726409912109375-73.9795608520507840.7612266540527342000.54.1600.324.96POINT (-74.00044250488281 40.726409912109375)POINT (-73.97956085205078 40.761226654052734)dr5rsdr5ruSoHo
2015-02-09 08:30:182015-02-09 08:36:1210.4-73.9629974365234440.77511978149414-73.9559402465820340.7727432250976565.500.51.2500.37.55POINT (-73.96299743652344 40.77511978149414)POINT (-73.95594024658203 40.772743225097656)dr5rudr5rvUpper East Side North
2015-06-17 06:41:072015-06-17 06:54:3413.9-73.9549713134765640.777645111083984-74.0027770996093840.760532379150391400.52.9500.317.75POINT (-73.95497131347656 40.777645111083984)POINT (-74.00277709960938 40.76053237915039)dr5rvdr5ruUpper East Side North
2015-02-10 15:17:102015-02-10 15:20:2310.6-73.9598312377929740.771060943603516-73.9543609619140640.778015136718754.500.51.0500.36.35POINT (-73.95983123779297 40.771060943603516)POINT (-73.95436096191406 40.77801513671875)dr5rvdr5rvUpper East Side South
2015-10-15 07:19:082015-10-15 07:20:4610.3-73.989891052246140.75679016113281-73.9866638183593840.761631011962893.500.5000.34.3POINT (-73.9898910522461 40.75679016113281)POINT (-73.98666381835938 40.76163101196289)dr5rudr5ruGarment District
2015-02-10 23:52:552015-02-11 00:03:5011.9-74.0076522827148440.740535736083984-73.98559570312540.7328071594238390.50.52.0500.312.35POINT (-74.00765228271484 40.740535736083984)POINT (-73.985595703125 40.73280715942383)dr5rgdr5rsMeatpacking/West Village West
2016-03-26 16:27:232016-03-26 16:32:5020.6-73.976051330566440.76039505004883-73.968849182128940.75501632690435.500.5000.36.3POINT (-73.9760513305664 40.76039505004883)POINT (-73.9688491821289 40.7550163269043)dr5rudr5ruMidtown Center
2015-10-18 01:25:232015-10-18 01:32:4951.73-73.9823379516601640.75114059448242-73.961448669433640.7604484558105580.50.51.8600.311.16POINT (-73.98233795166016 40.75114059448242)POINT (-73.9614486694336 40.76044845581055)dr5rudr5ruMurray Hill
2016-03-26 13:45:512016-03-26 13:55:4110.78-73.9777221679687540.759483337402344-73.9784240722656240.7635536193847667.500.51.6600.39.96POINT (-73.97772216796875 40.759483337402344)POINT (-73.97842407226562 40.763553619384766)dr5rudr5ruMidtown Center
2016-03-27 17:35:112016-03-27 17:42:3511.6-73.94897460937540.78845977783203-73.941993713378940.8063659667968757.500.5000.38.3POINT (-73.948974609375 40.78845977783203)POINT (-73.9419937133789 40.806365966796875)dr72jdr72jEast Harlem South
2015-01-28 10:09:412015-01-28 10:17:0012.37-74.0132904052734440.716796875-74.0031814575195340.74903106689453900.5200.311.8POINT (-74.01329040527344 40.716796875)POINT (-74.00318145751953 40.74903106689453)dr5redr5ruBattery Park City
2015-10-15 05:56:502015-10-15 06:01:4010.9-73.9970092773437540.737449645996094-74.0082702636718840.737625122070315.50.50.5000.36.8POINT (-73.99700927734375 40.737449645996094)POINT (-74.00827026367188 40.73762512207031)dr5rudr5rgFlatiron
2015-02-10 19:55:112015-02-10 20:10:4022.5-73.9873504638671940.73971939086914-74.0103302001953140.7189559936523441210.5000.313.8POINT (-73.98735046386719 40.73971939086914)POINT (-74.01033020019531 40.718955993652344)dr5rudr5reUnion Sq
2016-03-26 21:50:142016-03-26 22:02:1521.9-73.961059570312540.75942611694336-73.981422424316440.749893188476569.50.50.5000.310.8POINT (-73.9610595703125 40.75942611694336)POINT (-73.9814224243164 40.74989318847656)dr5rudr5ruLenox Hill East
2015-10-15 13:04:022015-10-15 13:20:0212.86-73.9486999511718840.781829833984375-73.9819412231445340.7704772949218751300.52.7600.316.56POINT (-73.94869995117188 40.781829833984375)POINT (-73.98194122314453 40.770477294921875)dr72jdr5ruYorkville West
2015-07-24 21:25:322015-07-24 21:40:2714.07-73.953712463378940.775089263916016-73.9875411987304740.74087905883789150.50.53.2600.319.56POINT (-73.9537124633789 40.775089263916016)POINT (-73.98754119873047 40.74087905883789)dr5rvdr5ruYorkville West
2015-06-17 22:22:542015-06-17 22:34:0912.78-74.0076141357421940.731101989746094-73.9822921752929740.7540702819824210.50.50.52.3600.314.16POINT (-74.00761413574219 40.731101989746094)POINT (-73.98229217529297 40.75407028198242)dr5redr5ruMeatpacking/West Village West
2015-10-15 12:40:592015-10-15 12:45:1410.5-73.9960861206054740.74435043334961-74.0048217773437540.747947692871094500.51.500.37.3POINT (-73.99608612060547 40.74435043334961)POINT (-74.00482177734375 40.747947692871094)dr5rudr5rgFlatiron
2015-10-16 12:36:392015-10-16 12:48:1222.15-73.9941482543945340.74506759643555-74.0111923217773440.729167938232421000.5000.310.8POINT (-73.99414825439453 40.74506759643555)POINT (-74.01119232177734 40.72916793823242)dr5rudr5reFlatiron
2015-10-17 08:29:142015-10-17 08:43:5913.4-73.9596481323242240.776771545410156-73.9748458862304740.741836547851561300.5000.313.8POINT (-73.95964813232422 40.776771545410156)POINT (-73.97484588623047 40.74183654785156)dr5rvdr5ruUpper East Side North
2015-10-15 06:52:542015-10-15 06:59:3811.22-73.9886016845703140.76892852783203-73.998191833496140.76076126098633700.51.5600.39.36POINT (-73.98860168457031 40.76892852783203)POINT (-73.9981918334961 40.76076126098633)dr5rudr5ruClinton East
2015-06-15 21:30:422015-06-15 21:44:1312.8-73.972290039062540.75907897949219-74.0030136108398440.734127044677734120.50.52.6500.315.95POINT (-73.9722900390625 40.75907897949219)POINT (-74.00301361083984 40.734127044677734)dr5rudr5rsMidtown East
2015-06-17 11:19:072015-06-17 11:38:4311.99-73.9828186035156240.76007080078125-74.0041046142578140.7427711486816413.500.5000.314.3POINT (-73.98281860351562 40.76007080078125)POINT (-74.00410461425781 40.74277114868164)dr5rudr5rgTimes Sq/Theatre District
2016-03-26 14:11:252016-03-26 14:17:4930.82-73.9705505371093840.76750183105469-73.9586105346679740.76060104370117600.5000.36.8POINT (-73.97055053710938 40.76750183105469)POINT (-73.95861053466797 40.76060104370117)dr5rudr5rvUpper East Side South
2016-03-26 15:19:082016-03-26 15:37:0413.63-73.9798660278320340.765586853027344-73.930297851562540.7589416503906251500.5000.315.8POINT (-73.97986602783203 40.765586853027344)POINT (-73.9302978515625 40.758941650390625)dr5rudr5rvMidtown North
2015-10-17 16:37:402015-10-17 16:41:4720.7-73.9618835449218840.77080535888672-73.9700469970703140.76715850830078500.5000.35.8POINT (-73.96188354492188 40.77080535888672)POINT (-73.97004699707031 40.76715850830078)dr5rudr5ruUpper East Side South
2015-06-16 19:32:152015-06-16 19:35:4651.03-73.943748474121140.77629852294922-73.9539718627929740.7659912109375510.51.700.38.5POINT (-73.9437484741211 40.77629852294922)POINT (-73.95397186279297 40.7659912109375)dr5rvdr5rvYorkville East
2015-01-28 16:55:212015-01-28 17:13:0211.71-73.9772796630859440.75563049316406-73.9562911987304740.764659881591811.510.52.6600.315.96POINT (-73.97727966308594 40.75563049316406)POINT (-73.95629119873047 40.7646598815918)dr5rudr5rvMidtown Center
2015-07-24 09:36:202015-07-24 09:50:4212.1-73.987426757812540.73880386352539-73.9706420898437540.764755249023441100.52.3500.314.15POINT (-73.9874267578125 40.73880386352539)POINT (-73.97064208984375 40.76475524902344)dr5rudr5ruUnion Sq
2015-10-18 02:31:262015-10-18 02:45:3922-73.987426757812540.720726013183594-74.0048904418945340.7374458312988310.50.50.52.3500.314.15POINT (-73.9874267578125 40.720726013183594)POINT (-74.00489044189453 40.73744583129883)dr5rsdr5rgLower East Side
2015-10-16 00:35:472015-10-16 00:51:1215-73.98754882812540.76292037963867-73.9454040527343840.82824325561523416.50.50.53.200.321POINT (-73.987548828125 40.76292037963867)POINT (-73.94540405273438 40.828243255615234)dr5rudr72mClinton East
2015-10-16 19:58:142015-10-16 20:05:4211.1-74.0088577270507840.71388626098633-73.9964141845703140.721553802490234710.51.7500.310.55POINT (-74.00885772705078 40.71388626098633)POINT (-73.99641418457031 40.721553802490234)dr5redr5rsTriBeCa/Civic Center
2015-10-17 22:57:022015-10-17 23:00:1210.63-73.975730895996140.752220153808594-73.9765014648437540.74597167968754.50.50.51.1600.36.96POINT (-73.9757308959961 40.752220153808594)POINT (-73.97650146484375 40.7459716796875)dr5rudr5ruMidtown East
2015-06-17 04:15:322015-06-17 04:24:5913.8-73.985450744628940.719383239746094-73.9548034667968840.6877861022949212.50.50.5000.313.8POINT (-73.9854507446289 40.719383239746094)POINT (-73.95480346679688 40.68778610229492)dr5rsdr5rmLower East Side
2015-07-24 21:19:302015-07-24 21:34:1922.66-73.9819183349609440.7681770324707-73.9679489135742240.8013763427734412.50.50.5000.313.8POINT (-73.98191833496094 40.7681770324707)POINT (-73.96794891357422 40.80137634277344)dr5rudr72hLincoln Square East
2015-10-14 23:51:492015-10-15 00:01:2711.38-73.9714050292968840.75712585449219-73.9897079467773440.7671318054199280.50.51.500.310.8POINT (-73.97140502929688 40.75712585449219)POINT (-73.98970794677734 40.76713180541992)dr5rudr5ruMidtown East
2016-03-27 11:18:562016-03-27 11:28:1621.6-73.9495391845703140.77260971069336-73.9702682495117240.784229278564458.500.51.8500.311.15POINT (-73.94953918457031 40.77260971069336)POINT (-73.97026824951172 40.78422927856445)dr5rvdr72hYorkville East
2015-10-15 20:23:192015-10-15 20:29:1311.32-73.9867019653320340.76142883300781-73.9799041748046940.77616119384765670.50.5100.39.3POINT (-73.98670196533203 40.76142883300781)POINT (-73.97990417480469 40.776161193847656)dr5rudr5ruTimes Sq/Theatre District
2015-02-10 21:40:382015-02-10 21:49:2851.9-73.9794006347656240.76222610473633-74.0005722045898440.747730255126958.50.50.51.9600.311.76POINT (-73.97940063476562 40.76222610473633)POINT (-74.00057220458984 40.74773025512695)dr5rudr5ruTimes Sq/Theatre District
2015-06-17 07:10:262015-06-17 07:18:5911.5-73.978370666503940.76657485961914-73.9731369018554740.7530136108398447.500.51.6500.39.95POINT (-73.9783706665039 40.76657485961914)POINT (-73.97313690185547 40.753013610839844)dr5rudr5ruMidtown North
2015-10-16 10:11:172015-10-16 10:13:4610.3-73.9507675170898440.77507400512695-73.9530792236328140.7784309387207400.50.9500.35.75POINT (-73.95076751708984 40.77507400512695)POINT (-73.95307922363281 40.7784309387207)dr5rvdr5rvYorkville West
2015-10-16 08:17:082015-10-16 08:34:5213.5-73.9859466552734440.744300842285156-73.9524765014648440.789047241210941400.5000.314.8POINT (-73.98594665527344 40.744300842285156)POINT (-73.95247650146484 40.78904724121094)dr5rudr72jMidtown South
2015-02-10 01:01:062015-02-10 01:02:5720.31-73.9497222900390640.80720138549805-73.9537734985351640.8061485290527343.50.50.5100.35.8POINT (-73.94972229003906 40.80720138549805)POINT (-73.95377349853516 40.806148529052734)dr72jdr72jCentral Harlem
2015-07-25 23:43:062015-07-26 00:00:0112.8-73.977149963378940.7520751953125-73.9802551269531240.72703552246094130.50.5200.316.3POINT (-73.9771499633789 40.7520751953125)POINT (-73.98025512695312 40.72703552246094)dr5rudr5rsMidtown East
2015-07-25 00:06:312015-07-25 00:07:3010.3-73.9958953857421940.738861083984375-73.9928894042968840.7426567077636730.50.5000.34.3POINT (-73.99589538574219 40.738861083984375)POINT (-73.99288940429688 40.74265670776367)dr5rudr5ruFlatiron
2015-10-17 15:52:192015-10-17 16:09:2822.24-74.0081634521484440.73746109008789-74.0093078613281240.7104225158691412.500.5000.313.3POINT (-74.00816345214844 40.73746109008789)POINT (-74.00930786132812 40.71042251586914)dr5rgdr5reMeatpacking/West Village West
2015-10-16 05:56:392015-10-16 06:00:4511.73-73.9798965454101640.7758903503418-73.9771804809570340.75937652587890670.50.51.6600.39.96POINT (-73.97989654541016 40.7758903503418)POINT (-73.97718048095703 40.759376525878906)dr5rudr5ruLincoln Square East
2015-02-10 18:39:272015-02-10 18:45:4410.6-73.9832153320312540.6967887878418-73.98754882812540.691318511962895.510.5000.37.3POINT (-73.98321533203125 40.6967887878418)POINT (-73.987548828125 40.69131851196289)dr5rsdr5rkDowntown Brooklyn/MetroTech
2015-10-14 20:50:002015-10-14 20:50:0315.7-74.0059280395507840.705989837646484-74.0059509277343840.70594024658203200.50.5400.325.3POINT (-74.00592803955078 40.705989837646484)POINT (-74.00595092773438 40.70594024658203)dr5redr5reFinancial District North
2016-03-27 11:51:562016-03-27 12:18:0812.48-73.9620971679687540.76386642456055-73.9864807128906240.7580184936523441700.53.5600.321.36POINT (-73.96209716796875 40.76386642456055)POINT (-73.98648071289062 40.758018493652344)dr5rudr5ruLenox Hill West
2015-06-16 11:52:592015-06-16 11:59:1021.04-73.9917755126953140.76054382324219-73.9947204589843840.7554817199707600.51.700.38.5POINT (-73.99177551269531 40.76054382324219)POINT (-73.99472045898438 40.7554817199707)dr5rudr5ruClinton East
2015-02-10 19:38:112015-02-10 19:52:3522.08-74.0056228637695340.73820114135742-74.0068206787109440.715080261230471110.5000.312.8POINT (-74.00562286376953 40.73820114135742)POINT (-74.00682067871094 40.71508026123047)dr5rgdr5reMeatpacking/West Village West
2016-03-26 14:33:502016-03-26 15:14:4115.6-74.0157318115234440.714759826660156-73.9861221313476640.7589988708496127.500.5000.328.3POINT (-74.01573181152344 40.714759826660156)POINT (-73.98612213134766 40.75899887084961)dr5redr5ruBattery Park City
2015-10-17 20:46:002015-10-17 20:54:2011.62-73.97387695312540.79372024536133-73.9526977539062540.803211212158280.50.5000.39.3POINT (-73.973876953125 40.79372024536133)POINT (-73.95269775390625 40.8032112121582)dr72hdr72jUpper West Side North
2015-07-25 18:58:112015-07-25 19:36:5114.39-74.0011825561523440.71985626220703-73.9837493896484440.76062393188476624.500.5000.325.3POINT (-74.00118255615234 40.71985626220703)POINT (-73.98374938964844 40.760623931884766)dr5rsdr5ruLittle Italy/NoLiTa
2015-07-24 13:32:052015-07-24 13:44:1910.9-73.9883575439453140.76411437988281-73.9911956787109440.755302429199228.500.52.300.311.6POINT (-73.98835754394531 40.76411437988281)POINT (-73.99119567871094 40.75530242919922)dr5rudr5ruClinton East
2015-07-25 14:09:512015-07-25 14:21:0112.51-73.9768600463867240.790122985839844-73.9641723632812540.7654342651367210.500.52.2600.313.56POINT (-73.97686004638672 40.790122985839844)POINT (-73.96417236328125 40.76543426513672)dr72hdr5ruUpper West Side North
2015-01-28 17:10:262015-01-28 17:30:1512.67-74.0056915283203140.74040985107422-73.9763336181640640.752048492431641410.53.9500.319.75POINT (-74.00569152832031 40.74040985107422)POINT (-73.97633361816406 40.75204849243164)dr5rgdr5ruMeatpacking/West Village West
2016-03-26 15:16:052016-03-26 15:25:4011.4-73.9827499389648440.75143814086914-73.9680099487304740.7623291015625800.51.7600.310.56POINT (-73.98274993896484 40.75143814086914)POINT (-73.96800994873047 40.7623291015625)dr5rudr5ruMidtown South
2015-07-23 20:09:142015-07-23 20:19:4521.24-74.00976562540.71452331542969-73.9983825683593840.7262229919433680.50.52.3200.311.62POINT (-74.009765625 40.71452331542969)POINT (-73.99838256835938 40.72622299194336)dr5redr5rsTriBeCa/Civic Center
2015-10-16 14:22:452015-10-16 14:38:5713.3-73.9914627075195340.751136779785156-73.973533630371140.7894668579101561300.52.7500.316.55POINT (-73.99146270751953 40.751136779785156)POINT (-73.9735336303711 40.789466857910156)dr5rudr72hPenn Station/Madison Sq West
2015-06-17 18:46:482015-06-17 19:11:1823.39-73.9754257202148440.755226135253906-73.9739913940429740.7916183471679717.510.5200.321.3POINT (-73.97542572021484 40.755226135253906)POINT (-73.97399139404297 40.79161834716797)dr5rudr72hMidtown Center
2016-03-27 18:48:322016-03-27 19:17:20411.3-73.8731307983398440.774169921875-73.9888610839843840.7775726318359433.500.57.955.540.347.79POINT (-73.87313079833984 40.774169921875)POINT (-73.98886108398438 40.77757263183594)dr5rydr5ruLaGuardia Airport
2015-02-09 16:01:302015-02-09 16:10:3221.09-73.9821853637695340.768333435058594-73.9714279174804740.7660903930664067.510.5100.310.3POINT (-73.98218536376953 40.768333435058594)POINT (-73.97142791748047 40.766090393066406)dr5rudr5ruLincoln Square East
2015-01-29 09:07:202015-01-29 09:31:4162.94-73.991188049316440.75001907348633-73.9595870971679740.7713584899902341600.54.200.321POINT (-73.9911880493164 40.75001907348633)POINT (-73.95958709716797 40.771358489990234)dr5rudr5rvPenn Station/Madison Sq West
2015-10-17 19:10:032015-10-17 19:20:5321.6-73.989723205566440.75254440307617-73.9777145385742240.76387023925781900.51.9500.311.75POINT (-73.9897232055664 40.75254440307617)POINT (-73.97771453857422 40.76387023925781)dr5rudr5ruGarment District
2015-01-28 14:55:222015-01-28 15:15:2562.12-73.9742736816406240.74709701538086-74.000587463378940.73900985717773413.500.5100.315.3POINT (-73.97427368164062 40.74709701538086)POINT (-74.0005874633789 40.739009857177734)dr5rudr5ruMurray Hill
2015-02-11 10:15:192015-02-11 10:32:4915.77-73.9811630249023440.74454116821289-73.9900970458984440.6951332092285161900.54.9500.324.75POINT (-73.98116302490234 40.74454116821289)POINT (-73.99009704589844 40.695133209228516)dr5rudr5rsMurray Hill
2015-10-16 17:35:442015-10-16 17:39:4110.7-73.9798889160156240.71788787841797-73.9777069091796940.72568130493164510.5000.36.8POINT (-73.97988891601562 40.71788787841797)POINT (-73.97770690917969 40.72568130493164)dr5rsdr5rsTwo Bridges/Seward Park
2016-03-26 17:40:002016-03-26 17:54:5622.6-73.9881134033203140.759586334228516-73.9618225097656240.7796707153320312.500.52.6500.315.95POINT (-73.98811340332031 40.759586334228516)POINT (-73.96182250976562 40.77967071533203)dr5rudr5ruClinton East
2015-07-24 01:43:072015-07-24 02:03:2514.6-74.0051956176757840.71916198730469-73.964576721191440.77293395996094180.50.5200.321.3POINT (-74.00519561767578 40.71916198730469)POINT (-73.9645767211914 40.77293395996094)dr5redr5ruTriBeCa/Civic Center
2016-03-28 14:11:052016-03-28 14:25:2118.7-73.8734283447265640.774078369140625-73.76831054687540.7248115539550824.500.5000.325.3POINT (-73.87342834472656 40.774078369140625)POINT (-73.768310546875 40.72481155395508)dr5rydr5x9LaGuardia Airport
2015-10-15 07:09:222015-10-15 07:12:4810.5-73.9770584106445340.755821228027344-73.9832611083984440.760421752929694.500.5000.35.3POINT (-73.97705841064453 40.755821228027344)POINT (-73.98326110839844 40.76042175292969)dr5rudr5ruMidtown Center
2015-10-16 13:29:412015-10-16 13:33:0730.29-73.9756698608398440.793853759765625-73.9731063842773440.79365539550781400.5000.34.8POINT (-73.97566986083984 40.793853759765625)POINT (-73.97310638427734 40.79365539550781)dr72hdr72hUpper West Side North
2015-02-09 17:51:032015-02-09 17:57:3811.13-73.9614944458007840.77125930786133-73.9752731323242240.765190124511726.510.51.6600.39.96POINT (-73.96149444580078 40.77125930786133)POINT (-73.97527313232422 40.76519012451172)dr5rudr5ruUpper East Side South
2016-03-26 23:25:552016-03-26 23:40:4112.7-73.9926376342773440.71865463256836-73.9965209960937540.74795913696289120.50.52.6500.315.95POINT (-73.99263763427734 40.71865463256836)POINT (-73.99652099609375 40.74795913696289)dr5rsdr5ruLower East Side
2015-06-17 05:37:192015-06-17 05:44:3912.85-73.9976425170898440.683692932128906-74.0125885009765640.70781326293945100.50.525.540.318.84POINT (-73.99764251708984 40.683692932128906)POINT (-74.01258850097656 40.70781326293945)dr5rkdr5reCobble Hill
2015-07-24 10:28:452015-07-24 10:38:2511.1-73.9920806884765640.74410629272461-73.979225158691440.749462127685557.500.52.0500.310.35POINT (-73.99208068847656 40.74410629272461)POINT (-73.9792251586914 40.74946212768555)dr5rudr5ruFlatiron
2015-06-17 09:16:112015-06-17 09:21:3910.86-73.9836349487304740.76962661743164-73.9818725585937540.7783241271972665.500.5000.36.3POINT (-73.98363494873047 40.76962661743164)POINT (-73.98187255859375 40.778324127197266)dr5rudr5ruLincoln Square East
2015-10-17 19:41:092015-10-17 19:57:4712-73.978172302246140.72955322265625-73.9855117797851640.7496910095214841200.5100.313.8POINT (-73.9781723022461 40.72955322265625)POINT (-73.98551177978516 40.749691009521484)dr5rsdr5ruStuy Town/Peter Cooper Village
2015-02-09 16:54:122015-02-09 17:08:5512.73-73.9940872192382840.751220703125-73.9786224365234440.783248901367191210.52.7600.316.56POINT (-73.99408721923828 40.751220703125)POINT (-73.97862243652344 40.78324890136719)dr5rudr72hPenn Station/Madison Sq West
2016-03-26 18:50:462016-03-26 19:05:0722.1-73.9889373779296940.721649169921875-73.9850692749023440.7448196411132811.500.52.4500.314.75POINT (-73.98893737792969 40.721649169921875)POINT (-73.98506927490234 40.74481964111328)dr5rsdr5ruLower East Side
2015-10-16 21:16:142015-10-16 21:32:5512.3-73.983787536621140.76040267944336-74.0039367675781240.73737335205078120.50.5000.313.3POINT (-73.9837875366211 40.76040267944336)POINT (-74.00393676757812 40.73737335205078)dr5rudr5rgTimes Sq/Theatre District

Showing the first 1000 rows.

Cache joined for further use in the notebook (still have the ~200M Points).

joined.cache.count
res13: Long = 211683669
display(
  joined
    .groupBy('neighborhood)
    .count()
    .orderBy(desc("count"))
)
Upper East Side SouthMidtown CenterUpper East Side NorthMidtown EastUnion SqEast VillagePenn Station/Madison Sq WestMurray HillTimes Sq/Theatre DistrictClinton EastLincoln Square EastMidtown NorthGramercyEast ChelseaMidtown SouthLaGuardia AirportUpper West Side SouthLenox Hill WestWest VillageOthers4%4%3%3%3%3%3%3%3%3%3%3%3%3%2%2%2%2%2%44%neighborhoodUpper East Side SouthUpper East Side SouthMidtown CenterMidtown CenterUpper East Side NorthUpper East Side NorthMidtown EastMidtown EastUnion SqUnion SqEast VillageEast VillagePenn Station/Madison Sq WestPenn Station/Madison Sq WestMurray HillMurray HillTimes Sq/Theatre DistrictTimes Sq/Theatre DistrictClinton EastClinton EastLincoln Square EastLincoln Square EastMidtown NorthMidtown NorthGramercyGramercyEast ChelseaEast ChelseaMidtown SouthMidtown SouthLaGuardia AirportLaGuardia AirportUpper West Side SouthUpper West Side SouthLenox Hill WestLenox Hill WestWest VillageWest VillageOthersOthers
%python

import folium
import pandas

neighborhoods = 'https://databricks-demo-bucket.s3-us-west-1.amazonaws.com/tlc/neighborhoods/neighborhoods.geojson.txt'
counts = 'https://databricks-demo-bucket.s3-us-west-1.amazonaws.com/tlc/neighborhoods/neighborhoodCountsFull.csv'
neighborhoodCounts = pandas.read_csv(counts)

# define custom bin sizes for a prettier map
bins = [0, 100, 100000, 1000000, 10000000, 37730974]

# create empty map zoomed in on NYC
m = folium.Map(location=[40.7594,-73.9549], zoom_start=12, width=1000, height=600)

folium.Choropleth(
    geo_data=neighborhoods,
    name='choropleth',
    data=neighborhoodCounts,
    columns=['neighborhood', 'count'],
    key_on='feature.properties.neighborhood',
    fill_color='YlOrRd',
    fill_opacity=0.5,
    line_opacity=0.8,
    bins=[float(x) for x in bins], # folium hack to address bug
    legend_name='Ride Count'
).add_to(m)
     
displayHTML(m._repr_html_())

7. What about spatiotemporal queries?

// convert raw string field to Timestamp
val temporal = joined.select(
  $"neighborhood",
  $"pickup_datetime",
  unix_timestamp($"pickup_datetime", "yyyy-MM-dd HH:mm:ss").cast(TimestampType).as("pickup_timestamp")
)

// parse out hour and month for each trip
val temporalAugmented = temporal.select(
  $"neighborhood",
  $"pickup_datetime",
  $"pickup_timestamp",
  month($"pickup_timestamp").as("pickup_month"),
  hour($"pickup_timestamp").as("pickup_hour")
)

// register temporary table to allow SQL queries
temporalAugmented.createOrReplaceTempView("temporalAugmented")
temporal: org.apache.spark.sql.DataFrame = [neighborhood: string, pickup_datetime: string ... 1 more field] temporalAugmented: org.apache.spark.sql.DataFrame = [neighborhood: string, pickup_datetime: string ... 3 more fields]
%sql

SELECT count(*), pickup_month
FROM temporalAugmented
WHERE neighborhood = "Midtown Center"
GROUP BY pickup_month
ORDER BY pickup_month ASC
0.00100k200k300k400k500k600k700k800k900k1.0M123456789101112TOOLTIPpickup_monthcount(1)
%sql

SELECT count(*), pickup_hour
FROM temporalAugmented
WHERE neighborhood = "Midtown Center"
GROUP BY pickup_hour
ORDER BY pickup_hour ASC
0.0050k100k150k200k250k300k350k400k450k500k550k01234567891011121314151617181920212223TOOLTIPpickup_hourcount(1)

8. Summary: Analyzing geospatial data at scale using Databricks

  • enables compute-heavy processing at massive scale
  • allows pipelining (easily move data from 1 tech to another)
  • notebooks & collaboration
  • dashboards & visualizations
  • elasticity of cloud
  • simple cluster management
  • advanced analytics (AI/ML use cases)