Note that there are some explanatory texts on larger screens.

plurals
  1. POd3.js geoJSON and bounds
    primarykey
    data
    text
    <p>I have successfully loaded geoJSON files loaded the feature collection into a </p> <pre><code>d3.geo.path() </code></pre> <p>The problem with my current implementation is that it starts off the scaling such that the path is a point, and I have to zoom in each time. Now I know there are plenty of methods to about setting the zoom level right, but I was hoping to use </p> <pre><code>d3.geo.bounds() </code></pre> <p>Given the following geoJSON feature:</p> <pre><code>json.features[0]: Object geometry: Object coordinates: Array[2] 0: -71.248913 1: 44.078426 length: 2 __proto__: Array[0] type: "Point" __proto__: Object id: 2 type: "Feature" __proto__: Object </code></pre> <p>and</p> <pre><code>json.features[1]: Object geometry: Object coordinates: Array[2] 0: -71.249021 1: 44.078387 length: 2 __proto__: Array[0] type: "Point" __proto__: Object id: 3 type: "Feature" __proto__: Object </code></pre> <p>If I execute</p> <pre><code>d3.geo.bounds(json.features) </code></pre> <p>I get infinity for the bounds:</p> <pre><code>d3.geo.bounds(json.features) [ Array[2] 0: Infinity 1: Infinity length: 2 __proto__: Array[0] , Array[2] 0: -Infinity 1: -Infinity length: 2 __proto__: Array[0] ] </code></pre> <p>I'm unsure what is wrong, clearly I have a much larget dataset than above, but I'm just trying to understand the output. This output does not make sense to me and clearly missing something simple about d3 handling of geoJSON data. Any help to get the bounds to work would be helpful.</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload