Skip to content

Instantly share code, notes, and snippets.

@kelsey-sorrels
Created October 23, 2012 14:34
Show Gist options
  • Save kelsey-sorrels/3939096 to your computer and use it in GitHub Desktop.
Save kelsey-sorrels/3939096 to your computer and use it in GitHub Desktop.
rSimulate GeoJSON Draft

Purpose

To define a common data language for applications that simulate entire worlds. When many applications speak the same language, an ecosystem develops that is often more than the sum of its parts.

General

  • All data is UTF-8 encoded.
  • MIME type is application/json

Objects

There shall be a single top-level GeoJSON FeatureCollection object.

Properties

name String: The name of the project

authors List of String. The names of the authors that contributed to the project.

version String: The version of the data exchange format.

    {
        "type": "FeatureCollection",
        "features": [ ... ],
        "properties": {
            "name": "project-name",
            "authors": [
                "me",
                "someone else"
            ],
            "version": "0.1",
        }
    }

Features

Elevation, Water, AtmosphericMoisture, SoilMoisture, and Snow are MultiPolygon features. Migrant, and Settlement are Point features. Feature meta-types are specified as a string value to the type key in the feature's property object.

Elevation

Elevation geometry is specified in [longitude, latitude, r] order. Longitude and latitude are specified in degrees. R is specified in meters.

    {
        "type": "Feature",
        "geometry": {
            "type": "MultiPolygon",
            "coordinates": [
                [
                    [100, 0.002, 10000],
                    [ 102.1, 1, 1000]
                ],
                [
                    [102, 0.002, 10000],
                    [104.1, 1, 1000]
                ]
            ]
        },
        "properties": {
            "type": "Elevation"
         }
    }

Water

Water geometry is specified in [longitude, latitude, depth] order. Longitude and latitude are specified in degrees. Depth is specified in meters of water.

    {
        "type": "Feature",
        "geometry": {
            "type": "MultiPolygon",
            "coordinates": [
                [
                    [100, 0.002, 10000],
                    [ 102.1, 1, 1000]
                ],
                [
                    [102, 0.002, 10000],
                    [104.1, 1, 1000]
                ]
            ]
        },
        "properties": {
            "type": "Water"
         }
    }

AtmosphericMoisture

Atmospheric moisture geometry is specified in [longitude, latitude, density] order. Longitude and latitude are specified in degrees. Density is specified in grams of water vapor per cubic meter.

    {
        "type": "Feature",
        "geometry": {
            "type": "MultiPolygon",
            "coordinates": [
                [
                    [100, 0.002, 10000],
                    [ 102.1, 1, 1000]
                ],
                [
                    [102, 0.002, 10000],
                    [104.1, 1, 1000]
                ]
            ]
        },
        "properties": {
            "type": "AtmosphericMoisture"
         }
    }

SoilMoisture

Soil moisture geometry is specified in [longitude, latitude, density] order. Longitude and latitude are specified in degrees. Density is specified in grams of water per cubic meter.

    {
        "type": "Feature",
        "geometry": {
            "type": "MultiPolygon",
            "coordinates": [
                [
                    [100, 0.002, 10000],
                    [ 102.1, 1, 1000]
                ],
                [
                    [102, 0.002, 10000],
                    [104.1, 1, 1000]
                ]
            ]
        },
        "properties": {
            "type": "SoilMoisture"
         }
    }

Snow

Snow geometry is specified in [longitude, latitude, depth] order. Longitude and latitude are specified in degrees. Depth is specified in meters of water if the snow was to be melted into water.

    {
        "type": "Feature",
        "geometry": {
            "type": "MultiPolygon",
            "coordinates": [
                [
                    [100, 0.002, 10000],
                    [ 102.1, 1, 1000]
                ],
                [
                    [102, 0.002, 10000],
                    [104.1, 1, 1000]
                ]
            ]
        },
        "properties": {
            "type": "Snow"
         }
    }

Migrant

Migrant geometry is in [longitude, latitude] order. Longitude and latitude are specified in degrees. A migrant's r value can be inferred by elevation.

    {
        "type": "Feature",
        "geometry": {
            "type": "Point",
            "coordinates": [100, 0.002, 10000]
        },
        "properties": {
            "type": "Migrant",
            "culture": {
                "name": "..."
            }
        }
    }

Settlement

Settlement geometry is in [longitude, latitude] order. Longitude and latitude are specified in degrees. A settlement's r value can be inferred by elevation.

Settlements must have an addition property named population. It is an integer value.

    {
        "type": "Feature",
        "geometry": {
            "type": "Point",
            "coordinates": [100, 0.002, 10000]
        },
        "properties": {
            "type": "Settlement",
            "population": 1353,
            "culture": {
                "name": "..."
            }
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment