Esri / joint-military-symbology-xml

Joint Military Symbology Markup Language is a data encapsulation of MIL-STD-2525D and APP-6(D).
Apache License 2.0
143 stars 56 forks source link

Ability to batch convert all SIDC Symbols from SVG to PNG #274

Open davidbuhler-zz opened 8 years ago

davidbuhler-zz commented 8 years ago

Is there currently a way to convert all of the Symbols for every Permutation from SVG to PNG?

Alternatively, Is there currently a way to convert each SIDC code request from an SVG to PNG?

In my use-case, I need to reference an asset as a KML Placemark Icon. The KML spec does not support SVGs, just rasterized graphics.

csmoore commented 8 years ago

I don't know if this repo has something like this, but you are going to indeed have a lot of files:

Here is just one example (Land Units) - that uses only 4 of the attributes: (193 Entity Codes) X (78 Modifier 1's) X (57 Modifier 2's) X (14 Echelons)

Something like PICT might be useful if you did decide to go down the permutation path: https://github.com/Microsoft/pict

A while ago, I did do test code for permutations of a single symbol if you want to get an idea of the business logic involved: https://github.com/csmoore/military-symbols-dotnet/blob/master/Samples/CodePermutations/Program.cs

abouffard commented 8 years ago

Thanks for the question @davidbuhler .

There is, currently, not a way to do what you've asked. There is a C# library of classes here and a way to use those classes to create a Symbol object based on a given SIDC. The Symbol object can return to a developer a C# Bitmap, which represents the basic symbol for that given SIDC.

You could write an app that cycled through the SIDC components broken out here: https://github.com/Esri/joint-military-symbology-xml/tree/master/samples/name_domains_values or use the JMSML API to cycle through the contents of the XML, build each possible SIDC, and use the JMSML API to create a Bitmap for each constructed SIDC, and then save that Bitmap to whatever format you like.

davidbuhler-zz commented 8 years ago

Noted. Thanks.

Perhaps an Image Dump would be a useful Feature Request?

abouffard commented 8 years ago

Yup, noted. Perhaps you want to rename this issue and make it more like a new feature request, like "Add Symbol Image Dump Capability" and describe what you'd like to see?

davidbuhler-zz commented 8 years ago

User Story: Some organizations need access to symbols based on a MIL Specification (A, B, C, D, or a change set). A feature is needed where a developer can:

Dump all of the symbols as a PNG, based on a MIL STD (or with the pngs divided into a folder by MIL STD. The developer would then move each image permutation to a file server where each image would by accessible by filepath/symbol-code.png

This feature would allow developers to access symbols as rasterized assets, compatible with the KML Specification.