How on earth can I VIEW RASTER ATTRIBUTE TABLE IN QGIS? - qgis

How on earth can I VIEW RASTER ATTRIBUTE TABLE IN QGIS?
In arcgis it is easy to view raster attribute. QGIS has no function to do same and this leaves me frustrated.

There is a plugin called RasterAttributeTable, with this plugin you can open the attribute table of a raster layer just like a vector layer.

Related

Calculate areas of new features in merged layer in QGIS

I have merged four different layers into one new one in QGIS, but I want this layer to have different information then the old layers. I want all the buffered 'islands' to have a different ID and a calculated area. However, now in the attribute table I just see four features, one for each layer that I merged. Is there a way to update the attribute table to consist of new features (one for each 'island')?
This is what the layer looks like:
And this is what the attribute table now looks like:
And this is what I want (the 5th and 6th column especially):
You must create a feature for each monopart geometry, you can achieve this using the 25.1.18.46. Multipart to singleparts tool, and then use the field calculator to get the area, you can find here how to calculate area Calculating polygon areas in shapefile using QGIS.

polygon label displying duplicate in mapbox studio style editor

I have uploaded polygon shape zip file in mapbox tileset and created layer name as polygon_label but layer labels are showing duplicate inside polygon area.
So there is any way to centroid the polygon geometry or restrict to display duplicate label.
How to get label centroid of the polygon and remove duplication of the label from polygon area?
You need to create point geometries and use that as your source.
I have the same issue with a shapefile with land sections I imported. To get the outline of the land sections I added a fill type layer since the tileset contains polygon features. Then I add another layer of type symbol to be able to show the section address text field from the tileset features. I set the placement as "Point". But, the text field shows multiple places inside the polygons.
The only solution I have found is to make the labels appear along the boundries of the polygons by setting the placement as "Line". This still shows multiple labels. But, it is a bit more friendly for the user.

Do I have to use geojson files to get data when I click polygons on the map in mapbox gl js?

I have 16,000 rows of data in excel.
In this excel, I have census block numbers.
What I want to achieve is that I want to make a map layer for these block numbers.
Then, if I click a polygon, the information of a block number display on the popups, like which state, county, and so on.
How can I do that? Do I have to use geojson files for this?
Because, many exmaples in the mapbox use geojson.
But I don't have any coordinates for these block numbers and 16,000 rows are really big to me. I got only block numbers.
But I got shapefiles for whole state block numbers.It is too big to upload mapbox gl js.
If geojson file is the way to achieve my goal, can someone tell me the orders that I can follow?
Or is there other way, please advise me.
Thanks.
So you have a geometry file ("shapefiles for whole state block numbers") and a data file ("16,000 rows of data in excel"). You want the user to click on a boundary in the geometry, and see data from the data file. You have two main options:
Join the data and geometry first (eg, use geojson-join, then upload to Mapbox as a tileset.
Upload just the geometry. Load the CSV file when the web page loads, then when the user clicks, display something from the CSV file.

Using Mapzen tiles with Leaflet

My reading of the Leaflet and Mapzen documentations suggest that in order to use a custom tile provider with Leaflet, one needs to do just two things:
Specify the tile provider in L.tilelayer(urlTemplateToTileProvider)
Set this provider to MapZen
var urlTemplateToTileProvider =
'http://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.mvt?api_key=apiKey'
However, when I try this I end up with an empty map which then proceeds to display markers etc correctly. And yet a manual test for a generated tile URL, e.g.
http://tile.mapzen.com/mapzen/vector/v1/all/14/8471/5583.mvt?api_key=apiKey
did in fact download some - unintelligible to me - data.
I also tried using the other two formats mentioned in the Mapzen docs (.json and .geojson) but with exactly the same result. Given that the latter two formats return human readable data, I checked them out for my test tile in my browser and the data is indeed for the area I want to use.
Curiously enough, the Leaflet docs and tutorials request a PNG tile layer (http://{s}.tile.osm.org/{z}/{x}/{y}.png), not raw data.
What am I doing wrong here?
The Tile Layer is for raster tiles (i.e. plain images, like the PNG format for example).
Mapzen delivers vector tiles. To use them with Leaflet, you could use a plugin, e.g. Leaflet.VectorGrid (license)
Display gridded vector data (sliced GeoJSON or protobuf vector tiles) in Leaflet 1.0.0
See the demo, which includes tiles from Mapzen
var mapzenTilesUrl = "https://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.mvt?api_key={apikey}";
var mapzenVectorTileOptions = {
rendererFactory: L.canvas.tile,
attribution: '© MapZen, © OpenStreetMap contributors',
vectorTileLayerStyles: vectorTileStyling,
apikey: 'KEY',
};
var mapzenTilesPbfLayer = L.vectorGrid.protobuf(mapzenTilesUrl, mapzenVectorTileOptions);
Since you have raw data in the vector tiles, you need to provide the styling spec (vectorTileStyling)

QGIS Essen Size Scale Field new location

Just updated to QGIS Essen 2.14.1
I want to scale markers based on a field in the layer's attribute table. In the previous version of QGIS I had installed, under layer properties->style -> graduated ->advanced, there was an option called Size-Scale-Field. In this Essen, this not longer is located here.
Looking for direction on how to scale markers according to field values in QGIS 2.14.1
Is this under the Method option now?