Skip to content

Commit e2a2949

Browse files
author
Kyle Barron
committed
Add trail waypoint types pseudocode
1 parent a142311 commit e2a2949

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

README.md

+53-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ This repository holds JSON Schemas to validate each of the tables of the project
55
The idea is that with small wrappers written in JS and Python, this can be an
66
importable package that is used any time data is being updated.
77

8+
This schema is for all data that will be held in the Parse Server/MongoDB
9+
database. Not all data will be held here: rather, only data that is expected to
10+
have frequent updates _and_ have two-way synchronization.
11+
12+
For example, a weather forecast layer does not need to be in here, because the
13+
data is always going from server to client, and old data can be deleted. It
14+
should be simple enough for this kind of data to check timestamps on the server,
15+
and just automatically redownload if available during the syncing process.
16+
817
This is a work in progress!
918

1019
## Tables
@@ -212,14 +221,52 @@ interface TrailWaypoint {
212221
id: number,
213222
name?: string,
214223
desc?: string,
215-
type: TrailWaypointType
216-
subtype: TrailWaypointSubtype
224+
type: TrailWaypointType,
225+
subtype: TrailWaypointSubtype,
217226
}
218227
enum TrailWaypointType {
219-
228+
Water,
229+
Camp,
230+
Natural,
231+
// transportation
232+
Trans,
233+
// TODO: Not sure if these should be here
234+
Toilet,
235+
Shower,
220236
}
221-
enum TrailWaypointSubtype {
222-
237+
type TrailWaypointSubtype = WaterSubtype || CampSubtype || NaturalSubtype || TransSubtype;
238+
enum WaterSubtype {
239+
// Natural LineString water source
240+
Stream,
241+
// Natural polygon water source
242+
Lake,
243+
// Natural point water source
244+
Spring,
245+
// non-natural water source that must be refilled.
246+
Cache,
247+
// an always?-running man-made water source. Doesn't need to be refilled,
248+
// but may sometimes be turned off.
249+
Faucet
250+
}
251+
enum CampSubtype {
252+
// wilderness campsite
253+
campsite,
254+
// designated campground with multiple sites
255+
campground,
256+
// fully enclosed shelter
257+
enclosedShelter,
258+
// shelter that is not fully enclosed
259+
unenclosedShelter,
260+
}
261+
enum NaturalSubtype {
262+
Pass,
263+
Peak,
264+
}
265+
enum TransSubtype {
266+
Highway,
267+
PavedRoad,
268+
DirtRoad,
269+
TrailJunction,
223270
}
224271
```
225272

@@ -228,3 +275,4 @@ enum TrailWaypointSubtype {
228275

229276
- How to name tables so that they're easiest to download for offline usage in Parse. I think Parse generally downloads an entire table. Should all tables be prefixed by `PCT_`?
230277
- strings or numbers for identifiers
278+
- locations for each subwaypoint, but connected when clicked

0 commit comments

Comments
 (0)