0

Is there a way, using open source software, to export multiple shapefiles of mixed geometry types, and different attributes, into one KMZ/KML file?

Something similar to from ArcMap "Map to KML", but styling information is not necessary.

1 Answer 1

2

Use R with sf package. It has an object kind called GEOMETRYCOLLECTION, you can merge different kinds of geometries and export them to google earth.

With a basic reproducible example:

library(sf)

geomcoll <- c(st_linestring(matrix(1:6,3)), st_point(1:2))

plot(geomcoll)

enter image description here

geomcoll <- st_sfc(geomcoll,crs='+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ')

st_write(geomcoll,'test.kml')

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.