Reader small image

You're reading from  Learning D3.js 5 Mapping - Second Edition

Product typeBook
Published inNov 2017
Reading LevelIntermediate
Publisher
ISBN-139781787280175
Edition2nd Edition
Languages
Tools
Right arrow
Authors (3):
Thomas Newton
Thomas Newton
author image
Thomas Newton

Thomas Newton has over 20 years of experience in software engineering, creating highly scalable and flexible software solutions for clients. During this period, he has developed a broad range of expertise ranging from data visualizations, to large-scale cloud platforms, to continuous delivery and DevOps. When not going in a new technology, he spends time with his beautiful family.
Read more about Thomas Newton

Oscar Villarreal
Oscar Villarreal
author image
Oscar Villarreal

Oscar Villarreal has been building web applications and visualizations for the past 15 years. He's worked with all kinds of businesses and organizations globally, helping them visualize and interact with data in more meaningful ways. He enjoys spending time with his wife and kid, as well as hanging from the edge of a rock wall when climbing.
Read more about Oscar Villarreal

Lars Verspohl
Lars Verspohl
author image
Lars Verspohl

Lars Verspohl has been modeling and visualizing data for over 15 years. He works with businesses and organisations from all over the world to turn their often complex data into intelligible interactive visualizations. He also writes and builds stuff at datamake.io. His ideal weekend is spent either at a lake or on a mountain with his kids, although it can be hard to tear them away from the computer games he wrote for them.
Read more about Lars Verspohl

View More author details
Right arrow

Finding and Working with Geographic Data

We have spent a significant amount of time creating and interacting with maps in our previous chapters. In all our examples, the geographic data was included. In this chapter, we will explain how to find geographic data about any country in the world.

There are typically two sets of data that we will need to create a map in D3:

  • A dataset that represents the geographic shape of our map (geodata)
  • Some meaningful data that we want to visualize on the map (for example, population density by US countries, or unemployment rate by countries in the world)

This chapter is focused on understanding, manipulating, and optimizing geodata for map visualizations. We will accomplish these goals by:

  • Explaining three important formats that contain geospatial vector data
  • Finding, downloading, and working with large amounts of map data
  • Using techniques...

Geodata file types

There are dozens of file formats that represent geographic information. In this section, we will focus on three file types: shapefiles, GeoJSON, and TopoJSON.

What are shapefiles and how do I get them?

Shapefiles are the most popular vector-based file format. They contain polygons and lines that represent geographic boundaries. The shapefile format was developed by the company Esri as an open standard to work with geographic information systems (GIS). This vector information can also describe other geographic entities (rivers, lakes, and railroads). In addition, the file format has the ability to store data attributes that are useful when working with visualizations (for example, the name of the geographic...

Summary

At this point, you should feel confident that you can find and modify datasets to your needs. We've covered common locations from where you can acquire data, and we've touched on the different types of flags TopoJSON offers. With these skills, it is up to you to make sure your data is trimmed and is acquired to your visualization needs. This closes the circle of developing maps with D3. In the next chapter, we will refine your craft by focusing on testing your visualizations.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Learning D3.js 5 Mapping - Second Edition
Published in: Nov 2017Publisher: ISBN-13: 9781787280175
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (3)

author image
Thomas Newton

Thomas Newton has over 20 years of experience in software engineering, creating highly scalable and flexible software solutions for clients. During this period, he has developed a broad range of expertise ranging from data visualizations, to large-scale cloud platforms, to continuous delivery and DevOps. When not going in a new technology, he spends time with his beautiful family.
Read more about Thomas Newton

author image
Oscar Villarreal

Oscar Villarreal has been building web applications and visualizations for the past 15 years. He's worked with all kinds of businesses and organizations globally, helping them visualize and interact with data in more meaningful ways. He enjoys spending time with his wife and kid, as well as hanging from the edge of a rock wall when climbing.
Read more about Oscar Villarreal

author image
Lars Verspohl

Lars Verspohl has been modeling and visualizing data for over 15 years. He works with businesses and organisations from all over the world to turn their often complex data into intelligible interactive visualizations. He also writes and builds stuff at datamake.io. His ideal weekend is spent either at a lake or on a mountain with his kids, although it can be hard to tear them away from the computer games he wrote for them.
Read more about Lars Verspohl