I was trying to create a map in Folium using a custom map built tile layer created with Mapbox Studio (using 3 different datasets and a satellite basemap). I was wondering if there is a simple way to add it with Folium? I read in the documentation that style layers and datasets had to be called separately. I tried with the following (and a few variations), but each time it loaded the Python data with no base map.   folium_map = folium.Map(location=[-8.907970, 33.433200],                         zoom_start=7,                         tiles='http://{s}.tiles.mapbox.com/v4/(username).(mapid)/{z}/{x}/{y}@2x.png?access_token=(access token)',                         attr='Mapbox')   I was using Mapbox (instead of loading the datasets independently) because my datasets are pretty big (up to 100MB, upwards of 100,000 points) and that causes the Leaflet map to lag tremendously.
121797
I cannot find correct usage for using custom mapbox tilesets with folium.  From the documentation, "Folium also supports Cloudmade and Mapbox custom tilesets- simply pass your key to the API_key keyword" ().  The docs provide this example...  folium.Map(location=[45.5236, -122.6750],            tiles='Mapbox',            API_key='your.API.key')   So I have tried...  #Create Map my_map = folium.Map(location=[45.372, -121.6972],                     zoom_start=12,                     tiles='Mapbox',                     API_key = 'pk.xxxxxxxxxxxxxxxxxxxxxxxxxxx') #mapbox map id    #Create Map my_map = folium.Map(location=[45.372, -121.6972],                     zoom_start=12,                     tiles='Mapbox',                     API_key = 'pk.xxxxxxxxxxxxxxxxxxxxxxxxxxx')#mb api key   #Create Map  my_map = folium.Map(location=[45.372, -121.6972],                     zoom_start=12,                     tiles='user.2fb7fc73',                     API_key = 'pk.xxxxxxxxxxxxxxxxxxxxxxx',                     attr='Mapbox Data Attribution')   I have not been able to find any more example usage or explanation in the documents. If anyone has had success please advise?
91871
Leaflet maintains that the Map panes elements contain all layers added to the map. The difference between many of the Map panes is strictly the z-index order of layering.  I would like to use a combination of lvector.CartoDB layers, which are essentially overlayPane layers, with TileLayer, such as GeoIQ Acetate-bg and labels.  This is the ordering of the elements as they are added the map:  tileLayer1 = new L.TileLayer(); map.add(tileLayer1);  // add first layer to map  cartoDBLayer1 = new lvector.CartoDB(); cartoDBLayer.setMap(map); // add second layer to map  tileLayer2 = new L.TileLayer(); map.add(tileLayer2);  // add third layer to map   What returns is a map with layers in this order:  tileLayer1,tileLayer2,cartoDBLayer1   tileLayer1 and tileLayer2 are situated in the HTMLElement: TilePane and cartoDBLayer1 is in HTMLElement: overlayPane.  Is there any way to force cartoDBLayer1 to render in the TilePane, such that it falls in order of the z-index that it is added to the map in...   i.e.   z-index[0]:tileLayer1 z-index[1]:cartoDBLayer1 z-index[2]:tileLayer2
90595
I have created some TikZ code to produce the diagram below (slightly simplified). This is my first real shot at TikZ and its taken me about 8 hours now to get this far. But I don't really begrudge the time, time spent learning is time well spent.  It is loosely based on .  I would like to have a different (variable) number of nodes in each layer, and would like to maintain the connection.  My current idea was to have a list of lists like {{1..3},{1..5},{1..7},{1..4},{1..3}} then I guesss i could use a nested for-each off the index. But that has 2 problems: I would lose my layer number, which I could get around by using count. Secondly, more majorly, I don't seen a good way of knowing how big the next layer is (to make the connections).     \documentclass{article} \usepackage{mathptmx} \usepackage{tikz} \usetikzlibrary{arrows} \usetikzlibrary{calc} \begin{document}   \def\layersep{3.5cm} \def\topnum{5} %\font\nullfont=cmr10 \begin{tikzpicture}[shorten &gt;=1pt,-&gt;,draw=black!50, node distance=\layersep]     \tikzstyle{neuron}=[circle,draw,fill=white!25,minimum size=25pt,inner sep=0pt]     \tikzstyle{bias neuron}=[neuron,dashed]       \foreach \y in {2,...,4}                 \foreach \x in {1,...,5}             \path   node[neuron] (L_\y_\x) at (\x cm,\y*\layersep) {$\sigma(\cdot)$};   %      \foreach  \x in {1,...,5}             \path  node[neuron] (L_1_\x) at (\x cm,1*\layersep) {$x_\x$};      \foreach  \x in {1,...,5}             \path  node[neuron] (L_5_\x) at (\x cm,5*\layersep) {$s_{m}(\cdot)$};       %Add Biases     \foreach \y in {1,...,4}     {         \path node[bias neuron] (B_\y) at (6 cm, 0.55*\layersep+\y*\layersep) {1};         \pgfmathtruncatemacro\nextlayer{\y+1}         \foreach \dest in {1,...,5}             \path (B_\y) edge[dashed] (L_\nextlayer_\dest.south);     }       % Connect every node in the input layer with every node in the     % hidden layer.     \foreach \layer in {1,...,4}         \pgfmathtruncatemacro\nextlayer{\layer+1}         \foreach \source in {1,...,5}             \foreach \dest in {1,...,5}                 \path (L_\layer_\source) edge (L_\nextlayer_\dest);   \end{tikzpicture} \end{document}
36767
I have a large geology data set that I need to display using an industry standard set of symbols and colours. The symbols and colours are attributes of the data. I have been using the data defined symbols capability of the dev build of QGIS (code revision b805894) to display the data according to its attributes. This works perfectly in terms of displaying the data correctly in the map window.  The problem arises when I try to create a legend in the composer. The data-defined colours displayed on the map don't pull through to the legend.  Here are some screens shots. The first shows the map window. You can see the problem manifesting in the Layers box on the left. The symbols are all coloured black.  The second screen shot shows the composer window with a legend.
77803
I have a vector layer, populated with points, and I want to programmatically add to this layer.  The part related to the geometry works just out of the box, but I was having trouble with adding attribute values to the new features.  The problem is, when I add a new feature to the layer, I do not manage to specify fields. The feature would complain on exceptions.KeyError.          featureList = []         ## now add the computed points to the layer         for p in [p for p in points.values() if p['computed']]:             x, y = p['coordinates']             feature = QgsFeature()             layerPoint = transf.transform(QgsPoint(x, y))             feature.setGeometry(QgsGeometry.fromPoint(layerPoint))             feature['id'] = p['id']             featureList.append(feature)          layer.dataProvider().addFeatures(featureList)         layer.commitChanges()   And before you ask, obviously I'm sure it's the feature['id'] which is giving trouble, not the p['id'].  So the short version of the question was "how do I specify fields of a feature before it was ever part of a layer?"
70650
If I load the original .csv file, I then have a map of the African continent represented by 14069 data points covering it at 40x40km resolution. Each data point shows solar radiation means across the year, (jan, feb, etc).   What I want to be able to do is convert that vector into a raster using GRASS.  What I have managed to do already, is import the .csv (tab delimited) file into the GRASS mapset using v.in.ascii. However, when I try use v.to.rast.constant to convert that vector into a raster, I get a solid square covering Africa, that cannot be edited. I.e. there is no data from the vector within the created raster.   What am I doing wrong?
48668
I realise that this question has been asked before (), however I am still unable to figure out how to create an index map of atlas features in the QGIS map composer.  Basically, I have a line and I have five atlas maps showing the extent of the line, and to show where which map corresponds to the line a I need five overviews on a map with numbers on them, which will look similar to below:    I've created five overviews, but as all of these must be set to correspond to the main map frame, all of them show the overview for which ever atlas feature is selected at the time, rather than appearing as separate index tiles.  Can anyone tell me where I am going wrong?
116750
I apologize for the subjective "best" keyword.  My friend and I have started creation of a 2D adventure game. It will be top-down in the style of pokemon or zelda (just the perspective). We have been discussing methods of creating a large world-map that the player can traverse without straining the memory capabilities of our machine.  Our first impulse was to create a large map and a circle around the player in which content will be loaded. We figured this won't hold for long and decided to partition the map into sections. First we had four large sections, but realized we could simply break it down into many tiny sections.  I played some Zelda from the SNES and saw that, during the shift of a map, the content could be loaded just then. What I mean is, instead of just checking a rectangular area for data to load, we simply section the map into many tiny chunks that load and de-load data as we move from map-portion to map-portion.  Today, he told me he wanted to create a simply 2D array map[WIDTH][HEIGHT] that contains data about every grid in the game and is a constant save-to-disk operation for data that we don't need.  I'm not sure about these ideas and thought that I might as it here. Any links, resources or tutorials on the subject would be greatly appreciated as well as direct answers to our question on how to do it efficiently.
57881
I want to display an indoor map. My problem is that when I change to another floor (the URL changes) the tiles are not refetched. The following code is used:  var indoorSource = new ol.source.XYZ({     crossOrigin: null,     tileUrlFunction: parseUrl,     maxZoom: 45 }); var indoorLayer = new ol.layer.Tile({     source: indoorSource });   The parseUrl function is the following:  var parseUrl = function (tileCoords, pixelRatio, projection) {     var url = 'http://127.0.0.1/tiles/{z}/{level}/{x}/{y}';     var innerMap = LocalUserData.currentInnerMap();      url = url.replace('{level}', innerMap.level || 0);     url = url.replace('{z}', tileCoords.z || 0);     url = url.replace('{x}', tileCoords.x || 0);     url = url.replace('{y}', tileCoords.y || 0);     return url; };   Is there a way to force a reload of the tiles?
113383
I have a question on speeding up “Mosaic to New Raster” or finding an alternative.  After completing a suitability analysis we are trying to define movement corridors.  We used a modified CircuitScape that left 4 folders, each containing 1080 raster tiles across our study area.  We now need combine all 1080 rasters in each folder then combine these 4 combined rasters into a final raster which will be analyzed for paths.  I tried a python script that just wouldn’t work so I went on to Model Builder.  It iterates through the grids in the folder, collects the values (raster names), then mosaics all to a new raster.  It has been running for 5 days now and the results window indicates it is working.  I’m hoping it will conclude in the next day or 2.  But, we still have 3 more folders, each with 1080 rasters, that need to be mosaicked.  So….is there a way to speed up Mosaic to New Raster or is there an alternative I could use to produce the final grid?    The cell size is 270 meters, 540 x 540 columns and rows, 1 band, 32 bit floating.
64172
I'm creating a composite image, in order to create a timeseries. I've already created the composited image, but i am having difficulty masking the clouds of the composite image. I've followed the code from a page having similar problems, however when I run the code (after replacing all the l8_mayo to composite as that is the name of my composite var), I get the error code of composite.map not a function. This error does not come up when I run the exact same code from the previous answer. Can someone explain how to overcome this problem? Here is the page I used:  here is my code and the link to my code:  (point is the long, lat for Lake Manyara, Tanzania)  //load images for composite var sr14= ee.ImageCollection('LANDSAT/LC08/C01/T1_SR') .filterBounds(point) .filterDate('2014-01-01','2014-03-01') .select(['B4','B3','B2']);  // Temporally composite the images with a maximum value function. var composite = sr14.max(); Map.setCenter(35.8244, -3.5799); Map.addLayer(composite, {}, 'max value composite');  var getQABits = function(image, start, end, newName) { // Compute the bits we need to extract. var pattern = 0; for (var i = start; i &lt;= end; i++) {    pattern += Math.pow(2, i); } // Return a single band image of the extracted QA bits, giving the band // a new name. return image.select([0], [newName])               .bitwiseAnd(pattern)               .rightShift(start); };  // A function to mask out cloudy pixels. var cloud_shadows = function(image) { // Select the QA band. var QA = image.select(['BQA']); // Get the internal_cloud_algorithm_flag bit. return getQABits(QA, 7,8, 'Cloud_shadows').eq(1); // Return an image masking out cloudy areas. };  // A function to mask out cloudy pixels. var clouds = function(image) { // Select the QA band. var QA = image.select(['BQA']); // Get the internal_cloud_algorithm_flag bit. return getQABits(QA, 4,4, 'Cloud').eq(0); // Return an image masking out cloudy areas. };  var maskClouds = function(image) { var cs = cloud_shadows(image); var c = clouds(image); image = image.updateMask(cs); return image.updateMask(c); };  var composite_free = composite.map(maskClouds);  Map.addLayer(composite_free, 'composite collection without clouds');
104891
Why can't I add a base map to my data frame in ArcMap?  I am using ArcGIS 10.2 for Desktop and the options under Add Data for Add Basemap and Add Data From ArcGIS Online are both disabled (grayed out).
15784
I'm creating a map with two shapefiles:   A polygon of counties Points of cities   I used the function Intersect to group the cities in each county.  I'm trying to get the number of cities in each county to show up in the legend.    For example, in county A there are 16 cities, in county B there are 7 cities and so on.  I'm trying to create a choropleth map that shows the number of cities in each county.
3458
I'm starting/started a 2D tilemap RPG game in Java and I want to implement random map generation. I have a list of different tiles, (dirt/sand/stone/grass/gravel etc) along with water tiles and path tiles, the problem I have is that I have no idea where to start on generating a map randomly.  It would need to have terrain sections (Like a part of it will be sand, part dirt, etc.) Similar to how Minecraft is where you have different biomes and they seamlessly transform into each other. Lastly I would also need to add random paths into this as well going in different directions all over the map.  I'm not asking anyone to write me all the code or anything, just piont me into the right direction please.  tl;dr - Generate a tile map with biomes, paths and make sure the biomes seamlessly go into each other.
101252
I'm trying to add Openstreet Map (OSM) to QGIS3 (Ubuntu 16.04) as a background WMS layer. I found a list of , and a WMS tab in the new Data Source Manager (Ctrl+L).  But after clicking the new button and entering the URL http://www.osm-wms.de to Create a New WMS Connection, I get a new connection called osm, which cannot be used. I can't expand the connection in the index pane as with other things like PostGIS, or add anything from that connection.  Can someone provide some pointers on how to manually add the WMS layer (ideally without using plugins)?
50222
I am trying to create a grid road map with an index table for street look up.  I am using this tutorial by ESRI:   I am at the step whereby I am supposed to spatially join a point file (centroid point for each label) to a grid (which has the grid ID):      The next step is to use the Spatial Join tool (one to many is the join   option) and join the annotation to each grid cell they fall within.    However, you will likely not want to work directly with the annotation   because the spatial join options for “contains” or “within” will not   include any annotation that overlaps more than one grid cell. Further,   the “intersects” option will create duplicate entries in the same   circumstances. To get around that convert the annotation to point   features using the Feature to Point tool (Important note: I had to   delete the Element field; the type is blob, the field isn’t needed,   but if it’s there, the tool won’t run).   It seems to be telling me to spatially join the points to the grid in order to match up each label point with its grid ID value. However, whenever I spatially join, the output table is empty.   Any advice? I simply need to find a way to extract the grid ID of where the points falls within the grid.     I've included a photo of the spatial join parameters. After the process runs, it simply spits out a new shapefile with no features and an empty attribute table.
56976
After reading , I was wondering if QGIS 2.6 will include this when running various processes. I checked online and I could only find that multi-threaded rendering was introduced to QGIS 2.4 (I assume it will again be available in 2.6). Now maps can be redrawn very quickly especially when dealing with large datasets.  I read that it's fairly difficult to include multi-threading to core functionality and that users are advised to manipulate Python code in order to achieve this, such as in .  I also checked the  but it has been closed for 9 months now by Tim Sutton with the last comment being:     "I'm closing this out - Martin Dobias has an implementation in a branch which will be merged post QGIS 2.2"   Will some functions in QGIS 2.6 exploit multi-threading (or will it again be focused on rendering) and if not, will that change at QGIS 3.0?