Disable layers (like roads) on map visualization in PowerBI - powerbi

I've created a really simple PowerBI report based on some dummy data in a CSV. It looks like this:
To repro my scenario just input any kind of map data like the single number shown above, and plot it in a map visualization with all the default settings.
The map has a lot of clutter, mostly caused by the roads and their names (and to a lesser extent by the city names). Is there any way to disable layers in the map visualization?
I've tried to answer my own question by:
Going through all of the individual settings on the map visualization;
Using some Google-fu to find my answer, skimming the most promising result and a secondary set of "tips and tricks";
Re-watching the appropriate parts of the Pluralsight course on PowerBI;
But haven't found a way to do this yet.
Am I missing something? Or is it just not possible?

The default map/filled map visuals in Power BI are limited in terms of options such as decluttering the map (even compared to maps in Excel 2016).
One option (possibly the only one right now) is to use the ArcGIS maps, which you can enable under Options and Settings > Preview Features > ArcGIS Maps for Power BI. (It is a Preview Feature). Once enabled, you can select the visual at the end of your list of visualizations.
These do allow for finer-grained control. For example, you can click the In-Focus Edit Mode button at the top-right on the ArcGIS map and then choose Basemap to change to a gray map.
ArcGIS maps can also show a base layer, such as population density (which I think you had asked about in another question).
There are certainly some considerations when using this feature (it is a preview feature, and your data is going to Esri rather than Bing to be plotted).
Introductory Blog Post: https://powerbi.microsoft.com/en-us/blog/announcing-arcgis-maps-for-power-bi-by-esri-preview/
More Information: http://www.esri.com/software/arcgis/arcgis-maps-for-power-bi

Related

Use map data offline with osmdroid

My ultimate goal is to have map data (offline, because I will customize it myself) and display it in an app (Android). I could make osmdroid work to load maps online and I was trying to figure out how to download and display offline maps. I downloaded MOBAC (Mobile Atlas Creator) and export the data to SQLite format and when I had a look at it I realized that tiles are saved in image format (PNG).
What I would like to do is to import data to the phone to later use it in algorithms such as a search engine or a routing algorithm, so I need the "nodes" and "ways" (as I get them from the original OSM XML), import them to the phone and visualize it to later have this data available for the algorithms I want to develop. Basically, what MAPS.ME does. I think it wouldn't be difficult to convert the XML into the SQLite since a simple script could make it, but then, how can I generate the tiles from this custom SQLite database? Or, is there a way I can download the data in a more appropriate way to do what I'm planning to do?
Thanks.
Rendering the tiles in an app from raw Openstreetmap data would be computation heavy and inefficient. I would suggest to use image tiles you exported for visual representation.
In addition to tiles you should export a data set you will need in the application for desired functionality. You will not need all data from Openstreetmap so you should identify what you need and build your custom export (there are tools and libraries for processing and filtering of Openstreetmap data. I have used pyosmium for some filtering and processing but there are others.) For example, you can build your custom database with POIs you want to search for.
Routing is another chapter. You can implement it yourself but it is a very complex task. There is java library called Graphopper which can do the data extraction (from Openstreetmap) and offline routing for you. They have an online API too but it is possible to make it working completely offline (I did it for one application). Try to look at the source code because than you can see how complex topic routing is. Final note: data exported from Graphopper contains information about some POIs along routes. It may be possible to search for some things via its java API but I haven't investigated this yet.

Saving offline map atlas inside osmdroid

Is there a solution to save the map tiles inside the app like the Mobile Atlas Creator works on the desktop?
I only found a way by using PC application.
There sure is. It probably needs some more testing, but the example is located here:
https://github.com/osmdroid/osmdroid/blob/master/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleCacheDownloaderArchive.java
Essentially, when you fire up an instance of CacheManager, it gets the map view's IFileSystemCache instance, which is normally the Sqlite tile cache (the kind that expires). This example feeds in an alternate implementation that produces a permanent sql tile archive (no expiration dates in it).
Use it with caution has many tile sources do not allow you to do this in their terms of service and you can get banned for doing so
Edit: there's more info the wiki
https://github.com/osmdroid/osmdroid/wiki/Offline-Map-Tiles#use-osmdroids-cache-manager-on-device---version-52

How to use OpenStreetMap background on Matplotlib Basemap

This should be simple, but when I look for it I just find web packages. I need something better than as oriented on This Blog. Maybe using .oms file or shapefiles. Some way to give bbox and get the OpenStreetMap background on Basemap map.
I found some questions like this on Stack, but the answers directs to, or download the .png file on OpenStreetMap website, or to use some web package.
I would suggest not to try to make something work, which is not made (yet) to work together.
There is a simple way to achieve what you want with Mplleaflet.
https://github.com/jwass/mplleaflet
The library allows you to visualize geographic data on a beautiful interactive openstreetmap. Map projection of data in long lat format is automatically performed.
Installation in windows and ubuntu is easy:
pip install mplleaflet
You can start with the provided examples and go from there.
There are many libraries today that can do this for you - smopy, folium and tilemapbase are three examples from my recent use.
Each of these tools fetch map tiles from the one of several servers that host OSM or other (Stamen, Carto, etc) map tiles and then allows you to display and plot on them using matplotlib. Tilemapbase also caches the tiles locally so that they are not fetched again the next time.
But there does not seem to be a readily available tool yet, based on my recent experience, to use offline tilesets (such as a compressed .mbtiles file) as background for matplotlib plotting.
This link contains a survey of the above tools and more - https://github.com/ispmarin/maps
EDIT
I had mentioned in my previous answer that Tilemapbase did not work for some geographical locations in the world, and hence explicitly recommended not to use it. But it turns out I was wrong, and I apologize for that. It actually works great! The problem in my case was embarrassingly simple - I had reversed the order or lat and lon while fetching tiles, and hence it always fetched blank tiles for certain geographical locations, leading me to assume that it did not work for those locations.
I had raised the issue in github and it was immediately resolved by the developers. See it here - https://github.com/MatthewDaws/TileMapBase/issues/7
Note the responses:
Coordinates are to be provided in order (1) longitude, (2) latitude. If you copied them from Google Maps, they will be in lat/lon order and you have to flip them. So your map image is not empty, it's just a location in the ocean north of Norway.
And from the developer himself:
Yes, when I wrote the code, it seemed that there wasn't a universal standard for ordering. So I chose the one which is different to Google Maps. The method name from_lonlat should give a hint as to the correct ordering...
For those who are using Cartopy, this is relatively simple:
import matplotlib.pyplot as pl
import numpy as np
import cartopy.crs as ccrs
import cartopy.io.img_tiles as cimgt
request = cimgt.OSM()
# Bounds: (lon_min, lon_max, lat_min, lat_max):
extent = [1, 13, 45, 53]
ax = pl.axes(projection=request.crs)
ax.set_extent(extent)
ax.add_image(request, 5) # 5 = zoom level
# Just some random points/lines:
pl.scatter(4.92, 51.97, transform=ccrs.PlateCarree())
pl.plot([4.92, 9], [51.97, 47], transform=ccrs.PlateCarree())
This produces:
You can download the necessary tiles yourself from one of the tile servers. The OSM wiki explains the technical details behind slippy map tilenames and also includes examples for various programming and scripting languages.
Please also read about the tile usage policy and keep in mind that different tile serves may have different policies.
This is very easy with geopandas and contextily.
Have a look at https://geopandas.org/gallery/plotting_basemap_background.html.

Java library to create and dynamically modify business diagrams

I am looking for a good java library to manipulate box, arrows and labels in order to dynamically create and fill diagrams like the following and render them to a png :
Another example
I can create a static template to be filled later, but I will need to dynamically create labels for every box and edges in the diagrams.
For now I have tried using batik to manipulate an svg template but creating multiline labels for the edges is proving quite complicated. The SVG way with batik seems to force me to create 1 text object for each label line with absolute positioning for each which is a real pain.
I would like to be able to define the label specifying only the text and the link they relate to, eventually some hints as to how it should be placed and let the library place them.
Any suggestions ?
If this is in a commercial scenario, the Java graph drawing library yFiles can be a good match for your requirements:
You can use a convenient API to create and style your diagram and automatically layout the diagram with lots and lots options to constrain the resulting layout to suit your needs.
Multi-line and (simple) HTML labels are supported out-of-the-box.
Also you can export to PNG (as well as other pixel based image formats) and vector graphics formats like SVG, PDF, EPS.
This can be done both in a regular Java (Swing) application as well as in a headless environment (e.g. to create images on a server and to send them to a web-based thin client dynamically).
To get a feel what can be done using that library, I suggest you take a look at the freely available graph editor application "yEd" that is based on yFiles and lets you try out the above steps in an interactive manner.
(Disclosure: I work for yWorks, but on Stackoverflow I do not represent my employer.)

How do I create levels for my puzzle game ? Obj-C & Cocos2d

I want to create levels in my cocos2d game and I do not know how to do that with .plist files ... I searched the Internet but unfortunately I couldn't find significant information on how to implement these property lists. Can you please help out ?
Check out Tiled Map Editor. Tiled's TMX format is supported by Cocos2D.
As with any Apple technologies, the first place you should start searching for is the developer.apple.com website. In this case, here's the Property List (plist) Programming Guide.
However, I find property lists very awkward to work with, specifically if you want to create them manually and whenever they contain more than just a few entries. It certainly can't hurt to evaluate rolling out your own file format, text-based plain and simple. I would always rather work with simple text files like these rather than messing with property lists:
X=10;Y=10;Tile=30;
X=12;Y=11;Tile=28;
X=16;Y=19;Tile=22;
It's a different story if you actually design the data with a tool or within an app, where you'll be able to make use of the various collection convenience methods that save and load property lists, for example to and from a dictionary or array.