azgs / map_conversion

An web application for downloading AZGS maps in multiple gis formats
1 stars 1 forks source link

Set the KML polystyle fill to the color attribute #1

Open aazaff opened 6 years ago

aazaff commented 6 years ago

Polygon color is currently defined in the attributes of the AreaFillRGB and HexCode fields. I need a programmatic way to have the <PolyStyle><fill></fill><PolyStyle> reference the <SimpleData name="HexCode"></SimpleData> field.

I have opened a GIS stack exchange question about the issue.

aazaff commented 5 years ago

I finally got a good answer for this through the above GIS stack exchange question. I am still unable to get it to work, presumably because I don't have the appropriate libkml subversion. Will continue to test, but at least I now know the general workflow.

aazaff commented 5 years ago

This works! The problem though is that you absolutely need the libkml driver installed. I have it on our dev and prod machines, which are Ubuntu, but not on my local.

Next step is to see how R handles this https://github.com/r-spatial/sf/issues/991. Also there seem to be some pretty bad performance issues that may make it unusable in a web app. Will investigate more.

aazaff commented 5 years ago

This works! But libkml is massively slower than regular kml. Here is the output of rbenchmark when invoking from sf::st_write(), but this is not r specific and will also be the case if invoking ogr2ogr directly.