-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPX metadataType #111
Comments
Personally I think I'd prefer a separate method, like I think it just makes more sense to have a separate process to get metadata, and if people strongly want to combine that metadata with their FeatureCollection object, they can do so with |
Based on: https://gis.stackexchange.com/a/415412
Maybe something like this would be even more easier to store and therefore portable (also when it comes to snapshot testing): {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [ ] // eventually populated by https://www.topografix.com/GPX/1/1/#type_boundsType
},
"properties": {
"_gpxType": "metadata" // everything else related to https://www.topografix.com/GPX/1/1/#type_metadataType
"name": "...",
"desc": "...",
"author": {
"name": "...",
"email": "",
"link": {
"href": "...",
"text": "...",
"type": "...",
}
},
"copyright": {
"author": "...",
"year": "...",
"license": "..."
},
"time": "...",
"keywords": "...",
"extensions": ??
},
{
// Other features
}
]
} Not really sure if these property names make sense:
but that's just to give you a quick idea. Related info:
👋 Raruto |
Hi Tom,
over years I come back to ask myself this question: Is it valid to have a properties element in an geoJSON featureCollection?
So first of all here's just a friendly reminder:
• RFC 7946 - Extending GeoJSON
• GPX 1.1 Schema Documentation - metadataType
Motivation
Mainly, make it easier to access the root gpx file
<name>
.Right now, others can achieve this more or less by doing like so:
Draft implementation
Essentially, augmenting the
FeatureCollection
interface by providing a new property:metadata
• lib/gpx.ts#L181-L197
•
lib/gpx/metadata.ts
Almost the same as: lib/gpx/properties.ts#L1-L36
NB some functions parameters types invoked in here must be double-checked (ref: Element and Document interfaces)
lib/index.d.ts
I'm not very knowledgeable about typescript, anyway I think it could result in something like this:
I'm really sorry, but at the moment I can't say how much additional re-work might be needed to integrate it in the generation of current
dist/index.d.ts
file.Hoping that somehow these notes can be useful
👋 Raruto
The text was updated successfully, but these errors were encountered: