Map of Australia: React (hooks) + D3.js

Area SQKM by Australian Commonwealth Electoral Division

D3 map featuring cloropeth colors, tooltip, scroll zoom and map control

Source: https://datapacks.censusdata.abs.gov.au/datapacks

Getting and formating the data

In order to draw Australian map, we need the Geography Boundaries and we can get this shapefile from here: https://datapacks.censusdata.abs.gov.au/datapacks/

Australian Bureau of Statistics: https://datapacks.censusdata.abs.gov.au/datapacks/

Now we have the file  —  CED_2016_AUST.zip  — we have to upload this file on https://mapshaper.org/

  • You will see the Australian map.
  • Now we will decrease the size simplifying and export as GeoJSON. We used 4% but you can use any value.

  • Next, we’ll visit the Ogre to Ogre (ogr2ogr) web client to convert our file to the correct EPSG:4326 coordinate system. https://ogre.adc4gis.com/
  • Upload the GeoJSON simplified

Now we have the GeoJSON formatted to work with d3.js.