Hi there! I'm currently using a combination of postgresql and node.js for my backend operations. I've been trying to insert a point into the database from the frontend, but unfortunately, I keep encountering an error message stating "value too long for type character varying(50)". Here's the insert query I have been using:
insert into public.fat (name, splitter, geom)
values ($1, $2, ST_GeomFromText('POINT($3)'))", [name,geom])
Below is the frontend code snippet utilizing ArcGIS API to add a point to the database:
var point = {
type: "point",
longitude: -49.97,
latitude: 41.73
};
var markerSymbol = {
type: "simple-marker",
color: [226, 119, 40],
outline: {
color: [255, 255, 255],
width: 2
}
};
var pointGraphic = new Graphic({
geometry: point,
});
async function postData(url = 'http://localhost:8080/post', data = {name:'rafy', geom:point}) {
const response = await fetch(url, {
method: 'POST',
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json'
},