-
Notifications
You must be signed in to change notification settings - Fork 67
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 metadata proposal #128
Comments
I don't want to be too stubborn about the initial getMetadata() proposal, but I don't fully understand why it wouldn't be the clearest solution: it would work well for people who have both The only downsides that I can think of are that it'd be an extra method to call. Any performance difference is probably extremely minimal because the bulk of the time spent is going to be in the initial parsing of XML into a DOM, which happens once. |
I don't know the details of the proposed What are the parameters to the proposed |
The API would be like:
And GpxMetadata would be an interface like
So if you're parsing a gpx file and getting metadata, you parse out the features as usual with I think the gist is, this extra method perfectly belongs with the rest of the togeojson functionality, but trying to emit metadata from the gpx() or gpxGen() methods is more trouble than it's worth. It should probably be a separate function that returns a metadata object. |
Looks like I was just confused about the support for
from this file? (rename to .gpx) |
Here's an alternative approach for handling the many vagaries of GPX metadata (vs #111).
Option 1
Instead of adding something like
getMetadata()
, add an extended implementation ofgpxGen()
which includes thexml node
being processed.So the iterator would return something like:
This shifts all of most of the implementation work onto clients, but at least gets them halfway there. Otherwise, everybody is stuck writing a full parser just to extract the stupid bloody custom metadata.
Option 2
Alternatively, return the metadata instead:
Option 3
Or, perhaps optionally just include the metadata in properties.
Of these, Option 1 is the most flexible, since it gives full access to the DOM node in case non-standard properties were added.
The text was updated successfully, but these errors were encountered: