diff --git a/README.md b/README.md index e1623b9..3cf41fa 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The ArcGIS Defense and Intelligence Military Features Data repository is a set o * If using the Style and Layer Files * ArcGIS Runtime 10.2 (or later) * If using the Symbol Dictionary Files -* ArcGIS Professional or ArcGIS Runtime 10.2.4+ +* ArcGIS Pro 1.1 or ArcGIS Runtime 10.3+ * If using the Stylx Files ## Instructions diff --git a/data/app6b/stylxfiles/app6b.stylx b/data/app6b/stylxfiles/app6b.stylx index 0c2bd85..0d71aa8 100644 Binary files a/data/app6b/stylxfiles/app6b.stylx and b/data/app6b/stylxfiles/app6b.stylx differ diff --git a/data/mil2525c/stylxfiles/mil2525c.stylx b/data/mil2525c/stylxfiles/mil2525c.stylx index 1daf53c..0cbabb4 100644 Binary files a/data/mil2525c/stylxfiles/mil2525c.stylx and b/data/mil2525c/stylxfiles/mil2525c.stylx differ diff --git a/data/mil2525d/README.md b/data/mil2525d/README.md index fe47f6a..c844dfc 100644 --- a/data/mil2525d/README.md +++ b/data/mil2525d/README.md @@ -24,7 +24,7 @@ See the Component Sections for more information: ## Requirements -* ArcGIS Professional 1.0+ +* ArcGIS Professional 1.1+ * ArcGIS Runtime 10.3+ * ArcGIS Desktop (10.1+) - only the .Style Files are compatible with Desktop 10.X diff --git a/data/mil2525d/core_data/gdbs/MilitaryOverlay.gdb.zip b/data/mil2525d/core_data/gdbs/MilitaryOverlay.gdb.zip index daeccea..1d1d820 100644 Binary files a/data/mil2525d/core_data/gdbs/MilitaryOverlay.gdb.zip and b/data/mil2525d/core_data/gdbs/MilitaryOverlay.gdb.zip differ diff --git a/data/mil2525d/core_data/gdbs/README.md b/data/mil2525d/core_data/gdbs/README.md index 6da1f5b..08d5a24 100644 --- a/data/mil2525d/core_data/gdbs/README.md +++ b/data/mil2525d/core_data/gdbs/README.md @@ -9,62 +9,67 @@ This folder contains the Military Features Core Geodatabase Schema format and an The following information is intended to succinctly capture the format of the Military Features Schema for other applications that may depend upon this format. -## Schema Sections - -* [Symbol Display Attributes](#symbol-display-attributes) -* [Modifier (Label) Attributes](#modifier-label-attributes) - -## Symbol Display Attributes +## Graphic Display Amplifiers The following fields control the display of symbols. -| Attribute Name | Data Type | Range of Values | Default Value/Meaning | Sample Name | Sample Value/Meaning | Explanatory Notes | -| -------------- | --------- | --------------- | ----------- | -------------------- | ----------------- | ----------------- | -| identity | long int | 0-9 | 1 (Unknown) | "Friend" | 3 ("friend") | **REQUIRED** | -| symbolset | short int | 00-99 | (per feature class) | "Air" | 01 ("air") | **REQUIRED** | -| entity | long int | N/A | (per feature class) | "Military (Air) : Fixed-Wing" | "110100" | **REQUIRED** | -| context | short int | 0-2 | 0 (Reality) | "Reality" | 0 ("reality") | Optional | -| modifier1 | long int | 00-99 | 00 (None) | "Mobility : Air Mobile/Air Assault" | Modifier "01" for Modifier 1 | Optional | -| modifier2 | long int | 00-99 | 00 (None) | "Close Range and Support : Casualty Staging" | Modifier "05" for Modifier 2 | Optional | -| indicator | long int | 0-7 | 0 (None) | Headquarters | Headquarters=2 | Optional (="HQ/TF/FD") | -| echelon | long int | 0-26 | 0 (None) | Squad | Squad=12 | Optional | -| mobility | long int | 0,31-52 (None) | 0 | Rail | Rail=36 | Optional | -| array | long int | 0,61-62 | 0 (None) | Short Towed Array | Short Towed Array=61 | Optional | -| operationalcondition | long int | 0-5 | 0 (Present) | Planned | Planned=1 | Optional | -| sidc | string/TEXT | string length(8 or 20) | N/A | "01100110" | SymbolSet:"Air"/"01" + Entity:"100110" | Optional-allows len=20 or len=8(identity=unknown) SIDC format | +| Attribute Name | 2525 D Field ID | Data Type | Range of Values | Default Value/Meaning | Sample Name | Sample Value/Meaning | Explanatory Notes | +| -------------- | --------- | --------- | --------------- | ----------- | -------------------- | ----------------- | ----------------- | +| symbolset | A/E/AC | short int | 00-99 | (per feature class) | "Air" | 01 ("air") | **REQUIRED** | +| entity | A | long int | N/A | (per feature class) | "Military (Air) : Fixed-Wing" | "110100" | **REQUIRED** | +| modifier1 | A | long int | 00-99 | 00 (None) | "Mobility : Air Mobile/Air Assault" | Modifier "01" for Modifier 1 | Optional | +| modifier2 | A | long int | 00-99 | 00 (None) | "Close Range and Support : Casualty Staging" | Modifier "05" for Modifier 2 | Optional | +| echelon | B | long int | 0-26 | 0 (None) | Squad | Squad=12 | Optional | +| indicator | D/S/AB | long int | 0-7 | 0 (None) | Headquarters | Headquarters=2 | Optional (="HQ/TF/FD") | +| identity | E | long int | 0-9 | 1 (Unknown) | "Friend" | 3 ("friend") | **REQUIRED** | +| context | E | short int | 0-2 | 0 (Reality) | "Reality" | 0 ("reality") | Optional | +| mobility | R | long int | 0,31-52 (None) | 0 | Rail | Rail=36 | Optional | +| array | AG | long int | 0,61-62 | 0 (None) | Short Towed Array | Short Towed Array=61 | Optional | +| operationalcondition | AL | long int | 0-5 | 0 (Present) | Planned | Planned=1 | Optional | +| sidc | | string/TEXT | string length(8 or 20) | N/A | "01100110" | SymbolSet:"Air"/"01" + Entity:"100110" | Optional-allows len=20 or len=8(identity=unknown) SIDC format | -## Modifier (Label) Attributes +## Text Amplifiers The following modifier fields are supported in [the current Pro Stylx and Runtime Symbol Dictionary](../stylxfiles). -To view the Label Rules and associations, view the symbol dictionary table "Label Rules." The following table lists the Modifier definitions from 2525C and 2525D and their corresponding attributes in the symbol dictionary. +To view the Label Rules and associations, view the symbol dictionary table "Label Rules." The following table lists the Modifier definitions from 2525D and their corresponding attributes in the symbol dictionary. -| Attribute Name | 2525 C Field ID | 2525 D Field ID | Field Title | Notes | -| ------------- | -------------- | --- | ----------------- | ----- | -| additionalinformation | H | H | Additional Information | | -| additionalinformation2 | H | H | Additional Information 2 | Used in the Convoys and Airspace Coordination Area tactical graphics. | -| combateffectiveness | K | K | Combat Effectiveness | | -| commonidentifier | AF | AF | Common Identifier | | -| credibility | J | J | Evaluation Rating | Credibility rating is second character of Evaluation Rating (J) field. | -| datetimeexpired | W | W | Date-Time Group (DTG) | Second half of Date-Time Group (DTG) (W) field. | -| datetimevalid | W | W | Date-Time Group (DTG) | First half of Date-Time Group (DTG) (W) field. | -| distance | AM | | Distance | | -| equipmentteardowntime | AE | | Equipment Teardown Time | | -| higherformation | M | M | Higher Formation | | -| idmode | P | P | IFF/SIF/AIS | | -| platformtype | AD | AD | Platform Type | | -| quantity | C | C | Quantity | | -| reinforced | F | F | Reinforced or Reduced | | -| reliability | J | J | Evaluation Rating | Reliability rating is first character of Evaluation Rating (J) field. | -| sigintmobility | R2 | R2 | SIGINT Mobility Indicator | | -| signatureequipment | L | L | Signature Equipment | | -| speed | Z | Z | Speed | | -| staffcomment | G | G | Staff Comments | | -| type | V | V | Type | | -| uniquedesignation | T | T | Unique Designation | | -| uniquedesignation2 | T | | Unique Designation 2 | Used as an additional field for Fire Support Lines tactical graphics. | -| x | Y | Y | Location | Longitude in degrees. | -| y | Y | Y | Location | Latitude in degrees. | -| z | X | X | Altitude/Depth | | -| zmax | X | X | Altitude/Depth | Maximum altitude for aviation tactical graphics. | -| zmin | X | X | Altitude/Depth | Minimum altitude for aviation tactical graphics. | +| Attribute Name | 2525 D Field ID | Field Title | Notes | +| ------------- | --- | ----------------- | ----- | +| quantity | C | Quantity | | +| reinforced | F | Reinforced or Reduced | | +| staffcomment | G | Staff Comments | | +| additionalinformation | H | Additional Information | | +| additionalinformation2 | H1 | Additional Information 2 | Used in the Convoys and Airspace Coordination Area tactical graphics. | +| credibility | J | Evaluation Rating | Credibility rating is second character of Evaluation Rating (J) field. | +| reliability | J1 | Evaluation Rating | Reliability rating is first character of Evaluation Rating (J) field. | +| combateffectiveness | K | Combat Effectiveness | | +| signatureequipment | L | Signature Equipment | | +| higherformation | M | Higher Formation | | +| hostile | N | Hostile | | +| idmode | P | IFF/SIF/AIS | | +| direction | Q | Direction of Movement Indicator | | +| sigintmobility | R2 | SIGINT Mobility Indicator | | +| uniquedesignation | T | Unique Designation | | +| uniquedesignation2 | T1 | Unique Designation 2 | Used as an additional field for Fire Support Lines tactical graphics. | +| type | V | Type | | +| datetimevalid | W | Date-Time Group (DTG) | First half of Date-Time Group (DTG) (W) field. | +| datetimeexpired | W1 | Date-Time Group (DTG) | Second half of Date-Time Group (DTG) (W) field. Many systems use W1 as a trigger to delete symbol from map. | +| z | X | Altitude/Depth | Maximum altitude for aviation tactical graphics. | +| z2 | X1 | Altitude/Depth 2 | Minimum altitude for aviation tactical graphics. | +| x | Y | Location | Longitude in degrees. | +| x2 | Y1 | Location | Longitude in degrees 2. | +| y | Y | Location | Latitude in degrees. | +| y2 | Y1 | Location | Latitude in degrees 2. | +| speed | Z | Speed | | +| specialheadquarters | AA | Special C2 Headquarters | | +| platformtype | AD | Platform Type | | +| equipmentteardowntime | AE | Equipment Teardown Time | | +| commonidentifier | AF | Common Identifier | | +| distance | AM | Distance | | +| distance2 | AM1 | Distance 2 | | +| azimuth | AN | Azimuth | | +| targetdesignator | AP | Target Designator | +| guardedunit | AQ | Guarded Unit | | +| specialdesignator | AR | Special Designator | | +| country | AS | Country Code | | diff --git a/data/mil2525d/core_data/stylefiles/Military 2525Delta All.style b/data/mil2525d/core_data/stylefiles/Military 2525Delta All.style index a48eb19..0b57c4d 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military 2525Delta All.style and b/data/mil2525d/core_data/stylefiles/Military 2525Delta All.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Activities.style b/data/mil2525d/core_data/stylefiles/Military Activities.style index bd2ae9e..0f33443 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Activities.style and b/data/mil2525d/core_data/stylefiles/Military Activities.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Air.style b/data/mil2525d/core_data/stylefiles/Military Air.style index 5003d22..142956e 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Air.style and b/data/mil2525d/core_data/stylefiles/Military Air.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Control Measures Areas.style b/data/mil2525d/core_data/stylefiles/Military Control Measures Areas.style index 1695b9b..d688342 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Control Measures Areas.style and b/data/mil2525d/core_data/stylefiles/Military Control Measures Areas.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Control Measures Lines.style b/data/mil2525d/core_data/stylefiles/Military Control Measures Lines.style index 2c63575..1f7a4a2 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Control Measures Lines.style and b/data/mil2525d/core_data/stylefiles/Military Control Measures Lines.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Control Measures Points.style b/data/mil2525d/core_data/stylefiles/Military Control Measures Points.style index a777193..f670a31 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Control Measures Points.style and b/data/mil2525d/core_data/stylefiles/Military Control Measures Points.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Cyberspace.style b/data/mil2525d/core_data/stylefiles/Military Cyberspace.style index 269ff0e..6e7e65a 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Cyberspace.style and b/data/mil2525d/core_data/stylefiles/Military Cyberspace.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Frames And Amplifiers.style b/data/mil2525d/core_data/stylefiles/Military Frames And Amplifiers.style index 840b159..c1a6cad 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Frames And Amplifiers.style and b/data/mil2525d/core_data/stylefiles/Military Frames And Amplifiers.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Land Equipment.style b/data/mil2525d/core_data/stylefiles/Military Land Equipment.style index e4aa90b..c180e6e 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Land Equipment.style and b/data/mil2525d/core_data/stylefiles/Military Land Equipment.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Land Installation.style b/data/mil2525d/core_data/stylefiles/Military Land Installation.style index b939a26..4735132 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Land Installation.style and b/data/mil2525d/core_data/stylefiles/Military Land Installation.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Land Unit.style b/data/mil2525d/core_data/stylefiles/Military Land Unit.style index 8f2f24d..7e367c4 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Land Unit.style and b/data/mil2525d/core_data/stylefiles/Military Land Unit.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Sea Subsurface.style b/data/mil2525d/core_data/stylefiles/Military Sea Subsurface.style index e4f0c6f..4063364 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Sea Subsurface.style and b/data/mil2525d/core_data/stylefiles/Military Sea Subsurface.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Sea Surface.style b/data/mil2525d/core_data/stylefiles/Military Sea Surface.style index 123c545..850fc27 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Sea Surface.style and b/data/mil2525d/core_data/stylefiles/Military Sea Surface.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military SigInt.style b/data/mil2525d/core_data/stylefiles/Military SigInt.style index d65189a..f532013 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military SigInt.style and b/data/mil2525d/core_data/stylefiles/Military SigInt.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Space.style b/data/mil2525d/core_data/stylefiles/Military Space.style index 22b4496..26aacf3 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Space.style and b/data/mil2525d/core_data/stylefiles/Military Space.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Weather Areas.style b/data/mil2525d/core_data/stylefiles/Military Weather Areas.style index 59c77f7..b473ca9 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Weather Areas.style and b/data/mil2525d/core_data/stylefiles/Military Weather Areas.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Weather Lines.style b/data/mil2525d/core_data/stylefiles/Military Weather Lines.style index 6e21e48..2582776 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Weather Lines.style and b/data/mil2525d/core_data/stylefiles/Military Weather Lines.style differ diff --git a/data/mil2525d/core_data/stylefiles/Military Weather Points.style b/data/mil2525d/core_data/stylefiles/Military Weather Points.style index e21d166..ee7d99a 100644 Binary files a/data/mil2525d/core_data/stylefiles/Military Weather Points.style and b/data/mil2525d/core_data/stylefiles/Military Weather Points.style differ diff --git a/data/mil2525d/core_data/stylxfiles/README.md b/data/mil2525d/core_data/stylxfiles/README.md index fd6ce5c..18d4744 100644 --- a/data/mil2525d/core_data/stylxfiles/README.md +++ b/data/mil2525d/core_data/stylxfiles/README.md @@ -14,14 +14,14 @@ This folder contains: * This auto-generated file is then merged with the .stylx below that is edited/maintained in Pro * **This version is intended for end-users** * [mil2525d-lines-areas-labels-base-template.stylx](./mil2525d-lines-areas-labels-base-template.stylx) - A separate version of this .stylx that has only the Label Placement Definitions, Point, Line, Polygon, and Text Symbols that are manually created and maintained in ArcGIS Pro - * **This version is intended only for use by the Product Engineers of this repo/data** + * **This version is intended only for use by the Product Engineers or maintainers of this repo/data** To use: [mil2525d.stylx](./mil2525d.stylx) * In Pro, Add Style to project - * **IMPORTANT: THIS FILE SHOULD NEVER BE MANUALLY UPDATED/EDITED IN PRO, IF UPDATING ANYTHING, USE THE OTHER INTENDED VERSION BELOW** + * **IMPORTANT: THIS FILE SHOULD NEVER BE MANUALLY UPDATED/EDITED IN PRO, IF UPDATING ANYTHING, USE THE OTHER INTENDED VERSION BELOW** * In Runtime * Place the file `mil2525d.stylx` in the folder: `{Runtime Install}\resources\symbols\mil2525d` * Requires Versions 10.2.4 or later @@ -33,3 +33,5 @@ To use: * In Pro, Add Style to project * You may edit/correct the symbols and associated meta data in this file in Pro, update this repo with this file as needed (**for repo Product Engineers or others making edits in Pro only**) +* Before you edit this file in Pro, please read the [Runtime Compatibility Warning section of the style-utilities README.md](../../utilities/style-utilities/README.md#important-warning-on-runtime-compatibility-before-you-begin) +* Once you have completed making any desired edits/changes, you will need to merge this file using the steps/process outlined in [merge-stylx-utilities](../../utilities/style-utilities/merge-stylx-utilities) diff --git a/data/mil2525d/core_data/stylxfiles/mil2525d-lines-areas-labels-base-template.stylx b/data/mil2525d/core_data/stylxfiles/mil2525d-lines-areas-labels-base-template.stylx index 3336300..aeb7700 100644 Binary files a/data/mil2525d/core_data/stylxfiles/mil2525d-lines-areas-labels-base-template.stylx and b/data/mil2525d/core_data/stylxfiles/mil2525d-lines-areas-labels-base-template.stylx differ diff --git a/data/mil2525d/core_data/stylxfiles/mil2525d.stylx b/data/mil2525d/core_data/stylxfiles/mil2525d.stylx index de20977..765c69d 100644 Binary files a/data/mil2525d/core_data/stylxfiles/mil2525d.stylx and b/data/mil2525d/core_data/stylxfiles/mil2525d.stylx differ diff --git a/data/mil2525d/sample_data/projects/ControlMeasuresAll.ppkx b/data/mil2525d/sample_data/projects/ControlMeasuresAll.ppkx new file mode 100644 index 0000000..817f517 Binary files /dev/null and b/data/mil2525d/sample_data/projects/ControlMeasuresAll.ppkx differ diff --git a/data/mil2525d/sample_data/projects/METOCall.ppkx b/data/mil2525d/sample_data/projects/METOCall.ppkx new file mode 100644 index 0000000..6ee1f4c Binary files /dev/null and b/data/mil2525d/sample_data/projects/METOCall.ppkx differ diff --git a/data/mil2525d/sample_data/projects/PairwiseTestProject.ppkx b/data/mil2525d/sample_data/projects/PairwiseTestProject.ppkx new file mode 100644 index 0000000..be780b9 Binary files /dev/null and b/data/mil2525d/sample_data/projects/PairwiseTestProject.ppkx differ diff --git a/data/mil2525d/utilities/military-features-utilities/README.md b/data/mil2525d/utilities/military-features-utilities/README.md index e6e877b..581e779 100644 --- a/data/mil2525d/utilities/military-features-utilities/README.md +++ b/data/mil2525d/utilities/military-features-utilities/README.md @@ -3,5 +3,75 @@ ## Purpose -* These utilities are used to create military feature classes, domains, and other feature and test data - * [update-domain-toolbox](./update-domain-toolbox) - GP Tools for creating geodatabase domains for military feature classes +* These utilities are used to create military feature classes, domains, and other feature and test data +* Individual utilities and steps: + * Update Military Features Domains - updates the geodatabase domains from source CSV(.csv) files + +## Sections + +* [Requirements](#requirements) +* [Instructions](#instructions) + +## Requirements + +* ArcGIS Professional 1.0+ (Toolbox requires ArcGIS Pro to open/use) + +## Instructions + +### Update Military Features Domains + +#### Overview + +This utility updates the Geodatabase(GDB) domains of the [Military Features template database](../../core_data/gdbs) with the latest source data/values obtained from the [Joint Military Symbology](https://github.com/Esri/joint-military-symbology-xml) repository. This utility should be run periodically as the Joint Military Symbology repository is refined, improved, and updated. + +The source data for this utility is a set of CSV files created in the Joint Military Symbology [`name_domains_values folder`](https://github.com/Esri/joint-military-symbology-xml/tree/master/samples/name_domains_values). The domain name is obtained from the CSV file name (with the "Coded_Domain" part removed) and the domain codes and description are obtained from the file contents. + +A Geoprocessing (GP) Tool is then run on the source data to add or replace the GDB domains using the source data. + +As a final (optional) validation step, once the domain data is imported into the GDB, the domains are then exported and compared to the original source data. + +#### Steps + +Importing the domain data: + +* Obtain the latest set of Military Features source data and utilities + * Clone/download this repository to your local machine. +* Obtain the latest set of `name_domains_values` source CSV files + * Clone/download the [Joint Military Symbology](https://github.com/Esri/joint-military-symbology-xml) repository. + * You may also just download the files from the [`name_domains_values folder`](https://github.com/Esri/joint-military-symbology-xml/tree/master/samples/name_domains_values) in this repository + * Note: although there are addition sample CSV files in this folder (ex. `*_Sample.csv`), the tools ignore these files using a file filter +* **REQUIRED WORKAROUND** + * There is currently an issue with one of the [source csv files - Coded_Domain_Land_Unit_Entities.csv](https://github.com/Esri/joint-military-symbology-xml/blob/master/samples/name_domains_values/Coded_Domain_Land_Unit_Entities.csv#L193) - there are some **string** entries in this file (containing "XXXX"), but the imported domain codes are expected to be integers + * These entries, currently the last four lines of Coded_Domain_Land_Unit_Entities.csv, will need to be manually edited/deleted in NotePad or other **text editor** (you should not use MS Excel because this may alter the format of the csv and data) + * See https://github.com/Esri/joint-military-symbology-xml/issues/201 for the full description of this issue and workaround +* Run ArcGIS Pro +* Navigate to the local location of the [update-domain-toolbox GeoProcessing Toolbox](./update-domain-toolbox) + * The toolbox should look similar to this +![Image of Update Domain Toolbox](./screenshots/Toolbox.JPG) +* Run the *Import or Replace All Domains (Military Features)* GP Tool + * As the `Input Folder` select the `joint-military-symbology-xml/tree/master/samples/name_domains_values` folder + * As the `Target Geodatabase` select the desired Military Features template geodatabase (usually the one [obtained from here](../../core_data/gdbs)) + * IMPORTANT: The *Table To Domain* operation requires an exclusive schema lock on the geodatabase - therefore: + * You should **not** have this geodatabase open elsewhere (for example, added to the current map) while performing this operation. + * You must have full editing privileges (Update, Delete, etc.) to any feature class using this domain (mainly an issue if using SDE) + * The GP Tool parameters will look similar to the following +![Image of Import Domains](./screenshots/ScreenShot.JPG) +* When the tool runs successfully, open the geodatabase in design mode and verify that the domains have been updated with the new source data + +Verifying the domain data updates (*Recommended/Optional*): + +* After running the *Importing the domain data* steps above +* Run ArcGIS Pro +* Navigate to the local location of the [update-domain-toolbox GeoProcessing Toolbox](./update-domain-toolbox) +* Run the *Export GDB Domains to Folder* GP Tool + * As the `Input Workspace` select the Military Features template geodatabase updated while performing the *Importing the domain data* steps above + * As the `Output Folder` select an empty folder + * This tool will export all Geodatabase domains to this folder +![Image of Export Domains](./screenshots/ScreenShot2.JPG) +* When the tool runs successfully, open the `Output Folder` and verify that the folder contains one CSV file for each domain stored in the `Input Workspace` +* Using a Diff Utility (such as [WinMerge](http://winmerge.org/)) compare the folder of exported domains to the folder containing the original/source set of `name_domains_values` source CSV files to verify that the exported CSVs match the inported CSVs + * Note: a Diff Utility may notice some slight differences, for example + * Domains included in the Geodatabase that are not included in the source data + * Leading zeroes in the source data imports that are not reflected in the export, for example + + ![Image of Domains Diff](./screenshots/DomainDiff.JPG) diff --git a/data/mil2525d/utilities/military-features-utilities/screenshots/DomainDiff.JPG b/data/mil2525d/utilities/military-features-utilities/screenshots/DomainDiff.JPG new file mode 100644 index 0000000..94a56ec Binary files /dev/null and b/data/mil2525d/utilities/military-features-utilities/screenshots/DomainDiff.JPG differ diff --git a/data/mil2525d/utilities/military-features-utilities/screenshots/ScreenShot.JPG b/data/mil2525d/utilities/military-features-utilities/screenshots/ScreenShot.JPG new file mode 100644 index 0000000..b14d328 Binary files /dev/null and b/data/mil2525d/utilities/military-features-utilities/screenshots/ScreenShot.JPG differ diff --git a/data/mil2525d/utilities/military-features-utilities/screenshots/ScreenShot2.JPG b/data/mil2525d/utilities/military-features-utilities/screenshots/ScreenShot2.JPG new file mode 100644 index 0000000..7f5c47f Binary files /dev/null and b/data/mil2525d/utilities/military-features-utilities/screenshots/ScreenShot2.JPG differ diff --git a/data/mil2525d/utilities/military-features-utilities/screenshots/Toolbox.JPG b/data/mil2525d/utilities/military-features-utilities/screenshots/Toolbox.JPG new file mode 100644 index 0000000..4f11a66 Binary files /dev/null and b/data/mil2525d/utilities/military-features-utilities/screenshots/Toolbox.JPG differ diff --git a/data/mil2525d/utilities/military-features-utilities/update-domain-toolbox/UpdateDomains.tbx b/data/mil2525d/utilities/military-features-utilities/update-domain-toolbox/UpdateDomains.tbx index e8033e0..09a5d56 100644 Binary files a/data/mil2525d/utilities/military-features-utilities/update-domain-toolbox/UpdateDomains.tbx and b/data/mil2525d/utilities/military-features-utilities/update-domain-toolbox/UpdateDomains.tbx differ diff --git a/data/mil2525d/utilities/military-features-utilities/update-domain-toolbox/scripts/ExportGDBDomainsToFolder.py b/data/mil2525d/utilities/military-features-utilities/update-domain-toolbox/scripts/ExportGDBDomainsToFolder.py new file mode 100644 index 0000000..9a4eb17 --- /dev/null +++ b/data/mil2525d/utilities/military-features-utilities/update-domain-toolbox/scripts/ExportGDBDomainsToFolder.py @@ -0,0 +1,73 @@ +# ---------------------------------------------------------------------------------- +# Copyright 2015 Esri +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- +# ExportGDBDomainsToFolder.py +# Description: Exports all domains from a Military Features GDB +# Requirements: ArcGIS Desktop/Pro +# ---------------------------------------------------------------------------------- +import csv +import os +import arcpy + +def exportDomains(): + gdb = arcpy.GetParameter(0) + folder = arcpy.GetParameter(1) + + if (gdb == '') or (gdb is None): + arcpy.AddError('Input GDB not provided') + return + + if (folder == '') or (folder is None): + arcpy.AddError('Output folder not provided') + return + + domains = arcpy.da.ListDomains(gdb) + + for domain in domains: + domainName = domain.name + csvFileName = 'Coded_Domain_' + domainName + '.csv' + if domain.domainType == 'CodedValue': + arcpy.AddMessage('Exporting Domain: ' + domainName + ' to CSV: ' + csvFileName) + + codedValues = domain.codedValues + + # Create a csv file and writer to export the domains + # we do this versus the DomainToTable snippet below* + # so we can make the format closely match the format of the exported tables + # at: https://github.com/Esri/joint-military-symbology-xml/tree/master/samples/name_domains_values + # (so we can then compare the 2 outputs with a "diff" utility) + csvFullFileName = os.path.join(str(folder), csvFileName) + csvFile = open(csvFullFileName, 'w', newline='') + writer = csv.writer(csvFile, delimiter=',') + writer.writerow(["Name", "Value"]) # make header row + + # sort the codes/keys so things are exported in order + sortedCodedValues = sorted(codedValues.keys()) + + # write each line to the csv in the [description, value] format + for val in sortedCodedValues: + writer.writerow([codedValues[val], val]) + + # *DomainToTable snippet + # NOTE a much simpler version of the above if we don't care above the order/format of the export table + # desc = arcpy.Describe(gdb) + # domains = desc.domains + # for domain in domains: + # csv = 'Coded_Values_' + str(domain) + '.csv' + # arcpy.AddMessage('Exporting: ' + str(domain) + ' to CSV: ' + csv) + # table = os.path.join(str(folder), csv) + # arcpy.DomainToTable_management(gdb, domain, table, 'Value','Name', '#') + +if __name__ == '__main__': + exportDomains() \ No newline at end of file diff --git a/data/mil2525d/utilities/style-utilities/ForceRuntimeCompatibility.reg b/data/mil2525d/utilities/style-utilities/ForceRuntimeCompatibility.reg index 195a627..1480674 100644 Binary files a/data/mil2525d/utilities/style-utilities/ForceRuntimeCompatibility.reg and b/data/mil2525d/utilities/style-utilities/ForceRuntimeCompatibility.reg differ diff --git a/data/mil2525d/utilities/style-utilities/README.md b/data/mil2525d/utilities/style-utilities/README.md index 1ed90ec..c37d85f 100644 --- a/data/mil2525d/utilities/style-utilities/README.md +++ b/data/mil2525d/utilities/style-utilities/README.md @@ -11,9 +11,10 @@ ## Requirements -* This repo has been cloned to your local machine -* A set of Military Feature source .svg images in the expected file/folder format +* This repo and the [joint-military-symbology-xml repo](https://github.com/Esri/joint-military-symbology-xml) have been cloned to your local machine +* A local set of Military Feature source .svg images in the expected file/folder format * These files are currently [obtained from here](https://github.com/Esri/joint-military-symbology-xml/tree/master/svg) (but note that this location is subject to change) + * These files will be available locally when you clone the [joint-military-symbology-xml repo](https://github.com/Esri/joint-military-symbology-xml) * ArcGIS Desktop 10.X (Standard) * Used to create and verify the 10.X .style file(s) * ArcGIS Pro @@ -23,55 +24,74 @@ * [style-file-utilities](./style-file-utilities) * [merge-stylx-utilities](./merge-stylx-utilities) +## Important Warning on Runtime Compatibility Before You Begin + +**IMPORTANT:** Because the .stylx files in this repo are shared between ArcGIS Pro and Runtime, before you begin creating or editing these .stylx files, you should be aware of and familiar with a very important pre-requisite step. This important step is the setting of a .stylx "ArcGIS Runtime Compatibility Flag" in ArcGIS Pro. This flag disables some Pro symbol features that are currently incompatible with Runtime. Failure to set this flag will result in a .stylx file with symbols that fail to draw in ArcGIS Runtime. + +* IMPORTANT: Set the ArcGIS Runtime Compatibility Flag in ArcGIS Pro before doing any .stylx editing operations (importing .style(s), editing .stylx(s), etc.) + * Justification/Background: ArcGIS Pro and Runtime have some differences in how each application encodes/handles colors, fonts, and arcs/curves. + * Therefore, **if you are creating a .stylx to be used in both platforms (and in this case you are), you must set a runtime compatibility flag in ArcGIS Pro** + * To do this: + * Using the .reg file: + * Use the .reg file [ForceRuntimeCompatibility.reg](./ForceRuntimeCompatibility.reg) + * Double click on this file to install this key + * Manually installing this key -and verifying that this key is set (highly recommended): + * Run `regedit` + * Navigate to `HKEY_CURRENT_USER\Software\ESRI\ArcGISPro` `*` + * `*` IMPORTANT: verify that the current version of ArcGIS Pro settings are still installed at this location - this location could be subject to change. + * Add a new key `RTCStyles` as DWORD with value 1 + * Setting this key in Pro, does/forces the following: + * Converts all colors to use RGB instead of the Pro color model + * Vectorizes the fonts/character markers (Runtime does not install fonts) + * Densifies curves (instead of using Bezier curves or circular arcs) + * Examples of incompatible Json entries include: + * CIMRGBColor Objects - `"CIMRGBColor","values":[0,0,0,100]` - "CIMRGBColor" color object versus simplified RGBA: `"color":[0,0,0,255]` and last/alpha value of "100" (CIMRGBColor full opaque) vs. "255" (RGBA full opaque) + * Curve objects - `"curveRings"` + * To determine if your .stylx contains incompatible features, you can use SQLite to perform a query for incompatible content: `select * from ITEMS where (Content like '%CIMRGBColor%') or (Content like '%curveRings%')` + * Be aware that setting this flag/key could affect the editing of non-ArcGIS Runtime .stylx(s), so if you intend to edit other Pro .stylx(s), you may wish to remove/disable this setting when done this process. + ## General Instructions +* Verify that the [Runtime Compatibility Flag] has been set on the machine you intend to run ArcGIS Pro. See [the ArcGIS Runtime Compatibility Flag section above](#important-warning-on-runtime-compatibility-before-you-begin) * Obtain the latest set of Military Feature source .svg images in the expected file/folder format * These files may be [obtained from here](https://github.com/Esri/joint-military-symbology-xml/tree/master/svg) - * Unzip the files from the set above to your local machine and note the location - * `{Svg_Images_Home}` = ____________ + * Clone the [joint-military-symbology-xml](https://github.com/Esri/joint-military-symbology-xml) repository locally if you have not already done so. + * Note the local location of the `joint-military-symbology-xml\svg\MIL_STD_2525D_Symbols` folder: + * `{Svg_Images_Home}` = ____________ + * Ex: `{Svg_Images_Home}` = `C:\Github\joint-military-symbology-xml\svg\MIL_STD_2525D_Symbols` +* **WORKAROUND** Convert the dash patterns of some of the source SVG frames + * There is currently a workaround required on the source SVG files with respect to some of the dash patterns used in the frames + * See [svg-dash-workaround](./svg-dash-workaround) for the details and steps of this workaround * Convert the .svg files to .emf - * See [image-conversion-utilities](./image-conversion-utilities) for the details of this process - * Note the location of these converted images, `{Emf_Images_Home}` = ____________ -* Convert the .emf files to .style files using the Style File Import Utility (csv2ArcGISStyle) + * See [image-conversion-utilities](./image-conversion-utilities) for the details of this process + * Note the location of these converted images: + * `{Emf_Images_Home}` = ____________ + * Ex: `{Emf_Images_Home}` = `C:\Github\joint-military-symbology-xml\emf\MIL_STD_2525D_Symbols` +* Convert/import the .emf files to .style files using the Style File Import Utility (csv2ArcGISStyle) * See [style-file-utilities](./style-file-utilities) for the details of this process * Open ArcGIS Desktop (ArcMap) and verify/validate the output style files produced by checking these styles for errors * ArcMap | Customize | Style Manager (Add Style to List) * Close ArcMap * Once you have verified/validated the output style files, you may want to rename them * Note: names *without spaces* were used during the conversion process so you may wish to change these names at this time (if you updating the .styles in this repo) -* Set the ArcGIS Runtime Compatibility Flag in ArcGIS Pro - * IMPORTANT: ArcGIS Pro and Runtime have some differences in how each application handles colors, fonts, and arcs/curves. - * Therefore, **if you are creating a .stylx to be used in both platforms (and in this case you are), you must set a runtime compatibility flag in ArcGIS Pro** - * To do this: - * Using the .reg file: - * Use the .reg file [ForceRuntimeCompatibility.reg](./ForceRuntimeCompatibility.reg) - * Manual : - * Run `regedit` - * Navigate to `HKEY_CURRENT_USER\Software\ESRI\ArcGISPro1.0` - * Add a new key `RTCStyles` as DWORD with value 1 - * Setting this key in Pro, does/forces the following: - * Converts all colors to use RGB instead of the Pro color model - * Vectorizes the fonts/character markers (Runtime does not install fonts) - * Densifies curves (instead of using Bezier curves or circular arcs) -* Create a Pro .stylx file for the "All Icons" style file - * Rename the style file created that contains with all the icons `Military-2525Delta-All-Icons.style` to `mil2525d-points-only.style` +* Create a Pro .stylx file for the ["All Icons" style file - "Military 2525Delta All.style"](../../core_data/stylefiles/Military%202525Delta%20All.style) + * **Rename** the style file created that contains with all the icons `Military 2525Delta All Icons.style` to `mil2525d-points-only.style` * Open ArcGIS Pro and import the file `mil2525d-points-only.style` * Project | Styles | Import Style - *(Note this operation may take several minutes to complete)* * Verify/validate that the file imported correctly and the icons look as expected * View | Project View | Styles | mil2525d-points-only - * *Note: it may take 30-60 seconds for the style symbols to initially show* + * *Note: if scrolling through all of the symbols, it may take 30-60 seconds for all of the style symbols to initially show* * Close ArcGIS Pro and locate the newly-created `mil2525d-points-only.stylx` (Note: this converted/imported file now has a **stylx** file extension) * Merge `mil2525d-points-only.stylx` (created above) with `mil2525d-lines-areas-labels-base-template.stylx` to create: `mil2525d.stylx` * See [merge-stylx-utilities](./merge-stylx-utilities) for the details of this process, including generally - * Copy the file created above: `mil2525d-points-only.stylx` - * Copy (from this repo) the latest copy of [mil2525d-lines-areas-labels-base-template.stylx](../../core_data/stylxfiles) - * Merge the 2 files into `mil2525d.stylx` + * Copy the file created above: `mil2525d-points-only.stylx` + * Copy (from this repo) the latest copy of [mil2525d-lines-areas-labels-base-template.stylx](../../core_data/stylxfiles) + * Merge the 2 files into a single file: `mil2525d.stylx` * Verify/validate the final/resulting `mil2525d.stylx` * Verify/validate the final `mil2525d.stylx` file created in ArcGIS Pro * This file should now contain points, lines, polygon, text, and label placement symbols * View | Project View | Styles | mil2525d * Change the `Show:` Pull Down to change between the Point Symbol, Line Symbol, etc. types - * *Note: it may take 30-60 seconds to switch between the types* * Verify symbols and associated meta data -* Finally, update [the .stylx file in this repo](../../core_data/stylxfiles) +* Finally, update [the mil2525d.stylx file in this repo](../../core_data/stylxfiles) diff --git a/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoEMF-CaptureOutput.bat b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoEMF-CaptureOutput.bat new file mode 100644 index 0000000..1df5dc3 --- /dev/null +++ b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoEMF-CaptureOutput.bat @@ -0,0 +1,3 @@ +:: Runs the converter batch and captures output to a file +:: (useful if there are errors in the conversion process) +ConvertTree-SVGtoEMF.bat > ConverterOutput.txt 2>&1 \ No newline at end of file diff --git a/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoEMF.bat b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoEMF.bat index c795d5e..f3af4a5 100644 --- a/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoEMF.bat +++ b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoEMF.bat @@ -6,7 +6,7 @@ :: This was needed to handle a set of source svgs with a complex folder structure that :: needed to be maintained -:: This script converts SVG files to EMF/PNG. Run as admin +:: This script converts SVG files to EMF/PNG. :: For Inkscape help, see http://inkscape.org/doc/inkscape-man.html :: For an alternative to Inkscape that works just as well, see http://code.google.com/p/svg2emf/ diff --git a/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoPNG-128.bat b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoPNG-128.bat index b6b7492..ffa624a 100644 --- a/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoPNG-128.bat +++ b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoPNG-128.bat @@ -6,7 +6,7 @@ :: This was needed to handle a set of source svgs with a complex folder structure that :: needed to be maintained -:: This script converts SVG files to EMF/PNG. Run as admin +:: This script converts SVG files to EMF/PNG. :: For Inkscape help, see http://inkscape.org/doc/inkscape-man.html :: For an alternative to Inkscape that works just as well, see http://code.google.com/p/svg2emf/ diff --git a/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoPNG-256.bat b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoPNG-256.bat index 36b787d..333b205 100644 --- a/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoPNG-256.bat +++ b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/ConvertTree-SVGtoPNG-256.bat @@ -6,7 +6,7 @@ :: This was needed to handle a set of source svgs with a complex folder structure that :: needed to be maintained -:: This script converts SVG files to EMF/PNG. Run as admin +:: This script converts SVG files to EMF/PNG. :: For Inkscape help, see http://inkscape.org/doc/inkscape-man.html :: For an alternative to Inkscape that works just as well, see http://code.google.com/p/svg2emf/ diff --git a/data/mil2525d/utilities/style-utilities/image-conversion-utilities/README.md b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/README.md index 68aac19..bbcbf5e 100644 --- a/data/mil2525d/utilities/style-utilities/image-conversion-utilities/README.md +++ b/data/mil2525d/utilities/style-utilities/image-conversion-utilities/README.md @@ -2,16 +2,16 @@ ## Purpose -* Converts a set of Scalable Vector Graphics (.svg) files (arranged in a directory tree) +* Converts a set of Scalable Vector Graphics (.svg) files (arranged in a directory tree) to other formats (ex: .png/.emf) * Recreates the original folder structure/tree of the source folder in the destination folder ## Important Notes/Caveats/Limitations * Windows-only * These utilities were written as DOS batch (.bat) files to be able to run relatively easily (with minimum configuration) i.e. without needing to install additional software (besides the .svg converter) -* No spaces in paths - * Because of the batch file constraints (mainly needing to replace text in variables in a DOS batch file), there can't be any spaces in the paths - * So, for instance, don't install your converter to "Program Files" or put the files to convert in "My Documents" +* IMPORTANT: No spaces in any of the paths (path to Inkscape, path to SVGs, etc.) + * Because of the Windows batch file constraints (mainly needing to replace text in variables in a DOS batch file), there can't be any spaces in the paths + * So, for instance, **don't** install your converter to **"Program Files"** or put the files to convert in **"My Documents"** * Need to install a third party .svg converter utility * A utility such as Inkscape to perform the actual conversion of each file @@ -19,10 +19,11 @@ * Ensure that an appropriate .svg converter is installed * This utility has been tested with Inkscape, but several others are available - * Inkscape is available at: http://www.inkscape.org/en/download/ - * It is recommended that you use the [.7zip version](http://downloads.sourceforge.net/inkscape/inkscape-0.48.4-1-win32.7z) which allows you to extract anywhere (so you don't put a space in the path) + * Note: this process was last tested with Inkscape 0.91 + * Inkscape is available at: http://www.inkscape.org/en/download/ (you may use 32 or 64-bit Windows version) + * It is recommended that you use the [.7zip version](https://inkscape.org/en/gallery/item/3932/Inkscape-0.91-1-win32.7z) which allows you to extract anywhere (so you don't put a space in the path - [see limitations](#important-notescaveatslimitations) ) * Select the desired .bat that matches your desired conversion method - * e.g. `ConvertTree-SVGtoEMF.bat` to convert an .svg file tree to Enhanced Metafile Format (.emf) + * `ConvertTree-SVGtoEMF.bat` used to convert an .svg file tree to Enhanced Metafile Format (.emf) is the version you will normally want to use with this process. * IMPORTANT: Modify the converter .bat command file to match your local paths * Open and edit the desired .bat file, find the "IMPORTANT/TODO" section at the top, and edit the paths: * (1) Converter location: full path to .svg converter @@ -30,13 +31,12 @@ * (3) Desired Destination Folder * See [sample converter .bat file for more information](./ConvertTree-SVGtoEMF.bat) * Run the desired .bat file - * Open a Command Prompt as an administrator * `cd {local-path-to-bat}` * Run the .bat, e.g. ConvertTree-SVGtoEMF.bat * If you wish to capture the command-line output for later analysis of errors add the following to the command above: `ConverterOutput.txt 2>&1` + * If you wish to capture the output, alternately, you can run the file: `ConvertTree-SVGtoEMF-CaptureOutput.bat` * (Full Example) `ConvertTree-SVGtoEMF.bat > ConverterOutput.txt 2>&1` * *(May take several minutes depending on the number of files)* * Check the output for errors * Check the destination folder for the converted image files - - + * IMPORTANT NOTE: MS Paint (which is the default file association) does not support the latest version of EMF so you will need to use an alternative program to view the resulting EMF files (ex. MS Word) diff --git a/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/.gitignore b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/.gitignore index 29a7166..3540e57 100644 --- a/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/.gitignore +++ b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/.gitignore @@ -1,2 +1,9 @@ -*.csv - +# Ignore these temp file used for the merge process +Military-All-Icons.csv +Military-ControlMeasures-Source-Points.csv +Military-ControlMeasures-Source-Lines.csv +Military-ControlMeasures-Source-Areas.csv +*.stylx +*.orig +*.localversion +*-local.* \ No newline at end of file diff --git a/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/AutomatedCopyandMerge.bat b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/AutomatedCopyandMerge.bat new file mode 100644 index 0000000..c81664c --- /dev/null +++ b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/AutomatedCopyandMerge.bat @@ -0,0 +1,70 @@ +:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +:: IMPORTANT/TODO: you must set/correct paths below: "TODO_" +:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +:: INPUTS/SETTINGS: +:: (1) Joint Military Symbology Cloned Repo location: +:: Cloned from: https://github.com/Esri/joint-military-symbology-xml to local machine +SET LOCAL_JMSXML_REPO_CLONE=C:\{TODO_EDIT_THIS_PATH}\joint-military-symbology-xml +:: EXAMPLE: SET LOCAL_JMSXML_REPO_CLONE=C:\Github\joint-military-symbology-xml + +:: (2) Path to Sqlite executable/engine +:: If you are using a tool other than sqlite3.exe, you may need to edit that also +SET SQLITE_PATH_AND_EXE=C:\{TODO_EDIT_THIS_PATH}\sqlite3.exe +:: EXAMPLE: SET SQLITE_PATH_AND_EXE=C:\Installs\Sqlite\sqlite3.exe + +:: (3) Military Features Data Root Folder (military-features-data) +:: No need to set this, but do note it assumes it is being run from: +:: .\military-features-data\data\mil2525d\utilities\style-utilities\merge-stylx-utilities +:: Just make it relative to this folder (this is easier than using this relative path everywhere) +SET LOCAL_MIL_FEATURES_REPO_2525D=..\..\.. + +:: (4) Name of the stylx file that has only the Point/SVG symbols +:: IMPORTANT: the script assumes this file will be in the same folder: +:: ...style-utilities\merge-stylx-utilities +SET POINTS_ONLY_STYLX=mil2525d-points-only.stylx + +:: it is the default, but just in case, this enables the needed feature "goto :eof" ("exit/return") +setlocal ENABLEEXTENSIONS + +:: Check the JMSXML_REPO folder exists +if exist "%LOCAL_JMSXML_REPO_CLONE%" goto prereqs_jmsxml_exists_ok + +echo "ERROR: Required local joint-military-symbology-xml repo does not exist: %LOCAL_JMSXML_REPO_CLONE%" +goto :pauseit + +:prereqs_jmsxml_exists_ok + +:: Check the Sqlite exe exists +if exist "%SQLITE_PATH_AND_EXE%" goto prereqs_sqlite_exists_ok + +echo "ERROR: Required Sqlite exe/engine does not exist: %SQLITE_PATH_AND_EXE%" +goto :pauseit + +:prereqs_sqlite_exists_ok + +:: Check that we are in the expected military-features-data folder +:: just check that an expected folder exists +if exist "%LOCAL_MIL_FEATURES_REPO_2525D%\core_data" goto prereqs_milfeatures_exists_ok + +echo "ERROR: This .bat does not appear to be in the expected folder: %LOCAL_MIL_FEATURES_REPO_2525D%" +goto :pauseit + +:prereqs_milfeatures_exists_ok + +if exist "%POINTS_ONLY_STYLX%" goto prereqs_points_only_stylx_exists_ok +echo "ERROR: Could not find points only stylx in current folder: %POINTS_ONLY_STYLX%" +goto :pauseit + +:prereqs_points_only_stylx_exists_ok + +copy "%LOCAL_MIL_FEATURES_REPO_2525D%\core_data\stylxfiles\mil2525d-lines-areas-labels-base-template.stylx" mil2525d.stylx + +copy %POINTS_ONLY_STYLX% mil2525d-points-to-add-keys-labels.stylx + +"%SQLITE_PATH_AND_EXE%" < "%LOCAL_MIL_FEATURES_REPO_2525D%\utilities\style-utilities\merge-stylx-utilities\SqliteMergeStylx.sql" + +echo ******* IMPORTANT: Now verify the output and check for any errors ******* + +:pauseit +Pause diff --git a/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/Readme.md b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/Readme.md index bca4d0e..c5e120c 100644 --- a/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/Readme.md +++ b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/Readme.md @@ -3,37 +3,58 @@ ## Purpose * Merges: -* A version of the .stylx that is edited and maintain in ArcGIS Pro + * A version of the .stylx that is edited and maintained in ArcGIS Pro * See: [mil2525d-lines-areas-labels-base-template.stylx](https://github.com/ArcGIS/military-features-pro-data/blob/master/data/core_data/stylxfiles/mil2525d-lines-areas-labels-base-template.stylx) * -with- -* A version that is automatically generated from [marker symbols and meta-data-tagged source data](https://github.com/Esri/joint-military-symbology-xml) - * For more information on this process/version, see : + * A version of the .stylx file with the SVG/EMF marker/points-only icons. This version is normally automatically generated from SVG icon marker symbols and meta-data-tagged source data from the [joint-military-symbology-xml repository](https://github.com/Esri/joint-military-symbology-xml) + * For more information on this data/process/version, see : * [joint-military-symbology-xml repo](https://github.com/Esri/joint-military-symbology-xml) * [style-file-utilities](../style-file-utilities) ## Requirements -* 2 Versions of the .stylx files: - * A Pro/Runtime stylx file with all of the 2525D Point Icons called `mil2525d-points-only.dat` - * This would have been created [by following the steps/readme here](https://github.com/ArcGIS/military-features-pro-data/tree/master/source/utilities) - * A version of the .stylx that is edited and maintained in ArcGIS Pro: [mil2525d-lines-areas-labels-base-template.stylx](https://github.com/ArcGIS/military-features-pro-data/blob/master/data/core_data/stylxfiles/mil2525d-lines-areas-labels-base-template.stylx) +* `(1)` 2 Versions of the .stylx files: + * A version of the .stylx file with the SVG/EMF icons + * A Pro/Runtime stylx file with all of the 2525D Point Icons called `mil2525d-points-only.stylx` + * This would have been created [by following the steps/readme here](../../utilities) + * If you don't already have this file, you can create one by (1) importing the 10.X **.style** file with these point icons into ArcGIS Pro and (2) renaming the resulting file to `mil2525d-points-only.stylx` - steps: + * Import the file ["Military 2525Delta All.style"](../../../core_data/stylefiles/Military%202525Delta%20All.style) into Pro (Note: this is a 10.X **style** file until you import it into Pro, after which time a **.stylx** file will be created) + * Rename `Military 2525Delta All.stylx` to `mil2525d-points-only.stylx` + * A version of the .stylx that is edited and maintained in ArcGIS Pro: [mil2525d-lines-areas-labels-base-template.stylx](../../../core_data/stylxfiles/mil2525d-lines-areas-labels-base-template.stylx) * This version has Label Placement definitions, Point, Line, Polygon, and Text Symbols that are manually created and maintained in ArcGIS Pro -* A Sqlite Editor/Interpreter capable of executing SQL commands - * These steps have been tested using [sqlite3.exe](http://www.sqlite.org/download.html) but you may use the editor of your choice -* An Style Icon specification file: [Military-All-Icons.csv](https://github.com/Esri/joint-military-symbology-xml/blob/master/samples/imagefile_name_category_tags/Military-All-Icons.csv) with the following required fields: `styleItemCategory, styleItemName, styleItemUniqueId, styleItemTags` + * This file is already included with this repo +* `(2)` A SQLite Engine/Editor/Interpreter capable of executing SQL commands from a script + * These steps have been tested using [sqlite3.exe](http://www.sqlite.org/download.html) but you may use the application/sqlite engine of your choice +* `(3)` A Style Icon specification file: [Military-All-Icons.csv](https://github.com/Esri/joint-military-symbology-xml/blob/master/samples/imagefile_name_category_tags/Military-All-Icons.csv) with the following required fields: `styleItemCategory, styleItemName, styleItemUniqueId, styleItemTags` ## Instructions -* Copy required files mentioned in Requirements above: - * `mil2525d-points-only.dat` - * `mil2525d-lines-areas-labels-base-template.stylx` - * `Military-All-Icons.csv` - * to this folder (`military-features-pro-data\source\utilities\merge-stylx-utilities`) -* Rename `mil2525d-lines-areas-labels-base-template.stylx` to `mil2525d.stylx` -* Launch the Sqlite editor/interpreter of your choice -* Follow the SQL commands/steps in [SqliteMergeStylx.sql](./SqliteMergeStylx.sql) - * Optionally you may edit this file to update the setting/string `{Full Path To}` to the local path and run this as an SQL script -* Exit the Sqlite Editor -* Test and update the resulting `mil2525d.stylx` in this repository +* Copy/edit/verify the prerequisite files are present + * Copy the required "Points/Icons-Only" version of the .stylx mentioned in Requirements above to this folder and ensure it is named: `mil2525d-points-only.stylx` + * This file should now exist locally: `...utilities\style-utilities\merge-stylx-utilities\mil2525d-points-only.stylx` + * Clone the [joint-military-symbology-xml](https://github.com/Esri/joint-military-symbology-xml) repository locally if you have not already done so. + * This file should now exist locally: `...joint-military-symbology-xml\samples\imagefile_name_category_tags\Military-All-Icons.csv` + * Edit the versions.csv file to update the pertinent version information, this information will be inserted into the completed/merged mil2525d.stylx file + * This file should now be current with the updated/desired version information: `...utilities\style-utilities\merge-stylx-utilities\versions.csv` +* Edit the automated scripts to point to the paths/configuration of your local machine: + * Use a text editor of your choice, such as Notepad/Notepad++, to edit and save local versions of the following files + * Edit the batch file: [AutomatedCopyandMerge.bat](./AutomatedCopyandMerge.bat), set/replace the following settings: + * These settings read `{TODO_EDIT_THIS_PATH}` and are: + * The local/cloned copy of the Joint Military Symbology repository: `SET LOCAL_JMSXML_REPO_CLONE=________` + * The path to the SQLite executable/engine: `SET SQLITE_PATH_AND_EXE=________` + * Save the updated version of the batch file + * Edit the SQLite script [SqliteMergeStylx.sql](./SqliteMergeStylx.sql) to provide the fully qualified local path to this folder (`...utilities/style-utilities/merge-stylx-utilities`) + * **IMPORTANT**: the SQLite engine `sqlite3.exe` will *not* recognize backslashes (`\` - MS-DOS paths) so forward slashes (`/` - Unix-style paths) must be used. + * Replace all instances (currently 4 instances) of `{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}` with the fully qualified local path to this folder: `....utilities/style-utilities/merge-stylx-utilities` being careful to + * Use forward slashes (`/`) rather than backslashes (`\`) + * Scroll through the entire file to check for replacements, several instances are near the bottom, end of the file + * Save the updated version of the .sql file +* Run the automated script to merge the two stylx files - [AutomatedCopyandMerge.bat](./AutomatedCopyandMerge.bat) + * After the batch file has run, verify that there are no errors in the output +* Test and update the resulting `mil2525d.stylx` created. To test you may: + * Open the mil2525d.stylx in ArcGIS Pro -or- + * You may replace/update the .stylx used mil2525d DictionaryRenderer by replacing the file at `ArcGIS\Pro\Resources\Dictionaries\mil2525d` +* Once you have tested for correctness, you may wish to update the managed version in this repository at [core_data/stylxfiles](../../../core_data/stylxfiles) + diff --git a/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/SqliteMergeStylx.sql b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/SqliteMergeStylx.sql index 2519c6a..dbdd586 100644 --- a/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/SqliteMergeStylx.sql +++ b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/SqliteMergeStylx.sql @@ -1,7 +1,7 @@ /* Prerequisites: 1. 2 Versions of the .stylx files: - 1. A Pro/Runtime stylx file with all of the 2525D Point Icons named : `mil2525d-points-only.stylx` + 1. A Pro/Runtime stylx file with all of the 2525D Point Icons named : `mil2525d-points-to-add-keys-labels.stylx` 2. A version of the .stylx that is edited and maintained in ArcGIS Pro: `mil2525d.stylx` (This is the copied/renamed file: `mil2525d-lines-areas-labels-base-template.stylx`) 2. A Sqlite Editor/Interpreter capable of executing SQL commands (ex. sqlite3.exe) @@ -13,13 +13,12 @@ Prerequisites: /* Conversion Steps - Launch the Sqlite editor/interpreter of your choice */ /* You may be able to run this as .sql script if you edit {Full Path To} to the local path */ -attach "{Full Path To}/mil2525d-points-only.stylx" as mil2525d_points; -attach "{Full Path To}/mil2525d.stylx" as mil2525d; +attach "{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}/mil2525d-points-to-add-keys-labels.stylx" as mil2525d_points; +attach "{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}/mil2525d.stylx" as mil2525d; /* Example: -attach "C:/DefenseTemplates/Github/military-features-pro-data/source/utilities/merge-stylx-utilities/mil2525d-points-only.stylx" as mil2525d_points; -attach "C:/DefenseTemplates/Github/military-features-pro-data/source/utilities/merge-stylx-utilities/mil2525d.stylx" as mil2525d; - +attach "C:/Github/military-features-data/source/utilities/merge-stylx-utilities/mil2525d-points-to-add-keys-labels.stylx" as mil2525d_points; +attach "C:/Github/military-features-data/source/utilities/merge-stylx-utilities/mil2525d.stylx" as mil2525d; --> IMPORTANT/TRICKY NOTE: the import/attach commands require **forward** slashes (even on Windows) */ @@ -28,18 +27,18 @@ attach "C:/DefenseTemplates/Github/military-features-pro-data/source/utilities/m /* Add these required columns to points version of the database */ /* TODO: Pro will eventually need to add these to the default stylx schema, so these commands may no longer be needed at some point */ -ALTER TABLE mil2525d_points.ITEMS ADD COLUMN Key TEXT; +/* NOTE: This Column("Key") did get added at Pro 1.1 */ +/*ALTER TABLE mil2525d_points.ITEMS ADD COLUMN Key TEXT; */ +/* NOTE: Still need to add this one("LabelRules"): */ ALTER TABLE mil2525d_points.ITEMS ADD COLUMN LabelRules TEXT; /* Set the Key and Label Rules for the points version of the database (from Military-All-Icons.csv) */ .mode csv -.import {FULL-PATH-TO}/Military-All-Icons.csv NameJoin +.import "{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}/Military-All-Icons.csv" NameJoin /* Example: -.mode csv -.import "C:/DefenseTemplates/Github/military-features-pro-data/source/utilities/merge-stylx-utilities/Military-All-Icons.csv" NameJoin - +.import "C:/Github/military-features-data/source/utilities/merge-stylx-utilities/Military-All-Icons.csv" NameJoin --> IMPORTANT/TRICKY NOTE: the import/attach commands require **forward** slashes (even on Windows) */ @@ -95,11 +94,20 @@ insert into mil2525d.ITEMS (CLASS,CATEGORY,NAME,TAGS,CONTENT,Key,LabelRules) detach mil2525d_points; +/* Add version information */ +.mode csv +.import "{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}/versions.csv" meta + +/* Example: +.import "C:/Github/military-features-data/source/utilities/merge-stylx-utilities/versions.csv" meta +--> IMPORTANT/TRICKY NOTE: the import/attach commands require **forward** slashes (even on Windows) +*/ + /* ensure mil2525d_points detached */ .databases /* clean up - really shouldn't be any (nothing was deleted), but just in case process changes */ VACUUM; -/* all done */ +/* all done - but make sure you check for errors! */ .exit \ No newline at end of file diff --git a/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/SqliteUpdateTemplateStylxTags.sql b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/SqliteUpdateTemplateStylxTags.sql new file mode 100644 index 0000000..14b3447 --- /dev/null +++ b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/SqliteUpdateTemplateStylxTags.sql @@ -0,0 +1,58 @@ +/* +Purpose: this script is an administrative tool to update the *Tags* column of the manually maintained .stylx: + `mil2525d-lines-areas-labels-base-template.stylx` + if/when the source data (as maintained in Military-All-Icons.csv) changes + +Prerequisites: +1. A version of the .stylx that is edited and maintained in ArcGIS Pro: `mil2525d-lines-areas-labels-base-template.stylx` + Copy this file: `mil2525d-lines-areas-labels-base-template.stylx` into the current/merge folder +2. A Sqlite Editor/Interpreter capable of executing SQL commands (ex. sqlite3.exe) +3. The 3 Icon specification files for the **Control Measures**: + 1. Military-ControlMeasures-Source-Points.csv + 2. Military-ControlMeasures-Source-Lines.csv + 3. Military-ControlMeasures-Source-Areas.csv + 4. Copy these files into the current/merge folder + 5. Additional Notes: + Obtained from: https://github.com/Esri/joint-military-symbology-xml/blob/master/samples/imagefile_name_category_tags + With the following required fields: `styleItemCategory, styleItemName, styleItemUniqueId, styleItemTags` + +To Run: +1. In this file, replace all instances of `{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}` + with the fully qualified local path to this folder: `....utilities/style-utilities/merge-stylx-utilities` + being careful to use forward slashes (`/`) rather than backslashes (`\`) + and save the file +1. Run sqlite3.exe +2. .load "{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}/SqliteUpdateTemplateStylxTags.sql" +-or- +sqlite3.exe < "{PATH_TO_LOCAL_MIL_FEATURES_REPO}\style-utilities\merge-stylx-utilities\SqliteUpdateTemplateStylxTags.sql" +*/ + +.print "Attaching stylx..." +attach "{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}/mil2525d-lines-areas-labels-base-template.stylx" as mil2525d; + +/* Import the icon specification files for the Control Measures */ +.print "Importing Military-All-Icons.csv to use for join..." +.mode csv +.import "{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}/Military-ControlMeasures-Source-Points.csv" NameJoin1 + +.import "{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}/Military-ControlMeasures-Source-Lines.csv" NameJoin2 + +.import "{FULL-PATH-TO-MERGE-FOLDER-NO-BACKSLASHES}/Military-ControlMeasures-Source-Areas.csv" NameJoin3 + +.print "Print current tables attached..." +.tables + +/* Now Join on those specification files to update the Tags with the data from the spec files */ +.print "Updating Tags where ITEMS.Key *contains* NameJoin.styleItemUniqueId for each csv file..." +INSERT OR REPLACE INTO mil2525d.ITEMS + SELECT ITEMS.ID,ITEMS.CLASS,ITEMS.CATEGORY,ITEMS.NAME,NameJoin1.styleItemTags,ITEMS.CONTENT,ITEMS.Key,ITEMS.LabelRules + FROM ITEMS JOIN NameJoin1 ON instr(ITEMS.Key, NameJoin1.styleItemUniqueId) > 0; + +INSERT OR REPLACE INTO mil2525d.ITEMS + SELECT ITEMS.ID,ITEMS.CLASS,ITEMS.CATEGORY,ITEMS.NAME,NameJoin2.styleItemTags,ITEMS.CONTENT,ITEMS.Key,ITEMS.LabelRules + FROM ITEMS JOIN NameJoin2 ON instr(ITEMS.Key, NameJoin2.styleItemUniqueId) > 0; + +INSERT OR REPLACE INTO mil2525d.ITEMS + SELECT ITEMS.ID,ITEMS.CLASS,ITEMS.CATEGORY,ITEMS.NAME,NameJoin3.styleItemTags,ITEMS.CONTENT,ITEMS.Key,ITEMS.LabelRules + FROM ITEMS JOIN NameJoin3 ON instr(ITEMS.Key, NameJoin3.styleItemUniqueId) > 0; + diff --git a/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/versions.csv b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/versions.csv new file mode 100644 index 0000000..6d175b8 --- /dev/null +++ b/data/mil2525d/utilities/style-utilities/merge-stylx-utilities/versions.csv @@ -0,0 +1,6 @@ +runtime_version,10.3 +pro_version,1.1.0 +milstylx_version,1.1.0 +milplugin_version,1.1.0 +milstd_version,2525D-0.1 +jmsml_version,1.0.1 \ No newline at end of file diff --git a/data/mil2525d/utilities/style-utilities/svg-dash-workaround/PowerShellReplaceMultiple.ps1 b/data/mil2525d/utilities/style-utilities/svg-dash-workaround/PowerShellReplaceMultiple.ps1 new file mode 100644 index 0000000..b23b7b4 --- /dev/null +++ b/data/mil2525d/utilities/style-utilities/svg-dash-workaround/PowerShellReplaceMultiple.ps1 @@ -0,0 +1,25 @@ +# replaces multiple strings in a file (requires Powershell installed) + +Param( + [parameter(Mandatory=$true)] + [alias("replacefile")] + $source_file + ) + +Write-Host "Checking SourceFile = $source_file" + + # These are all of the various "stroke-dasharray" values that were causing problems: +(Get-Content $source_file) | Foreach-Object { +$_ -replace 'stroke-dasharray="22.1063,13.2638"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="23.3682,14.0209"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="23.4314,14.0588"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="23.5714,14.1429"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="24.1702,14.5021"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="24.267,14.5602"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="24.5874,14.7524"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="25.4169,15.2501"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="25.4169,20.3335"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="25.5417,15.325"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="25.7843,15.4706"', 'stroke-dasharray="75,45"' ` + -replace 'stroke-dasharray="25,15"', 'stroke-dasharray="75,45"' + } | Out-File $source_file -encoding ASCII diff --git a/data/mil2525d/utilities/style-utilities/svg-dash-workaround/README.md b/data/mil2525d/utilities/style-utilities/svg-dash-workaround/README.md new file mode 100644 index 0000000..cab6f31 --- /dev/null +++ b/data/mil2525d/utilities/style-utilities/svg-dash-workaround/README.md @@ -0,0 +1,34 @@ +# military-features-data / data / mil2525d / utilities / style-utilities / svg-dash-workaround + +## Purpose + +* This utility replaces dash patterns in a set of Scalable Vector Graphics (.svg) files +* It is a WORKAROUND to an issue encountered where the dash patterns of the SVG frames are not apparent or visible at smaller scales + * This issue is most apparent when the symbols are viewed as symbols on a map where there size is 128 points or less + * Without this workaround, the dashed symbol frames will appear this way when run through the complete conversion process + +![Image of Symbol Without Workaround](WithoutWorkaround.png) + +## Instructions + +* Using a text editor, edit the [stroke-dash-array-workaround.bat](./stroke-dash-array-workaround.bat) batch file in this folder + * IMPORTANT: Modify the .bat command file to match your local paths + * Open and edit the .bat file, find the "IMPORTANT/TODO" section at the top, and edit the line/path: + * `SET svg_source_folder=C:\{TODO_EDIT_PATH_TO_SVGs}` + * Set `C:\{TODO_EDIT_PATH_TO_SVGs}` to the fully qualified path of the joint-military-symbology-xml SVG Files + * Ex: `C:\Github\joint-military-symbology-xml\svg\MIL_STD_2525D_Symbols` +* Run the stroke-dash-array-workaround.bat file + * Double click on the file + * -or- open a command prompt + * `cd {local-path-to*}` + * `stroke-dash-array-workaround.bat` + * Check the output for errors +* Check the SVG source folder that the workaround has been applied + * Open a command prompt + * `cd {local-path-to*}\joint-military-symbology-xml\svg\MIL_STD_2525D_Symbols\Frames` + * `findstr /s /c:"stroke-dasharray=\"75,45\"" *.svg > stroke-dash-array-check.txt` + * Open the resulting file `stroke-dash-array-check.txt` in a text editor and verify that there are entries (currently several hundred) that show the `stroke-dasharray` workaround values: `stroke-dasharray="75,45"` + * These values are not present in the source data, so there existence will verify that the replacement was made + * If you would like to see the values replaced, see the [replacement script](./PowerShellReplaceMultiple.ps1) + +`*` Note: Replace `{local-path-to}` with the fully qualified path, ex: `C:\Github\....` \ No newline at end of file diff --git a/data/mil2525d/utilities/style-utilities/svg-dash-workaround/WithoutWorkaround.png b/data/mil2525d/utilities/style-utilities/svg-dash-workaround/WithoutWorkaround.png new file mode 100644 index 0000000..51af22b Binary files /dev/null and b/data/mil2525d/utilities/style-utilities/svg-dash-workaround/WithoutWorkaround.png differ diff --git a/data/mil2525d/utilities/style-utilities/svg-dash-workaround/stroke-dash-array-workaround.bat b/data/mil2525d/utilities/style-utilities/svg-dash-workaround/stroke-dash-array-workaround.bat new file mode 100644 index 0000000..a556ba0 --- /dev/null +++ b/data/mil2525d/utilities/style-utilities/svg-dash-workaround/stroke-dash-array-workaround.bat @@ -0,0 +1,79 @@ +@ECHO OFF + +:: License Apache V2 + +:: This script replaces text in a set of SVG files + +:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +:: IMPORTANT/TODO: you must set/correct paths below +:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +:: (1) Source SVG Root Folder +SET svg_source_folder=C:\{TODO_EDIT_PATH_TO_SVGs} +:: Ex: +:: SET svg_source_folder=C:\Github\joint-military-symbology-xml\svg\MIL_STD_2525D_Symbols + +:: Note: there must be a "Frames" subfolder under the path above +SET svg_frames_source_folder="%svg_source_folder%\Frames" + +:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +:: it is the default, but just in case, this enables the needed feature "goto :eof" ("return") +setlocal ENABLEEXTENSIONS + +powershell -Command "Write-Host "PowerShell Installed"" + +:: Check source folder exists +if exist %svg_frames_source_folder% goto prereqs_exists_ok + +echo Required Source Folder does not exist: %svg_frames_source_folder% +pause +goto :EOF + +:prereqs_exists_ok + +:: Note: Use "/r" option if you want to convert a folder and all subfolders (recursion) +:: do ReplaceTextInFiles for each svg found with these matching patterns: + +for /r %svg_frames_source_folder% %%i in (*_1.svg) do call :ReplaceTextInFiles %%i + +for /r %svg_frames_source_folder% %%i in (*_1c.svg) do call :ReplaceTextInFiles %%i + +:: Done +echo Successfully Completed! + +pause + +goto :EOF + +:: ---------------------------------------------------------------------------- +:: ReplaceTextInFiles - Replaces text in a file +:: +:: %1 - Source File (full path) +:: ---------------------------------------------------------------------------- + +:ReplaceTextInFiles + +setlocal ENABLEEXTENSIONS + +set source_file="%1" + +if "" == %source_file% goto :EOF + +:: Check file exists +if exist %source_file% goto exists_ok + +echo "Required File does not exist: %source_file%" +goto :EOF + +:exists_ok + +echo Checking text in: %source_file% + +:: Simpler Form if we only had to do 1 replace: +:: powershell -Command "(gc %source_file%) -replace 'stroke-dasharray=\"X,Y\"', 'stroke-dasharray=\"75,45\"' | Out-File %source_file% -encoding ASCII" + +:: Our *slightly* more complicated version to replace multiple strings (needs run from standalone script): +powershell -ExecutionPolicy ByPass -file PowerShellReplaceMultiple.ps1 %source_file% + +endlocal & goto :EOF