Obtaining coordinate information from collada files?

17 views
Skip to first unread message

Auslander

unread,
Jun 10, 2020, 5:24:38 PM6/10/20
to pycollada
I am building out a geoindexer that vacuums up a number of file types and exports holdings to geojson, feature class, etc.  I have numerous collada files with geolocation embedded according to 1.5 spec but standard GIS libraries don't handle collada.

I hate to sound so needy, but can someone provide me a simple recipe on how I can obtain that content?

I've installed pycollada without issue, but I think mine is something of an edge case as I'm not using it for construction/editing/saving.  All I'd like to do is to iterate over a file list, look for the <geographic_location> tag and then parse out the child elements.  Hopefully this is easy?

in pseudo code what i'm trying to do is like this:


model_list = [models...]

for m in model_list:
   
for element in m.get('geographic_location'):
        lat
= element.latitude
        lon
= element.longitude
       
if element.altitude_mode == "absolute":
            z_ab
= element.altitude_mode
       
elif element.altitude_mode == "relativeToGround":
            z_re
= element.altitude_mode




Thanks for any assistance

Jeff Terrace

unread,
Jun 10, 2020, 5:27:32 PM6/10/20
to pyco...@googlegroups.com
If you just want to grab the XML content, you might consider using lxml (https://lxml.de/) or etree (https://docs.python.org/3/library/xml.etree.elementtree.html) directly.


--
You received this message because you are subscribed to the Google Groups "pycollada" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pycollada+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pycollada/f922bbe8-9426-4209-a0fe-7e261910abe1o%40googlegroups.com.

Auslander

unread,
Jun 10, 2020, 8:45:59 PM6/10/20
to pycollada
Oh, didn't realize collada was all XML format!  Okay, I'll try that.  Thanks,


On Wednesday, June 10, 2020 at 5:27:32 PM UTC-4, Jeff Terrace wrote:
If you just want to grab the XML content, you might consider using lxml (https://lxml.de/) or etree (https://docs.python.org/3/library/xml.etree.elementtree.html) directly.


On Wed, Jun 10, 2020 at 2:24 PM Auslander <eric.cha...@gmail.com> wrote:
I am building out a geoindexer that vacuums up a number of file types and exports holdings to geojson, feature class, etc.  I have numerous collada files with geolocation embedded according to 1.5 spec but standard GIS libraries don't handle collada.

I hate to sound so needy, but can someone provide me a simple recipe on how I can obtain that content?

I've installed pycollada without issue, but I think mine is something of an edge case as I'm not using it for construction/editing/saving.  All I'd like to do is to iterate over a file list, look for the <geographic_location> tag and then parse out the child elements.  Hopefully this is easy?

in pseudo code what i'm trying to do is like this:


model_list = [models...]

for m in model_list:
   
for element in m.get('geographic_location'):
        lat
= element.latitude
        lon
= element.longitude
       
if element.altitude_mode == "absolute":
            z_ab
= element.altitude_mode
       
elif element.altitude_mode == "relativeToGround":
            z_re
= element.altitude_mode




Thanks for any assistance

--
You received this message because you are subscribed to the Google Groups "pycollada" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyco...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages