old-mil-sym-java icon indicating copy to clipboard operation
old-mil-sym-java copied to clipboard

Aviation Areas DTG1 label

Open ChristinaKochan opened this issue 9 years ago • 16 comments

Sometimes when the size of an Aviation area graphic is too small to fit all of the modifier text, "???" is returned instead of the "TIME TO: W1" label. Any idea if something in my data is bad or if this is a bug?

The following data sent to the service is one example that I have seen that causes this to happen: [0]: {[ID, f2ea82a8-cf2b-4bfd-a2bc-c2134fc60265]} [1]: {[NAME, name]} [2]: {[DESCRIPTION, GHGPAAH----I---]} [3]: {[CONTROLPOINTS, -16.9596325160394,43.3194068834523 -16.9596325160394,40.8686532543514 -14.5088788869385,40.8686532543514 -14.5088788869385,43.3194068834523]} [4]: {[ALTITUDEMODE, clampToGround]} [5]: {[SCALE, 20496779.3334322]} [6]: {[BBOX, -17.5723209233147,40.2559648470762,-13.8961904796633,43.9320952907275]} [7]: {[FORMAT, 2]} [8]: {[SYMSTD, 0]} [9]: {[MODIFIERS, {"H":"","H1":"","T":"test t value","W":"test w value","W1":"test w1 value","X":["0"]}]}

image

ChristinaKochan avatar Feb 15 '17 20:02 ChristinaKochan

If the area graphic is too small for the text to fit our code adds an ellipsis, three dots at the bottom. It should not be ??? Here is the code we are using: if (addEllipsis) { Character letter = (char) 9679; String s = Character.toString(letter); String echelonSymbol = s + s + s; modifierE.text = echelonSymbol; modifierE.lineFactor = maxLF + 1; modifiers2.add(modifierE); Thus far we had no reports of the ellipsis not displaying.

mdeutch3 avatar Feb 15 '17 20:02 mdeutch3

It's the same characters when we render a boundary with a squad, section or platoon echelon. I haven't tried Java yet but when I use my JavaScript tester to render a boundry with echelon platoon I get:

{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"label":"","strokeColor":"#000000","lineOpacity":1,"strokeWidth":3,"strokeWeight":3},"geometry":{"type":"MultiLineString","coordinates":[[[66.2755568,30.6472778],[66.2565425,30.646327]]]}},{"type":"Feature","properties":{"label":"●●●","pointRadius":0,"fontSize":"12pt","fontFamily":"Arial, sans-serif","fontWeight":"bold","fontColor":"#000000","labelOutlineColor":"#FFFFFF","labelOutlineWidth":3,"labelAlign":"center","labelBaseline":"alphabetic","labelXOffset":0,"labelYOffset":0,"rotation":-1.240462792849581,"angle":-1.240462792849581},"geometry":{"type":"Point","coordinates":[66.2660506,30.646725]}}],"properties":{"id":"ID","name":"Name","description":"Description","symbolID":"GFGPGLB----D**X"}}

michael-spinelli avatar Feb 15 '17 21:02 michael-spinelli

You can see the ellipsis in the label in the previous post. I tested HIDACZ with GeoJSON format and produced a JSON file with it and displayed in the following viewer: http://geojson.io. The ellipsis appears in the viewer. Can you examine your json output to see if the ellipsis appears and also with the viewer?

mdeutch3 avatar Feb 15 '17 21:02 mdeutch3

Is there any option to force it to return all of the labels even if they don't fit? I have a feeling that even if we get the ellipsis to appear my customer would not like that.

I'll take a look at my json later today either way.

ChristinaKochan avatar Feb 16 '17 16:02 ChristinaKochan

@michael-spinelli would no ellipsis that be a renderer setting?

mdeutch3 avatar Feb 16 '17 16:02 mdeutch3

-There's get/setAutoCollapseModifiers() in RendererSettings if you're using the jars directly.
-If you're using the WAR, goto mil-sym-service.war\WEB-INF\classes\properties\prop.properties and change the value to false -If you're running the web service from the jars, I'm going to have to add an argument that you can pass in to disable it.

michael-spinelli avatar Feb 16 '17 17:02 michael-spinelli

Renderer scaleModifiers has the call to RendererSettings: if (RendererSettings.getInstance().getAutoCollapseModifiers() == false) { return; } so it won't scale the modifiers if the client at whatever level does setAutoCollapseModifiers(true);

