<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Drawing points part 1
Step1:  the file contain some major railway stations. 
read the shapefile and take a look.
Step2:  Tthe projection of the file is epsg
Step3:  And now read the borders file, and do the projection.
Step4:  Now they are projected and have the same projection.
Lets, prepare the map with the borders file as a background
Step5:  And, first try
Step6:  Try to change the marker with a circle (marker='o'), and change to red colour.
Step7:  And, change to square.
Step8:  get  some special icon as the marker come with the colouringmap
colouringmap package has included some font icons, which included maki (by mapbox) and so on...
to get a list of the icon_sets
Step9:  to get a list of the icon in an icon set
Step10:  to get an icon from the sets and names
Step11:  The above xxx_icon will be used as the marker for mapping.
You can also use ms.show_icon() to take a look at the chosen icon.
Step12:  map the points using the special icons
just similar with the previous map_scatter, but change the marker to the show_icon/rail_icon.
Step13:  map the points according to a column of category
Sometimes, there are different types of points in a shapefile that you want to draw with different marker shapes, for differentiating them. 
One way to do this, is create a temporally geodataframe, with distincted category, and map them with two lines of codes. 
colouringmap provided another function named mpoint.map_category, which do the above procedures automatically for you. What you need to do is, provide a list of categories that you want to map (cat_order), and their style (marker_order, size_order, colour_order) in the same sequence.
Step14:  By default, map_category function will use some default markers for the different categories. 
The following show how to use different sets of styles for each category.
Step15:  colouring the points using different colour
The following demonstrate how to use map_colour to change the colour of the points according to a column that contain the colour info.
In this tutorial, I will just create some random colour for each point. The matplotlib rgb color is a set of three 0.0-1.0 float numbers.
Step16:  Now, map the points using the 'color' column.
Step17:  varying the sizes of the points according to a column with a size number
The following tutorial show how to specify the size for each point, using a column. 
The numbers in the column is intended to be used directly as a size. Well, this can also use as the proportional size for a variable. 
To make a map with points using sizes that represent the breaking level, see another tutorial (part 2). 
Let say we want to change the size of the points according to a column named 'DistanceBe'.
Step18:  Now change the size according to the column "size2"
Step19:  Actually, this can also be done by using size_scale=20. (default to 1.).
But, note that the column is 'DistanceBe2', which is a column of numberic numbers, unlike the original column which is a string.
<ASSISTANT_TASK:>
Python Code:
import geopandas as gpd # read and manage attribute table data
import matplotlib.pyplot as plt # prepare the figure
import colouringmap.mapping_point as mpoint # for drawing points
import colouringmap.mapping_polygon as mpoly # for mapping background polygon
import colouringmap.markerset as ms # getting more marker icons
from random import random # just for creating a random colour for demonstration
# the projection of the map, the data is in wgs84(epsg:4326), so need a proj dict for conversion
proj = {u'lon_0': 138, u'ellps': u'WGS84', u'y_0': 0, u'no_defs': True, u'proj': u'eqdc', u'x_0': 0, u'units': u'm', u'lat_2': 40, u'lat_1': 34, u'lat_0': 0}
## magic line for matplotlib
%matplotlib inline
Explanation: Drawing points part 1: major and basic functions
In this tutorial, I will show you how to draw point maps from point shapefile data. 
The data is a set of major stations in Tokyo.
An administrative boundary (polygon) shapefile will be used as the background. 
The most basic, most frequently used functions for mapping point shapefile is covered in this tutorial.
mpoint.prepare_map: just same as mpoly.prepare_map
mpoint.map_scatter: drawing all points with one simple marker (default='.'), which marker can also be customized using the markerset, and other matplotlib markers ('s' for square, etc.)
markerset.(list_icon_sets, list_icon_names, show_icon, get_marker): these functions are provided for choosing/showing/getting the markers before drawing them to map
drawing poitns with the markers get from the markerset
mpoint.map_category: drawing points according to a column of category (and use marker_order, colour_order, size_order to assign the marker design)
mpoint.map_colour: map points according to a column of colour
mpoint.map_size: map points according to a column of size, with a size_scale to set the size scale
start mapping
preparation: import modules, reading files, projections, prepare map
End of explanation
stations = gpd.read_file('data/tweets_hotspot_station.shp')
stations.head()
stations.crs
Explanation: the file contain some major railway stations. 
read the shapefile and take a look.
End of explanation
stations = stations.to_crs(proj)
Explanation: Tthe projection of the file is epsg:4326, which is the latitude and longitude. So, lets project them to a projected crs.
End of explanation
borders = gpd.read_file('data/tokyo_special_ward.shp')
borders.head()
borders = borders.to_crs(proj) # convert the borders projection to the same as the stations
print borders.crs==stations.crs # now check again if the two shapefile have the same projection
Explanation: And now read the borders file, and do the projection.
End of explanation
fig,ax = plt.subplots(figsize=(7,7))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
Explanation: Now they are projected and have the same projection.
Lets, prepare the map with the borders file as a background: use mpoly.map_shape.
End of explanation
fig,ax = plt.subplots(figsize=(7,7))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_scatter(stations, ax, extend_context=False)
Explanation: And, first try: map them using default settings with mpoint.map_scatter, which default to dot (marker='.')
End of explanation
fig,ax = plt.subplots(figsize=(7,7))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_scatter(stations, ax, extend_context=False, 
                        marker='o', size=36, facecolor='red', alpha=.7)
