Author Topic: New map  (Read 8544 times)

Offline Papave

  • Full Member
  • ***
  • Join Date: Mar 2015
  • Posts: 13
  • Forum Citizenship: +2/-0
    • Keyword SARL
New map
« 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)

Offline petterhuseby

  • Full Member
  • ***
  • Join Date: Mar 2015
  • Posts: 18
  • Forum Citizenship: +0/-0
Re: New map
« Reply #1 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"
}

Offline Papave

  • Full Member
  • ***
  • Join Date: Mar 2015
  • Posts: 13
  • Forum Citizenship: +2/-0
    • Keyword SARL
Re: New map
« Reply #2 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)

Offline Papave

  • Full Member
  • ***
  • Join Date: Mar 2015
  • Posts: 13
  • Forum Citizenship: +2/-0
    • Keyword SARL
Re: New map
« Reply #3 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 //
« Last Edit: 11 Jun 2015 12:35:15 pm by Papave »

Offline Papave

  • Full Member
  • ***
  • Join Date: Mar 2015
  • Posts: 13
  • Forum Citizenship: +2/-0
    • Keyword SARL
Re: New map
« Reply #4 on: 14 Apr 2015 04:34:46 am »
petterhuseby,

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

Papave

Offline Joscha

  • Full Member
  • ***
  • Join Date: May 2016
  • Posts: 10
  • Forum Citizenship: +0/-0
Re: New map
« Reply #5 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:

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

This prevents the map from getting skewed.


Offline vinod589

  • Associate
  • **
  • Join Date: Nov 2016
  • Posts: 3
  • Forum Citizenship: +0/-0
Re: New map
« Reply #6 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
« Last Edit: 09 Nov 2016 07:05:27 am by vinod589 »

Offline vinod589

  • Associate
  • **
  • Join Date: Nov 2016
  • Posts: 3
  • Forum Citizenship: +0/-0
New map
« Reply #7 on: 09 Nov 2016 07:13:36 am »
I am attaching Jason as well just in case if any one wanted to help

Offline Joscha

  • Full Member
  • ***
  • Join Date: May 2016
  • Posts: 10
  • Forum Citizenship: +0/-0
Re: New map
« Reply #8 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

Offline vinod589

  • Associate
  • **
  • Join Date: Nov 2016
  • Posts: 3
  • Forum Citizenship: +0/-0
Re: New map
« Reply #9 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