Showing posts with label web GIS. Show all posts
Showing posts with label web GIS. Show all posts

Friday, 4 September 2015

Summarize Point data using Aggregate Points in Polygon in ArcGIS Online


This post will demonstrate how to use our web based GIS application software-ArcGIS Online to summarize Point data as well as visualizing the aggregate points in each polygon feature on a map.

For sample data to practice, Click this link to download this zipped shapefiles: GrazingSpots.ZIP, West Africa.ZIP
(Kindly attribute this data to www.mapsnigeriainitiative.wordpress.com)

Sign into ArcGIS Online account (You must be subscribing to an organizational account to be able to perform analysis in ArcGIS Online). Click on Map to open a new map.
Capture-1

Let us look at our data in the Contents window. We have a Point feature layer- Grazingspots-which represent major grazing spots within the geographical extent. Below is a polygon map comprising the different countries that make up the West African sub-region.
Our task is to summarize the number of points per polygon and visualize this result on the map using ArcGIS Online.
Capture-2

Click on Analysis (red box 1). The Perform Analysis window will open, then click on Summarize Data (red box 2) and under it click on Aggregate Points (red box 3).
Capture-3

In Option 2, we select the polygon layer as that is the layer containing the countries. Option3- Add statistics and its an optional field. For the demo, the dataset contains information on the numerical sizes of the livestock at the mapped grazing spots. Headcount represents the numerical size in the wet months and Drycount in the dry months when migration to the south takes place. Click RUN ANALYSIS
Capture-4

The new layer-Summarize (red boxed) is added. The different circles represent the total number of points per polygon -the bigger the circle translates to a greater number of Points in Polygon. To create the visualization, Click on the ….. beside the layer and choose Create Labels.
Capture-7

The Label Features window will open. Select the appropriate attribute field for labeling the features. The Label size, color and font attributes can be edited. Click OK
Capture-8

The Cluster markers are now labelled and displayed on the map in the screenshot below.
Capture-10


Thank you for following the blog.

Friday, 28 August 2015

Using the CartoDb Map layer wizard to generate Intensity and Heat maps



The Map layer wizard in CartoDB is a very useful tool for creating different types of feature maps. In this post, we will try to simplify the process of using point data to create heat and Intensity map using CartoDB.

Procedure
- Our Map view shows dataset comprising Point features that represent schools.
Capture-20

Click on the Map Layer wizard icon (red boxed) and Choose HEATMAP. Select the opacity, resolution and other parameters.
Capture-22

The results of the demo version at zoom level 10 show the highest intensity of the points to be in the Central area of the map.
Capture-23

The results of the Demo at a higher zoom level of 11 also shows a higher concentration of schools in the central area of the map.
Capture-25

Next, the demo will use the intensity tool to compare to the result of the heat map.
Scroll down the Map layer wizard and Click on the INTENSITY.
Capture-2

The results of the intensity map at zoom level 10 show more concentration of points in the central part of the map.
Capture-3

In these short simple steps, CartoDB Map layer wizard has generated heat and intensity maps for a Point map.

Friday, 21 August 2015

Creating and Styling web maps using the Mapbox Studio



Mapbox Studio is a development upgrade to TileMill and can be downloaded to the PC or Desktop. Mapbox studio is used to create Style and Source vector tiles that can be uploaded as data for use in Mapbox Editor and other GIS mapping applications. Mapbox Studio gives the user a wider range for customization with the use of CartoCSS.

The post will demonstrate how to use a standard free subscription of Mapbox Studio to create web maps. Mapbox Studio can be downloaded from the Mapbox.com site.

* Internet connection is required to use Mapbox Studio.

Task
Create and style a simple web map using Mapbox Studio. This demonstration will be a very introductory procedure(as we move along in the series the procedures will become more advanced).

Procedure

1. First Add a custom vector tile. Simply implies the user will import and apply a vector layer.

Launch Mapbox Studio from the desktop. Click on Projects (cursor finger on the lower corner left on the screenshot).
Capture-1

