How can I convert a tileset to an Albers projection? Or add a feature to an albers projection that lines up correctly? - mapbox

Mapbox studio has a style with an Albers projection (https://www.mapbox.com/elections/albers-usa-projection-style):
I need to use another style with waterbodies like this:
but in the Albers projection. When I start with the Albers style, and then add water, they of course don't line up:
How can I get the tile I used in my waterbody example to be in the Albers project? I ultimately am wanting to use it in a leaflet map and add markers to it (using R).

The example you cited above is actually showing a workaround to make data appear as if it is projected in Albers but it's really just altered polygons being displayed in webmercator. This was a workaround/hack to get the desired visual using the tools available at the time. If you want to do the same workaround for your water bodies data so it will appear this way in leaflet, follow the steps of the tutorial which uses third party tools (QGIS, Dirty Reprojectors, Tippecanoe)
Mapbox has since added support for non-webmercator projections, which means you don't need to modify your source data to reproject them for use in a mapboxgl-js map: https://docs.mapbox.com/mapbox-gl-js/example/projections/
Disregard the earlier example, and just change the projection to Albers in Mapbox Studio.
Bear in mind that changing the projection in Mapbox Studio does not actually modify your data, it just renders it differently on the screen.

Related

Labelling multi polygons with the same geometry

In my dataset i have some polygons overlapped each other and I want to display their value in the label. In qgis we can do this as follows.
first step
Second step
multi labeling results in qgis
I am looking for a solution in mapbox studio to be able to do this.
There are some options like Expressions in Mapbox studio style but all are for working with labelling using multiple columns. But i need to have labelling based on multi features that have overlapping.

Is there an option to remove duplicate point labels within a distance in Mapbox Studio?

I'm using Mapbox Studio to label some point features (from a GeoJSON layer I uploaded) in a style, and there are some duplicate points located nearby each other:
Are there any options in Mapbox Studio to remove the duplicate labels automatically? For example, some other mapping programs have the option to remove duplicate labels within a specified distance (pixels or map units). Is this available in Mapbox Studio (or failing that, in Mapbox-GL-JS)?
Mapbox Studio does not provide a way to remove the duplicate labels automatically. You could work with a filter to manually filter out duplicates by writing a relatively complex expression, although this is not really the intended use case of expressions. You could also add a duplicate: true property to duplicated point features in your source data, but since this would require manipulating your source data, you might as well remove the duplicates from the source data instead of taking this approach.
That being said, you could consider clustering your data and styling the clusters so that a cluster looks the same as any individual point. This example shows how to create and style clusters using Mapbox GL JS. Here is a JSFiddle that heavily modifies this example to cluster closely-located points, and style the clusters in the same way that individual points are styled: https://jsfiddle.net/uo216fxz/ (you will need to add your own Mapbox access token in order to view the result). Text labels are added with the point count for each cluster containing more than one point, so that you can easily see that clusters and single points are identical aside from the labeling.
You will likely need to customize several properties (such as clusterRadius, clusterMaxZoom, etc) beyond what is provided in the linked JSFiddle, to be more specific to your source data.

No support for custom shapped windows in gtk3?

I want to use a custom shaped window using gtk3. I found gtk_widget_shape_combine_mask_() in gtk2. The closest thing I can find in gtk3 is gdk_window_shape_combine_region_(), which only allows for rectangular shaped regions. Why was the support dropped? Or was it changed and implemented in a different way?
What do you mean with "why was the support dropped?".
gtk_widget_shape_combine_mask() only supports rectangular shapes, too. That's what a GdkBitmap is: An image with a bit depth of 1. This means that a pixel is either included or not.
This is basically the same as a cairo_region_t. The difference is only in how the data is stored: Instead of a bitmap, cairo_region_t uses a list of rectangles to describe the same result.
"Or was it changed and implemented in a different way?"
Yes and you already found the replacement yourself.

TileMill - nice style for osm data in OS Windows

can you tell me what is the simpliest way to add style for my shape extracts from mapzen and give me some hint how do that in windows, becouse the majoritz of tutorials are for linux or mac oc. I need also help to choose the correct shape files from mapzen, there are 2 ways:
datasets split by by geometry type: lines, points or polygons
datasets grouped into individual layers by OpenStreetMap tags
I need import shape into tilemill, add nice style (for exmaple this: https://github.com/mapbox/osm-bright), and next export to *.mbtiles.

How to make a DEM in QGIS using spot heights and contors

I have 2 shapefiles. One is the contors of an area and the other the spot heights. Both of them has a altitude attribute. In ArcGIS there is a tool called topo to raster were you can use both these features to create a dem. In qgis I have only found tools were you can only use one.
Any Ideas?
There is only the interpolation tool that I know of which will create a DEM. Depending on the resolution you're after, you could BUFFER the spot heights, then MERGE SHAPE FILES and run the interpolation tool on that.
Using the graphical modeler would prevent the buffer layer being created making the process a little tidier (and i'm sure there's a better way using the python console). Hope this helps.