GeoJSON

GeoJSON is the acronym for Geographic JavaScript Object Notation.

Geographic JavaScript Object Notation

A format for encoding various geographic data structures using JSON (JavaScript Object Notation), a lightweight data-interchange format. GeoJSON extends JSON to include data about geographical features and their non-spatial attributes. Let’s explore some illustrative examples of GeoJSON data structures:

1. Point

  • Represents a single location on Earth.
{
    "type": "Feature",
    "geometry": {
        "type": "Point",
        "coordinates": [-86.13379, 39.7684] 
    },
    "properties": {
        "name": "Monument Circle, Indianapolis"
    }
}

2. MultiPoint

  • Represents a collection of points.
{
    "type": "Feature",
    "geometry": {
        "type": "MultiPoint",
        "coordinates": [
            [-86.13379, 39.7684],  // Monument Circle
            [-86.15804, 39.76638]   // Indiana Statehouse
        ]
    },
    "properties": {
        "name": "Landmarks in Indianapolis"
    }
}

3. LineString

  • Represents a sequence of connected points, forming a line or path.
{
    "type": "Feature",
    "geometry": {
        "type": "LineString",
        "coordinates": [
            [-86.16211, 39.77675],  // Start of the Cultural Trail
            [-86.15383, 39.77083],
            [-86.14528, 39.76389]   // End near Mass Ave
        ]
    },
    "properties": {
        "name": "Section of the Indianapolis Cultural Trail"
    }
}

4. Polygon

  • Represents an enclosed area, defined by a series of connected points that form a closed ring. The first and last points are the same, closing the shape.
{
    "type": "Feature",
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [-86.16404, 39.79518], 
                [-86.13256, 39.79518],
                [-86.13256, 39.76121],
                [-86.16404, 39.76121],
                [-86.16404, 39.79518]
            ]
        ]
    },
    "properties": {
        "name": "Approximate boundary of downtown Indianapolis"
    }
}

5. MultiPolygon

  • Represents a collection of polygons, potentially with holes or multiple disconnected areas.
{
    "type": "Feature",
    "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
            [
                [ 
                    [-86.2, 39.8], 
                    [-86.1, 39.8],
                    [-86.1, 39.7],
                    [-86.2, 39.7],
                    [-86.2, 39.8]
                ]
            ],
            [
                [
                    [-86.3, 39.9], 
                    [-86.2, 39.9],
                    [-86.2, 39.8],
                    [-86.3, 39.8],
                    [-86.3, 39.9]
                ]
            ]
        ]
    },
    "properties": {
        "name": "Two separate areas near Indianapolis"
    }
}

Key Points:

  • coordinates: An array representing the geographic coordinates (longitude, latitude) of the feature.
  • properties: An optional object containing additional information about the feature, such as its name or other attributes.

This format is widely used in web mapping and geographic information systems (GIS) due to its simplicity, ease of use, and compatibility with web technologies.

Back to top button
Close

Adblock Detected

We rely on ads and sponsorships to keep Martech Zone free. Please consider disabling your ad blocker—or support us with an affordable, ad-free annual membership ($10 US):

Sign Up For An Annual Membership