Ogr2ogr easily handle your data but shapefile format does not. Ogrinfo reveals that your data contains one geometry which is of type Geometrycollection. Collection is made by combining one linestring and one point.
GEOMETRYCOLLECTION (
LINESTRING (
120.9954464 6.040449 0,
120.9953874 6.0402356 0,
120.9957951 6.0401396 0,
120.9958595 6.040337 0,
120.9958595 6.040337 0,
120.9954464 6.040449 0
),
POINT (
120.9954464 6.040449 0
))
You have two troubles:
- Geometrycollections cannot be saved into shapefile.
- Exploding the collection to primitive elements is not enough for a rescue because linestrings and points can't be saved into a same shapefile.
For converting your KML data into shapefiles you must take two steps:
- Explode the collections into basic geometries
- Sort the geometries by the type of geometries and save lines into one shapefile and points to another.
I would do the task with ogr2ogr by using GML as an interim file format. Totally three commands are needed and you find them below. I included the non-dangerous warnings because you may not know another limitation in shapefiles: attribute names can have max. 10 characters. I apologize the cryptic layer creation options used for defining the explicit shapefile type (-lco SHPT=) but in your use case they just must be there.
ogr2ogr -f GML habib.gml habib_mosque.kmz -explodecollections
ogr2ogr -f "ESRI Shapefile" habib_point.shp habib.gml -sql "select * from habib_mosque where OGR_GEOMETRY='POINT'" -lco SHPT=POINT
Warning 6: Normalized/laundered field name: 'description' to 'descriptio'
Warning 6: Normalized/laundered field name: 'altitudeMode' to 'altitudeMo'
ogr2ogr -f "ESRI Shapefile" habib_line.shp habib.gml -sql "select * from habib_mosque where OGR_GEOMETRY='LINESTRING'" -lco SHPT=ARC
Warning 6: Normalized/laundered field name: 'description' to 'descriptio'
Warning 6: Normalized/laundered field name: 'altitudeMode' to 'altitudeMo'
Here is the end result with the outline on one layer and the reference point on another layer.
/Users/Ryan/Downloads/api.wikimapia.org-4.kml' using driver
LIBKML' successful. 1: Layer0 Ryans-MacBook-Air:~ Ryan$ogrinfo -al --debug on /Users/Ryan/Downloads/api.wikimapia.org-4.kml
api.wikimapia.org-4.kml
instead of/Users/Ryan/Downloads/api.wikimapia.org-4.kml