3

When I read the paper Characterizing Urban Landscapes using Geolocated Tweets, I'm attracted by the figures illustrated in it, like this:

Figure_1

Figure_2

Figure_3

How do I plot these figures for my own data?

Which software or package could be used to achieve this?

It seems like the basemap package in python doesn't contain the POI layer.

My working language is python and OS is Linux, while the data(containing ID, Lng, Lat, timestamp) is represented using Numpy arrays.

asked Jan 22, 2015 at 8:40
4
  • Shapely is a python package that works closely with numpy arrays. You could use it to transform your data into spatial layers Commented Jan 22, 2015 at 14:32
  • @BelowtheRadar Thanks for suggestion~ If I transform my data into spatial layers, can I merge it with other layers like poi or road network together to achieve the effect like the figure above? Commented Jan 22, 2015 at 15:05
  • Maps like those are made by supperpositions of layers, do you aim to create a dynamic or a static map? Commented Jan 22, 2015 at 15:06
  • @BelowtheRadar static map, just like the figures for illustration. I gathered some GPS trajectory data as well as some POI data, and I want to do some clustering on both to check whether there exists some correlation between trajectories and POIs. So I want to visualize the result for better understanding Commented Jan 22, 2015 at 15:36

2 Answers 2

1

I should add that Shapely alone is probably not enough to create your layers, you should use Fiona package to export your Shapely objects to geojson file that could be used in a GIS such QGIS.

Simpler:

You could also export your data into a csv or json file and use QGIS to create your spatial layers from the x and y fields. You can give any style to your layers or create thematics on it with QGIS.

For the base layers made of aerial photos, you can use Bing Map from within QGIS.

Finally, you can export from QGIS to pdf or any image format you like.

For POI: How to add csv file in QGIS 2.0 using Delimited Text Layer Plugin?

For polylines or polygon: Import polylines and polygons into QGIS from CSV

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered Jan 22, 2015 at 15:20
0
1

Some notes on a pure python way to do this (I prefer this to working in QGIS, when possible):

For managing your own data, I would recommend using the geopandas package. You can read GeoJSON or Shapefiles in directly, or else convert your own data from CSV or a Pandas Dataframe, which is easy to construct from a Numpy array.

Once you have a geopandas dataframe, you can call df.plot() to produce a plot. This is built off of Matplotlib, which takes a layered approach that allows you to put different datasets on top of each other.

In order to get a nice basemap, I recommend using the contextily package for the bottom layer. An example is shown on the package's Github. There is also an plugin for Jupyter notebook called gmaps but I found the syntax harder to grasp.

answered May 9, 2020 at 19:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.