cancel
Showing results for 
Search instead for 
Did you mean: 

GeoJSON file for compounded key 0REGION

martin_chambers
Participant
0 Kudos

Hi,

I've tried to use a GeoJSON file in Design Studio 1.5 SP1 to display the states as shapes in the US.

The GeoJSON file contained the Feature "LSAD" with the abbreviated State as the property, e.g.

"LSAD": "AZ" for Arizona,

"LSAD": "AK" for Alaska,

etc.

My DS application used a BEx Query with the InfoObject 0REGION. This is compounded with the InfoObject 0COUNTRY.

This didn't work.

I then created a new InfoProvider with the non-compounded InfoObject REGION.

This worked.

My question is how must I write the property in the GeoJSON file correctly for the compounded InfoObject 0REGION?

e.g. for Arizona

"LSAD": "USAZ" or

"LSAD": "US/AZ" or

"LSAD": "US\AZ" or

"LSAD": "AZUS"

or something else?

Please tell me if you know.

Martin


Accepted Solutions (1)

Accepted Solutions (1)

IngoH
Active Contributor
0 Kudos

Hello Martin,

my guess would be there is a " " (space) between the key values but the best way is to take a BEx query with the compounded values and use a crosstab and then just use a .getSelectedvalue on the crosstab for the onSelect and get the compounded key value

regards

Ingo Hilgefort, Visual BI

martin_chambers
Participant
0 Kudos

Hi Ingo,

Thanks for your answer. Your guess is as always very good, as it should be for someone who has almost got to gold level!

I checked the value in the crosstab and there is indeed a space between country and state,

e.g. "US AZ" for Arizona.

If a may, a related question - I had tried to get the connection via text, i.e. "Arizona". But it seems that that only works if  I have coded Arizona in the InfoObject key. That is to say, DS always connects the chosen GeoJSON value with the InfoObject key value which in my case is "AZ" and not with the InfoObject text, in my case "Arizona".

My question:

Is this really so? This would mean that the GeoMap property "Text" is a bit misleading.

Or have I just configured something wrong.

Regards,

Martin

IngoH
Active Contributor
0 Kudos

Hello Martin,

using the Text would only work if the text is then also used in the GeoJSON file as otherwise you wouldn't be able to do a match up.

You can configure if for the matchup the key or the text is being used - that is in the properties of the mapping component.

Ingo

martin_chambers
Participant
0 Kudos

Hi Ingo,

the text is also used in the GeoJSON file. That is not the problem.

The problem is the BEx query.


Using your idea of getSelectedvalue on the crosstab for the onSelect, I always get the key value.

It does not matter if I change 0REGION from the BEx query in the DS DataSource initial view to text, text and key or just key.

I suspect that text in the GeoJSON file will only match up if 0REGION's key value contains the text, e.g. 0REGIONS key value would have to be Arizona and not AZ.

What is your experience?

Regards,

Martin

IngoH
Active Contributor
0 Kudos

Hi Martin,

in the Initial View in Design Studio do you see the Key and the Text for the Region ?

regards

Ingo

martin_chambers
Participant
0 Kudos

Hi Ingo,

I changed the initial view to text (e.g. Arizona)

This was meant to correspond to the text in the GeoJSON file (also Arizona).

This didn't work.

I changed the intial view to key and then to key and text.

That didn't work either.

On the other hand, when I changed GeoJSON to LSAD (= AZ) it worked and it didn't matter how I set up the initial view (text = Arizona or key = AZ or both = AZ Arizona)

I'm not quite sure what LSAD above means, but it contains the same abbreviation in GeoJSON that is used as a key in 0REGION in the BEx query displayed in the initial view.

Regards,

Martin

IngoH
Active Contributor
0 Kudos

Hello Martin,

in the GeoMap component you uploaded the GeoJSON file I assume.

Then in the properties you have

- GeoJSON Mapping Property: This is where you select the attribute that you want to map to the data in the Data Source

- GeoJSON Mapping Type : Here you pick Text or Key.

So based on your description you would set the GeoJSON Mapping Property to LSAD and you would set the GeoJSON Mapping Type to the "Key".

You mentioned that your GeoJSON file only has Key values - correct me if I misunderstood that.

Also make sure that in the initial view there is only one dimension / characteristic in the Rows !

regards

Ingo

martin_chambers
Participant
0 Kudos

Sorry Ingo,

my last post was a bit confused.

GeoJSON includes several possibilities, including these two:

1) LSAD      This contains the key, e.g. AZ

2) NAME     This contains the text, e.g. Arizona

I tried 4 different combinations -

1)

NAME from GeoJSON        Arizona

Text from the initial view     Arizona

--> Didn't work.

2)

NAME from GeoJSON        Arizona

Key from the initial view      AZ

--> Didn't work.

3)

LSAD from GeoJSON        AZ

Key from the initial view     AZ

--> Worked

4)

LSAD from GeoJSON        AZ

Text from the initial view     Arizona

--> Worked

I assume that Design Studio always uses the key from geo-relevant characteristic  in the BEx Query, in my case 0REGION.

The display mode in the initial view, key, text or both is irrelevant.

What is your opinion?

Regards,

Martin

IngoH
Active Contributor
0 Kudos

Hi Martin,

thats now what I experienced so far.

when you tried your scenario (1) - was in the initial view the Key and Text shown ? Could you try with only the TExt being shown in the initial view ?

The fact that combination (4) worked is kind of "strange".

I have used the Text before and matched it to a "name" attribute.

regards

Ingo

martin_chambers
Participant
0 Kudos

Hi Ingo,

Scenario 1 - Only the text was shown in the initial view.

I added the datefield component and used data binding to the cell with the Arizona data in the initial view. Design Studio generates a script that contains the key "AZ", see below.

This might explain why scenario 4 works.


Regards,

Martin

Answers (0)