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

Partial conversion of KML files with MultiGeometry to GeoJSON + missing conversion of ExtendedData #2

Open
alexboss opened this issue Jan 5, 2017 · 0 comments

Comments

@alexboss
Copy link

alexboss commented Jan 5, 2017

Dear @earelin,

Thank you for this library which is really useful for KML conversion to GeoJSON.

I'd like to inform you that the conversion of KML files with MultiGeometry to GeoJSON doesn't work.

For instance, if you convert the following KML files with MultiGeometry
points_shapes.kml.txt using the method toExtGeoJSON you'll get a file without the polygons of the MultiGeometry points_shapes_converted_phplibkml.geojson.txt.

Meanwhile GeoJSON.io converts it correctly points_shapes_converted_geojsonio.geojson.txt

If you send the file points_shapes.kml.txt to the test/parse.php you'll get the following fatal error:

Fatal error: Cannot call abstract method libKML\KMLObject::__toString() in /path/to/php-libkml_v0.1/libKML/geometries/MultiGeometry.php on line 51
Call Stack
#	Time	Memory	Function	Location
1	0.0007	320280	{main}( )	.../parse.php:0
2	0.0518	2672032	KML->__toString( )	.../parse.php:106
3	0.0518	2673152	libKML\Document->__toString( )	.../libkml.php:127
4	0.0518	2673224	libKML\Container->__toString( )	.../Document.php:13
5	0.0530	2684880	libKML\Placemark->__toString( )	.../Container.php:71
6	0.0530	2685800	libKML\MultiGeometry->__toString( )	.../Placemark.php:22

Also, Name and Description tags are correctly converted, but I have the felling that ExtendedData are not (for instance they are missing when converted to GeoJSON).

Thanks a lot for your help,

Kind regards,

Alexandre 8)

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