COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => RAVE Visualizations => Topic started by: Papave on 25 Mar 2015 03:48:01 AM

Title: New map
Post by: Papave on 25 Mar 2015 03:48:01 AM
Hi,

I'm trying to create a map of france visualization. I didn't start from scratch but modified an existing world map from the IBM samples. Considering the amount of [{]}, I started trying to draw a map of two french "département" (with all embedded data + coordinates, as a polygon).

Therefore, I :
- Modified the data set of the json (the "categories")
- Changed the coordinates (in the embedded data, these are geojson coordinates I found on the web).

The .json is well formed, but the visualization customizer gives me an error when I try to draw it ("this.data is undefined").

My questions are ...
- What could I have missed or done wrong (I didn't modify anything but what I mentioned above. Maybe it's not enough? I basically replaced strings by others and removed some...)
- In the resource part, what is the URI and is it something generic or does it have to be adapted ? (I really can't figure out what this is doing to the visualization)
         "URIs":
         [
            "embedded:///resource/*[\"id\"=\"id1\"]/embeddedData"
         ],

Any help or ideas would be welcome.

Papave

PS : example of embedded data is, for example, US_Choropleth_Embedded_Data.json (here --> http://rave.mybluemix.net/visualizations.html)
Title: Re: New map
Post by: petterhuseby on 31 Mar 2015 09:51:34 AM
Hi

I have the same problem. I have attached the json file and here is the code. Have you found any solutions?


{
   "data":
   [
      {

      }
   ],
   "augment":
   [
      {
         "source":"c:/Petter/USStates.json"
      }
   ],
   "grammar":
   [
      {
         "coordinates":
         {
            "dimensions":
            [
               {
                  "scale":
                  {
                     "spans":
                     [
                        {
                           "fit":"exact"
                        }
                     ]
                  }
               },
               {
                  "scale":
                  {
                     "spans":
                     [
                        {
                           "fit":"exact"
                        }
                     ]
                  },
                  "axis":
                  {
                     "gridStyle":
                     {
                        "fill":"#8888"
                     },
                     "lineStyle":
                     {

                     },
                     "markStyle":
                     {

                     },
                     "tickStyle":
                     {

                     }
                  }
               }
            ],
            "transforms":
            [
               {
                  "type":"projection",
                  "projectionParameters":
                  {
                     "name":"simple"
                  }
               }
            ],
            "style":
            {
               "fill":"#afa"
            }
         },
         "elements":
         [
            {
               "type":"polygon",
               "style":
               {
                  "fill":"#99f",
                  "stroke":
                  {
                     "width":0.25
                  },
                  "outline":"black"
               }
            },
            {
               "type":"edge",
               "position":
               [
                  {
                     "value":34.1
                  },
                  {
                     "value":41.78
                  },
                  {
                     "value":-118.7
                  },
                  {
                     "value":-87.75
                  }
               ],
               "style":
               {
                  "fill":"#c00",
                  "stroke":
                  {
                     "width":4
                  },
                  "endArrow":"arrow",
                  "outline":"black"
               }
            }
         ]
      }
   ],
   "size":
   {
      "width":800,
      "height":600
   },
   "version":"7.1"
}
Title: Re: New map
Post by: Papave on 31 Mar 2015 10:37:45 AM
Hi,

No, unfortunately, it is still not working.

I did recreate my file, but nothing. I'll reply to this post if I find something.

What is super odd is that:
- If I use the vizcustomizer 10.2.2, I get the "data undefined" error
- If I user the vizcustomizer 10.2.1 (replacing version 7.1 by 3.0), I get "All URIS are invalid".


Papave

(PS : I attached my json as well)
Title: Re: New map
Post by: Papave on 14 Apr 2015 03:05:04 AM
I finally got something here!

I attached it. Fell free to use or modify it if you need.

I'm still working on the white space in the south east (a département near the sea seems to have some problems).

Papave

// Edit : The corrected file in a vizbundle format //
Title: Re: New map
Post by: Papave on 14 Apr 2015 04:34:46 AM
petterhuseby,

Here is what I could achieve with your data (based on what I did).

Papave
Title: Re: New map
Post by: Joscha on 02 Jun 2016 01:04:59 AM
I know, this is a pretty old thread, but I used Papaves customized map (with us-states) to learn how to embedd my own coordinates (I was working on a map of Cologne, Germany). This helped me a lot, many thanks to papave (though I'm not sure he will ever read this)!

To everyone using papaves code: You should add the following to the "grammar" - "coordinates"-part:

"transforms":
            [
               {
                  "type":"projection",
                  "projectionParameters":
                  {
                     "name":"simple"
                  }
               }
            ]


This prevents the map from getting skewed.

Title: Re: New map
Post by: vinod589 on 09 Nov 2016 07:03:22 AM
Papave-  I have a similar requirement when in I need to have three regions in my map , APAC Asia , EMEA Africa, Americas( including Canada & noth America as well) with  three different colors. I tried to pull the coordinate from "https://geojson-maps.kyd.com.au/" but when I am trying to replace the existing coordinates in "embeddedData" section I am getting an error "}" missing. Not sure if am doing the right thing or not , but I wanted my map to be in three colors based on my measure.

I am attaching the coordinates.

Please take a look and help me out . Thanks
Title: New map
Post by: vinod589 on 09 Nov 2016 07:13:36 AM
I am attaching Jason as well just in case if any one wanted to help
Title: Re: New map
Post by: Joscha on 14 Nov 2016 09:34:14 AM
Hi vinod589,

I embedded your geojason coordinates into dynamic map, it is working, but some countries are missing... but maybe this is a starting Point for you. Just have a look at how I embedded the coordinates and you should be able to do the same with other coordinates.

Best
Title: Re: New map
Post by: vinod589 on 25 Nov 2016 04:01:34 AM
Hi Joscha,

Thank you so much, I will check and let you know if that help's looks like it will.

Thanks
Vinod589