If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

New map

Started by Papave, 25 Mar 2015 03:48:01 AM

Previous topic - Next topic

Papave

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)

petterhuseby

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"
}

Papave

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)

Papave

#3
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 //

Papave

petterhuseby,

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

Papave

Joscha

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.


vinod589

#6
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

vinod589

I am attaching Jason as well just in case if any one wanted to help

Joscha

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

vinod589

Hi Joscha,

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

Thanks
Vinod589