Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
m_cherriman
Advocate I
Advocate I

GeoJSON reference layer - location labels/names

Hi,

 

I'm using an Azure maps visual with a GeoJSON reference layer which is showing red dots for distribution centres, which is great.  But what I also need is to show is the centre name.  I've added the name and label options to my GeoJSON file, but they don't pull through.

 

is this even possible?

 

TIA

14 REPLIES 14
jusTodd
Advocate III
Advocate III

{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name":"locationA","latitude":"39.142475600","longitude":"-94.576185800"},"geometry":{"type":"Point","coordinates":[-94.576186,39.142476]}},{"type":"Feature","properties":{"name":"locationB","latitude":"39.213128600","longitude":"-94.464780200"},"geometry":{"type":"Point","coordinates":[-94.46478,39.213129]}},{"type":"Feature","properties":{"name":"locationC","latitude":"39.214377000","longitude":"-94.463564000"},"geometry":{"type":"Point","coordinates":[-94.463564,39.214377]}}]}

That still only has a name property.  You would have to use name as the location value. Note that I used the test.json file as the custom map.

 

Usually the topojson also has polygons with the shapes of your items.

 

see attached.

 

 

Thanks @lbendlin!  I see what is happening now.  I still cannot get it to work in the "Azure Maps" visual, but it works perfectly over in the "Shape Map."  I appreciate your taking time on this.

KT-PBI
Frequent Visitor

Hi

New to mapping in PBI... I've got a GEOJSON file I'm overlaying on top of some "other" school location data. The GEOJSON file has our "home" schools in and it shows as red dots fine, but how do I get the name of home schools in the GEOJSON file to show? As tooltips or something? Importing to MapShaper and it's recognising the name / number of students etc fine.

Don't believe we can use th ArcGIS visual, just yet. Thought the reference layer should do this?

Cheers

Keith

Make sure you don't strip out the polygon attributes when exporting to TopoJSON in MapShaper.

Thanks for the reply! Ok, several questions...

For the fictious locations, I want 2 points (Lat / Lon / name changed etc) and I have this as GeoJSON and TopoJSON (seems to be little difference? and isn't a polygon, points are fine / basic)

{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"color": "Red",
"name": "LBR1"
},
"geometry": {
"coordinates": [
-0.087724,
51.507904
],
"type": "Point"
},
"id": 0
},
{
"type": "Feature",
"properties": {
"color": "Red",
"name": "LBR2"
},
"geometry": {
"coordinates": [
-0.087724,
51.507904
],
"type": "Point"
},
"id": 1
}
]
}

 

As far as I understand it, I can drop this in as a reference layer and this works showing 2 red dots, but how would I get the name to show (all the time / on hover) or something? Unless I'm missing the point of reference layers... I'd basically like a layer where nothing changes (Home layer) and then dynamic data I can slice 'n' dice. Thoughts welcomed! Cheers Keith

Have a "name" field in your data model that carries the values in your "name" property. Declare that field as a geo place.

Hi

Thanks for getting back to me.

Ok, so the very simple model is :

 

KTPBI_0-1687962985567.png

 

And I drop postcode onto an Azure map to show postcodes. Works a treat. I then have the GeoJSON file mentioned earlier. Unsure where the 'name' field should be going? Do I create a a tabel with 2 values in LBR1 / LBR2 and the column is called name? Apologies if I sound dumb... And thanks for your help!

Cheers

Do I create a a tabel with 2 values in LBR1 / LBR2 and the column is called name?

 

If that makes sense in your data model, yes.  One of your dimension fields in the data model will need to tie to the name attribute in the JSON.

I am a little confused.  I have the field "Location" designated as a Place, but how exactly do I tie that back?

Do you have a TopoJSON file?

Thanks for the response. I am working with a regular GeoJSON.  Exporting from MapShaper to TopoJSON consistently fails to import to PBI with parsing errors.

can you share a sample GeoJSON?

lbendlin
Super User
Super User

It is possible with TopoJSON formats, should be possible with GeoJSON too.  Check your file in Mapshaper.org, maybe you inadvertently dropped the attribute during the transform.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.