Hello, i have the following script and im getting an error 1060 that goes like this:
{"addResults":[{"success":false,"error":{"code":1060,"description":"Rowbuffer creation failed."}}],"updateResults":[],"deleteResults":[]} error
What im doing wrong?
My script to add a new feature using ajax.
function agregarFact(f, callback){aaa
var myAttributes = {
Rut : "1231556165-5",
Nombre : "a",
Apellido : "b",
Telefono : "84031822",
Email: "aa@aa.CL",
Tipo_cliente : "INDUSTRIAL",
Tipo_contribuyente : "AUTOCONSUMO",
Rotulo : "131551077",
Tramo : "CD35-CD35-CD35",
Empalme : "SUBTERRANEO",
Fase : "TRIFASICO",
Potencia : 6.0,
Capacidad_empalme : 6.6,
Capacidad_interruptor : 10,
Tiempo_empalme : "DEFINITIVO",
Tipo_empalme: "BT",
Cantidad_empalme : 3,
ID_Direccion : 4855875,
Direccion: "AVENIDA ARGENTINA 1",
Potencia_calculada : 18,
DistRotuloMedidor: 15,
DistDireccionMedidor : 22,
Comuna : "VALPARAISO",
Alimentador: "BARON",
Idnodo : 131551077,
Estado_tramite: "NUEVA",
Tipo_factibilidad: "FACTIBILIDAD ASISTIDA",
Tipo_mejora : "",
Zona : "ZONA VALPARAISO",
Origen_factibilidad : "OFICINA COMERCIAL",
Sed :0,
PotenciaDispSed :-325.27305331396866
}
console.log(myAttributes)
let geox = f.factigisGeoCliente.x;
let geoy= f.factigisGeoCliente.y;
const data = {
f: 'json',
adds: JSON.stringify([{ attributes: myAttributes, geometry: {"x":geox , "y": geoy}}]),
token: token.read()
};
jQuery.ajax({
method: 'POST',
url: "http://myserver/arcgis/rest/services/FACTIBILIDAD/FACTIGIS/FeatureServer/0/applyEdits",
dataType:'html',
data: data
}).done(d =>{
if(d.includes("error")){
console.log(d,"error");
return callback(false);
}
if(d.includes("success")){
console.log(d,"adds");
return callback(true);
}
return callback(false)
})
.fail(f=>{
console.log(f,"no pase");
return callback(false)
});
}
The geometry seems to be missing the spatial reference information. Does the FeatureServer service spatial reference matches the coordinates?
Ah, well i dont know how to see if the spatial reference matches, cuz my arcgis admin makes the rest services. Is there a way to see it through rest service?
Thanks!.
If you open the service url (http://myserver/arcgis/rest/services/FACTIBILIDAD/FACTIGIS/FeatureServer
) in browser id should display all the properties and SpatialReference is one among them.
well if i dont put any geometry, like :
adds: JSON.stringify([{ attributes: {Rut: '17091916-5'}, geometry: {}}]),
of even this
adds: JSON.stringify([{ attributes: {Rut: '17091916-5'}}])
i got the same error 1060, so my question is, the spatial reference in this case still matters?
According to this documentation, 1006 mean invalid html content. ArcGIS REST API. Then I noticed your ajax request contains dataType:'html'
, shouldn't it be "json"?
The thing is, i tried the same script with another layer in the same directory ( actually is a table) and it works wihout any problem. So i dont thing thats the prob.