So far I load 3 Geojson files on my Mapbox map.
When I try to load a forth one it does not work.
Is 3 the limit for thos kind of files?
Thanks
Is it any fourth one or have you possibly hit your limit in the number of features?
Related
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.
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.
I am using Mapbox to build a multiple choropleth map.
Something along the lines of this example, https://www.mapbox.com/mapbox.js/example/v1.0.0/choropleth-joined-data-multiple-variables/
I am using countries instead of US states however.
I've got the map working and I can switch between layers
I have an extra requirement however to add a marker in each country that displays how many projects are active in that country.
I found out how I can add custom markers to the map with this example, https://www.mapbox.com/mapbox.js/example/v1.0.0/divicon/
The problem is I need to put a marker in the center of each country.
Does anybody know a way to put a marker in the middle of each country?
I tried to use the natural earth admin 0 label points data but that has multiple points per country. It looked like the 'scalerank=0' points were the middle of the countries but if I filter on these points, I still get multiple points for some countries (russia has 4 for instance, but Belgium has 4 as well).
If you plot all scalerank 0 points on a map you get the following result:
https://a.tiles.mapbox.com/v4/persyval.jg5p7gm7/page.html?access_token=pk.eyJ1IjoicGVyc3l2YWwiLCJhIjoiX3lrSTNYYyJ9.6Ps4OlBCYmlkxQksKsGb7A#6/45.159/12.206
Does anybody know about a dataset that has one point per country or another way to put a marker in the center of each country with mapbox?
It seems it's hard to find a list of country points for the placing of markers.
So I took the mentioned admin labal 0 points and tried to sanitize it to have only one appropiate marker per country.
The result can be downloaded here in GEOJSON format:
https://drive.google.com/file/d/0B6IQhfb-UYeUYk1mcUZaMmV0S1U/edit?usp=sharing
If you want to have a visual representation of the points take a look at this map:
https://a.tiles.mapbox.com/v4/persyval.jgk4767c/page.html?access_token=pk.eyJ1IjoicGVyc3l2YWwiLCJhIjoiX3lrSTNYYyJ9.6Ps4OlBCYmlkxQksKsGb7A#4/36.49/34.32
I needed this points for a proof of concept project so I haven't checked all markers meticulously, I also haven't taken account some of the more political sensitive country borders.
If you have a project in which this is of importance please check the file before using, but the points in this file can be easily edited to your own preferences.
I have a group of polygons which I merged to create one large polygon using the editor toolbar. This worked fine but there are still 5 or 6 lines contained within the large polygon. I'm assuming these are contained within the polygon because when I select the polygon the lines are selected too - how can I get rid of these 'rogue' lines, if I merged the polygons how come I have lines now? Any help appreciated!
My guess is that your polygons don't have correct topology, I mean the sharing border is not exactly the same. There is very likely a tiny gap and when you merge your polygons, you see those tiny gaps as line (try zoom to very detail). If this was problem, solution is obvious - you should correct topology of your polygon before merge - you can use topology class with no gaps rule.
You can manually remove the lines by:
1) Enter an edit session
2) Selecting the feature
3) Select the "Edit Vertices" tool from the editor toolbar
4) Find the vertices of the rogue lines, select them, and delete them
5) End edit session and save edits
ESRI resource:
http://resources.arcgis.com/en/help/main/10.1/index.html#//01m80000003p000000
I have been dealing with a lot of shape files editing tools last month..
I tried to get two dbf files from shape file (one for nodes and one for links) in an appropriate format (node_id,x,y for nodes and link_id,start_node_id,end_node_id,...for links)in order to create an oracle spatial network.
I got the dbf for nodes..
I want now to get the attribute table from a loaded shape file containing polylines (roads) and I want to split each polyline to its segments containing their start and end node id's besides their geometry..
Every help accepted..
You might want to clarify your question slightly, but it sounds like you want to get the details of each point in a polyline from a shapefile so that you can define segments.
I wrote an example of how you can do this using Python here:
https://gis.stackexchange.com/questions/40798/how-to-split-shapefile-per-feature-in-python-using-gdal
Specifically, pay attention to the lines:
line = geom.asPolyline()
# all points in the line
for point in line:
You should be able to achieve your goal using a variation of this basic example.
Dan