Explanation: Try to change the marker with a circle (marker='o'), and change to red colour.
End of explanation
fig,ax = plt.subplots(figsize=(7,7))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_scatter(stations, ax, extend_context=False, 
                        marker='s', size=36, facecolor='red', alpha=.7)
Explanation: And, change to square.
End of explanation
print ms.list_icon_sets()
Explanation: get  some special icon as the marker come with the colouringmap
colouringmap package has included some font icons, which included maki (by mapbox) and so on...
to get a list of the icon_sets:
End of explanation
print ms.list_icon_names('maki')
print ms.list_icon_names('linecons')
Explanation: to get a list of the icon in an icon set:
End of explanation
rail_icon = ms.get_marker('maki', 'rail')
shop_icon = ms.get_marker('linecons', 'shop')
Explanation: to get an icon from the sets and names:
End of explanation
ms.show_icon(shop_icon, size=36, face_colour='green')
ms.show_icon(rail_icon, size=48)
Explanation: The above xxx_icon will be used as the marker for mapping.
You can also use ms.show_icon() to take a look at the chosen icon.
End of explanation
fig,ax = plt.subplots(figsize=(12,12))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_scatter(stations, ax, extend_context=False, 
                        marker=shop_icon, size=12, facecolor='red', alpha=.9)
fig,ax = plt.subplots(figsize=(12,12))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_scatter(stations, ax, extend_context=False, 
                        marker=rail_icon, size=24, facecolor='#4b0101', alpha=.9)
Explanation: map the points using the special icons
just similar with the previous map_scatter, but change the marker to the show_icon/rail_icon.
End of explanation
fig,ax = plt.subplots(figsize=(12,12))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_category(stations,'Company', ax, size=48, extend_context=False)
Explanation: map the points according to a column of category
Sometimes, there are different types of points in a shapefile that you want to draw with different marker shapes, for differentiating them. 
One way to do this, is create a temporally geodataframe, with distincted category, and map them with two lines of codes. 
colouringmap provided another function named mpoint.map_category, which do the above procedures automatically for you. What you need to do is, provide a list of categories that you want to map (cat_order), and their style (marker_order, size_order, colour_order) in the same sequence.
End of explanation
fig,ax = plt.subplots(figsize=(12,12))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_category(stations,'Company', ax, size=28, extend_context=False, 
                         cat_order=['Tokyo Metro', 'Toei'], # category order
                         marker_order=[shop_icon, rail_icon], 
                         size_order=[24,30], 
                         colour_order=['r', 'g'])
Explanation: By default, map_category function will use some default markers for the different categories. 
The following show how to use different sets of styles for each category.
End of explanation
col_list = []
for i in range(len(stations)):
    r = random()
    g = random()
    b = random()
    col_list.append((r,g,b))
stations['color'] = col_list
Explanation: colouring the points using different colour
The following demonstrate how to use map_colour to change the colour of the points according to a column that contain the colour info.
In this tutorial, I will just create some random colour for each point. The matplotlib rgb color is a set of three 0.0-1.0 float numbers.
End of explanation
fig,ax = plt.subplots(figsize=(12,12))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_colour(stations, 'color', ax, extend_context=False, 
                        marker=rail_icon, size=24,alpha=.9)
Explanation: Now, map the points using the 'color' column.
End of explanation
stemp = stations['DistanceBe'].tolist()
stemp2 = [ float(s)*20 for s in stemp ]
stations['size2'] = stemp2
stations['DistanceBe2'] = [ float(s) for s in stemp ]
stations.head()
Explanation: varying the sizes of the points according to a column with a size number
The following tutorial show how to specify the size for each point, using a column. 
The numbers in the column is intended to be used directly as a size. Well, this can also use as the proportional size for a variable. 
To make a map with points using sizes that represent the breaking level, see another tutorial (part 2). 
Let say we want to change the size of the points according to a column named 'DistanceBe'.
End of explanation
fig,ax = plt.subplots(figsize=(12,12))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_size(stations, 'size2', ax, extend_context=False, 
                        marker=rail_icon, facecolor='green', alpha=.9)
Explanation: Now change the size according to the column "size2"
End of explanation
fig,ax = plt.subplots(figsize=(12,12))
ax = mpoint.prepare_map(ax, map_context=borders, background_colour='grey')
ax = mpoly.map_shape(borders, ax, lw=.1, alpha=.7, fc='#c1c6fc')
ax = mpoint.map_size(stations, 'DistanceBe2', ax, extend_context=False, size_scale=20.,
                        marker=rail_icon, facecolor='green', alpha=.9)
Explanation: Actually, this can also be done by using size_scale=20. (default to 1.).
But, note that the column is 'DistanceBe2', which is a column of numberic numbers, unlike the original column which is a string.
End of explanation
<END_TASK>