mdeutch3 avatar Feb 16 '17 17:02 mdeutch3

Last comment should read as follows: so it won't scale the modifiers if the client at whatever level does setAutoCollapseModifiers(false);

mdeutch3 avatar Feb 16 '17 18:02 mdeutch3

We are running a web service.

ChristinaKochan avatar Feb 16 '17 19:02 ChristinaKochan

My JSON has the ??? as well... We are getting the response using response.Content.ReadAsStringAsync() and deserializing the JSON object.

{
   "type":"FeatureCollection",
   "features":[
      {
         "type":"Feature",
         "properties":{
            "label":"",
            "strokeColor":"#00FF00",
            "lineOpacity":1.0,
            "strokeWidth":3,
            "strokeWeight":3
         },
         "geometry":{
            "type":"MultiLineString",
            "coordinates":[
               [
                  [
                     -93.95957194,
                     -6.8489893
                  ],
                  [
                     -93.95957194,
                     -9.09521064
                  ],
                  [
                     -93.95957194,
                     -11.34143198
                  ],
                  [
                     -93.95957194,
                     -13.58765367
                  ],
                  [
                     -93.95957194,
                     -15.83387466
                  ],
                  [
                     -93.95957194,
                     -18.08009635
                  ],
                  [
                     -93.95957194,
                     -20.32631804
                  ],
                  [
                     -93.95957194,
                     -22.57253974
                  ],
                  [
                     -93.95957194,
                     -24.81876001
                  ],
                  [
                     -91.3970683,
                     -24.95110054
                  ],
                  [
                     -88.82996824,
                     -25.03952944
                  ],
                  [
                     -86.26009,
                     -25.08380275
                  ],
                  [
                     -83.68928276,
                     -25.08380275
                  ],
                  [
                     -81.11940455,
                     -25.03952944
                  ],
                  [
                     -78.55230385,
                     -24.95110054
                  ],
                  [
                     -75.98980048,
                     -24.81876001
                  ],
                  [
                     -75.98980031,
                     -22.57253974
                  ],
                  [
                     -75.98980015,
                     -20.32631804
                  ],
                  [
                     -75.98980001,
                     -18.08009635
                  ],
                  [
                     -75.98980026,
                     -15.83387466
                  ],
                  [
                     -75.98980013,
                     -13.58765367
                  ],
                  [
                     -75.98980112,
                     -11.34143198
                  ],
                  [
                     -75.98980104,
                     -9.09521064
                  ],
                  [
                     -75.98980025,
                     -6.8489893
                  ],
                  [
                     -78.23567259,
                     -6.88580968
                  ],
                  [
                     -80.48184326,
                     -6.91215161
                  ],
                  [
                     -82.72821462,
                     -6.92797345
                  ],
                  [
                     -84.9746862,
                     -6.93325018
                  ],
                  [
                     -87.22115831,
                     -6.92797345
                  ],
                  [
                     -89.46752933,
                     -6.91215161
                  ],
                  [
                     -91.71369993,
                     -6.88580968
                  ],
                  [
                     -93.95957194,
                     -6.8489893
                  ]
               ]
            ]
         }
      },
      {
         "type":"Feature",
         "properties":{
            "label":"HIDACZ",
            "pointRadius":0,
            "fontColor":"#00FF00",
            "fontSize":"12pt",
            "fontFamily":"arial, sans-serif",
            "fontWeight":"bold",
            "labelAlign":"center",
            "labelBaseline":"alphabetic",
            "labelXOffset":0,
            "labelYOffset":0,
            "labelOutlineColor":"#000000",
            "labelOutlineWidth":4,
            "rotation":0.0,
            "angle":0.0
         },
         "geometry":{
            "type":"Point",
            "coordinates":[
               -85.34665856,
               -6.8489893
            ]
         }
      },
      {
         "type":"Feature",
         "properties":{
            "label":"test t value",
            "pointRadius":0,
            "fontColor":"#00FF00",
            "fontSize":"12pt",
            "fontFamily":"arial, sans-serif",
            "fontWeight":"bold",
            "labelAlign":"center",
            "labelBaseline":"alphabetic",
            "labelXOffset":0,
            "labelYOffset":0,
            "labelOutlineColor":"#000000",
            "labelOutlineWidth":4,
            "rotation":0.0,
            "angle":0.0
         },
         "geometry":{
            "type":"Point",
            "coordinates":[
               -85.20392677,
               -12.42628628
            ]
         }
      },
      {
         "type":"Feature",
         "properties":{
            "label":"MIN ALT: 0.0 ft. MSL",
            "pointRadius":0,
            "fontColor":"#00FF00",
            "fontSize":"12pt",
            "fontFamily":"arial, sans-serif",
            "fontWeight":"bold",
            "labelAlign":"center",
            "labelBaseline":"alphabetic",
            "labelXOffset":0,
            "labelYOffset":0,
            "labelOutlineColor":"#000000",
            "labelOutlineWidth":4,
            "rotation":0.0,
            "angle":0.0
         },
         "geometry":{
            "type":"Point",
            "coordinates":[
               -84.97030922,
               -18.00358326
            ]
         }
      },
      {
         "type":"Feature",
         "properties":{
            "label":"MAX ALT: ",
            "pointRadius":0,
            "fontColor":"#00FF00",
            "fontSize":"12pt",
            "fontFamily":"arial, sans-serif",
            "fontWeight":"bold",
            "labelAlign":"center",
            "labelBaseline":"alphabetic",
            "labelXOffset":0,
            "labelYOffset":0,
            "labelOutlineColor":"#000000",
            "labelOutlineWidth":4,
            "rotation":0.0,
            "angle":0.0
         },
         "geometry":{
            "type":"Point",
            "coordinates":[
               -84.65953686,
               -23.20906044
            ]
         }
      },
      {
         "type":"Feature",
         "properties":{
            "label":"TIME FROM: test w value",
            "pointRadius":0,
            "fontColor":"#00FF00",
            "fontSize":"12pt",
            "fontFamily":"arial, sans-serif",
            "fontWeight":"bold",
            "labelAlign":"center",
            "labelBaseline":"alphabetic",
            "labelXOffset":0,
            "labelYOffset":0,
            "labelOutlineColor":"#000000",
            "labelOutlineWidth":4,
            "rotation":0.0,
            "angle":0.0
         },
         "geometry":{
            "type":"Point",
            "coordinates":[
               -84.20944676,
               -28.78635742
            ]
         }
      },
      {
         "type":"Feature",
         "properties":{
            "label":"???",
            "pointRadius":0,
            "fontColor":"#00FF00",
            "fontSize":"12pt",
            "fontFamily":"arial, sans-serif",
            "fontWeight":"bold",
            "labelAlign":"center",
            "labelBaseline":"alphabetic",
            "labelXOffset":0,
            "labelYOffset":0,
            "labelOutlineColor":"#000000",
            "labelOutlineWidth":4,
            "rotation":0.0,
            "angle":0.0
         },
         "geometry":{
            "type":"Point",
            "coordinates":[
               -83.61066045,
               -34.36365441
            ]
         }
      }
   ],
   "properties":{
      "id":"e965b2bb-daee-4b0b-b051-9d32171ff86b",
      "name":"name",
      "description":"GNGPAAH----I---",
      "symbolID":"GNGPAAH----I---"
   }
}

ChristinaKochan avatar Feb 17 '17 15:02 ChristinaKochan

Do you have the same problem displaying echelons?

mdeutch3 avatar Feb 17 '17 16:02 mdeutch3

Yes. Sending -D in positions 11 & 12 of the symbol code returns a label with ??? instead of ●●●.

ChristinaKochan avatar Feb 17 '17 16:02 ChristinaKochan

@michael-spinelli Can you take a look at this? Do we need to serialize the text?

mdeutch3 avatar Feb 17 '17 19:02 mdeutch3

I was able to duplicate the "???" and am working on a fix for this issue.

michael-spinelli avatar Feb 21 '17 15:02 michael-spinelli

I have checked in fixes for character encoding so that you don't get the "???" anymore. Also, if you're running the local service from the jars, you can pass in "-acmodifiers false" as one of the parameters to make sure all modifiers are shown.

This will be available in the next release.

michael-spinelli avatar Feb 22 '17 15:02 michael-spinelli

fixed in release 0.1.20

michael-spinelli avatar Feb 24 '17 15:02 michael-spinelli