Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

Geographic information for an event describes where the event is located and the geographic area impacted. This page introduces geographic information available in events:

Field
Description

geo.geography

Geo data in GeoJSON format for the area impacted by the event.

place_hierarchies and scope

Place where the event is located.

Events also have the formatted_address field for venue entities with the street address of an event where it is present.

The location field is deprecated. Use the geo field for geographic information.

Points and areas

Latitude and longitude coordinates represent a point event's location. An example is this MLB game located at 37.77859,-122.38926.

Area events impact a geographic area such as a region, or an entire country. For example, Christmas Day in the United Kingdom, is a country-wide public holiday.

A polygon can represent area events. The example image shows this flood warning for several rivers in Mississippi, USA.

Map showing a polygon that outlines the area covered by a flood warning for several rivers in Mississippi, USA

Our APIs offer spatial search parameters to discover all events that impact your locations of interest.

Basic location

The geo field in the Events API response contains the longitude and latitude for point events. The following is an example of the location information for point events in the geo field. For a point type geometry object the coordinates are in the order longitude, latitude (as this follows the geojson standard). Here is an example:

In the geo.geometry field we follow the GeoJSON standard which orders coordinates as longitude followed by latitude (i.e., [longitude, latitude]).

For a point event, its location coordinates are where the event occurs. This may be the location of a venue. For example, a San Francisco Giants MLB game at Oracle Park has a latitude and longitude of -122.38926979999997, 37.7785951, which corresponds to the address of Oracle Park, 24 Willie Mays Plaza.

For an area event that does not have a polygon, its coordinates are the center of the area where the event occurs.

Area events cover either a Geonames Place, for example Thanksgiving Day, or a specific geographic area bounded by a geometry (polygon). The next section details geometries and polygons, additional geometric data available in the geo field for area events. See GeoJSON for more information.

Location field (deprecated)

The location field was previously used for latitude and longitude information. The location field's value contains coordinates in GeoJSON order: [longitude, latitude]. Note the geo field is preferred over the location field because the location field is deprecated.

Address data in the geo field

The geo field also contains address information. The address subfield within the geo field can contain the following information:

  • country_code (required) - two-letter country code

  • formatted_address (optional) - a fully formatted address which can include street address, locality, postcode, region, and country

  • postcode (optional)

  • locality (optional) - indicates the city or town the event occurs in

  • region (optional) - the region or state at which the event takes place

For attended events when they are linked to a venue entity then the address information corresponds to the address of the venue.

Events that cover a larger area (for example non-attended events like holidays) tend to have less address information. For example, a country-wide holiday may only have the country code field in the address field.

This later example shows the address subfield within the geo field:

GeoJSON

The geo field contains geometry information about an event's location in GeoJSON format. Point events have a Point-type geometry, with the coordinates of the event's location (same as the location field). Area events may have Polygon or MultiPolygon-type geometries representing the specific area impacted by the event.

Where an area event has a Point-type geometry, it means the event applies to the Geonames Place of the event. The following response shows an event with a Polygon geometry:

The example event snippet is a flood warning in Missouri. The GeoJSON data in the geo.geometry field can be plotted using tools that accept GeoJSON such as geojson.io. All our events with a Polygon or MultiPolygon display the geometry's shape when viewed in our WebApp or our Public Event page. The following image plots the flood warning event's geometry.

Plot of the flood warning event's polygon geometry on a map

The following image shows an example of an event with a MultiPolygon geometry; you can see it has two polygons for one event.

Map showing an event with a MultiPolygon geometry made up of two separate polygons

We provide examples and code snippets to plot polygons in a Jupyter notebook in our Severe-Weather Events Data Exploration notebook.

Simplified polygons

Our raw polygon sources can have extremely detailed geometries which result in large GeoJSON filesizes. Polygons of this nature aren't practical to use for individual events either in the PredictHQ API or a customer's data lake. The complexity of such polygons often result from capturing geographic features that aren't relevant for practical use cases in determining the impact of an event (for example small bodies of water, or small unpopulated islands off a coast).

For this reason, we may pre-process polygons to simplify them to reduce the number of points. This results in smoothing out the shape while retaining the key boundaries of the geographic area of impact.

In the example images, the first polygon is part of a raw polygon before simplification; the second is after simplification. The original GeoJSON data contained about 18000 coordinate points (the JSON data for this alone is around 700kb) to accurately outline individual offshore land masses.

Map of a Maine county showing the detailed raw polygon outline, including offshore land masses, before simplification
Raw polygon before simplification
Map of a Maine county showing the smoothed polygon outline after simplification, with the key boundaries retained
Polygon after simplification

Last updated

Was this helpful?