POST
|
Hello community, I hope all of you are fine and doing best in your domain. I need a suggestion regarding the mentioned subject. I have a PostgreSQL database with the PostGIS spatial extension to store spatial records. Additionally, I am using GeoServer as a mapping server, which directly connects to the database and retrieves the data in GeoJSON format. On the client-side, I am utilizing the ArcGIS API. However, I am facing performance issues as the map takes a significant amount of time to render the 100k records. Compounding the issue, I have a complex symbology setup, which I describe in code snippet. With complex expression, I am facing challenges in reducing the response time of the GeoJSONLayer. One possible solution is to use the CQL_FILTER method provided by GeoServer, which allows me to retrieve only the specified query records. However, the limitation of this approach is that I cannot update the CQL_FILTER (Geojson URL) in an existing layer view without creating another instance of the GeoJSONLayer. This can be time-consuming and inefficient when working with a large dataset like the 100k records I have. Another approach I have tried is using the definitionExpression method of the GeoJSONLayer, but it fetches all the records from the server before applying the filter, resulting in longer load times for the 100k records Please provide guidance on any possible solutions to resolve this issue. I am looking for ways to optimize the response time of the GeoJSONLayer.I would appreciate any suggestions on how to address this challenge. Thanks & Regards, Kawish const { customer } = this.context.view;
const name = "$feature.alarmstate";
const cat = "$feature.category";
const week = "$feature.lastdowntime";
const ticketStatus = "$feature.ticketstatus";
let valueExpression = `When(
${name} == 0 && ${cat} == 'VIP', 'zero',
${name} == 1 && ${cat} == 'VIP', 'one',
${name} == 2 && ${cat} == 'VIP' && ${week} >= '${complete_date}', 'two',
${name} == 2 && ${cat} == 'VIP' && ${week} <= '${complete_date}', 'two_1',
${name} == 3 && ${cat} == 'VIP', 'three',
${name} == 4 && ${cat} == 'VIP', 'four',
${name} == 2 && ${cat} != 'VIP' && ${week} <= '${complete_date}' && ${ticketStatus} != 'In-process', 'two_1_not_vip',
${name} == 2 && ${cat} != 'VIP' && ${week} <= '${complete_date}' && ${ticketStatus} == 'In-process', 'c-two_1',
${name} == 2 && ${cat} != 'VIP' && ${week} >= '${complete_date}' && ${ticketStatus} != 'In-process', 2,
${name} == 2 && ${cat} != 'VIP' && ${week} >= '${complete_date}' && ${ticketStatus} == 'In-process', 'c-two',
${name} == 0 && ${cat} != 'VIP' && ${ticketStatus} != 'In-process', 0,
${name} == 0 && ${cat} != 'VIP' && ${ticketStatus} == 'In-process', 'c-0',
${name} == 1 && ${cat} != 'VIP' && ${ticketStatus} != 'In-process', 1,
${name} == 1 && ${cat} != 'VIP' && ${ticketStatus} == 'In-process', 'c-1',
${name} == 3 && ${cat} != 'VIP' && ${ticketStatus} != 'In-process', 3,
${name} == 3 && ${cat} != 'VIP' && ${ticketStatus} == 'In-process', 'c-3',
${name} == 4 && ${cat} != 'VIP' && ${ticketStatus} != 'In-process', 4,
${name} == 4 && ${cat} != 'VIP' && ${ticketStatus} == 'In-process', 'c-4',
5
)`;
... View more
07-17-2023
01:59 AM
|
0
|
2
|
1053
|
POST
|
Hi, As I stated in my subject, I want to use socket.io to get real-time alerts from ONT devices. Everything is going good, I am receiving real-time alerts on server side and also get those alerts on my web page. But, I have a confusion, as is apply applyEdits() method on my GEOJSON layer to remove and add the points within real-time (or as the alert receive) then my web page crashed. I hope community members are understanding my point. For the better understanding, I attached the code as a zip file. Please anyone from the community can help me to resolve this issue.? Note: For front-end I am using react.js and esri-loader for mapping capabilities. Regards, Kawish
... View more
02-14-2023
09:40 PM
|
0
|
1
|
941
|
POST
|
Hello, Is there anyone who can figure out my mistake ? I want to to visualize point on map that have the difference of 5 minutes from current time to the time that is mentioned in database. I have mentioned or code the time difference in the arcade expression but unfortunately its not working. Please guide me how can I resolve it. Regards, Kawish let dates = new Date();
let lastSevenDays = new Date(dates);
lastSevenDays.toDateString();
lastSevenDays.setDate(lastSevenDays.getDate() - 7);
let year = lastSevenDays.getFullYear();
let month = (date) => {
const m = date.getMonth() + 1;
if (m.toString().length === 1) {
return `0${m}`;
} else {
return m;
}
};
let date = ("0" + lastSevenDays.getDate()).slice(-2);
let complete_date = year + "-" + month(lastSevenDays) + "-" + date;
const name = "$feature.alarmstate";
const cat = "$feature.category";
const week = "$feature.lastdowntime";
const ticketStatus = "$feature.ticketstatus";
let c_date = new Date();
let d = new Date(week);
let diff = c_date.getMinutes() - d.getMinutes();
if (Math.abs(diff) <= 5)
console.log(c_date.getMinutes(), d.getMinutes(), "Diff - ", diff);
let value = 5;
const valueExpression = `When(
${name} == 2 && ${cat} == 'VIP' && ${week} >= '${complete_date}', 'two',
${name} == 2 && ${cat} == 'VIP' && ${week} <= '${complete_date}', 'two_1',
${name} == 2 && ${Math.abs(c_date.getMinutes() - new Date(week).getMinutes())
} <= 5, '5Min', 0)`;
var rendererCheck = {
type: "unique-value",
valueExpression: valueExpression,
uniqueValueInfos: [
{
value: "5Min",
symbol: {
type: "picture-marker",
url: "images/down-arrow-red.gif",
width: "35px",
height: "40px",
xoffset: 0,
yoffset: 12,
},
},
{
value: "two",
symbol: {
type: "picture-marker",
url: "images/two.png",
color: "red",
width: "25px",
height: "25px",
},
},
{
value: "two_1",
symbol: {
type: "picture-marker",
url: "images/two_1.png",
color: "red",
width: "24px",
height: "24px",
},
},
{
value: 0,
symbol: {
type: "simple-marker",
style: "circle",
color: "white",
size: "6.5px",
outline: {
color: [255, 255, 255, 1],
width: 0.4,
},
},
},
],
};
... View more
11-22-2022
01:18 AM
|
2
|
0
|
313
|
POST
|
Hi, I am using the Geojson web service in a client-side application. It's working fine, but sometimes I get an error of "SERVER RESPONSE TIMEOUT". It occurs sometimes because of load on GeoServer. Please guide how can resolve this error or how can I set the response time in the GeoJSON layer.
... View more
12-15-2021
03:58 AM
|
0
|
0
|
451
|
POST
|
@ReneRubalcava I have created a new repository and simplified the code. Now the login screen will not appear. Please note that there are two files with the name of Realtime.js and Tracking.js. These two components receive data from socket server and socket server is hosted on private IP. That is why I have disabled it. Please look at the code of Realtime. As socket clients receive data, I am deleting old record and adding a new one to Geojson layer. If there is a need for improvement in the code of Realtime, please let me know. I am very grateful to you. Repository: https://github.com/kawish14/Arcgis-React-v1 Waiting for your kind response.
... View more
11-23-2021
10:53 PM
|
0
|
2
|
2920
|
POST
|
Hi @ReneRubalcava , following is the git repository. https://github.com/kawish14/Arcgis-React
... View more
11-16-2021
10:26 PM
|
0
|
4
|
2951
|
POST
|
Hello, I am using @arcgis/core for my react application but I am unable to find the root cause of error. Usually it's working fine but some time I am getting the following error in my console. Can anyone guide my why some time this error is generated? error
... View more
11-11-2021
01:04 AM
|
1
|
9
|
3030
|
POST
|
Thanks, @BlakeTerhune for your kind reply. My question is that when I applied the checkbox instead of the selection tag then how can I change my javascript code, especially queryExpression mentioned in line number 105. When the user checked more than two checkboxes, queryExpression should be changed and display data to the map. Reagrds, Kawish
... View more
08-11-2021
11:16 AM
|
0
|
2
|
2393
|
POST
|
Hello, Please suggest what is the procedure to create a dropdown checkbox to select multiple values from the table. I have created a dropdown list that shows customer status. Users can select the online status to reflect the record of online customer to the map as it is there are multiple statuses that can be select one by one. Now, I want to create a checkbox with the dropdown list. User want to select multiple status at a time. Please suggest or help me to find out the solution. import React, { Component } from 'react';
import { Navbar, NavbarBrand, Nav, NavbarToggler, Collapse, NavItem,Dropdown,DropdownToggle,
DropdownMenu,DropdownItem,UncontrolledDropdown} from 'reactstrap';
import { NavLink } from 'react-router-dom';
import { authenticationService } from '../_services/authentication';
class Header extends Component {
constructor(props) {
super(props);
this.state = {
isNavOpen: false,
dropdownOpen:false,
south:null,
north:null,
central:null,
alarminfo:'',
status:false,
show:false
};
this.toggleNav = this.toggleNav.bind(this);
this.toggleDrop = this.toggleDrop.bind(this);
}
logout = () => {
authenticationService.logout();
}
toggleNav() {
this.setState({
isNavOpen: !this.state.isNavOpen // true
});
}
toggleDrop() {
this.setState({
isNavOpen: !this.state.isNavOpen // true
});
}
selectLayer = (e) => {
let _this = this
if(this.props.loginRole.data.role === 'Admin'){
let customerQuery = this.props.item.customer.data
var query = customerQuery.createQuery();
let centerCustomerQuery = this.props.centerItem.centerCustomer.data
var centerQuery = centerCustomerQuery.createQuery();
let northCustomerQuery = this.props.northItem.northCustomer.data
var northQuery = northCustomerQuery.createQuery();
if(e.target.value === "clear"){
/* this.props.view.goTo({
target:[67.116733,24.898892],
zoom:14
}) */
let clearQuery = "status = 'Active'"
customerQuery.definitionExpression = clearQuery
centerCustomerQuery.definitionExpression = clearQuery
northCustomerQuery.definitionExpression = clearQuery
query.where = clearQuery
customerQuery.queryFeatures(query)
.then(function(response){
_this.setState({
show:true
})
_this.props.alarmInfo(_this.state)
});
centerQuery.where = clearQuery
centerCustomerQuery.queryFeatures(centerQuery)
.then(function(response){
_this.setState({
show:true
})
_this.props.alarmInfo(_this.state)
});
northQuery.where = clearQuery
northCustomerQuery.queryFeatures(northQuery)
.then(function(response){
_this.setState({
show:true
})
_this.props.alarmInfo(_this.state)
});
query.where = clearQuery
centerQuery.where = clearQuery
northQuery.where = clearQuery
}
else {
//var queryExpression = `status = '${e.target.value}'`
var queryExpression = `alarmstate = ${e.target.value} AND status = 'Active'`
// South
customerQuery.definitionExpression = queryExpression
query.where = queryExpression
customerQuery.queryFeatures(query)
.then(function(response){
if (response.features[0].attributes.alarmstate === 0){
_this.setState({
alarminfo:'Online',
south:response.features.length,
status:true,
show:false
})
}else if (response.features[0].attributes.alarmstate === 1){
_this.setState({
alarminfo:'Powered Off',
south:response.features.length,
status:true,
show:false
})
}else if (response.features[0].attributes.alarmstate === 2){
_this.setState({
alarminfo:'Link Down',
south:response.features.length,
status:true,
show:false
})
}else if (response.features[0].attributes.alarmstate === 3){
_this.setState({
alarminfo:'GEM Packet Loss',
south:response.features.length,
status:true,
show:false
})
}else if (response.features[0].attributes.alarmstate === 4){
_this.setState({
alarminfo:'Low Optical Power',
south:response.features.length,
status:true,
show:false
})
}else
_this.setState({
alarminfo:response.features[0].attributes.alarminfo,
south:response.features.length,
status:true,
show:false
})
_this.props.alarmInfo(_this.state)
});
// Central
centerCustomerQuery.definitionExpression = queryExpression
centerQuery.where = queryExpression
centerCustomerQuery.queryFeatures(centerQuery)
.then(function(response){
_this.setState({
central:response.features.length,
show:false
})
_this.props.alarmInfo(_this.state)
});
// North
northCustomerQuery.definitionExpression = queryExpression
northQuery.where = queryExpression
northCustomerQuery.queryFeatures(northQuery)
.then(function(response){
_this.setState({
north:response.features.length,
show:false
})
_this.props.alarmInfo(_this.state)
});
query.where = queryExpression
centerQuery.where = queryExpression
northQuery.where = queryExpression
}
}
else {
let customerQuery = this.props.item.customer.data
var query = customerQuery.createQuery();
if(e.target.value === "clear"){
let clearQuery = "1=1"
customerQuery.definitionExpression = clearQuery
query.where = clearQuery
}
else {
//var queryExpression = `status = '${e.target.value}'`
var queryExpression = `alarmstate = ${e.target.value} AND status = 'Active'`
customerQuery.definitionExpression = queryExpression
query.where = queryExpression
}
}
}
render() {
return(
<div>
<Navbar color="dark" dark expand="md">
<NavbarToggler onClick={this.toggleNav} />
<NavbarBrand style={{color:'#1f91f3'}}>Transworld</NavbarBrand>
<Collapse isOpen={this.state.isNavOpen} navbar>
<Nav className="ml-auto" navbar>
<UncontrolledDropdown nav inNavbar>
<DropdownToggle style={styles.dropToggle} nav caret>
Customer Status
</DropdownToggle>
<DropdownMenu onClick={(e)=> this.selectLayer(e)} style={{background:"#343a40"}} center>
<DropdownItem value = "clear" style={styles.dropItem}>Clear Selection</DropdownItem>
<DropdownItem value='0' style={styles.dropItem}>Online</DropdownItem>
<DropdownItem value='1' style={styles.dropItem}>Powered Off</DropdownItem>
<DropdownItem value='2' style={styles.dropItem}>Link Down</DropdownItem>
<DropdownItem value='3' style={styles.dropItem}>GEM Packet Loss</DropdownItem>
<DropdownItem value='4' style={styles.dropItem}>Low Optical Power</DropdownItem>
</DropdownMenu>
</UncontrolledDropdown>
<NavItem>
<NavLink className="nav-link" to='/login' onClick={this.logout}><span className="fa fa-sign-in fa-lg"></span> Logout</NavLink>
</NavItem>
</Nav>
</Collapse>
</Navbar>
</div>
);
}
}
const styles = {
dropToggle:{
background:"#343a40",
color:"#1f91f3",
},
dropItem:{
color:"#1f91f3",
}
}
export default Header;
Regards, Kawish
... View more
08-10-2021
03:34 AM
|
0
|
4
|
2440
|
POST
|
Thank you @JoseBanuelos to figure out the mistake. Blessings
... View more
07-15-2021
08:05 AM
|
1
|
0
|
1465
|
POST
|
Hello, I want to symbolize my data on behalf of two fields. One is status field and other is category field. I try to used arcade expression for uniqueValueInfos to render the layer but unfortunately it is not working. Please help me to figure out my mistake. Here is source code. Thanks const name = "$feature.alarmstate"
const cat = "$feature.category"
const valueExpression = `When( ${name} == '0' AND ${cat} == 'VIP', 0, ${name} == '1' AND ${cat} == 'VIP', 0,
${name} == '2' AND ${cat} == 'VIP', 0, ${name} == '3' AND ${cat} == 'VIP', 0,
${name} == '4' AND ${cat} == 'VIP', 0,
${name} == '0' AND ${cat} == 'Ordinary', 1, ${name} == '1' AND ${cat} == 'Ordinary', 2,
${name} == '2' AND ${cat} == 'Ordinary', 3, ${name} == '3' AND ${cat} == 'Ordinary', 4,
${name} == '4' AND ${cat} == 'Ordinary', 5)`
var rendererCheck = {
type: "unique-value",
//field: "alarminfo",
valueExpression:valueExpression,
uniqueValueInfos: [
{
value: "0",
symbol: {
type: "picture-marker",
url: "images/vip.png",
width: "30px",
height: "15px"
}
}, {
value: "1",
symbol: {
type: "simple-marker",
style: "diamond",
color: "green",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}, {
value: "2",
symbol: {
type: "simple-marker",
style: "diamond",
color: "blue",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}, {
value: "3",
symbol: {
type: "simple-marker",
style: "diamond",
color: "red",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}, {
value: "4",
symbol: {
type: "simple-marker",
style: "diamond",
color: "black",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}, {
value: "5",
symbol: {
type: "simple-marker",
style: "diamond",
color: "Yellow",
size: "10px",
outline: {
color: [ 255, 255, 255, 1 ],
width: 0.4
}
}
}
]
};
customerLayer.renderer =rendererCheck
... View more
07-09-2021
06:23 AM
|
0
|
2
|
1484
|
Title | Kudos | Posted |
---|---|---|
1 | 11-11-2021 01:04 AM | |
2 | 11-22-2022 01:18 AM | |
1 | 07-15-2021 08:05 AM | |
1 | 07-21-2019 03:12 AM |
Online Status |
Offline
|
Date Last Visited |
01-02-2024
04:00 PM
|