Hello GeoNet community. I'm working on an application with ECDIS related functionality. I'm getting AIS and radar latitude longitude positions of targets (ships/water crafts etc) and i want to display them in the military symbolic standard MIL STD 2525D. Going through the documentation, i found that we are supposed to use a .stylx file to obtain a symbol however i cannot understand the code to do so. Its also mentioned here (display-military-symbols-with-a-dictionary-renderer) that:
Military symbol dictionary styles allow you to choose whether to assemble and render the symbol based on a single attribute with a unique Symbol ID Code (SIC or SIDC) or based on a series of predefined attributes. For example, in MIL-STD-2525BC2, a SIC of SFSPCL--------- represents this symbol
.
I cannot find any sample code where i can understand the use of SIDC to obtain a symbol from the .stylx file and display it on the map. Please tell me how do i display a specific symbol using a specific SID Code.
Hi Fuzail,
we have the document Symbolize data—ArcGIS Runtime SDK for Java | ArcGIS for Developers and the sample Read Symbols from Mobile Style File | ArcGIS for Developers to help with that.
Regards,
Gayle.
I'm sorry, it's still not clear, how we pass the SIDC (Symbol Identification Code) or how do we passing some parameters (like modifier, graphic amplifier, text amplifier, frame, icon, fill etc) to the dictionary and get a symbol using this code? There is no code available for that or any reference what are the possible parameters and values.
Okay so after trying some codes from the incomplete documentations and trying to pass the symbol id attribute using different key names i achieved what i was trying to do. goes like:
My code:
File stylxFile = new File(System.getProperty("user.dir") + "\\mil2525d.stylx");
DictionarySymbolStyle symbolDictionary = DictionarySymbolStyle.createFromFile(stylxFile.getAbsolutePath());
symbolDictionary.loadAsync();
Map<String, Object> attributes = new HashMap<>();
attributes.put("sidc", 10000000000000000000); // pass here a unique 20 digit Symbol ID Code
try {
Symbol s = symbolDictionary.getSymbolAsync(attributes).get();
} catch (InterruptedException e) {
e.printStackTrace();
System.out.println("InterruptedException - failed to symbolize SIDC: "+ sidc);
} catch (ExecutionException e) {
e.printStackTrace();
System.out.println("ExecutionException - failed to symbolize SIDC: "+ sidc);
}
This is how we can create a Symbol using the MIL STD 2525D .stylx file. Now we can create a Graphic object by passing in the symbol and display it on the map.
Thanks for investigating Fuzail.
Perhaps the Api reference DictionarySymbolStyle (ArcGIS Runtime SDK for Java 100.8.0) was what was missing; it links to the Military Symbology Styles | ArcGIS Solutions for Defense
Regards,
Gayle.