evolution icon indicating copy to clipboard operation
evolution copied to clipboard

please support kml styling (in fill and border color)

Open drwilkins opened this issue 2 years ago • 5 comments

This feature is requested because I often need to generate KML layers for Google Earth Studio videos like this one. For example, I want to output a semitransparent shapefile of a state or country to overlay on a satellite map.

Currently (as far as I can tell) it is very difficult or impossible to control styling in KML exports using sf or other "modern" packages. st_write(driver="kml") for example has inconsistent effect across OSes and doesn't seem to handle border color at all. Yet, this is very simply accomplished with maptools::kmlPolygons() and kmlLines() with col and borderparameters.

What is really excellent is that the col parameter takes alpha hex values. e.g. col= "#4530384C" makes a polygon with a semitransparent fill, and you can supply border="white" to keep a solid border.

Ideally, this nice kml export functionality would be collapsed into a single function rather than having to call kmlPolygons vs kmlLines based on different classes, and this function would be included in sf or another package which will be supported after maptools goes away.

Thanks for listening :)

drwilkins avatar Aug 16 '22 21:08 drwilkins

@edzer How should we handle this? Should we partition maptools into functions using functionality from rgdal or rgeos and others which do not? Moving stuff to sp increases the too large maintenance burden on you; keeping a residual maptools is not viable without a new maintainer. How could we identify possible candidate maintainers?

The twitter case shows that just using pkgapi doesn't pick up usage in peoples' scripts and workflows; the same applies to running reverse dependency checks on packages.

rsbivand avatar Aug 17 '22 08:08 rsbivand

This feature is requested because I often need to generate KML layers for Google Earth Studio videos like this one. For example, I want to output a semitransparent shapefile of a state or country to overlay on a satellite map.

Currently (as far as I can tell) it is very difficult or impossible to control styling in KML exports using sf or other "modern" packages. st_write(driver="kml") for example has inconsistent effect across OSes and doesn't seem to handle border color at all. Yet, this is very simply accomplished with maptools::kmlPolygons() and kmlLines() with col and borderparameters.

What is really excellent is that the col parameter takes alpha hex values. e.g. col= "#4530384C" makes a polygon with a semitransparent fill, and you can supply border="white" to keep a solid border.

Ideally, this nice kml export functionality would be collapsed into a single function rather than having to call kmlPolygons vs kmlLines based on different classes, and this function would be included in sf or another package which will be supported after maptools goes away.

Thanks for listening :)

Maybe you should try to ask sf devs to improve their function using the sp one as example. If you (or someone else that you know) can do and submit the change, the better.

LuisLauM avatar Jun 08 '23 12:06 LuisLauM

I have put a skeleton package on https://github.com/rsbivand/spkml, and would like to ask @LuisLauM or @drwilkins whether you would be prepared to take on maintenance of this lightweight and trouble-free package?

rsbivand avatar Jun 27 '23 13:06 rsbivand

Hi Roger,

Thank you for following up on my issue! I don't really have the expertise in the spatial stats realm to maintain a package. I merely dabble when necessity requires it.

Thanks, Matt

On Tue, Jun 27, 2023 at 8:22 AM Roger Bivand @.***> wrote:

I have put a skeleton package on https://github.com/rsbivand/spkml, and would like to ask @LuisLauM https://github.com/LuisLauM or @drwilkins https://github.com/drwilkins whether you would be prepared to take on maintenance of this lightweight and trouble-free package?

— Reply to this email directly, view it on GitHub https://github.com/r-spatial/evolution/issues/6#issuecomment-1609498206, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOQ6UAHDEFKY2YM3A3Z2J3XNLNARANCNFSM56XIPYCA . You are receiving this because you were mentioned.Message ID: @.***>

drwilkins avatar Jun 29 '23 15:06 drwilkins

@drwilkins @LuisLauM please use the channels available to you to canvas for a new maintainer.

rsbivand avatar Jun 30 '23 08:06 rsbivand