eth4io / libkml

Automatically exported from code.google.com/p/libkml
Other
0 stars 0 forks source link

kmlengine.KmlFile.CreateFromImport(kml) in Python #46

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Script: see attached file

#!/usr/bin/env python
# CreateFromImport.py

import kmlbase
import kmldom
import kmlengine

factory = kmldom.KmlFactory_GetFactory()

folder = factory.CreateFolder()
kmlfile = kmlengine.KmlFile.CreateFromImport(folder)    # working
print 'folder:', kmlfile.get_root().Type()

placemark = factory.CreatePlacemark()
kmlfile = kmlengine.KmlFile.CreateFromImport(placemark) # working
print 'placemark:', kmlfile.get_root().Type()

kml = factory.CreateKml()
kmlfile = kmlengine.KmlFile.CreateFromImport(kml)       # not working
print 'kml:', kmlfile.get_root().Type()

What is the expected output? What do you see instead?
Expected:

diethart$ python CreateFromImport.py 
folder: 23
placemark: 49
kml: 97

I see:

folder: 23
placemark: 49
Assertion failed: (own), function SWIG_Python_ConvertPtrAndOwn, file 
kmlengine_python.cc, line 
2010.
Abort trap
diethart$ 

What version of the product are you using? On what operating system?
svn revision 423
Python 2.5.1
OS X 10.5.6

Did you run the unit test suite that comes with the project? Did all tests pass?
All tests pass (including Python unit tests)

Please provide any additional information below.

Original issue reported on code.google.com by dieth...@wiedemuth.info on 22 Jan 2009 at 2:15

Attachments:

GoogleCodeExporter commented 8 years ago
Not fixed yet, but see this for a workaround:
http://code.google.com/p/libkml/source/browse/trunk/src/swig/kmlengine_test.py?s
pec=svn483&r=483#156

Original comment by kml.mash...@gmail.com on 10 Mar 2009 at 11:18