Professional Documents
Culture Documents
Spatial Analysis of New York City
Spatial Analysis of New York City
Course
Institution Affiliation
Instructor
Date
DATA SOURCE :
The OpenStreetMap (OSM) dataset is a collaborative project to create a free and open-source
map of the world. The dataset contains geospatial data about various features such as roads,
buildings, points of interest, land use, and natural features. The OSM dataset is maintained by a
large and diverse community of contributors worldwide, who use various techniques to collect
The data in OSM is stored in a database, which is organized into nodes, ways, and relations. A
node is a single point in space with a latitude and longitude coordinate, representing a feature
such as a building entrance or a street lamp. A way is a series of connected nodes representing a
linear feature such as a road or a river. A relation is a collection of nodes, ways, and other
York City
The objective here is to retrieve the location data for all schools with a name value present in the
New York City area. Converting the raw geometric data into human-readable representations
facilitates easier manual review and interpretation without needing GIS software.
FROM planet_osm_point
ST_AsText(way) applies the Spatial Text function to the way column which contains the
geographic point coordinates. This converts them into a well-formatted string representation
Renaming name to school_name makes the output column label more descriptive.
FROM planet_osm_point:
Filters restrict outputs to only point features classified as amenities of type 'school' with a name
The retrieved location data for schools in the New York City area, presented in human-readable
format, reveals key details about various educational institutions. Notable entries include Apple
Montessori School, Plaza Child Care School, Peppermint Tree Child Care Center School, Sacred
Heart Elementary School, Saint Mary Elementary School, and Cardinal McCarrick High School.
The spatial coordinates, provided in the POINT(x y) format, accurately depict the geographic
positions of each school. The amenity type 'school' categorizes these locations, offering valuable
insights into the distribution of educational facilities. Stakeholders, including educators, parents,
and city planners, can leverage this information to assess the accessibility and geographic
infrastructure.
Query 2: Decoding New York City's Post Offices: Utilizing Spatial Functions for
Location Analysis
The goal of this query is to extract the geographic locations of all post office amenities with a
name value in the New York City region from the planet_osm_point database. Applying the
ST_AsText spatial function converts the raw coordinate data into human-interpretable text
FROM planet_osm_point
ST_AsText(way): Translates the way column containing geographic point coordinates into Well-
Known Text (WKT) format strings e.g. POINT(-74 40). This makes the raw coordinates
understandable.
name AS postoffice_name: Renames the name column to the more descriptive label
amenity: Retains the classification amenity tag marking these map features as post offices.
FROM planet_osm_point
Specifies planet_osm_point table as the data source. This contains point geometries representing
Filters dataset to only points categorized as amenities of type 'post_office' which have a name
value present (non-null). Ensures only named post offices are selected.
Results Analysis:
The output presented the geographic coordinates and details of various post offices in the New
York City region. Notable entries include FedEx Customer Center, FedEx Office, United States
Post Office, Carteret Post Office, The UPS Store, and Clark Post Office. The spatial coordinates,
provided in the POINT(x y) format, accurately represent the locations of each post office. The
amenity type 'post_office' categorizes these locations, offering insights into the distribution of
postal services in the specified area. This dataset, with multiple rows, provides foundational
information for understanding the spatial layout of post offices. Stakeholders, including postal
service administrators, urban planners, and logistics professionals, can leverage this information
to assess accessibility, plan efficient service routes, and gain a nuanced understanding of the
postal infrastructure landscape in New York City. The spatial context enhances the usability of
the data, allowing for informed decision-making and strategic planning related to postal services.
Query 3:Navigating New York City: Analyzing the Distance Between Avatar Studios
Objective
The goal is to find the real-world distance in meters between Avatar Studios and Times Square
station in New York City. This will tell us how many meters someone would need to walk in a
SELECT
ST_DistanceSphere(
ST_SetSRID(
ST_MakePoint(
(SELECT ST_X(ST_Transform(way, 4326)) FROM planet_osm_point WHERE name
= 'Avatar Studios'),
= 'Avatar Studios')
),
4326
),
ST_SetSRID(
ST_MakePoint(
),
4326
) AS distance_in_meters;
ST_X and ST_Y transform Avatar Studio's internal stored geometric data into readable latitude-
Does the same coordinate transformations for the Times Square subway station entry point. The
filters ensure we only select the station point not other Times Square POIs.
ST_MakePoint uses the extracted real-world coordinates to create clean spatial point
ST_SetSRID sets the proper geographic coordinate system to longitude/latitude so the points
Calculating distance:
ST_DistanceSphere takes the two constructed point objects and calculates the geodesic meters
between them on the spheroid surface, giving us the real straight line distance someone would
walk.
Result Analysis
The query effectively calculates the distance between two pivotal locations in New York City,
Avatar Studios and the Times Square subway station, leveraging the ST_DistanceSphere
function to determine the great-circle distance in meters. The output presents this calculated
distance alongside the names of the locations, offering valuable spatial insights for various
applications.
This information is particularly useful for logistical planning, enabling optimization of routes
and efficient allocation of resources. For urban navigation, individuals can leverage the
computed distance to plan their journeys effectively, considering the spatial separation between
these significant landmarks. Additionally, from a broader geographic perspective, the data
contributes to a nuanced understanding of the city's layout and the relationships between key
locations.