Friday 25 September 2015

Creating a Simple leaflet map



Leaflet is a light weight java script application created some years back. The popularity has grown over time because it gives a lot of room for customization of many features on a web map.
Creating a web map in web pages by using javasript language and object libraries enclosed within web pages designed with HTML/CSS seems novel to many GIS analyst and cartographers in this part of the world. Vector layers can also be added as variables or in the geojson format as well as other more advanced plugins like marker clustering.

Let us start by building the HTML web page.
Open a new file in a Text editor.
Write this in. (You can edit title and text if you want). Save as HTML.
Capture-1a


We add the link to leaflet.CSS application in the section of the web HTML (red boxed area).

Capture-2


Add the div container for the map (red boxed area).

Capture-3


Connect to the leaflet javascript library (red boxed area).

Capture-4

Next, we add  the set view of the map- Var map- (red boxed area). The map centre is in West Africa at a zoom of 8. The Tile layers – L.tilelayer are added from openstreetmap.org open layers- http:\\www.openstreetmap.org

Capture-5



Open the html file with a modern browser. Screenshot below displays the leaflet map in the web page.
Capture-1

Viola! we have added a simple leaflet map into the webpage. The leaflet map centre is in West Africa.

Thank you for following the blog.

Friday 18 September 2015

Labeling Bubble maps in Arcmap 10.2 Desktop



Task
- To create a Bubble map of various points and their PH values using graduated symbol sizes.
-Labeling the Point features with their PH value.

FOR SAMPLE DATA CLICK THIS LINK BELOW:
https://www.dropbox.com/s/iaev3uyo7uhgwzx/Points.csv?dl=0
(kindly attribute the production of this data to www.mapsnigeriainitiative.wordpress.com)


Let us have a look at our dataset. In the Table of Contents, we have a Point feature layer which has on its attribute table a field containing the PH values of the different points. The goal here is to use graduated symbol sizes to create a Bubble map with the values in the attribute field –‘PH’.
Capture-1

Right Click on the Point feature layer  > Properties.
Capture-2

In the Layer Properties window, Click on the tab- Symbology (red boxed).
Then since we are dealing with quantitative data, under the features, click on Quantities (red box 2).
Capture-3

1) Select Graduated symbols under quantities (2) In the Value option, select the attribute field of interest- PH (3) Define the number of classes the data will be classified into. (4) Define the range of the symbol size.
Capture-4

A Bubble map is created in the screenshot below. Notice that the symbol sizes are graduated according to increasing value of PH.
Capture-5

Labeling
The goal will be to label the point features with the PH values displayed right inside the marker.
Right Click the Point feature layer and go to Properties.
Capture-7

Click on the Labels tab. Check the box titled ‘Label features in this layer’. Select the attribute field whose values will be used to label the features. Choose font and font size. Next Click on Placement Properties –see cursor arrow position.
Capture-8

In this window-Placement Properties- Select the option in the red box. Click Ok
Capture-9

Next in the Label window, Click on the Label Styles tab. The Label Style Selector window will open. Select a style and Click Ok.
Capture-10

The labels are placed inside the symbols here in the screenshot below.
Capture-11

Friday 11 September 2015

Aggregate Points inside a Polygon using Point in Polygon analysis tool in QGIS 2.8



Clustering or aggregating points can help the end user analyze data on the maps better. Most times, points or markers can be so many at several different locations within a map that aggregating them will bring about a saner look. In addition, applying a cluster will give the map user the number of points within a geographic extent or location.

Task
To aggregate our points as clusters with labels using Points in Polygon analysis tool in QGIS 2.8

Load your sample data into QGIS. The sample dataset comprises a Point features shapefile- and a polygon feature shapefile.
See the Layers window on the screenshot. Download the data from the link text above.
(kindly attribute the sample dataset to www.mapsnigeriainitiative.wordpress.com)

 Capture-1

Click on Vector > Analysis Tools > Points in Polygon. This analysis tool will aggregate the points within their respective polygons.
Capture-2

The Count Points in Polygon window will open. Fill in the details as on the screenshot below and set a directory and name for the output shapefile. Click Ok when the processing is done.
Capture-3

Our new shapefile-PNTCNT is added to the Layer window. It is a polygon shapefile.
Capture-4

Right Click the new layer > Open attribute table. Note that the points have been aggregated and a count is given per polygon feature. See column PNTCNT on the table in the screenshot below.
image

Symbolize the point count as cluster markers and label them.

Right Click on the PNTCNT layer and click on Properties in the drop down menu.
Capture-6

First Click on Style (red boxed 1) and the style window will open. Choose Single Symbol (red boxed 2), then go to the Simple fill (red boxed 3) and click on it. To the extreme right, click on the dropdown box and select Centroid fill (red boxed 4).
Capture-7

The Centroid fill (red boxed leftmost) will move to a position above the marker. Edit the Colors option to a transparent fill and adjust the Size to 4.2 (see red boxed area to the right). Click Apply and transparent circle symbols should appear inside the polygon features. Click Ok.
Capture-8

Next we label the circle markers. Double click the layer and the Layer Properties window will open.
Click on Labels (red box 1) > Click on the Label this layer with and Select the PNTCNT field from the drop down menu. Go down and click on the Placement option(red boxed 3). Check Offset from centroid.
Capture-10

Then click on the Text option and change the Color to red. Click Apply to observe the changes on the map window and Click Ok to save them.
image

The symbols now have their labels showing the number of points in each polygon. The map user can now visualize the points based on their immediate geographic location depending on the scale we used for the map.
Capture-11


Now we have a map using symbols to illustrate the number of points in a particular polygon. Thank you for following us.

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.