PDA

View Full Version : Importing gps data?


wannabeArtist
07-15-2009, 09:40 AM
Hello,

Has anyone tried to import gps data (gpx) to Softimage?

I would guess it shouldn't be too difficult to use the coordinate and elevation data from the gpx (=xml) file to generate a curve? But does such an importer exists and how easy it is to code one if it doesn't? Is there for example a ready interface provided for writing importers?

CiaranM
07-16-2009, 02:01 PM
I don't think there's what you would call a "ready interface", but I think I remember some example importers in the SDK docs.
But as you say, it shouldn't be too tough if this is an XML file. It shouldn't be much more difficult than parsing the file for the relevant data and passing that into a generate curve Op or directly into the geometry description of an existing primitive.

wannabeArtist
07-17-2009, 06:38 AM
Thanks for the reply!

Yeah, there's an example in the docs, I need to take a closer look at that.

Just out of curiosity, are these (importers/exporters) usually written in c++ as in the example? I kind of thought it would be python code. No matter though, I more familiar with c++ than python :)

mdee
07-18-2009, 07:51 PM
Thanks for the reply!

Yeah, there's an example in the docs, I need to take a closer look at that.

Just out of curiosity, are these (importers/exporters) usually written in c++ as in the example? I kind of thought it would be python code. No matter though, I more familiar with c++ than python :)
If you want to use Python, elementree module makes manipulating xml data trivial.

http://effbot.org/zone/element-index.htm

ThE_JacO
07-19-2009, 07:46 AM
As of Python 2.5 the excellent celemnttree is part of the default distribution.
There's also the free lxml which is pretty nice if you want a better/bigger xpath and parsing.

wannabeArtist
07-19-2009, 08:07 AM
Thanks guys!

I could try to go with Python, but are there any Importer/Exporter examples around done with it? The example in XSI docs is in C++ as mentioned before and therefore seemed like a good starting point, but if xml manipulation is easier with Python then I might want to try that instead.

Personally I have no experience with neither for xml manipulation, but I have done that with Java (SAX, DOM parsers).

wannabeArtist
07-19-2009, 04:06 PM
I browsed around the XSI sdk docs, and I got mildly interested in trying to write this with C# instead. Any pros or cons for the choice of language?

Personally I figured that going with C# might be a good idea because it's closer to Java, which is my main language.

But is it a good choice for writing this kind of importer code for XSI? Would it still be easier with C++ or Python considering XSI?

CGTalk Moderation
07-19-2009, 04:06 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.