block by bricedev 90a59fe4882541220971

SA Lambert Conformal Conic

Full Screen

Admin 0 South America projected topojson (Lambert Conformal Conic).

index.html

<!DOCTYPE html>
<meta charset="utf-8">
<style>

.countries {
  fill: #222;
  stroke: #fff;
}

.countries :hover {
  fill: #8a8a8a;
}

</style>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js"></script>
<script>

var width = 960,
    height = 800;

var path = d3.geo.path()
    .projection(null);

var svg = d3.select("body").append("svg")
    .attr("width", width)
    .attr("height", height);

d3.json("sa.json", function(error, sa) {
  if (error) throw error;

  svg.append("g")
      .attr("class","countries")
    .selectAll("path")
      .data(topojson.feature(sa, sa.objects.countries).features)
    .enter().append("path")
      .attr("d", path)
    .append("title")
      .text(function(d) { console.log(d); return d.properties.ADMIN; });

});

d3.select(self.frameElement).style("height", height + "px");

</script>

makefile.md

ogr2ogr \
    -f 'ESRI Shapefile' \
    -t_srs 'EPSG:102015' \
    -where "continent IN ('South America')" \
    sa-projected.shp \
    ne_10m_admin_0_countries.shp

topojson \
    --width 960 \
    --height 800 \
    --margin 20 \
    --properties ADMIN \
    --properties ADMO0_A3 \
    --properties GEOUNIT \
    --properties NAME \
    -o sa.json \
    -- countries=sa-projected.shp