├── README.md
├── _config.yml
├── _layouts
├── default.html
├── home.html
├── nav.html
└── post.html
├── css
├── main.css
└── syntax.css
├── draft-gillies-geojson-events.md
├── index.md
└── js
└── nav.js
/README.md:
--------------------------------------------------------------------------------
1 | # Instants and Intervals for event-like GeoJSON features
2 |
3 | Extends [RFC 7649](https://tools.ietf.org/html/rfc7946) GeoJSON with
4 | instants and intervals of time
5 |
6 | Documentation and draft: [https://sgillies.github.io/geojson-events](https://sgillies.github.io/geojson-events)
7 |
8 | ## In a nutshell
9 |
10 | - Defines a "when" member analogous to GeoJSON's existing "geometry".
11 | - Defines two types of temporal objects: "Instant" and "Interval".
12 | - Values of these objects are ISO-8601 or RFC 3339 date/time strings.
13 |
14 | The "when" object describes the temporal extent of a feature in the same sense
15 | that a GeoJSON "geometry" object describes its spatial extent. A common
16 | representation of time allows us to more readily mix GeoJSON from different
17 | sources in spatio-temporal visualizations.
18 |
19 | ## Hypothetical examples
20 |
21 | ### Instantaneous event-like feature
22 |
23 | For a thing that exists at a certain time.
24 |
25 | ```json
26 | {
27 | "geometry": {
28 | "coordinates": [
29 | 0.0,
30 | 0.0
31 | ],
32 | "type": "Point"
33 | },
34 | "id": "1",
35 | "properties": {"foo": "bar"},
36 | "type": "Feature",
37 | "when": {
38 | "start": "2014-04-24",
39 | "type": "Instant"
40 | }
41 | }
42 | ```
43 |
44 | ### Non-instaneous event-like feature
45 |
46 | For a thing that exists during a certain interval.
47 |
48 | ```json
49 | {
50 | "geometry": {
51 | "coordinates": [
52 | 0.0,
53 | 0.0
54 | ],
55 | "type": "Point"
56 | },
57 | "id": "1",
58 | "properties": {"foo": "bar"},
59 | "type": "Feature",
60 | "when": {
61 | "start": "2014-04-24",
62 | "end": "2014-04-25",
63 | "type": "Interval"
64 | }
65 | }
66 | ```
67 |
68 | ### Open-ended event-like feature
69 |
70 | For a thing that exists *since* a certain time.
71 |
72 | ```json
73 | {
74 | "geometry": {
75 | "coordinates": [
76 | 0.0,
77 | 0.0
78 | ],
79 | "type": "Point"
80 | },
81 | "id": "1",
82 | "properties": {"foo": "bar"},
83 | "type": "Feature",
84 | "when": {
85 | "type": "Interval",
86 | "start": "2014-04-24"
87 | }
88 | }
89 | ```
90 |
91 | ## Real world example
92 |
93 | The USGS publishes [GeoJSON feeds of recent earthquake
94 | data](http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php). These
95 | feeds record the time of earthquake events in a manner unique to these feeds
96 | (milliseconds since the epoch). Below is an example of the [Past 7 Days
97 | Significant
98 | Earthquakes](http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.geojson),
99 | retrieved 2016-08-14, converted to use geojson-events instants.
100 |
101 | ```json
102 | {
103 | "type": "FeatureCollection",
104 | "features": [
105 | {
106 | "geometry": {
107 | "type": "Point",
108 | "coordinates": [
109 | 173.1114,
110 | -22.4953,
111 | 9.95
112 | ]
113 | },
114 | "when": {
115 | "type": "Instant",
116 | "start": "2016-08-12T01:26:35.140000+00:00"
117 | },
118 | "type": "Feature",
119 | "properties": {
120 | "rms": 0.94,
121 | "code": "10006d5h",
122 | "cdi": 6.2,
123 | "sources": ",pt,at,us,gcmt,",
124 | "nst": null,
125 | "tz": 720,
126 | "title": "M 7.2 - 109km E of Ile Hunter, New Caledonia",
127 | "magType": "mww",
128 | "detail": "http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us10006d5h.geojson",
129 | "sig": 799,
130 | "net": "us",
131 | "type": "earthquake",
132 | "status": "reviewed",
133 | "updated": 1471043352566,
134 | "felt": 2,
135 | "alert": "green",
136 | "dmin": 4.822,
137 | "mag": 7.2,
138 | "gap": 21,
139 | "types": ",cap,dyfi,finite-fault,general-link,general-text,geoserve,impact-link,losspager,moment-tensor,origin,phase-data,poster,shakemap,",
140 | "url": "http://earthquake.usgs.gov/earthquakes/eventpage/us10006d5h",
141 | "ids": ",pt16225050,at00obrw0f,us10006d5h,gcmt20160812012635,",
142 | "tsunami": 1,
143 | "place": "109km E of Ile Hunter, New Caledonia",
144 | "time": 1470965195140,
145 | "mmi": 0
146 | },
147 | "id": "us10006d5h"
148 | },
149 | {
150 | "geometry": {
151 | "type": "Point",
152 | "coordinates": [
153 | -122.8018333,
154 | 39.3293333,
155 | 14.45
156 | ]
157 | },
158 | "when": {
159 | "type": "Instant",
160 | "start": "2016-08-10T02:57:17.510000+00:00"
161 | },
162 | "type": "Feature",
163 | "properties": {
164 | "rms": 0.15,
165 | "code": "72672610",
166 | "cdi": 5,
167 | "sources": ",at,nc,us,",
168 | "nst": 120,
169 | "tz": -420,
170 | "title": "M 5.1 - 19km NNE of Upper Lake, California",
171 | "magType": "mw",
172 | "detail": "http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/nc72672610.geojson",
173 | "sig": 899,
174 | "net": "nc",
175 | "type": "earthquake",
176 | "status": "reviewed",
177 | "updated": 1471176057699,
178 | "felt": 1062,
179 | "alert": "green",
180 | "dmin": 0.155,
181 | "mag": 5.09,
182 | "gap": 32,
183 | "types": ",cap,dyfi,focal-mechanism,general-link,geoserve,impact-link,losspager,moment-tensor,nearby-cities,origin,phase-data,scitech-link,shakemap,",
184 | "url": "http://earthquake.usgs.gov/earthquakes/eventpage/nc72672610",
185 | "ids": ",at00oboavh,nc72672610,us10006chu,",
186 | "tsunami": 1,
187 | "place": "19km NNE of Upper Lake, California",
188 | "time": 1470797837510,
189 | "mmi": 3.74
190 | },
191 | "id": "nc72672610"
192 | }
193 | ],
194 | "metadata": {
195 | "status": 200,
196 | "count": 2,
197 | "title": "USGS Significant Earthquakes, Past Week",
198 | "url": "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.geojson",
199 | "generated": 1471184780000,
200 | "api": "1.5.2"
201 | }
202 | }
203 | ```
204 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | name: Your New Jekyll Site
2 | markdown: redcarpet
3 | pygments: true
4 |
--------------------------------------------------------------------------------
/_layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ page.title }}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
20 | {% if page.shownav %}
21 |
22 |
23 | {% endif %}
24 |
25 |
26 |
--------------------------------------------------------------------------------
/_layouts/home.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 | {{ content }}
6 |
7 |
--------------------------------------------------------------------------------
/_layouts/nav.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | shownav: 1
4 | ---
5 |
6 | {{ content }}
7 |
8 |
--------------------------------------------------------------------------------
/_layouts/post.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 | {{ page.title }}
5 | {{ page.date | date_to_string }}
6 |
7 |
8 | {{ content }}
9 |
10 |
--------------------------------------------------------------------------------
/css/main.css:
--------------------------------------------------------------------------------
1 | /**
2 | * GeoJSON
3 | *
4 | * Color Scheme
5 | *
6 | * http://colorschemedesigner.com/#3x61Tw0w0w0w0
7 | *
8 | * @author Tim "tschaub" Schaub
9 | * @author David "oodavid" King
10 | */
11 |
12 | /* Use a better box model - http://www.paulirish.com/2012/box-sizing-border-box-ftw/ */
13 | * { box-sizing: border-box; }
14 |
15 | /* Basic Elements */
16 | body {
17 | font-family: "Open Sans", Arial, sans-serif;
18 | font-size: 115%;
19 | margin: 1em 2em 2em;
20 | color: #34495E;
21 | }
22 | h1 {
23 | text-align: center;
24 | font-weight: 800;
25 | color: #0B61A4;
26 | }
27 | a {
28 | text-decoration: none;
29 | color: #00AF64;
30 | }
31 | a:hover {
32 | color: #007241;
33 | }
34 |
35 | /* Splash page - centered column */
36 | .splash {
37 | width: 80%;
38 | min-width: 450px;
39 | margin: 0 auto;
40 | }
41 | .splash h1 {
42 | font-size: 3em;
43 | text-transform: uppercase;
44 | margin-bottom: 0;
45 | }
46 |
47 | /* Syntax Highlighting - see ./syntax.css */
48 | .highlight pre {
49 | font-size: 95%;
50 | padding: 0.8em;
51 | border: 1px solid #ddd;
52 | border-radius: 5px;
53 | background: #eee;
54 | }
55 |
56 | /**
57 | * Spec style
58 | */
59 | table.docinfo {
60 | font-size: 95%;
61 | }
62 | table.docinfo th {
63 | text-align: right;
64 | vertical-align: top;
65 | padding-right: 1em;
66 | }
67 |
68 | /** Other */
69 | .splash h1 span.fkin {
70 | font-size: 1.2em;
71 | }
72 |
73 | /* Nav Highlighting */
74 | #nav {width: 300px; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: scroll; overflow-x: hidden;}
75 | #content {padding: 0 0 0 300px;}
76 | /* Nav Styling */
77 | #nav {background-color: #EEEEEE; border: 5px solid #EEEEEE;}
78 | #nav .first {color: #A65f00;}
79 | #nav .active {color: #FF9200;}
80 | #nav ul {margin: 0; padding: 0 0 0 20px;}
81 | #nav ul li {margin: 0; padding: 0;}
82 | /* Markdown Fixes */
83 | #nav p {display: none;} /* Output by extraneous newlines... */
84 |
85 | /* Minimalist scrollbars in webkit */
86 | ::-webkit-scrollbar {width: 12px;}
87 | ::-webkit-scrollbar-track {border-radius: 10px; -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);}
88 | ::-webkit-scrollbar-thumb {border-radius: 10px; background: #AAAAAA; -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.6);}
89 | ::-webkit-scrollbar-corner {display: none;}
90 |
--------------------------------------------------------------------------------
/css/syntax.css:
--------------------------------------------------------------------------------
1 | .highlight { background: #ffffff; }
2 | .highlight .c { color: #999988; font-style: italic } /* Comment */
3 | .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
4 | .highlight .k { font-weight: bold } /* Keyword */
5 | .highlight .o { font-weight: bold } /* Operator */
6 | .highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
7 | .highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
8 | .highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
9 | .highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
10 | .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
11 | .highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
12 | .highlight .ge { font-style: italic } /* Generic.Emph */
13 | .highlight .gr { color: #aa0000 } /* Generic.Error */
14 | .highlight .gh { color: #999999 } /* Generic.Heading */
15 | .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
16 | .highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
17 | .highlight .go { color: #888888 } /* Generic.Output */
18 | .highlight .gp { color: #555555 } /* Generic.Prompt */
19 | .highlight .gs { font-weight: bold } /* Generic.Strong */
20 | .highlight .gu { color: #aaaaaa } /* Generic.Subheading */
21 | .highlight .gt { color: #aa0000 } /* Generic.Traceback */
22 | .highlight .kc { font-weight: bold } /* Keyword.Constant */
23 | .highlight .kd { font-weight: bold } /* Keyword.Declaration */
24 | .highlight .kp { font-weight: bold } /* Keyword.Pseudo */
25 | .highlight .kr { font-weight: bold } /* Keyword.Reserved */
26 | .highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
27 | .highlight .m { color: #25567B } /* Literal.Number */
28 | .highlight .s { color: #BF8230 } /* Literal.String */
29 | .highlight .na { color: #008080 } /* Name.Attribute */
30 | .highlight .nb { color: #0086B3 } /* Name.Builtin */
31 | .highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
32 | .highlight .no { color: #008080 } /* Name.Constant */
33 | .highlight .ni { color: #800080 } /* Name.Entity */
34 | .highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
35 | .highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
36 | .highlight .nn { color: #555555 } /* Name.Namespace */
37 | .highlight .nt { color: #000080 } /* Name.Tag */
38 | .highlight .nv { color: #008080 } /* Name.Variable */
39 | .highlight .ow { font-weight: bold } /* Operator.Word */
40 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */
41 | .highlight .mf { color: #25567B } /* Literal.Number.Float */
42 | .highlight .mh { color: #25567B } /* Literal.Number.Hex */
43 | .highlight .mi { color: #25567B } /* Literal.Number.Integer */
44 | .highlight .mo { color: #25567B } /* Literal.Number.Oct */
45 | .highlight .sb { color: #BF8230 } /* Literal.String.Backtick */
46 | .highlight .sc { color: #BF8230 } /* Literal.String.Char */
47 | .highlight .sd { color: #BF8230 } /* Literal.String.Doc */
48 | .highlight .s2 { color: #BF8230 } /* Literal.String.Double */
49 | .highlight .se { color: #BF8230 } /* Literal.String.Escape */
50 | .highlight .sh { color: #BF8230 } /* Literal.String.Heredoc */
51 | .highlight .si { color: #BF8230 } /* Literal.String.Interpol */
52 | .highlight .sx { color: #BF8230 } /* Literal.String.Other */
53 | .highlight .sr { color: #009926 } /* Literal.String.Regex */
54 | .highlight .s1 { color: #BF8230 } /* Literal.String.Single */
55 | .highlight .ss { color: #990073 } /* Literal.String.Symbol */
56 | .highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
57 | .highlight .vc { color: #008080 } /* Name.Variable.Class */
58 | .highlight .vg { color: #008080 } /* Name.Variable.Global */
59 | .highlight .vi { color: #008080 } /* Name.Variable.Instance */
60 | .highlight .il { color: #25567B } /* Literal.Number.Integer.Long */
61 |
--------------------------------------------------------------------------------
/draft-gillies-geojson-events.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: home
3 | title: draft-gillies-geojson-events
4 | ---
5 |
6 | draft-gillies-geojson-events
7 | ============================
8 |
9 | **Revision**: 01
10 |
11 | **Date**: 2017-01-07
12 |
13 | ## Abstract
14 |
15 | Extends [RFC 7649](https://tools.ietf.org/html/rfc7946) GeoJSON with
16 | instants and intervals of time to allow standard descriptions of event-like
17 | Features.
18 |
19 | ## Status of this memo
20 |
21 | This is an independently authored draft.
22 |
23 | ## Copyright notice
24 |
25 | This work is licensed under a [Creative Commons Attribution 4.0 International
26 | License](http://creativecommons.org/licenses/by/4.0/).
27 |
28 | ## Introduction
29 |
30 | This document defines an extension object for GeoJSON named "when" that is
31 | analogous to GeoJSON's existing "geometry" object. The "when" object describes
32 | the temporal extent of a feature in the same sense that a GeoJSON "geometry"
33 | object describes its spatial extent. A common representation of time allows us
34 | to more readily mix GeoJSON from different sources in spatio-temporal
35 | visualizations.
36 |
37 | ### Requirements Language
38 |
39 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
40 | "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this
41 | document are to be interpreted as described in [RFC2119].
42 |
43 | ### Examples
44 |
45 | The "when" object for an instantaneous feature has type "Instant" and a
46 | "start" member.
47 |
48 | ```json
49 | {
50 | "geometry": {
51 | "coordinates": [
52 | 0.0,
53 | 0.0
54 | ],
55 | "type": "Point"
56 | },
57 | "id": "1",
58 | "properties": {"foo": "bar"},
59 | "type": "Feature",
60 | "when": {
61 | "start": "2014-04-24",
62 | "type": "Instant"
63 | }
64 | }
65 | ```
66 |
67 | The "when" object for a feature of finite duration has type "Interval" and
68 | "start" and "end" members.
69 |
70 | ```json
71 | {
72 | "geometry": {
73 | "coordinates": [
74 | 0.0,
75 | 0.0
76 | ],
77 | "type": "Point"
78 | },
79 | "id": "1",
80 | "properties": {"foo": "bar"},
81 | "type": "Feature",
82 | "when": {
83 | "start": "2014-04-24",
84 | "end": "2014-04-25",
85 | "type": "Interval"
86 | }
87 | }
88 | ```
89 |
90 | ## Specification
91 |
92 | ### Instants
93 |
94 | An instant is an object with a "start" member, the value of which is a [RFC
95 | 3339](https://tools.ietf.org/html/rfc3339) date/time string, and a "type" of
96 | "Instant". An instant does not have a "end" member.
97 |
98 | ### Intervals
99 |
100 | An interval is an object with either or both "start" and "end" members and
101 | a "type" of "Interval". Open-ended intervals (cosmological theories aside) can
102 | be represented by omitting either the "start" or the "end". An interval MUST
103 | NOT have more than one "start" member or more than one "end" member. As with
104 | instants, the values of "start" and "end" are [RFC
105 | 3339](https://tools.ietf.org/html/rfc3339) date/time strings. The "start" and
106 | "end" values are on the boundary of, but not within, the interval they define.
107 | In other words: two intervals are adjacent, but do not overlap, if the end
108 | of one and the start of the other coincide.
109 |
110 | ### "when"
111 |
112 | The value of "when" is either an instant or an interval. A GeoJSON feature
113 | has no more than one "when" object. What "when" means in the context of a
114 | GeoJSON geometry or feature collection object is not defined.
115 |
116 | ## Security Considerations
117 |
118 | This draft adds a new dimension, time, to the security considerations of
119 | [RFC 7946, Section 10](https://tools.ietf.org/html/rfc7946#section-10). Adding
120 | temporal information, even fuzzy, to spatial data is likely to increase its
121 | susceptibility to de-anonymization attack.
122 |
123 | ## IANA Considerations
124 |
125 | None.
126 |
127 | ## References
128 |
129 | * [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement
130 | Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997,
131 | .
132 | * [RFC3319]
133 | * [RFC7946]
134 |
135 | ## Acknowledgements
136 |
137 | TODO
138 |
139 | ## Author Address
140 |
141 | Sean Gillies , Mapbox
142 |
143 | ## Appendix: real world example
144 |
145 | The USGS publishes [GeoJSON feeds of recent earthquake
146 | data](http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php). These
147 | feeds record the time of earthquake events in a manner unique to these feeds
148 | (milliseconds since the epoch). Below is an example of the [Past 7 Days
149 | Significant
150 | Earthquakes](http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.geojson),
151 | retrieved 2016-08-14, converted to use geojson-events instants.
152 |
153 | ```json
154 | {
155 | "type": "FeatureCollection",
156 | "features": [
157 | {
158 | "geometry": {
159 | "type": "Point",
160 | "coordinates": [
161 | 173.1114,
162 | -22.4953,
163 | 9.95
164 | ]
165 | },
166 | "when": {
167 | "type": "Instant",
168 | "start": "2016-08-12T01:26:35.140000+00:00"
169 | },
170 | "type": "Feature",
171 | "properties": {
172 | "rms": 0.94,
173 | "code": "10006d5h",
174 | "cdi": 6.2,
175 | "sources": ",pt,at,us,gcmt,",
176 | "nst": null,
177 | "tz": 720,
178 | "title": "M 7.2 - 109km E of Ile Hunter, New Caledonia",
179 | "magType": "mww",
180 | "detail": "http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us10006d5h.geojson",
181 | "sig": 799,
182 | "net": "us",
183 | "type": "earthquake",
184 | "status": "reviewed",
185 | "updated": 1471043352566,
186 | "felt": 2,
187 | "alert": "green",
188 | "dmin": 4.822,
189 | "mag": 7.2,
190 | "gap": 21,
191 | "types": ",cap,dyfi,finite-fault,general-link,general-text,geoserve,impact-link,losspager,moment-tensor,origin,phase-data,poster,shakemap,",
192 | "url": "http://earthquake.usgs.gov/earthquakes/eventpage/us10006d5h",
193 | "ids": ",pt16225050,at00obrw0f,us10006d5h,gcmt20160812012635,",
194 | "tsunami": 1,
195 | "place": "109km E of Ile Hunter, New Caledonia",
196 | "time": 1470965195140,
197 | "mmi": 0
198 | },
199 | "id": "us10006d5h"
200 | },
201 | {
202 | "geometry": {
203 | "type": "Point",
204 | "coordinates": [
205 | -122.8018333,
206 | 39.3293333,
207 | 14.45
208 | ]
209 | },
210 | "when": {
211 | "type": "Instant",
212 | "start": "2016-08-10T02:57:17.510000+00:00"
213 | },
214 | "type": "Feature",
215 | "properties": {
216 | "rms": 0.15,
217 | "code": "72672610",
218 | "cdi": 5,
219 | "sources": ",at,nc,us,",
220 | "nst": 120,
221 | "tz": -420,
222 | "title": "M 5.1 - 19km NNE of Upper Lake, California",
223 | "magType": "mw",
224 | "detail": "http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/nc72672610.geojson",
225 | "sig": 899,
226 | "net": "nc",
227 | "type": "earthquake",
228 | "status": "reviewed",
229 | "updated": 1471176057699,
230 | "felt": 1062,
231 | "alert": "green",
232 | "dmin": 0.155,
233 | "mag": 5.09,
234 | "gap": 32,
235 | "types": ",cap,dyfi,focal-mechanism,general-link,geoserve,impact-link,losspager,moment-tensor,nearby-cities,origin,phase-data,scitech-link,shakemap,",
236 | "url": "http://earthquake.usgs.gov/earthquakes/eventpage/nc72672610",
237 | "ids": ",at00oboavh,nc72672610,us10006chu,",
238 | "tsunami": 1,
239 | "place": "19km NNE of Upper Lake, California",
240 | "time": 1470797837510,
241 | "mmi": 3.74
242 | },
243 | "id": "nc72672610"
244 | }
245 | ],
246 | "metadata": {
247 | "status": 200,
248 | "count": 2,
249 | "title": "USGS Significant Earthquakes, Past Week",
250 | "url": "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.geojson",
251 | "generated": 1471184780000,
252 | "api": "1.5.2"
253 | }
254 | }
255 | ```
256 |
--------------------------------------------------------------------------------
/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: home
3 | title: geojson-events project
4 | ---
5 |
6 | # GeoJSON Events
7 |
8 | ## Draft
9 |
10 | [draft-gillies-geojson-events](./draft-gillies-geojson-events.html)
11 |
12 | ## Repository
13 |
14 | [https://github.com/sgillies/geojson-events](https://github.com/sgillies/geojson-events)
15 |
--------------------------------------------------------------------------------
/js/nav.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Nav Highlighting
3 | *
4 | * Automatically highlights the visible anchored elements
5 | *
6 | * Inspiration
7 | * http://www.phptherightway.com/
8 | *
9 | * @author David King
10 | * @copyright Copyright (c) 2013 +
11 | */
12 | (function($){
13 | function highlight(){
14 | var id;
15 | var visible = [];
16 | var lastID = false;
17 | // Viewport
18 | var viewT = $(window).scrollTop();
19 | var viewB = viewT + $(window).height();
20 | // Loop all Headings to see if they are visible
21 | $('h1 a, h2 a, h3 a, h4 a').each(function(){
22 | // MUST have an id...
23 | if(id = $(this).attr('id')){
24 | // Grab the element position
25 | var elT = $(this).offset().top;
26 | var elB = elT + $(this).height();
27 | // If we're within the top of the viewport then start thinking
28 | if(elB >= viewT){
29 | // If we're off the bottom of the viewport...
30 | if(elT >= viewB){
31 | // ...and NOTHING has been added...
32 | if(!visible && lastID){
33 | visible.push(lastID || id);
34 | }
35 | return false;
36 | }
37 | // Add this element
38 | visible.push(id);
39 | }
40 | // Store this "element" for the next pass...
41 | lastID = id;
42 | }
43 | });
44 | // Highlight
45 | $('#nav a').removeClass("active first");
46 | $('#nav a[href="#'+visible.shift()+'"]').addClass("first");
47 | $(visible).each(function(k,v){
48 | $('#nav a[href="#'+v+'"]').addClass("active");
49 | });
50 | }
51 |
52 | // Add a scroll and resize listener
53 | $(window).scroll(highlight).resize(highlight);
54 |
55 | // Trigger the highlight on load
56 | highlight();
57 | })(jQuery);
--------------------------------------------------------------------------------