Skip to content
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

Include building metadata in OBJ and COLLADA files #17

Open
2 tasks done
bcamper opened this issue Feb 10, 2016 · 6 comments
Open
2 tasks done

Include building metadata in OBJ and COLLADA files #17

bcamper opened this issue Feb 10, 2016 · 6 comments

Comments

@bcamper
Copy link
Member

bcamper commented Feb 10, 2016

In addition to the GeoJSON files, let's include building properties in the OBJ and COLLADA files, to simplify usage (no need to request multiple files).

  • OBJ: we can use a stringified JSON object in a comment (since there is no standard format support for metadata).
  • COLLADA: we can put something in the XML (is there a metadata standard?).
@robhawkes
Copy link
Contributor

As a start, I've implemented the existing method that I used with the original Polygon City – this adds simple comments to the top of the obj file for each of the origin longitude/latitude and the elevation. For the collada files I've added longitude, latitude and elevation properties to the document structure.

For example…

obj:

# Longitude: 14.270778949915217
# Latitude: 48.244130368992465
# Elevation: 266.506

...

collada:

<?xml version="1.0"?>
<collada version="Thu Jan 04 2001 00:00:00 GMT+0000 (GMT)">
    <asset>
        <created>Thu, 11 Feb 2016 13:00:28 GMT</created>
        <modified>Thu, 11 Feb 2016 13:00:28 GMT</modified>
        <unit name="meter" meter="1"/>
        <up_axis>Y_UP</up_axis>
        <longitude>14.270778949915217</longitude>
        <latitude>48.244130368992465</latitude>
        <elevation>266.506</elevation>
    </asset>

...

Happy to change the structure and naming of these as I just went with something simple to start with.

@bcamper
Copy link
Member Author

bcamper commented Feb 11, 2016

Sounds good. Maybe we could also include a stringified JSON blob to make it easier to parse all properties out at one time, but could also keep the more human- (and machine-) readable versions you have?

@bcamper
Copy link
Member Author

bcamper commented Feb 11, 2016

(I mean for OBJ, COLLADA already supports reasonably structured data)

@robhawkes
Copy link
Contributor

That's a good idea – I've pushed an update that places a JSON string as the first line of an obj, and also includes the same string in a 'metadata' tag in the collada header.

# {"id":"linz-ID_3467","idOriginal":"ID_3467","origin":[14.274986011132702,48.32885736798415],"elevation":307.76}
# Longitude: 14.274986011132702
# Latitude: 48.32885736798415
# Elevation: 307.76

...

@bcamper
Copy link
Member Author

bcamper commented Feb 26, 2016

This is a small nitpick but perhaps we could prefix the JSON with something like Properties, e.g.:

# Properties: {"id":"linz-ID_3467", ...

To make it a bit more reliable parsing wise? Basically someone is going to have to look for a regex or make other format expectations to parse these, so the more precise we can be about it the better.

@robhawkes
Copy link
Contributor

It's easy enough to change – the reason it isn't prefixed at the moment is in my head imagined it was easier to know that the first line is always the JSON and to get to it you need to only remove the # comment prefix.

I'll change it for now and we can always change it back if we want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants