Hi all,
I followed the instruction in here to load earthquakes GeoJSON geometry type:point over a MapView. Now I am using the same code to load a GeoJSON geometry type:polygon over the MapView. I changed the function createGraphics as shown bellow (Item 3). The GeoJSON file has 19315 features (polygons) and the console is showing the following warning and error messages (Item 1). Find bellow the footPrintRenderer (Item 2).
The console seems to be pointing to renderer error and Layer Graphics. I wonder if someone could help me to figure out what is going wrong. I am not sure if I set the rings correctly. I am following the bases for setting rings: [[[Xo,Yo],[X1,Y1],[X2,Y2],[X3,Y3],[Xo,Yo]]]. Lastly, find a piece of my GeoJSON (Item 4).
Any comment on that will very appreciated.
Thank you very much for your time in advance.
(Item 1)
[esri.core.Accessor] Accessor#set Invalid property value, value needs to be one of 'esri.renderers.HeatmapRenderer', 'esri.renderers.SimpleRenderer', 'esri.renderers.UniqueValueRenderer', 'esri.renderers.ClassBreaksRenderer', or a plain object that can autocast (having .type = 'heatmap', 'simple', 'unique-value', 'class-breaks') 4.10:310:392
[esri.layers.graphics.sources.MemorySource] Encountered 19315 validation errors while loading features
Array(19315) [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ]
(Item 2)
var footPrintRenderer = {
type: "simple-fill",
color: [51, 51, 204, 0.8],
style: "none",
outline: {
color: [0, 0, 255, 0.5],
width: 1.25
}
};
(Item 3)
function createGraphics(response) {
// raw GeoJSON data
var geoJson = response.data;
// Create an array of Graphics from each GeoJson feature
return geoJson.features.map(function(feature, i) {
return {
geometry: new Polygon({
rings: [[
[feature.geometry.coordinates[0], feature.geometry.coordinates[0]],
[feature.geometry.coordinates[1], feature.geometry.coordinates[1]],
[feature.geometry.coordinates[2], feature.geometry.coordinates[2]],
[feature.geometry.coordinates[3], feature.geometry.coordinates[3]],
[feature.geometry.coordinates[0], feature.geometry.coordinates[0]]
]]
// spatialReference: {wkid: 4326} or view.spatialReference
}),
// select only the attribute you care about
attributes:{
ObjectID: i,
imageID: feature.properties.co_seq_ima,
aquisitionDate: feature.properties.dt_coleta,
orbitDirection: feature.properties.no_direcao,
imagingSide: feature.properties.no_lado_im,
product: feature.properties.tp_produto,
indexationDate: feature.properties.dt_indexac,
url: feature.properties.no_caminho,
area: feature.properties.nu_area_km
}
};
});
}
(Item 4)
{
"type": "FeatureCollection",
"name": "cosmo_skymed_footprint",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "co_seq_ima": 16379, "dt_coleta": null, "no_direcao": null, "no_lado_im": null, "tp_produto": "geo_db", "dt_indexac": "2017/01/31 08:40:13.000", "no_caminho": "/imagens/image.tif", "nu_area_km": 3084.1016279290402 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -60.006289926645998, -7.502665927409351 ], [ -60.333370063662102, -7.42908171303827 ], [ -60.2532172368633, -7.07175138748668 ], [ -59.926359542411099, -7.14505950947063 ], [ -60.006289926645998, -7.502665927409351 ] ] ] } },