Click on New Project on the next page. Click on Sources (cursor finger)
Capture-3

On the next page, click on the + button under blank source (cursor finger).
Capture-7

Click on New Layer (red boxed) and the inner display box will appear. Click on Browse (cursor finger) to navigate for the vector file. In the case of this demo, the vector file is a polygon shapefile named Parcels.shp.
Capture-9

The vector layer is added. The default window to the right will be the Configure window(red boxed) Fill in Description and adjust buffer size to 30-32 preferably.
Capture-11

Click on the Fields button (cursor finger) and a window that will allow the user to inspect and fill in description of the attribute fields (see in red box) of the vector layer will open.
Capture-12

Once done with the editing, click Save as (highlighted in blue on the upper left side where the cursor finger is). Make sure to save the vector layer.
Capture-14
Next Upload the Source to Mapbox. Click on Settings (indicated in red box 1) > In the settings window (red box 2), fill in the details and fix the zoom of the source map created > Click on Upload to Mapbox (red box 3).
Capture-17

Open Mapbox Account online. Click on Data > Uploads and copy the Map ID of the uploaded vector source (green boxed).
Capture-25


2. Create a Style. A source (either raster or vector) is added on a style to produce the web map.

Click on Projects (red boxed 1) > New Projects (red boxed 2) > Styles (red boxed 3). For the demo, High contrast map style is chosen.
Capture-23

Next is to add in the source layer (red box 1) on the style. Click on Layers and Change source (red box 2). The source window will open. Put a comma after the description of the Style layer and input the copied Map ID  Capture-26. Click Apply
Capture-26

The uploaded vector source layer is now added to the Style.For the demo- see the Parcels layer (red boxed).
Capture-28


3. Let us style the layer.

Click on the + button on the far right (small red box). The Add a new CartoCSS tab to your style  window opens. Give the style a name and click on new tab to add.
Capture-31

The new CartoCSS tab is added in the right window. Now we write a simple code as follows:
image  This is a simple CartoCSS code. To learn more about CartoCSS, browse online for resources on this topic. First line indicates the layer to style, the line-color allocates color to the polygon border lines. line-width allocates a polygon border line of 1. polygon-opacity allocates opacity to the polygon and polygon-fill gives the fill color. Once the code is written , click on save button and the changes are made on the layer.
Capture-34

image Simple changes can be made in the code to change the appearance of the layer. line-width is increased to 2 and polygon-opacity to 8. Though a slight change but look at the screenshot to observe that the polygon border lines are now thicker.
Capture-37

4. Save the Style and Upload to the web

Click on Settings and a settings window will open. Fill in the Name and description of the style. Click Save to save the style locally.
Capture-38

Click on Settings again and Click on Upload to Mapbox. Note the Map ID allocated to the Style.
Capture-41

Viola!!!User can go their online Mapbox account and Click on Styles to view the uploaded map or edit it further.
Capture-42

This demonstration is a very simple introduction to using Mapbox Studio. This was designed in order to gradually bring in light skilled GI Users who may find the addition of codes intimidating. As we move along, more posts will reveal the awesome capacity of Mapbox Studio and even TileMill.

Thank you for reading and practicing along. Feel free to send in your comments.

Sunday, 16 August 2015

Creating a Web map using Mapbox Editor



This post will demonstrate how to produce web maps using an online Mapbox account.
Mapbox is an online web mapping platform that has the ability to use and integrate so many forms of web mapping formats.

This demonstration will show the reader how to use the online platform of Mapbox.

Things to note
- Register an online User account with Mapbox.
- Free accounts have their usage limits.
- User must be connected to the web to use the application.
Sign into your user account in Mapbox. On this page on the screenshot, Click Projects (cursor finger).

Capture-12

On the next page, click New project (cursor finger) to start a new project.
Capture-13

The Editor page with a working menu and a base map will open. Style- will allow the user select map styles to apply for the project. For the demo, Streets is selected (cursor finger).
Capture-14

Next, Click on Data (red boxed) and the lower menu (green boxed) will open. Click on import   (cursor finger). For the demo, a kml file of populated cities in the world’s poorest countries is imported.
Capture-16

In the import features window, give the features a Title from the attribute table. For the demo, the attributes of the Name field is used.
Capture-17

Click Style and give each point (known as marker in Mapbox) a size and colour.
Capture-18

Click Symbol and choose a symbol icon for the Points or markers. Put a Description and Click Finish importing.
Capture-19

The screenshot shows the imported data overlaying the base map.
Capture-20

Click on a marker and Add a description of the feature. For the demo, during import, name has been specified as the Title, so automatically each feature has the name attribute set.
User can further customize the style and symbol of each feature inside the info window.
Capture-21

In addition, user can change the base map to suit the temperament of the map design. Here in the demo, the screenshot below shows what the map will llok like when the Comic style is selected as base map for the layer.
Capture-24

Click Save (cursor finger) to save the map.
Capture-25

Click on Data to inspect the features of the data imported.
Capture-22

Click on Project, select the settings tab and give the project a name and description. Click Save and the map is automatically published.

Capture-29

Click Project again (cursor finger) and Info (lower left side of the screenshot) to get the details of the map that has been created. A Map ID was created in Mapbox.
Capture-27

Data- the map layer can be downloaded as Geojson or KML.  Share- the window provides a link to the location of the map online. Embed- provides a HTML code that user can use to add the map to a webpage.
That is it folks!! The web map is ready and published using the Mapbox online editor. In addition, edits can be made to it real time.

Sunday, 9 August 2015

More on Styling Line features in TileMill


In this post, we will use line feature layers-roads and rail line to design a map project in TileMill.

Download Sample data here- Line features
(attribute data to www.mapsnigeriainitiative.blogspot.com)

Launch TileMill and create a new project.
Click the Layers icon > Add to import the line feature layers that represent the different classes of roads and rail line.
Capture-35

In the Layers window, three classes of roads namely Major, Minor and Secondary roads as well as a rail line were added into the TileMill project- .
A look at the Style.mss window also shows the different default codes assigned to each layer.
Capture-41

image In the railine style, an additional line of code- line-dasharray:5,3; is added to style the railline as dashed lines. This will help clearly differentiate the railline from the roads.The screenshot below shows the changes reflected in the style of the railline feature due to this additional line of code.
Capture-42

Next extra lines of code defining which features should appear at certain zoom levels is added to the style layers. With the understanding that a lot lines can crisscross and intersect each other, turning some off at certain zoom levels will give a neater view to the map user when zooming in and out of the map.
The Style.mss codes for each layer indicates the following:
image major roads line width increases from 3 to 5 as the zoom level moves from 8 to 10. The line width stays as 5 anything above or equal to 12.
imageThe  Interesting part is the railline style layer that specifies that it only appears on the map between zoom greater or equal to 13 and less than or equal to 15 with a line width of 5. Look at the screenshot below and one can see that at zoom 12 (reb boxed to the upper left) the railline is not appearing on the map.
Capture-49

But on moving the zoom up to 13 (red boxed to the upper left of the screenshot), the railline appears on the map as instructed in the code.
Capture-50

Another important part of working with line features is to label them with proper names like street names etc.
image We insert this layer of code in the style.mss window allocating labels to the roads based on an attribute field that contains this values. Note that in the second line- text-name: [blank];. this blank space will have to be filled with the attribute field name.
For the demo, the attribute field name is ‘Name’, as seen on the screenshot. The Features window can be opened by clicking the features icon beside the layer in the Layers window.
Capture-51


image Note that two extra lines of code have been added to the previous style layer. text-dy is to displace the label upwards 12 pixels while the text-max-char-angle-delta allocated the angle the label will bend towards at the point of placement.
From the screenshot, one can observe that the labels (red boxed on the map canvas) are well aligned with the line features now.
Capture-54


In this brief tutorial, we have been able to show you how to style your lines into dashed or straight lines, hide and/or show different lines at different zoom levels as well as label the line features.