Open abismailinglist opened 2 years ago
This is a bit fuzzy for me as well but if you look at the code and d3-contour that it uses you can see that it takes the rectangular array/matrix of z-values and pushes it into d3-contour and then the output is mapped to the geographical coordinates. So you need to map your z-values to a rectangular array/matrix in some way that makes sense, like some kind of "spatial binning" (?). In you example you don't really have any z-values which makes it hard to come with any recommendation. But if the polygon has the same z-value all over then put it into a bounding box, decide the array dimensions of the bounding box and project it onto the bounding box array/matrix in some way.
Sorry for the slow response. The input data needs to be a object with the following format {x: [[]], y:[[]], z:[[]]}. Where each of the values is a 2D matrix.
e.g. {x: [[9.1, 9.2, 9.3],[9.1, 9.2, 9.3],[9.1, 9.2, 9.3]], y:[[46.1, 46.1, 46.1],[46.05, 46.05, 46.05],[46, 46, 46]], z:[[1,1.2,1.3],[1.1,1.5,1.3],[1.4,1.1,1.1]]}
Hi James, I have got a 200 lat, lon, value array. I couldn't figure out how should I split them into 2d array. Could you explain the 2d array that make sense for us.
Hey, I wasn't quite able to understand the plugin's usage. Can you help me out? In MatPlotLib, you have to create a 2D array whose indexes are the latitude and longitude. So for instance something like this
How is the data supposed to be structured for this plugin instead? I see that there are a lot of nulls and stuff, I suppose that you created it programmatically, but how? Let's say for example that you wanted to draw a contour starting from this GeoJSON data (which is just a pentagon really), how would you do that?