Compare commits
47 Commits
main
...
bfc5c22c95
| Author | SHA1 | Date | |
|---|---|---|---|
| bfc5c22c95 | |||
| 57b8d8eca7 | |||
| 9d62a37b12 | |||
| fd69b5378f | |||
| 7fdf572d19 | |||
| 11d8e00bbc | |||
| 5a7b8a5932 | |||
| da1d3e1098 | |||
| a949b49b35 | |||
| 9837e3a5b9 | |||
| e01edc7224 | |||
| c2762414c2 | |||
| 52f3b89664 | |||
| 83ff9cba16 | |||
| 340be124d6 | |||
| 72a862ea23 | |||
| 66b1f78745 | |||
| 9f67439db3 | |||
| f9e83b1f0e | |||
| 8a28b58513 | |||
| 93383c8c23 | |||
| 9f06a550fc | |||
| e423647a59 | |||
| 53e7c7e158 | |||
| d4bfe17898 | |||
| fab0c34ffb | |||
| e3f93fed10 | |||
| 884d3ceb62 | |||
| 686109361f | |||
| 914b2aae03 | |||
| d254140b91 | |||
| d2c1f9c7da | |||
| 3c44dac29e | |||
| 39db27fca1 | |||
| 6e4c74c426 | |||
| 91a1e86415 | |||
| 36783d2de7 | |||
| 7d8ab90e49 | |||
| ed14a3fa9e | |||
| 9f45e71b59 | |||
| 3e0ba9279b | |||
| 1722d20e8e | |||
| 76ebe97f24 | |||
| 0de815893f | |||
| afd6abd9e3 | |||
| 721b4cac26 | |||
| 43185b31ea |
2
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
/src/main/resources/static/resources
|
||||
/src/main/resources/static/resources/metadata
|
||||
/src/main/java/tctable
|
||||
/logs/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 8081
|
||||
port: 8083
|
||||
ssl:
|
||||
enabled: true
|
||||
key-store: classpath:keystore.jks
|
||||
@ -8,13 +8,16 @@ server:
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: org.ccalm.main
|
||||
name: org-ccalm-main
|
||||
datasource:
|
||||
url: jdbc:postgresql://91.201.214.156:5432/CCALM?ApplicationName=org_ccalm_main&ssl=true&sslmode=require&connectTimeout=10000&socketTimeout=10000
|
||||
url: jdbc:postgresql://10.0.0.1:5432/CCALM?ApplicationName=org_ccalm_main&connectTimeout=10000&socketTimeout=30000
|
||||
#url: jdbc:postgresql://ccalm.org:5432/CCALM?ApplicationName=org_ccalm_main&ssl=true&sslmode=require&connectTimeout=10000&socketTimeout=10000
|
||||
#url: jdbc:postgresql://127.0.0.1:5432/CCALM?ApplicationName=org_ccalm_main&ssl=true&sslmode=require&connectTimeout=10000&socketTimeout=10000
|
||||
username: postgres
|
||||
password: 309A86FF65A78FB428F4E38DFE35F730
|
||||
driver-class-name: org.postgresql.Driver
|
||||
hikari:
|
||||
connection-init-sql: "SET timezone TO 'UTC';"
|
||||
maximum-pool-size: 10
|
||||
minimum-idle: 5
|
||||
max-lifetime: 1740000
|
||||
49
pom.xml
@ -5,12 +5,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.4.2</version>
|
||||
<version>3.5.5</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>org.ccalm</groupId>
|
||||
<artifactId>main</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<version>1.0.7</version>
|
||||
<name>main</name>
|
||||
<description>main</description>
|
||||
<properties>
|
||||
@ -44,12 +44,12 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!--dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<version>6.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependency-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jdbc</artifactId>
|
||||
@ -57,7 +57,7 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.7.5</version>
|
||||
<version>42.7.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
@ -69,17 +69,19 @@
|
||||
<artifactId>mail</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!--dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency-->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.15.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.logstash.logback</groupId>
|
||||
<artifactId>logstash-logback-encoder</artifactId>
|
||||
<version>6.6</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/edu.ucar/netcdfAll -->
|
||||
<dependency>
|
||||
<groupId>edu.ucar</groupId>
|
||||
@ -121,10 +123,33 @@
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>6.1.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<version>2.8.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.36</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.logstash.logback</groupId>
|
||||
<artifactId>logstash-logback-encoder</artifactId>
|
||||
<version>8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>org-ccalm-main</finalName>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
@ -141,7 +166,7 @@
|
||||
<version>2.22.2</version>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<spring.config.location>file:application.properties</spring.config.location>
|
||||
<spring.config.location>file:org-ccalm-main.yml</spring.config.location>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
12
src/main/java/logging/Logger.java
Normal file
@ -0,0 +1,12 @@
|
||||
package logging;
|
||||
|
||||
public interface Logger {
|
||||
void debug(String msg);
|
||||
void info(String msg);
|
||||
void warn(String msg);
|
||||
void error(String msg);
|
||||
|
||||
static Logger getLogger(Class<?> clazz) {
|
||||
return LoggerFactory.createLogger(clazz); // Подменяется реализацией
|
||||
}
|
||||
}
|
||||
22
src/main/java/logging/LoggerFactory.java
Normal file
@ -0,0 +1,22 @@
|
||||
package logging;
|
||||
|
||||
|
||||
public class LoggerFactory {
|
||||
public static Logger createLogger(Class<?> clazz) {
|
||||
// Тут выбираешь реализацию по флагу/условию
|
||||
//if (isAndroid()) {
|
||||
// return new AndroidLogger(clazz);
|
||||
//} else {
|
||||
return new SLF4JLogger(clazz);
|
||||
//}
|
||||
}
|
||||
|
||||
private static boolean isAndroid() {
|
||||
try {
|
||||
Class.forName("android.os.Build");
|
||||
return true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
src/main/java/logging/SLF4JLogger.java
Normal file
@ -0,0 +1,18 @@
|
||||
package logging;
|
||||
|
||||
import org.ccalm.main.MainController;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SLF4JLogger implements Logger {
|
||||
private final org.slf4j.Logger logger;
|
||||
|
||||
public SLF4JLogger(Class<?> clazz) {
|
||||
this.logger = LoggerFactory.getLogger(clazz);
|
||||
|
||||
}
|
||||
|
||||
public void debug(String msg) { logger.debug(msg); }
|
||||
public void info(String msg) { logger.info(msg); }
|
||||
public void warn(String msg) { logger.warn(msg); }
|
||||
public void error(String msg) { logger.error(msg); }
|
||||
}
|
||||
@ -25,6 +25,7 @@ import java.util.*;
|
||||
//import javax.servlet.ServletContext;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//import javax.servlet.http.Part;
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
@ -90,7 +91,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
return hexString.toString();
|
||||
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(),ex);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -134,7 +135,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
}
|
||||
|
||||
//Update lon lat
|
||||
@RequestMapping(value = "/update",method = { RequestMethod.GET })
|
||||
@RequestMapping(value = {"/update", "/api/locust/v01/update"},method = { RequestMethod.GET })
|
||||
@ResponseBody
|
||||
public Object update_lon_lat() {
|
||||
JSONObject result = new JSONObject();
|
||||
@ -155,7 +156,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
// Чтение файла
|
||||
BufferedReader reader = new BufferedReader(new FileReader("O:\\temp\\Новая папка\\errors.log"));
|
||||
StringBuilder content = new StringBuilder();
|
||||
StringBuilder content = new StringBuilder(1024);
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
content.append(line);
|
||||
@ -206,7 +207,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return obj.toString();
|
||||
}
|
||||
stmt.close();
|
||||
@ -221,7 +222,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -233,7 +234,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
}
|
||||
|
||||
//Save or update your health questionnaire
|
||||
@RequestMapping(value = "/asdc/frmlocusthealth/",method = { RequestMethod.GET, RequestMethod.POST },produces = "application/json")
|
||||
@RequestMapping(value = {"/asdc/frmlocusthealth/", "/api/locust/v01/asdc/frmlocusthealth/"},method = { RequestMethod.GET, RequestMethod.POST },produces = "application/json")
|
||||
@ResponseBody
|
||||
public Object uploadFrmLocustHealth(@RequestHeader(required=false,name="Content-Type") String contentType,@RequestBody(required=false) byte[] reqData) {
|
||||
JSONObject result = new JSONObject();
|
||||
@ -274,7 +275,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
rs = st.executeQuery("select 1 from main.frmlocusthealth where uid='"+uid+"'");
|
||||
} catch( SQLException ex ) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
@ -288,7 +289,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
st.close();
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
@ -391,7 +392,8 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
risk_probe_analysis_name=${risk_probe_analysis_name},
|
||||
risk_probe_analysis_number=${risk_probe_analysis_number},
|
||||
test=${test},
|
||||
geom=ST_SetSRID(ST_GeomFromGeoJSON(${geom}),4326)
|
||||
geom=ST_SetSRID(ST_GeomFromGeoJSON(${geom}),4326),
|
||||
efficacy_impact_type=${efficacy_impact_type}
|
||||
where uid=main.strtouuid(${uid})
|
||||
""";
|
||||
}else
|
||||
@ -489,7 +491,8 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
risk_probe_analysis_name,
|
||||
risk_probe_analysis_number,
|
||||
test,
|
||||
geom
|
||||
geom,
|
||||
efficacy_impact_type
|
||||
)values(
|
||||
main.strtouuid(${uid}),
|
||||
main.strtouuid(${frmlocustdel_uid}),
|
||||
@ -582,7 +585,8 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
${risk_probe_analysis_name},
|
||||
${risk_probe_analysis_number},
|
||||
${test},
|
||||
ST_SetSRID(ST_GeomFromGeoJSON(${geom}),4326)
|
||||
ST_SetSRID(ST_GeomFromGeoJSON(${geom}),4326),
|
||||
${efficacy_impact_type}
|
||||
)""";
|
||||
}
|
||||
|
||||
@ -590,7 +594,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmtn = new PreparedStatementNamed(conn, sql);
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage()+" "+sql);
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
@ -800,13 +804,16 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
value = jsonObj.optString("geom",null);
|
||||
stmtn.setString("geom",value);
|
||||
|
||||
value = jsonObj.optString("efficacy_impact_type",null);
|
||||
stmtn.setString("efficacy_impact_type",value);
|
||||
|
||||
//Execute SQL
|
||||
try {
|
||||
PreparedStatement stmt=stmtn.getPreparedStatement();
|
||||
stmt.execute();
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
@ -818,7 +825,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
String tmpDir = "temp"+File.separator;
|
||||
try{ new File(dataDir+tmpDir).mkdirs(); }catch (Exception ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
@ -880,7 +887,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
ex.printStackTrace();
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return result.toString();
|
||||
}finally {
|
||||
try{ if(conn!=null) conn.close(); }catch(Exception e){}
|
||||
@ -889,7 +896,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
}
|
||||
|
||||
// To authorize a tablet using a QR code from "ScanActivity" form
|
||||
@RequestMapping(value = "/asdc/qrcode/",method = { RequestMethod.GET, RequestMethod.POST },produces = "application/json")
|
||||
@RequestMapping(value = {"/asdc/qrcode/", "/api/locust/v01/asdc/qrcode/"},method = { RequestMethod.GET, RequestMethod.POST },produces = "application/json")
|
||||
@ResponseBody
|
||||
public Object uploadJSON(@RequestHeader(required=false,name="Content-Type") String contentType,@RequestBody(required=false) byte[] reqData) {
|
||||
|
||||
@ -942,7 +949,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return obj.toString();
|
||||
}
|
||||
try {
|
||||
@ -951,7 +958,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return obj.toString();
|
||||
}
|
||||
try {
|
||||
@ -960,7 +967,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return obj.toString();
|
||||
}
|
||||
|
||||
@ -972,7 +979,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return obj.toString();
|
||||
}
|
||||
|
||||
@ -983,7 +990,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return obj.toString();
|
||||
}
|
||||
|
||||
@ -993,7 +1000,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return obj.toString();
|
||||
}
|
||||
|
||||
@ -1008,7 +1015,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return obj.toString();
|
||||
}
|
||||
if(rs!=null)
|
||||
@ -1028,7 +1035,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",1);
|
||||
obj.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return obj.toString();
|
||||
}
|
||||
}else {
|
||||
@ -1042,7 +1049,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
ex.printStackTrace();
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
return result.toString();
|
||||
}finally {
|
||||
try{ if(conn!=null) conn.close(); }catch(Exception e){}
|
||||
@ -1050,7 +1057,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/get/",method = { RequestMethod.GET, RequestMethod.POST },produces = "application/xml; charset=utf-8")
|
||||
@RequestMapping(value = {"/get/", "/api/locust/v01/get/"},method = { RequestMethod.GET, RequestMethod.POST },produces = "application/xml; charset=utf-8")
|
||||
@ResponseBody
|
||||
public Object uploadXML(HttpServletResponse response, @RequestHeader(required=false,name="Content-Type") String contentType, @RequestBody(required=false) byte[] reqData) {
|
||||
|
||||
@ -1067,7 +1074,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
String tmpDir = "temp"+File.separator;
|
||||
try{ new File(dataDir+tmpDir).mkdirs(); }catch (Exception ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>";
|
||||
return result;
|
||||
}
|
||||
@ -1102,14 +1109,14 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stm.execute("SET timezone TO 'UTC';");
|
||||
} catch( SQLException ex ) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>";
|
||||
return result;
|
||||
}
|
||||
stm.close();
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>";
|
||||
return result;
|
||||
}
|
||||
@ -1130,11 +1137,12 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
try {
|
||||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
||||
dbFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||||
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
|
||||
doc = dBuilder.parse(body);
|
||||
} catch (Exception ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<metadata fn=\"-1\"><![CDATA[Parsing request error!]]></metadata>";
|
||||
return result;
|
||||
}
|
||||
@ -1159,7 +1167,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
rs = st.executeQuery("select 1 from main.frmlocust where uid='"+uid+"'");
|
||||
} catch( SQLException ex ) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=("<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>");
|
||||
return result;
|
||||
}
|
||||
@ -1171,7 +1179,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
st.close();
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=("<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>");
|
||||
return result;
|
||||
}
|
||||
@ -1180,7 +1188,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
if(exists)
|
||||
{
|
||||
String sql="update main.frmlocust set\n"
|
||||
+" uid = ?,\n"
|
||||
+" uid = main.strtouuid(?),\n"
|
||||
+" changed = false,\n"
|
||||
+" user_id=?,\n"
|
||||
+" device_id=?,\n"
|
||||
@ -1263,7 +1271,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt = conn.prepareStatement(sql);
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage()+" "+sql);
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=("<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>");
|
||||
return result;
|
||||
}
|
||||
@ -1349,7 +1357,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
+" geom,\n"
|
||||
+" test\n"
|
||||
+")values(\n"
|
||||
+" ?,\n" //1 uid
|
||||
+" main.strtouuid(?),\n" //1 uid
|
||||
+" false,\n"
|
||||
+" ?,\n" //2 user_id
|
||||
+" ?,\n" //3 device_id
|
||||
@ -1432,7 +1440,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt = conn.prepareStatement(sql);
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage()+" "+sql);
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=("<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>");
|
||||
return result;
|
||||
}
|
||||
@ -1572,7 +1580,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
try{
|
||||
tm = new java.sql.Timestamp(dfm.parse(date).getTime());
|
||||
} catch (Exception ex) {
|
||||
logger.error("Error",ex.getMessage());
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
stmt.setTimestamp(14, tm);
|
||||
}
|
||||
@ -1688,7 +1696,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=("<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>");
|
||||
return result;
|
||||
}
|
||||
@ -1698,7 +1706,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt.execute();
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex.getMessage());
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=("<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>");
|
||||
return result;
|
||||
}
|
||||
@ -1749,7 +1757,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
rs = st.executeQuery("select 1 from main.frmlocustdel where uid=main.strtouuid('"+uid+"')");
|
||||
} catch( SQLException ex ) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex.getMessage());
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=("<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>");
|
||||
return result;
|
||||
}
|
||||
@ -1877,13 +1885,14 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
+" comments=?,\n"
|
||||
+" geom=ST_SetSRID(ST_GeomFromGeoJSON(?),4326),\n"
|
||||
+" locust_purpose_id=?,\n" //Чтобы много циферек не перебивать сделал внизу запроса
|
||||
+" efficacy_impact=?,\n"
|
||||
+" test=?\n"
|
||||
+" where uid=main.strtouuid('"+uid+"')";
|
||||
try {
|
||||
stmt = conn.prepareStatement(sql);
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=("<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>");
|
||||
return result;
|
||||
}
|
||||
@ -1997,6 +2006,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
+" comments,\n"
|
||||
+" geom,\n"
|
||||
+" locust_purpose_id,\n"
|
||||
+" efficacy_impact,\n"
|
||||
+" test\n"
|
||||
+")values(\n"
|
||||
+" main.strtouuid(?),\n" //1 uid
|
||||
@ -2104,13 +2114,14 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
+" ?,\n" //102 comments
|
||||
+" ST_SetSRID(ST_GeomFromGeoJSON(?),4326),\n" //103 geom
|
||||
+" ?,\n" //104 locust_purpose_id
|
||||
+" ?\n" //105 test
|
||||
+" ?,\n" //105 efficacy_impact
|
||||
+" ?\n" //106 test
|
||||
+")";
|
||||
try {
|
||||
stmt = conn.prepareStatement(sql);
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=("<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>");
|
||||
return result;
|
||||
}
|
||||
@ -2230,6 +2241,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
String comments=getCdataValue(reqNode, "comments");
|
||||
String geom=getCdataValue(reqNode, "geom");
|
||||
String locust_purpose_id=getCdataValue(reqNode, "locust_purpose_id");
|
||||
String efficacy_impact=getCdataValue(reqNode, "efficacy_impact");
|
||||
String test=getCdataValue(reqNode, "test");
|
||||
if(test==null) test="0";
|
||||
|
||||
@ -2275,7 +2287,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
try{
|
||||
tm = new java.sql.Timestamp(dfm.parse(date).getTime());
|
||||
} catch (Exception ex) {
|
||||
logger.error("Error",ex.getMessage());
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
stmt.setTimestamp(14, tm);
|
||||
}
|
||||
@ -2426,16 +2438,16 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt.setNull(104, Types.INTEGER, null);
|
||||
else
|
||||
stmt.setInt(104,Integer.parseInt(locust_purpose_id));
|
||||
|
||||
if(test==null) stmt.setNull(105, Types.BOOLEAN, null);
|
||||
stmt.setString(105,efficacy_impact);
|
||||
if(test==null) stmt.setNull(106, Types.BOOLEAN, null);
|
||||
else {
|
||||
if(test.equals("1")) stmt.setBoolean(105,true);
|
||||
else stmt.setBoolean(105,false);
|
||||
if(test.equals("1")) stmt.setBoolean(106,true);
|
||||
else stmt.setBoolean(106,false);
|
||||
}
|
||||
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>";
|
||||
return result;
|
||||
}
|
||||
@ -2445,7 +2457,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt.execute();
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>";
|
||||
return result;
|
||||
}
|
||||
@ -2490,13 +2502,16 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (Exception ex) {
|
||||
//logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}finally {
|
||||
if(conn!=null){ try{ conn.close(); }catch(Exception e){} }
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@RequestMapping(value = "/get/",params = {"fn"},method = { RequestMethod.GET, RequestMethod.POST })
|
||||
/**
|
||||
* reqS - Миллисекунд сначала 1970 года
|
||||
* */
|
||||
@RequestMapping(value = {"/get/", "/api/locust/v01/get/"},params = {"fn"},method = { RequestMethod.GET, RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public Object uploadFILE(HttpServletResponse response,@RequestHeader(required=false,name="Content-Type") String contentType,@RequestBody(required=false) String reqData,@RequestParam(required=false,name="file") MultipartFile file,@RequestParam(required=false,name="fn") String fn,@RequestParam(required=false,name="r") String reqR,@RequestParam(required=false,name="n") String reqN,@RequestParam(required=false,name="s") String reqS,@RequestParam(required=false,name="l") String reqL,@RequestParam(required=false,name="days",defaultValue = "0") int days,@RequestParam(required=false,name="country_id",defaultValue = "0") int country_id,@RequestParam(required=false,name="android_id",defaultValue = "") String device_id) {
|
||||
|
||||
@ -2530,7 +2545,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stm.close();
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>";
|
||||
response.setContentType("application/xml");
|
||||
return result;
|
||||
@ -2542,7 +2557,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
{
|
||||
//int pR=0;
|
||||
String pN="";
|
||||
int pS=0;
|
||||
long pS=0;
|
||||
//int pL=0;
|
||||
|
||||
String val;
|
||||
@ -2550,7 +2565,13 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
//if(val!=null) pR=Integer.parseInt(val);
|
||||
pN = reqN;
|
||||
val = reqS;
|
||||
if(val!=null) pS=Integer.parseInt(val);
|
||||
if(val!=null && !val.isEmpty()) {
|
||||
try {
|
||||
pS = Long.parseLong(val);
|
||||
} catch (Exception ex) {
|
||||
logger.error(UUID.randomUUID().toString(), ex.getMessage()+" val="+val, ex);
|
||||
}
|
||||
}
|
||||
val = reqL;
|
||||
//if(val!=null) pL=100;
|
||||
|
||||
@ -2561,14 +2582,16 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
String sql;
|
||||
|
||||
if(pN.equals("frmlocustdel_locations") && days>0 && country_id>0){
|
||||
sql = "select fldl.* from main.frmlocustdel_locations fldl join main.frmlocustdel fld on main.strtouuid(fld.uid)=main.strtouuid(fldl.frmlocustdel_uid) where fld.date>now()-interval '"+String.valueOf(days)+" days' and fld.country_id="+String.valueOf(country_id)+" and fld.device_id!='"+device_id+"' order by fldl.seq";
|
||||
//sql = "select fldl.* from main.frmlocustdel_locations fldl join main.frmlocustdel fld on main.strtouuid(fld.uid)=main.strtouuid(fldl.frmlocustdel_uid) where fld.date>now()-interval '"+String.valueOf(days)+" days' and fld.country_id="+String.valueOf(country_id)+" and fldl.seq>"+pS+" and fld.device_id!='"+device_id+"' order by fldl.seq";
|
||||
sql = "select fldl.* from main.frmlocustdel_locations fldl join main.frmlocustdel fld on main.strtouuid(fld.uid)=main.strtouuid(fldl.frmlocustdel_uid) where fld.date>now()-interval '"+String.valueOf(days)+" days' and fld.country_id="+String.valueOf(country_id)+" and fldl.seq>"+pS+" order by fldl.seq"; //TODO удалить
|
||||
//sql = "select fldl.* from main.frmlocustdel_locations fldl join main.frmlocustdel fld on main.strtouuid(fld.uid)=main.strtouuid(fldl.frmlocustdel_uid) where fld.date>now()-interval '"+String.valueOf(days)+" days' and fld.country_id="+String.valueOf(country_id)+" and fldl.seq>"+pS+" order by fldl.seq"; //TODO удалить
|
||||
}else
|
||||
if(pN.equals("frmlocustdel") && days>0 && country_id>0){
|
||||
Map<String, String> fields = TCTableTools.getTableSchema(conn, "main.frmlocustdel");
|
||||
STools.delFromMapByValue(fields, "geometry"); //Исключаем поля с типом геометрия, SQLite в android их не понимает
|
||||
sql = "select "+String.join(", ", fields.keySet())+" from main.frmlocustdel where date>now()-interval '"+String.valueOf(days)+" days' and country_id="+String.valueOf(country_id)+" and device_id!='"+device_id+"' order by seq";
|
||||
//sql = "select "+String.join(", ", fields.keySet())+" from main.frmlocustdel where date>now()-interval '"+String.valueOf(days)+" days' and country_id="+String.valueOf(country_id)+" and seq>"+pS+" and device_id!='"+device_id+"' order by seq";
|
||||
sql = "select "+String.join(", ", fields.keySet())+" from main.frmlocustdel where date>now()-interval '"+String.valueOf(days)+" days' and country_id="+String.valueOf(country_id)+" and seq>"+pS+" order by seq"; //TODO удалить
|
||||
//sql = "select "+String.join(", ", fields.keySet())+" from main.frmlocustdel where date>now()-interval '"+String.valueOf(days)+" days' and country_id="+String.valueOf(country_id)+" and seq>"+pS+" order by seq"; //TODO удалить
|
||||
}else
|
||||
if(pN.equals("_translations"))
|
||||
{
|
||||
@ -2587,7 +2610,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
rs = st.executeQuery(sql);
|
||||
} catch( SQLException ex ) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<metadata fn=\"-1\"><![CDATA[SQL arror: "+ex.getMessage()+"]]></metadata>";
|
||||
response.setContentType("application/xml");
|
||||
return result;
|
||||
@ -2632,7 +2655,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<metadata fn=\"-1\"><![CDATA[SQL arror: "+ex.getMessage()+"]]></metadata>";
|
||||
response.setContentType("application/xml");
|
||||
return result;
|
||||
@ -2647,7 +2670,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
String dataDir = data_dir;
|
||||
String tmpDir = "temp"+File.separator;
|
||||
try{ new File(dataDir+tmpDir).mkdirs(); }catch (Exception ex) {
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result="<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"-1\"><![CDATA["+ex.getMessage()+"]]></metadata>";
|
||||
response.setContentType("application/xml");
|
||||
return result;
|
||||
@ -2674,7 +2697,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (Exception ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
result="<?xml version=\"1.0\" encoding=\"utf-8\"?><metadata fn=\"6\"><![CDATA[1]]></metadata>";
|
||||
}else
|
||||
@ -2686,7 +2709,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (Exception ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}finally {
|
||||
if(conn!=null) {try { conn.close(); } catch (SQLException e) {} }
|
||||
}
|
||||
@ -2699,7 +2722,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
* @param reqData
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/asdc/tctable/",method = { RequestMethod.GET, RequestMethod.POST },produces = "application/octet-stream")
|
||||
@RequestMapping(value = {"/asdc/tctable/", "/api/locust/v01/asdc/tctable/"},method = { RequestMethod.GET, RequestMethod.POST },produces = "application/octet-stream")
|
||||
@ResponseBody
|
||||
public Object uploadTCTable(@RequestHeader(required=false,name="Content-Type") String contentType,@RequestParam(required=false,name="file") MultipartFile file) {
|
||||
|
||||
@ -2754,7 +2777,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
rs = st.executeQuery(sql);
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -2783,7 +2806,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt = conn.prepareStatement(sql);
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -2812,7 +2835,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt = conn.prepareStatement(sql);
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -2828,7 +2851,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt.setString(7, tbl.fields.get(0).getStrVal());
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -2839,7 +2862,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt.execute();
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -2847,7 +2870,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -2895,7 +2918,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
rs = st.executeQuery(sql);
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -2942,7 +2965,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt = conn.prepareStatement(sql);
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -3000,7 +3023,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
stmt.setString(7, tbl.fields.get(0).getStrVal());*/
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -3013,7 +3036,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -3021,7 +3044,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error:",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result.put("error_code",1);
|
||||
result.put("error_message", ex.getMessage());
|
||||
return result.toString();
|
||||
@ -3032,21 +3055,10 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
}
|
||||
|
||||
//table=frmlocust&file=3a28b88f_locust_1508816625.jpg
|
||||
@RequestMapping(value = "/photo/",method = RequestMethod.GET, produces = "image/jpeg")
|
||||
@RequestMapping(value = {"/photo/", "/api/locust/v01/"},method = RequestMethod.GET, produces = "image/jpeg")
|
||||
@ResponseBody
|
||||
public FileSystemResource sendPhoto(HttpServletResponse response,@RequestParam(required=true,name="table") String tableName,@RequestParam(required=true,name="file") String fileName) {
|
||||
|
||||
//Load DB configuration
|
||||
String data_dir = "";
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
prop.load(new FileInputStream("org_ccalm_main.properties")); // load a properties file
|
||||
data_dir = prop.getProperty("data.dir");
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error("Error load org_ccalm_main.properties",ex);
|
||||
}
|
||||
|
||||
File file = new File(data_dir + "data/" + tableName + "/" + fileName);
|
||||
if(file.exists())
|
||||
{
|
||||
@ -3068,9 +3080,9 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
}
|
||||
}
|
||||
|
||||
//@RequestMapping(value = "/get",params = {"fn"},method = { RequestMethod.GET, RequestMethod.POST })
|
||||
//Для проверки какие фото есть на сервере а каких нет чтобы удалить из имена фотографий которых нет в базе
|
||||
@RequestMapping(value = "/photolist",method = RequestMethod.GET, produces = "text/html")
|
||||
//@RequestMapping(value = {"/get", "/api/locust/v01/"},params = {"fn"},method = { RequestMethod.GET, RequestMethod.POST })
|
||||
//Для проверки какие фото есть на сервере а каких нет чтобы удалить имена фотографий которых нет в базе
|
||||
@RequestMapping(value = {"/photolist", "/api/locust/v01/"},method = RequestMethod.GET, produces = "text/html")
|
||||
@ResponseBody
|
||||
public Object getPhotoList() {
|
||||
|
||||
@ -3106,7 +3118,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
rs = st.executeQuery(sql);
|
||||
} catch( SQLException ex ) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=ex.getMessage();
|
||||
return result;
|
||||
}
|
||||
@ -3154,7 +3166,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=ex.getMessage();
|
||||
return result;
|
||||
}
|
||||
@ -3169,7 +3181,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
rs = st.executeQuery(sql);
|
||||
} catch( SQLException ex ) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=ex.getMessage();
|
||||
return result;
|
||||
}
|
||||
@ -3217,7 +3229,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (SQLException ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=ex.getMessage();
|
||||
return result;
|
||||
}
|
||||
@ -3226,7 +3238,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
|
||||
} catch (Exception ex) {
|
||||
logRotate(data_dir+"errors.log",ex.getMessage());
|
||||
logger.error("error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}finally{
|
||||
if(conn!=null){ try{ conn.close(); }catch(Exception e){} }
|
||||
}
|
||||
@ -3281,7 +3293,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
}catch(Exception ex)
|
||||
{
|
||||
System.out.println(ex.getMessage());
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
result=false;
|
||||
}
|
||||
return result;
|
||||
@ -3306,7 +3318,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
writer.newLine();
|
||||
writer.close();
|
||||
} catch (IOException ex) {
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,395 +0,0 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
|
||||
|
||||
import java.io.*;
|
||||
//import java.io.FileInputStream;
|
||||
//import java.io.OutputStream;
|
||||
//import java.io.UnsupportedEncodingException;
|
||||
//import java.nio.file.Paths;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Properties;
|
||||
//import java.util.zip.CRC32;
|
||||
//import java.util.zip.Checksum;
|
||||
|
||||
//import javax.servlet.ServletContext;
|
||||
//import javax.servlet.http.Part;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import jakarta.servlet.ServletContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
//import org.apache.commons.io.FileUtils;
|
||||
//import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
//import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import tools.User;
|
||||
|
||||
|
||||
@Controller
|
||||
public class AcceptEXCEL implements ServletContextAware {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AcceptEXCEL.class);
|
||||
|
||||
private ServletContext context;
|
||||
|
||||
@Value("${spring.datasource.url}")
|
||||
String db_url="";
|
||||
@Value("${spring.datasource.username}")
|
||||
String db_login="";
|
||||
@Value("${spring.datasource.password}")
|
||||
String db_password="";
|
||||
@Value("${data.dir}")
|
||||
String data_dir = "";
|
||||
|
||||
@Override
|
||||
public void setServletContext(ServletContext context) {
|
||||
this.context=context;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/AcceptCSV", method = { RequestMethod.GET, RequestMethod.POST })
|
||||
public String acceptCSV(@ModelAttribute User user, Model model,@RequestParam(required=false,name="file") MultipartFile file,@RequestParam(required=false,name="skip",defaultValue = "0") Boolean skip) {
|
||||
|
||||
Connection conn = null;
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
conn = DriverManager.getConnection(db_url, db_login, db_password);
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
|
||||
String sqlData="";
|
||||
String json="{\"type\": \"FeatureCollection\",\"features\":[";
|
||||
|
||||
|
||||
String table="<table border=\"1\">";
|
||||
table+="<tr style=\"background-color: #e0e0e0;\"><th>№</th><th>Latitude (Широта)</th><th>Longitude (Долгота)</th><th>Oblast (область)</th><th>District (Район)</th><th>Сельский округ</th><th>Хозяйство или местность</th><th>Вид саранчи</th><th>Фаза</th><th>ЭПВ</th><th>Заселено Га</th><th>Дата</th></tr>";
|
||||
|
||||
//row+="<td>"+i+"</td><td>"+locust.lat+"</td><td>"+locust.lon+"</td><td>"+locust.region+" = "+locust.region_id+"</td><td>"+locust.district+" = "+locust.district_id+"</td><td>"+locust.terrain+"</td><td>"+locust.village+"<td>";
|
||||
|
||||
if (file!=null && !file.isEmpty()) {
|
||||
|
||||
BufferedReader reader;
|
||||
try {
|
||||
int i=1; //for testing
|
||||
|
||||
reader = new BufferedReader(new InputStreamReader(file.getInputStream(), "UTF-8"));
|
||||
//reader = new BufferedReader(new FileReader(file));
|
||||
|
||||
String line = reader.readLine();
|
||||
if(skip) line = reader.readLine();
|
||||
while (line != null) {
|
||||
|
||||
StringBuffer data=new StringBuffer(line);
|
||||
Boolean error=false;
|
||||
|
||||
Locust locust = new Locust();
|
||||
try {
|
||||
String lat=CutBeforeFirst(data,";");
|
||||
if(lat.equals("46.3104.6")) lat="46.31046";
|
||||
if(lat.equals("43.21303.")) lat="43.21303";
|
||||
if(lat.equals("43.26067.")) lat="43.26067";
|
||||
if(lat.equals("43.20181.")) lat="43.20181";
|
||||
if(lat.equals("43.20181.")) lat="43.20181";
|
||||
if(lat.equals("43.74691.")) lat="43.74691";
|
||||
if(lat.equals("43.41954.")) lat="43.41954";
|
||||
if(lat.equals("43.78288.")) lat="43.78288";
|
||||
if(lat.equals("43.26260.")) lat="43.26260";
|
||||
if(lat.equals("43.79702.")) lat="43.79702";
|
||||
if(lat.equals("43.64891.")) lat="43.64891";
|
||||
if(lat.equals("43.64891.")) lat="43.64891";
|
||||
if(lat.equals("43.42271.")) lat="43.42271";
|
||||
if(lat.equals("43.64891.")) lat="43.64891";
|
||||
if(lat.equals("43.89990.")) lat="43.89990";
|
||||
if(lat.equals("43.96273.")) lat="43.96273";
|
||||
if(lat.equals("43.26907.")) lat="43.26907";
|
||||
if(lat.equals("43.26630.")) lat="43.26630";
|
||||
if(lat.equals("43.50605.")) lat="43.50605";
|
||||
if(lat.equals("43.74965.")) lat="43.74965";
|
||||
if(lat.equals("43.20813.")) lat="43.20813";
|
||||
if(lat.equals("43.23298.")) lat="43.23298";
|
||||
if(lat.equals("43.74774.")) lat="43.74774";
|
||||
if(lat.equals("43.77144.")) lat="43.77144";
|
||||
if(lat.equals("43.58847.")) lat="43.58847";
|
||||
if(lat.equals("43.58944.")) lat="43.58944";
|
||||
if(lat.equals("4342755.")) lat="43.42755";
|
||||
if(lat.equals("43.80416.")) lat="43.80416";
|
||||
if(lat.equals("43.79536.")) lat="43.79536";
|
||||
if(lat.equals("50.75 767")) lat="50.75767";
|
||||
if(lat.equals("50.77 542")) lat="50.77542";
|
||||
if(lat.equals("50.85 140")) lat="50.85140";
|
||||
if(lat.equals("50.79 773")) lat="50.79773";
|
||||
if(lat.equals("50.63 469")) lat="50.63469";
|
||||
if(lat.equals("51.23 130")) lat="51.23130";
|
||||
if(lat.equals("51.03 220")) lat="51.03220";
|
||||
if(lat.equals("51.38 922")) lat="51.38922";
|
||||
if(lat.equals("51.06.940")) lat="51.06940";
|
||||
if(lat.equals("51.08 273")) lat="51.08273";
|
||||
if(lat.equals("50.96 705")) lat="50.96705";
|
||||
if(lat.equals("51.03 021")) lat="51.03021";
|
||||
if(lat.equals("51.01 764")) lat="51.01764";
|
||||
if(lat.equals("50.99 388")) lat="50.99388";
|
||||
if(lat.equals("50.50 509")) lat="50.50509";
|
||||
if(lat.equals("43.109.94")) lat="43.10994";
|
||||
if(lat.equals("50.11.926")) lat="50.11926";
|
||||
if(lat.equals("50.04.966")) lat="50.04966";
|
||||
if(lat.equals("49.26.385")) lat="49.26385";
|
||||
if(lat.equals("49.26.251")) lat="49.26251";
|
||||
if(lat.equals("49.25.307")) lat="49.25307";
|
||||
if(lat.equals("44.4930.")) lat="49.25307";
|
||||
|
||||
locust.lat=Double.parseDouble(lat);
|
||||
|
||||
String lon=CutBeforeFirst(data,";");
|
||||
if(lon.equals("51.25 560")) lon="51.25560";
|
||||
if(lon.equals("51.25 099")) lon="51.25099";
|
||||
if(lon.equals("51.26 378")) lon="51.26378";
|
||||
if(lon.equals("51.25 235")) lon="51.25235";
|
||||
if(lon.equals("51.83 107")) lon="51.83107";
|
||||
if(lon.equals("51.71 702")) lon="51.71702";
|
||||
if(lon.equals("52.21 390")) lon="52.21390";
|
||||
if(lon.equals("52.10 873")) lon="52.10873";
|
||||
if(lon.equals("51.85 606")) lon="51.85606";
|
||||
if(lon.equals("52.41 085")) lon="52.41085";
|
||||
if(lon.equals("52.36 125")) lon="52.36125";
|
||||
if(lon.equals("51. 56 025")) lon="51.56025";
|
||||
if(lon.equals("51.56 786")) lon="51.56786";
|
||||
if(lon.equals("51.57 946")) lon="51.57946";
|
||||
if(lon.equals("51.16 758")) lon="51.16758";
|
||||
if(lon.equals("85.09.142")) lon="85.09142";
|
||||
|
||||
|
||||
locust.lon=Double.parseDouble(lon);
|
||||
|
||||
}catch(Exception ex)
|
||||
{
|
||||
error=true;
|
||||
}
|
||||
|
||||
locust.region=CutBeforeFirst(data,";");
|
||||
|
||||
//Выбираю ID области
|
||||
Statement stt = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
|
||||
if(locust.region.equals("Алматинский")) locust.region="Алматинская";
|
||||
if(locust.region.equals("Туркестанский")) locust.region="Туркестанская";
|
||||
|
||||
stt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
String sql_query = "select id from main.countriesregions where name like '%"+locust.region+"%';";
|
||||
rs = stt.executeQuery(sql_query);
|
||||
if (rs != null) {
|
||||
try {
|
||||
if (rs.next()) {
|
||||
locust.region_id=rs.getString(1);
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException ex) {
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
|
||||
}finally {
|
||||
if(rs!=null) try{rs.close();}catch(SQLException ex){}
|
||||
if(stt!=null) try{stt.close();}catch(SQLException ex){}
|
||||
}
|
||||
|
||||
//Выбираю id региона (main.countriesdistricts)
|
||||
locust.district_id="";
|
||||
locust.district=CutBeforeFirst(data,";");
|
||||
stt = null;
|
||||
rs = null;
|
||||
try {
|
||||
|
||||
if(locust.district.equals("Сарканский ")) locust.district="Саркандский";
|
||||
if(locust.district.equals("Уйгуский")) locust.district="Уйгурский";
|
||||
if(locust.district.equals("г.Капшагай")) locust.district="Капчагайский городской округ";
|
||||
if(locust.district.equals("Каратальскиий")) locust.district="Каратальский";
|
||||
if(locust.district.equals("г. Талдыкорган")) locust.district="Талдыкорганский";
|
||||
if(locust.district.equals("г Атырау ")) locust.district="Атырауский городской округ";
|
||||
if(locust.district.equals("г. Атырау")) locust.district="Атырауский городской округ";
|
||||
if(locust.district.equals("Кызылкуга")) locust.district="Кзылкогинский район";
|
||||
if(locust.district.equals("Курчумский ")) locust.district="Куршимский район";
|
||||
if(locust.district.equals("г.Семей")) locust.district="Семипалатинский городской округ";
|
||||
if(locust.region_id.equals("4") && locust.district.equals("Жамбылский")) locust.district="Джамбулский район";
|
||||
if(locust.district.equals("Т.Рыскуловский")) locust.district="Рыскуловский район";
|
||||
if(locust.district.equals("Шуйский")) locust.district="Чуйский район";
|
||||
if(locust.district.equals("Сарысуский")) locust.district="Сары-Суйский район";
|
||||
if(locust.district.equals("Федоровский")) locust.district="Фёдоровский район";
|
||||
if(locust.district.equals("Жангельдинский")) locust.district="Джангельдинский район";
|
||||
if(locust.district.equals("Сырдария")) locust.district="Сырдарьинский район";
|
||||
if(locust.district.equals("Кызылорда")) locust.district="Кызылординский городской округ";
|
||||
if(locust.district.equals("к.Кызылорда")) locust.district="Кызылординский городской округ";
|
||||
if(locust.district.equals("Аралский")) locust.district="Аральский район";
|
||||
if(locust.district.equals("Шиелі")) locust.district="Шиелийский район";
|
||||
if(locust.region_id.equals("11") && locust.district.equals("Аксуский")) locust.district="Аксуйский городской округ";
|
||||
if(locust.region_id.equals("11") && locust.district.equals("Аксуский")) locust.district="Аксуйский городской округ";
|
||||
if(locust.region_id.equals("11") && locust.district.equals("Ақсуский")) locust.district="Аксуйский городской округ";
|
||||
if(locust.district.equals("Аққулы")) locust.district="Аккулинский район";
|
||||
if(locust.district.equals("Аккулы")) locust.district="Аккулинский район";
|
||||
if(locust.district.equals("Тереңкөл")) locust.district="Теренкольский";
|
||||
if(locust.district.equals("г. Павлодар")) locust.district="Павлодарский городской округ";
|
||||
if(locust.district.equals("Екибастузский")) locust.district="Экибастузский городской округ";
|
||||
if(locust.district.equals("Шербактнский")) locust.district="Щербактинский район";
|
||||
if(locust.district.equals("Толебиский ")) locust.district="Толебийский район";
|
||||
if(locust.district.equals("г.Шымкент Абайский ")) locust.district="Шымкентский городской округ";
|
||||
if(locust.district.equals("г.Шымкент Каратауский ")) locust.district="Шымкентский городской округ";
|
||||
if(locust.district.equals("Баянауыл")) locust.district="Баянаул";
|
||||
if(locust.district.equals("Екібастұз")) locust.district="Экибастуз";
|
||||
|
||||
|
||||
|
||||
|
||||
stt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
String sql_query = "select id from main.countriesdistricts where region_id="+locust.region_id+" and name like '%"+locust.district+"%';";
|
||||
rs = stt.executeQuery(sql_query);
|
||||
if (rs != null) {
|
||||
try {
|
||||
if (rs.next()) {
|
||||
locust.district_id=rs.getString(1);
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException ex) {
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
|
||||
}finally {
|
||||
if(rs!=null) try{rs.close();}catch(SQLException ex){}
|
||||
if(stt!=null) try{stt.close();}catch(SQLException ex){}
|
||||
}
|
||||
|
||||
//Сельский округ
|
||||
locust.terrain=CutBeforeFirst(data,";");
|
||||
//Хозяйство или местность
|
||||
locust.village=CutBeforeFirst(data,";");
|
||||
//Вид саранчи
|
||||
locust.locust=CutBeforeFirst(data,";");
|
||||
locust.locust_id="";
|
||||
if(locust.locust.equals(" итальянский прус")) locust.locust_id="1";
|
||||
if(locust.locust.equals("итальянский прус")) locust.locust_id="1";
|
||||
if(locust.locust.equals("Итальянский прус")) locust.locust_id="1";
|
||||
if(locust.locust.equals("итальянский прус ")) locust.locust_id="1";
|
||||
if(locust.locust.equals("Азиатская саранча")) locust.locust_id="3";
|
||||
if(locust.locust.equals("азиатская саранча")) locust.locust_id="3";
|
||||
if(locust.locust.equals("нестадные")) locust.locust_id="4";
|
||||
if(locust.locust.equals("нестадные саранчовые")) locust.locust_id="4";
|
||||
if(locust.locust.equals("Нестадные саранчевые")) locust.locust_id="4";
|
||||
if(locust.locust.equals("Нестадная саранча ")) locust.locust_id="4";
|
||||
if(locust.locust.equals("Нестадная саранча")) locust.locust_id="4";
|
||||
if(locust.locust.equals("нестадная саранча")) locust.locust_id="4";
|
||||
if(locust.locust.equals("Мароккская саранча")) locust.locust_id="2";
|
||||
|
||||
//фаза саранчи
|
||||
locust.phase=CutBeforeFirst(data,";");
|
||||
locust.locust_have="3";
|
||||
if(locust.phase.equals("кубышки")) locust.locust_have="2";
|
||||
if(locust.phase.equals("личинки")) locust.locust_have="3";
|
||||
if(locust.phase.equals("имаго")) locust.locust_have="5";
|
||||
|
||||
locust.evp=CutBeforeFirst(data,";"); //ЭФП
|
||||
locust.size=CutBeforeFirst(data,";"); //Заселённая площадь
|
||||
locust.size=locust.size.replace(",",".");
|
||||
locust.date=CutBeforeFirst(data,";"); //Дата
|
||||
|
||||
String row="<tr>";
|
||||
if(error==true || locust.lat==0 || locust.lon==0 || locust.region_id.isEmpty() || locust.district_id.isEmpty() || locust.terrain.isEmpty() || locust.locust_id.isEmpty()) {
|
||||
row="<tr style=\"background-color:red;\">";
|
||||
}
|
||||
row+="<td>"+i+"</td><td>"+locust.lat+"</td><td>"+locust.lon+"</td><td>"+locust.region+" = "+locust.region_id+"</td><td>"+locust.district+" = "+locust.district_id+"</td><td>"+locust.terrain+"</td><td>"+locust.village+"</td><td>"+locust.locust+" = "+locust.locust_id+"</td><td>"+locust.phase+" = "+locust.locust_have+"</td><td>"+locust.evp+"</td><td>"+locust.size+"</td><td>"+locust.date+"</td>";
|
||||
row+="</tr>\n";
|
||||
|
||||
|
||||
|
||||
table += row;
|
||||
i++;
|
||||
|
||||
json+=" \n{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":["+locust.lon+","+locust.lat+"]},\"properties\":{\"oblast\":\""+locust.region.replace("\"", "'")+"\",\"district\":\""+locust.district.replace("\"", "'")+"\",\"region\":\""+locust.terrain.replace("\"", "'")+"\",\"village\":\""+locust.village.replace("\"", "'")+"\",\"phase\":\""+locust.phase+"\",\"locust\":\""+locust.locust+"\",\"evp\": \""+locust.evp+"\",\"ga\": \""+locust.size+"\",\"date\": \""+locust.date+"\"}},";
|
||||
|
||||
sqlData+="insert into main.frmlocust(country_id,region_id,district,terrain,village,lon1,lat1,locust_type_id,locust_have,locust_populated,date)values(5,"+locust.region_id+",'"+locust.district.trim()+"','"+locust.terrain.trim()+"','"+locust.village.trim()+"',"+locust.lon+","+locust.lat+","+locust.locust_id+","+locust.locust_have+","+locust.size+",TO_DATE('"+locust.date+"','DD.MM.YYYY'));\n";
|
||||
|
||||
if(i>5000) break;
|
||||
line=reader.readLine();
|
||||
}
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else {
|
||||
table="CSV file is empty! "+skip;
|
||||
}
|
||||
table += "</table>";
|
||||
|
||||
json=json.substring(0,json.length()-1); //Удаляю последнюю запятую
|
||||
json+="\n]}";
|
||||
|
||||
model.addAttribute("PreviewTable",table);
|
||||
model.addAttribute("PreviewGEOJSON",json);
|
||||
model.addAttribute("PreviewSQL",sqlData);
|
||||
|
||||
return "excel";
|
||||
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
public static String CutBeforeFirst(StringBuffer str,String ch)
|
||||
{
|
||||
int pos=str.indexOf(ch);
|
||||
String result="";
|
||||
if(pos==-1)
|
||||
{
|
||||
result.concat(str.toString());
|
||||
str.delete(0,str.length());
|
||||
}else
|
||||
{
|
||||
result=str.substring(0,pos);
|
||||
str.delete(0,pos+1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
class Locust{
|
||||
double lon;
|
||||
double lat;
|
||||
String region; //Область
|
||||
String region_id;
|
||||
|
||||
String district; //Район
|
||||
String district_id;
|
||||
|
||||
String terrain; //Название месности
|
||||
|
||||
String village; //Хозяйство или местность
|
||||
|
||||
String locust; //Вид саранчи
|
||||
String locust_id; //Вид саранчи
|
||||
|
||||
String phase; //Фаза саранчи
|
||||
String locust_have; //id Фазы саранчи
|
||||
String evp; //ЭФП
|
||||
String size; //Заселённая площадь
|
||||
String date; //Дата
|
||||
|
||||
}
|
||||
}
|
||||
@ -64,7 +64,7 @@ public class DataJSON implements ServletContextAware {
|
||||
// return new User("none");
|
||||
//}
|
||||
|
||||
@RequestMapping(value = "/get_companies",method = {RequestMethod.POST,RequestMethod.GET}, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = {"/get_companies", "/api/locust/v01/get_companies"},method = {RequestMethod.POST,RequestMethod.GET}, produces = "application/json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public String getCompanies(@ModelAttribute User user,@RequestParam(required=false,name="country_id") String country_id,@RequestParam(required=false,name="lng") String language_id) {
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ public class DownloadNDVI implements ServletContextAware {
|
||||
|
||||
private ServletContext context;
|
||||
|
||||
@RequestMapping(value = "/DownloadNDVI",method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@RequestMapping(value = {"/DownloadNDVI", "/api/locust/v01/DownloadNDVI"},method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public Object ajaxTamer(@RequestParam(required=false,name="forecast") String forecast) {
|
||||
|
||||
@ -62,6 +62,7 @@ public class DownloadNDVI implements ServletContextAware {
|
||||
//String fullPath = context.getRealPath("/WEB-INF/config.xml");
|
||||
//File fXmlFile = new File(fullPath);
|
||||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
||||
dbFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||||
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
|
||||
//Document doc = dBuilder.parse(fXmlFile);
|
||||
Document doc = dBuilder.parse(new ClassPathResource("config.xml").getInputStream());
|
||||
|
||||
@ -51,7 +51,7 @@ public class DownloadWeather implements ServletContextAware {
|
||||
@Value("${data.dir}")
|
||||
String data_dir = "";
|
||||
|
||||
@RequestMapping(value = "/DownloadWeather",method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@RequestMapping(value = {"/DownloadWeather", "/api/locust/v01/DownloadWeather"},method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public Object ajaxTamer(@RequestParam(required=false,name="forecast") String forecast,@RequestParam(required=false,name="date") String date) {
|
||||
//String forecast = request.getParameter("forecast"); //Date like as "000".
|
||||
@ -354,7 +354,7 @@ public class DownloadWeather implements ServletContextAware {
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
//List of "Soil temperature" dates from database in JSON
|
||||
@RequestMapping(value = "/WeatherSoilDates",method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@RequestMapping(value = {"/WeatherSoilDates", "/api/locust/v01/WeatherSoilDates"},method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public Object ajaxSoilDates() {
|
||||
boolean error=false;
|
||||
|
||||
@ -1,29 +1,40 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
import java.io.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
//import javax.servlet.ServletContext;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import jakarta.servlet.ServletContext;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
@ -47,7 +58,20 @@ public class GeoGSON implements ServletContextAware {
|
||||
@Value("${data.dir}")
|
||||
String data_dir = "";
|
||||
|
||||
@RequestMapping(value = "/geojson", method = RequestMethod.GET)
|
||||
|
||||
private final NamedParameterJdbcTemplate jdbcTemplate;
|
||||
private final Environment environment;
|
||||
private HikariDataSource dataSource;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@Autowired
|
||||
public GeoGSON(NamedParameterJdbcTemplate jdbcTemplate, HikariDataSource dataSource, Environment environment) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
this.environment = environment;
|
||||
this.dataSource = dataSource;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
@RequestMapping(value = {"/geojson", "/api/locust/v01/geojson"}, method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Object home(@RequestParam(required=false,name="table") String table,@RequestParam(required=false,name="id") String id)
|
||||
{
|
||||
@ -107,10 +131,9 @@ public class GeoGSON implements ServletContextAware {
|
||||
this.context=context;
|
||||
}
|
||||
|
||||
|
||||
//For compilatin android project
|
||||
//http://127.0.0.1:8080/CCALM/countriesregionspoints
|
||||
@RequestMapping(value = "/countriesregionspoints", method = RequestMethod.GET)
|
||||
@RequestMapping(value = {"/countriesregionspoints", "/api/locust/v01/countriesregionspoints"}, method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Object countriesregions()
|
||||
{
|
||||
@ -226,4 +249,232 @@ public class GeoGSON implements ServletContextAware {
|
||||
return result;
|
||||
}
|
||||
|
||||
// JSON to file frmlocust_pods_density.qgs
|
||||
@RequestMapping(
|
||||
value = { "/geojson/frmlocust_pods_density", "/api/locust/v01/geojson/frmlocust_pods_density"},
|
||||
method = RequestMethod.GET,
|
||||
produces = "application/geo+json;charset=UTF-8"
|
||||
)
|
||||
@ResponseBody
|
||||
public ResponseEntity<byte[]> podsDensity(
|
||||
@RequestParam(required = false, name = "country_id", defaultValue = "5") Integer countryId,
|
||||
@RequestParam(required = false, name = "region_id") Long regionId,
|
||||
@RequestParam(required = false, name = "locust_type_id") Long locustTypeId,
|
||||
@RequestParam(required = false, name = "date_start", defaultValue = "1750227418") Long dateStartUnix,
|
||||
@RequestParam(required = false, name = "date_end", defaultValue = "1758010618") Long dateEndUnix,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id,
|
||||
HttpServletRequest request // Добавляем для получения заголовка Range
|
||||
) {
|
||||
try {
|
||||
String sql = """
|
||||
SELECT
|
||||
*
|
||||
FROM main.get_frmlocust_pods_density(
|
||||
:countryId,
|
||||
:regionId,
|
||||
:locustTypeId,
|
||||
cast(to_timestamp(:dateFrom) as timestamp without time zone),
|
||||
cast(to_timestamp(:dateTo) as timestamp without time zone)
|
||||
)
|
||||
""";
|
||||
|
||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||
params.addValue("countryId", countryId, Types.BIGINT);
|
||||
params.addValue("regionId", regionId, Types.BIGINT);
|
||||
params.addValue("locustTypeId", locustTypeId, Types.BIGINT);
|
||||
params.addValue("dateFrom", dateStartUnix, Types.BIGINT);
|
||||
params.addValue("dateTo", dateEndUnix, Types.BIGINT);
|
||||
|
||||
List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql, params);
|
||||
|
||||
// Формируем FeatureCollection
|
||||
JSONArray features = new JSONArray();
|
||||
for (Map<String, Object> row : rows) {
|
||||
JSONObject feature = new JSONObject();
|
||||
feature.put("type", "Feature");
|
||||
feature.put("geometry", new JSONObject((String) row.get("geometry")));
|
||||
|
||||
JSONObject props = new JSONObject();
|
||||
for (Map.Entry<String, Object> e : row.entrySet()) {
|
||||
if (!"geometry".equals(e.getKey())) {
|
||||
Object value = e.getValue();
|
||||
if (value == null) {
|
||||
props.put(e.getKey(), JSONObject.NULL);
|
||||
} else {
|
||||
props.put(e.getKey(), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
feature.put("properties", props);
|
||||
features.put(feature);
|
||||
}
|
||||
|
||||
JSONObject collection = new JSONObject();
|
||||
collection.put("type", "FeatureCollection");
|
||||
collection.put("features", features);
|
||||
|
||||
// Преобразуем в байты
|
||||
byte[] data = collection.toString().getBytes(StandardCharsets.UTF_8);
|
||||
long contentLength = data.length;
|
||||
|
||||
// Обрабатываем Range-запрос
|
||||
String rangeHeader = request.getHeader("Range");
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Accept-Ranges", "bytes");
|
||||
|
||||
if (rangeHeader != null && rangeHeader.startsWith("bytes=")) {
|
||||
String[] ranges = rangeHeader.replace("bytes=", "").split("-");
|
||||
long start = Long.parseLong(ranges[0]);
|
||||
long end = ranges.length > 1 && !ranges[1].isEmpty() ? Long.parseLong(ranges[1]) : contentLength - 1;
|
||||
|
||||
if (start >= contentLength || end >= contentLength || start > end) {
|
||||
return ResponseEntity.status(HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE)
|
||||
.header("Content-Range", "bytes */" + contentLength)
|
||||
.build();
|
||||
}
|
||||
|
||||
long rangeLength = end - start + 1;
|
||||
byte[] rangeData = new byte[(int) rangeLength];
|
||||
System.arraycopy(data, (int) start, rangeData, 0, (int) rangeLength);
|
||||
|
||||
headers.add("Content-Range", "bytes " + start + "-" + end + "/" + contentLength);
|
||||
headers.add("Content-Length", String.valueOf(rangeLength));
|
||||
|
||||
return new ResponseEntity<>(rangeData, headers, HttpStatus.PARTIAL_CONTENT);
|
||||
}
|
||||
|
||||
// Полный ответ, если Range не запрошен
|
||||
headers.add("Content-Length", String.valueOf(contentLength));
|
||||
return new ResponseEntity<>(data, headers, HttpStatus.OK);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
String error = "{\"error\":\"" + e.getMessage() + "\"}";
|
||||
return new ResponseEntity<>(error.getBytes(StandardCharsets.UTF_8), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping(
|
||||
value = { "/geojson/countriesdistricts", "/api/locust/v01/geojson/countriesdistricts"},
|
||||
produces = "application/geo+json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public ResponseEntity<byte[]> getCountriesDistricts(
|
||||
@RequestParam(required = false, name = "country_id") Long countryId,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
return getGeoJson("main.view_countriesdistricts", "id", countryId, request);
|
||||
}
|
||||
|
||||
@GetMapping(
|
||||
value = { "/geojson/countriesregions", "/api/locust/v01/geojson/countriesregions"},
|
||||
produces = "application/geo+json;charset=UTF-8"
|
||||
)
|
||||
@ResponseBody
|
||||
public ResponseEntity<byte[]> getCountriesRegions(
|
||||
@RequestParam(required = false, name = "country_id") Long countryId,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
return getGeoJson("main.view_countriesregions", "id", countryId, request);
|
||||
}
|
||||
|
||||
@GetMapping(
|
||||
value = { "/geojson/countries", "/api/locust/v01/geojson/countries"},
|
||||
produces = "application/geo+json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public ResponseEntity<byte[]> getCountries(
|
||||
@RequestParam(required = false, name = "country_id") Long countryId,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
return getGeoJson("main.view_countries", "country_id", countryId, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Общая функция для GeoJSON с поддержкой Range-запросов
|
||||
*/
|
||||
private ResponseEntity<byte[]> getGeoJson(
|
||||
String table,
|
||||
String idField,
|
||||
Long countryId,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
try {
|
||||
String sql = """
|
||||
SELECT
|
||||
%s AS id,
|
||||
ST_AsGeoJSON(geom)::text AS geometry,
|
||||
*
|
||||
FROM %s
|
||||
WHERE
|
||||
geom IS NOT NULL
|
||||
AND (country_id = :countryId)
|
||||
""".formatted(idField, table);
|
||||
|
||||
MapSqlParameterSource params = new MapSqlParameterSource();
|
||||
params.addValue("countryId", countryId);
|
||||
|
||||
List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql, params);
|
||||
|
||||
JSONArray features = new JSONArray();
|
||||
for (Map<String, Object> row : rows) {
|
||||
JSONObject feature = new JSONObject();
|
||||
feature.put("type", "Feature");
|
||||
|
||||
// Геометрия
|
||||
feature.put("geometry", new JSONObject((String) row.get("geometry")));
|
||||
|
||||
// Свойства
|
||||
JSONObject props = new JSONObject();
|
||||
for (Map.Entry<String, Object> e : row.entrySet()) {
|
||||
if (!"geometry".equals(e.getKey()) && !"geom".equals(e.getKey())) {
|
||||
Object value = e.getValue();
|
||||
props.put(e.getKey(), value == null ? JSONObject.NULL : value);
|
||||
}
|
||||
}
|
||||
feature.put("properties", props);
|
||||
features.put(feature);
|
||||
}
|
||||
|
||||
JSONObject collection = new JSONObject();
|
||||
collection.put("type", "FeatureCollection");
|
||||
collection.put("features", features);
|
||||
|
||||
byte[] data = collection.toString().getBytes(StandardCharsets.UTF_8);
|
||||
long contentLength = data.length;
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Accept-Ranges", "bytes");
|
||||
|
||||
// Обработка Range
|
||||
String rangeHeader = request.getHeader("Range");
|
||||
if (rangeHeader != null && rangeHeader.startsWith("bytes=")) {
|
||||
String[] ranges = rangeHeader.replace("bytes=", "").split("-");
|
||||
long start = Long.parseLong(ranges[0]);
|
||||
long end = ranges.length > 1 && !ranges[1].isEmpty() ? Long.parseLong(ranges[1]) : contentLength - 1;
|
||||
|
||||
if (start >= contentLength || end >= contentLength || start > end) {
|
||||
return ResponseEntity.status(HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE)
|
||||
.header("Content-Range", "bytes */" + contentLength)
|
||||
.build();
|
||||
}
|
||||
|
||||
long rangeLength = end - start + 1;
|
||||
byte[] rangeData = new byte[(int) rangeLength];
|
||||
System.arraycopy(data, (int) start, rangeData, 0, (int) rangeLength);
|
||||
|
||||
headers.add("Content-Range", "bytes " + start + "-" + end + "/" + contentLength);
|
||||
headers.add("Content-Length", String.valueOf(rangeLength));
|
||||
|
||||
return new ResponseEntity<>(rangeData, headers, HttpStatus.PARTIAL_CONTENT);
|
||||
}
|
||||
|
||||
headers.add("Content-Length", String.valueOf(contentLength));
|
||||
return new ResponseEntity<>(data, headers, HttpStatus.OK);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
String error = "{\"error\":\"" + e.getMessage() + "\"}";
|
||||
return new ResponseEntity<>(error.getBytes(StandardCharsets.UTF_8), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
48
src/main/java/org/ccalm/main/GlobalExceptionHandler.java
Normal file
@ -0,0 +1,48 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
import org.ccalm.main.models.ErrorResponseModel;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.servlet.NoHandlerFoundException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
@ExceptionHandler(NoHandlerFoundException.class)
|
||||
public ResponseEntity<ErrorResponseModel> handleNotFound(NoHandlerFoundException ex) {
|
||||
ErrorResponseModel errorResponse = new ErrorResponseModel(
|
||||
HttpStatus.NOT_FOUND.value(),
|
||||
10000,
|
||||
"Not_Found",
|
||||
UUID.randomUUID().toString()
|
||||
);
|
||||
return new ResponseEntity<>(errorResponse, HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public ResponseEntity<ErrorResponseModel> handleException(Exception ex) {
|
||||
ErrorResponseModel errorResponse = new ErrorResponseModel(
|
||||
HttpStatus.NOT_FOUND.value(),
|
||||
10000,
|
||||
"Internal_Server_Error", //Collections.singletonList("Internal_Server_Error"),
|
||||
UUID.randomUUID().toString()
|
||||
);
|
||||
return new ResponseEntity<>(errorResponse, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
@RequestMapping("/error")
|
||||
public ResponseEntity<ErrorResponseModel> handleError() {
|
||||
ErrorResponseModel errorResponse = new ErrorResponseModel(
|
||||
HttpStatus.NOT_FOUND.value(),
|
||||
10000,
|
||||
"Unknown_error",
|
||||
UUID.randomUUID().toString()
|
||||
);
|
||||
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ public class Integration implements ServletContextAware {
|
||||
@Value("${data.dir}")
|
||||
String data_dir = "";
|
||||
|
||||
@RequestMapping(value = "/integration/getByTime", method = RequestMethod.GET,produces = "application/json; charset=utf-8")
|
||||
@RequestMapping(value = {"/integration/getByTime", "/api/locust/v01/integration/getByTime"}, method = RequestMethod.GET,produces = "application/json; charset=utf-8")
|
||||
@ResponseBody
|
||||
public Object getByTime(@RequestParam(required=true,name="token") String token,@RequestParam(required=true,name="timeBegin") String timeBegin,@RequestParam(required=false,name="timeEnd") String timeEnd,@RequestParam(required=false,name="type") String type)
|
||||
{
|
||||
@ -68,7 +68,7 @@ public class Integration implements ServletContextAware {
|
||||
return getData(token,timeBegin,timeEnd,null,null);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/integration/getByDate", method = RequestMethod.GET,produces = "application/json; charset=utf-8")
|
||||
@RequestMapping(value = {"/integration/getByDate", "/api/locust/v01/integration/getByDate"}, method = RequestMethod.GET,produces = "application/json; charset=utf-8")
|
||||
@ResponseBody
|
||||
public Object getByDate(@RequestParam(required=true,name="token") String token,@RequestParam(required=true,name="dateBegin") String dateBegin,@RequestParam(required=false,name="dateEnd") String dateEnd,@RequestParam(required=false,name="type") String type)
|
||||
{
|
||||
@ -528,7 +528,7 @@ public class Integration implements ServletContextAware {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/integration/getPhoto", method = RequestMethod.GET,produces = "application/json; charset=utf-8")
|
||||
@RequestMapping(value = {"/integration/getPhoto", "/api/locust/v01/integration/getPhoto"}, method = RequestMethod.GET,produces = "application/json; charset=utf-8")
|
||||
@ResponseBody
|
||||
public Object getPhoto(@RequestParam(required=true,name="token") String token,@RequestParam(required=true,name="id") Long id)
|
||||
{
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.sql.*;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
//import javax.servlet.ServletContext;
|
||||
@ -21,7 +19,6 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.http.CacheControl;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@ -30,7 +27,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
|
||||
|
||||
import org.ccalm.main.TranslationUtils;
|
||||
import tools.DBTools;
|
||||
import tools.User;
|
||||
|
||||
@ -61,7 +57,7 @@ public class MainController implements ServletContextAware {
|
||||
/**
|
||||
* Simply selects the home view to render by returning its name.
|
||||
*/
|
||||
@RequestMapping(value = "/privacy", method = RequestMethod.GET)
|
||||
@RequestMapping(value = {"/privacy", "/api/locust/v01/privacy"}, method = RequestMethod.GET)
|
||||
public String privacy(Locale locale, Model model) {
|
||||
logger.info("Welcome home! The client locale is {}.", locale);
|
||||
|
||||
@ -73,7 +69,7 @@ public class MainController implements ServletContextAware {
|
||||
return "privacy";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/robots.txt")
|
||||
@RequestMapping(value = {"/robots.txt", "/api/locust/v01/robots.txt"})
|
||||
public void robots(HttpServletResponse response) {
|
||||
try {
|
||||
response.getWriter().write("User-agent: *\n");
|
||||
@ -87,7 +83,7 @@ public class MainController implements ServletContextAware {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/sitemap.xml")
|
||||
@RequestMapping(value = {"/sitemap.xml", "/api/locust/v01/sitemap.xml"})
|
||||
public void sitemap(HttpServletResponse response) {
|
||||
try {
|
||||
response.getWriter().write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
@ -104,7 +100,7 @@ public class MainController implements ServletContextAware {
|
||||
/**
|
||||
* Testing new main index page
|
||||
*/
|
||||
@RequestMapping(value = "/", method = RequestMethod.GET)
|
||||
@RequestMapping(value = {"/", "/api/locust/v01/"}, method = RequestMethod.GET)
|
||||
public String home2(Model model,@CookieValue(value = "lng", defaultValue = "1") String language_id_str) {
|
||||
int language_id;
|
||||
try {
|
||||
@ -120,12 +116,12 @@ public class MainController implements ServletContextAware {
|
||||
//Для перевода выбираю всё что под номером 1 в переводе
|
||||
TranslationUtils.loadTranslations(jdbcTemplate, language_id, model);
|
||||
|
||||
//return "index";
|
||||
return "test";
|
||||
return "index";
|
||||
//return "test";
|
||||
}
|
||||
|
||||
//Returns data for building a map on the first index page
|
||||
@RequestMapping(value = "/dataindex",method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json; charset=utf-8")
|
||||
@RequestMapping(value = {"/dataindex", "/api/locust/v01/dataindex"},method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json; charset=utf-8")
|
||||
@ResponseBody
|
||||
public Object ajaxIndexData(HttpServletResponse response,@ModelAttribute User user,@RequestParam(required=false,name="date_start") String date_start,@RequestParam(required=false,name="date_end") String date_end, @RequestParam(required=false,name="lng") String language_id) {
|
||||
String headerValue = CacheControl.maxAge(60, TimeUnit.SECONDS).getHeaderValue();
|
||||
@ -160,7 +156,7 @@ public class MainController implements ServletContextAware {
|
||||
}
|
||||
} catch( DataAccessException ex )
|
||||
{
|
||||
logger.error("Error",ex);
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
result.put("Error_code", "0");
|
||||
|
||||
@ -5,32 +5,37 @@ import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Properties;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.PublicKey;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
|
||||
//import javax.servlet.ServletContext;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jws;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import org.ccalm.main.models.ErrorResponseModel;
|
||||
import org.ccalm.main.utils.CustomException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MarkerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
@ -40,7 +45,10 @@ import org.json.JSONObject;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
import tctable.Tools;
|
||||
import tools.DBTools;
|
||||
import tools.PreparedStatementNamed;
|
||||
import tools.Translation;
|
||||
import tools.User;
|
||||
|
||||
@Controller
|
||||
@ -57,20 +65,52 @@ public class Products implements ServletContextAware {
|
||||
String db_login="";
|
||||
@Value("${spring.datasource.password}")
|
||||
String db_password="";
|
||||
@Value("${public.key}")
|
||||
String key_a_txt="";
|
||||
|
||||
private final NamedParameterJdbcTemplate jdbcTemplate;
|
||||
private final Environment environment;
|
||||
private HikariDataSource dataSource;
|
||||
|
||||
//If not created object "user", create him.
|
||||
//@ModelAttribute("user")
|
||||
//public User populatePerson() {
|
||||
// return new User("none");
|
||||
//}
|
||||
|
||||
@RequestMapping(value = "/get_survey",method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
//---------------------------------------------------------------------------
|
||||
@Autowired
|
||||
public Products(NamedParameterJdbcTemplate jdbcTemplate, HikariDataSource dataSource, Environment environment) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
this.environment = environment;
|
||||
this.dataSource = dataSource;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
@RequestMapping(value = {"/get_survey", "/api/locust/v01/get_survey"},method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public String getLocustSurvey(@ModelAttribute User user,@RequestBody(required=false) byte[] reqData,@RequestParam(required=false,name="lng") String language_id) {
|
||||
|
||||
int errorCode=0;
|
||||
String errorMessage="";
|
||||
public ResponseEntity<Object> getLocustSurvey(
|
||||
@ModelAttribute User user,
|
||||
@RequestBody(required=false) byte[] reqData,
|
||||
@CookieValue(value = "jwt_a", defaultValue = "") String jwt_a,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
) {
|
||||
Translation trt = new Translation(language_id,jdbcTemplate);
|
||||
try{
|
||||
if(user.id==null || user.id.equals("null")) {
|
||||
if (jwt_a.equals("") || Tools.countOccurrences(jwt_a, '.') != 2) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "Please_log_in"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
Jws<Claims> claims = null;
|
||||
PublicKey key_a = getPublicKey();
|
||||
try {
|
||||
claims = Jwts.parserBuilder()
|
||||
.setSigningKey(key_a)
|
||||
.build()
|
||||
.parseClaimsJws(jwt_a);
|
||||
} catch (Exception e) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "JWT_token_verification_error"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
user.id = claims.getBody().get("user_id").toString();
|
||||
}
|
||||
|
||||
Connection conn = null;
|
||||
try {
|
||||
@ -79,13 +119,10 @@ public class Products implements ServletContextAware {
|
||||
if (conn != null) {
|
||||
logger.info("Connect is OK!");
|
||||
} else {
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
throw new CustomException(200, 10000, trt.trt(false, "An error occurred while connecting to the database!"), UUID.randomUUID().toString(),true);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
throw new CustomException(200, 10000, trt.trt(false, "An error occurred while connecting to the database!"), UUID.randomUUID().toString(),true);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -94,9 +131,7 @@ public class Products implements ServletContextAware {
|
||||
stt0.executeUpdate("SET TIME ZONE 'Asia/Almaty';"); //Зачем раскоментил? может в начале поставить ещё TimeZone.setDefault(TimeZone.getTimeZone("UTC")); ?
|
||||
stt0.close();
|
||||
} catch (SQLException ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="Failed to execute SQL query!";
|
||||
throw new CustomException(200, 10000, trt.trt(false, "Failed to execute SQL query!"), UUID.randomUUID().toString(),true);
|
||||
}
|
||||
|
||||
JSONObject doc=null;
|
||||
@ -344,46 +379,66 @@ public class Products implements ServletContextAware {
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException ex) {
|
||||
errorCode=4;
|
||||
errorMessage+="Internal server error, sampling.";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), ex.getMessage());
|
||||
throw new CustomException(200, 10000, trt.trt(false, "Internal_server_error"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
errorCode=5;
|
||||
errorMessage+="Внутренняя ошибка сервера, запрос. ";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), ex.getMessage());
|
||||
throw new CustomException(200, 10000, trt.trt(false, "Internal_server_error"), UUID.randomUUID().toString(),false);
|
||||
}finally {
|
||||
if(rs!=null) try{rs.close();}catch(SQLException ex){}
|
||||
if(stt!=null) try{stt.close();}catch(SQLException ex){}
|
||||
}
|
||||
|
||||
|
||||
if(errorCode!=0) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",errorCode);
|
||||
obj.put("error_message", errorMessage);
|
||||
return obj.toString();
|
||||
}else {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",0);
|
||||
obj.put("error_message", "");
|
||||
if(doc!=null)
|
||||
obj.put("indicator",doc.getString("indicator"));
|
||||
obj.put("data",array);
|
||||
return obj.toString();
|
||||
return ResponseEntity.ok(obj.toString());
|
||||
|
||||
} catch (CustomException e) {
|
||||
if(e.isSaveToLog()) {
|
||||
logger.error(MarkerFactory.getMarker(e.getErrorMarker()), e.getMessage());
|
||||
}
|
||||
return new ResponseEntity<>(e.getErrorResponseModel(), getHttpStatus(e.getHttpCode()));
|
||||
} catch (Exception e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage());
|
||||
return new ResponseEntity<>(new ErrorResponseModel(500, 10000, trt.trt(false, "Internal_Server_Error"), null, uuid), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/get_spray",method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = {"/get_spray", "/api/locust/v01/get_spray"},method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public String getSprayMonitoring(@ModelAttribute User user,@RequestBody byte[] reqData,@RequestParam(required=false,name="lng") String language_id) {
|
||||
|
||||
int errorCode=0;
|
||||
String errorMessage="";
|
||||
public ResponseEntity<Object> getSprayMonitoring(
|
||||
@ModelAttribute User user,
|
||||
@RequestBody byte[] reqData,
|
||||
@CookieValue(value = "jwt_a", defaultValue = "") String jwt_a,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
) {
|
||||
Translation trt = new Translation(language_id,jdbcTemplate);
|
||||
try{
|
||||
if(user.id==null || user.id.equals("null")) {
|
||||
if (jwt_a.equals("") || Tools.countOccurrences(jwt_a, '.') != 2) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "Please_log_in"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
Jws<Claims> claims = null;
|
||||
PublicKey key_a = getPublicKey();
|
||||
try {
|
||||
claims = Jwts.parserBuilder()
|
||||
.setSigningKey(key_a)
|
||||
.build()
|
||||
.parseClaimsJws(jwt_a);
|
||||
} catch (Exception e) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "JWT_token_verification_error"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
user.id = claims.getBody().get("user_id").toString();
|
||||
}
|
||||
|
||||
Connection conn = null;
|
||||
try {
|
||||
@ -392,13 +447,10 @@ public class Products implements ServletContextAware {
|
||||
if (conn != null) {
|
||||
logger.info("Connect is OK!");
|
||||
} else {
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
throw new CustomException(200, 10000, trt.trt(false, "An error occurred while connecting to the database!"), UUID.randomUUID().toString(),true);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
throw new CustomException(200, 10000, trt.trt(false, "An error occurred while connecting to the database!"), UUID.randomUUID().toString(),true);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -407,9 +459,7 @@ public class Products implements ServletContextAware {
|
||||
stt0.executeUpdate("SET TIME ZONE 'Asia/Almaty';");
|
||||
stt0.close();
|
||||
} catch (SQLException ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="Failed to execute SQL query!";
|
||||
throw new CustomException(200, 10000, trt.trt(false, "Failed to execute SQL query!"), UUID.randomUUID().toString(),true);
|
||||
}
|
||||
|
||||
JSONObject doc=null;
|
||||
@ -625,43 +675,150 @@ public class Products implements ServletContextAware {
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException ex) {
|
||||
errorCode=4;
|
||||
errorMessage+="Internal server error, sampling.";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), ex.getMessage());
|
||||
throw new CustomException(200, 10000, trt.trt(false, "Internal_server_error"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
errorCode=5;
|
||||
errorMessage+="Внутренняя ошибка сервера, запрос. ";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
throw new CustomException(200, 10000, trt.trt(false, "Internal server error."), UUID.randomUUID().toString(),true);
|
||||
}finally {
|
||||
if(rs!=null) try{rs.close();}catch(SQLException ex){}
|
||||
if(stt!=null) try{stt.close();}catch(SQLException ex){}
|
||||
}
|
||||
|
||||
|
||||
if(errorCode!=0) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",errorCode);
|
||||
obj.put("error_message", errorMessage);
|
||||
return obj.toString();
|
||||
}else {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",0);
|
||||
obj.put("error_message", "");
|
||||
obj.put("data",array);
|
||||
return obj.toString();
|
||||
return ResponseEntity.ok(obj.toString());
|
||||
|
||||
} catch (CustomException e) {
|
||||
if(e.isSaveToLog()) {
|
||||
logger.error(MarkerFactory.getMarker(e.getErrorMarker()), e.getMessage());
|
||||
}
|
||||
return new ResponseEntity<>(e.getErrorResponseModel(), getHttpStatus(e.getHttpCode()));
|
||||
} catch (Exception e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage());
|
||||
return new ResponseEntity<>(new ErrorResponseModel(500, 10000, trt.trt(false, "Internal_Server_Error"), null, uuid), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/get_checkpoints",method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = { "/api/locust/v01/get_health"},method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public String getCheckpoints(@ModelAttribute User user,@RequestBody byte[] reqData,@RequestParam(required=false,name="lng") String language_id) {
|
||||
public ResponseEntity<Object> getHealthPoints(
|
||||
@ModelAttribute User user,
|
||||
@RequestBody byte[] reqData,
|
||||
@CookieValue(value = "jwt_a", defaultValue = "") String jwt_a,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
) {
|
||||
Translation trt = new Translation(language_id,jdbcTemplate);
|
||||
try{
|
||||
if(user.id==null || user.id.equals("null")) {
|
||||
if (jwt_a.equals("") || Tools.countOccurrences(jwt_a, '.') != 2) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "Please_log_in"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
Jws<Claims> claims = null;
|
||||
PublicKey key_a = getPublicKey();
|
||||
try {
|
||||
claims = Jwts.parserBuilder()
|
||||
.setSigningKey(key_a)
|
||||
.build()
|
||||
.parseClaimsJws(jwt_a);
|
||||
} catch (Exception e) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "JWT_token_verification_error"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
user.id = claims.getBody().get("user_id").toString();
|
||||
}
|
||||
|
||||
int errorCode=0;
|
||||
String errorMessage="";
|
||||
JSONObject doc=null;
|
||||
InputStream body;
|
||||
if(reqData!=null) {
|
||||
body = new ByteArrayInputStream(reqData);
|
||||
String text="";
|
||||
try {
|
||||
text = new String(body.readAllBytes(), StandardCharsets.UTF_8);
|
||||
} catch (IOException ex) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), ex.getMessage(), ex);
|
||||
}
|
||||
doc = new JSONObject(text);
|
||||
}
|
||||
|
||||
JSONArray array=new JSONArray(); //Resulting data set
|
||||
|
||||
String sql_query = """
|
||||
select
|
||||
fld.uid,
|
||||
fld.lat_center,
|
||||
fld.lon_center,
|
||||
ST_AsGeoJSON(fld.geom) as geom
|
||||
from
|
||||
main.frmlocusthealth flh
|
||||
join main.frmlocustdel fld on fld.uid=flh.frmlocustdel_uid
|
||||
where
|
||||
fld.del=false
|
||||
and (:country_id is null or (:country_id=-1 and fld.country_id in (7,3,4,2)) or (:country_id=-2 and fld.country_id in (7,1,5,6,8,9,10)) or :country_id=fld.country_id)
|
||||
order by fld.id desc;
|
||||
""";
|
||||
MapSqlParameterSource parameters = new MapSqlParameterSource();
|
||||
if(doc!=null) {
|
||||
if(doc.isNull("country_id")) { parameters.addValue("country_id", null, Types.INTEGER); }
|
||||
else { parameters.addValue("country_id", doc.getInt("country_id"), Types.INTEGER); }
|
||||
}
|
||||
List<String> ret = jdbcTemplate.query(sql_query, parameters, new DBTools.JsonRowMapper());
|
||||
List<Map<String,String>> data = new ArrayList<>();
|
||||
for (String s : ret) {
|
||||
JSONObject row = new JSONObject(s);
|
||||
array.put(row);
|
||||
}
|
||||
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",0);
|
||||
obj.put("error_message", "");
|
||||
obj.put("data",array);
|
||||
return ResponseEntity.ok(obj.toString());
|
||||
|
||||
} catch (CustomException e) {
|
||||
if(e.isSaveToLog()) {
|
||||
logger.error(MarkerFactory.getMarker(e.getErrorMarker()), e.getMessage());
|
||||
}
|
||||
return new ResponseEntity<>(e.getErrorResponseModel(), getHttpStatus(e.getHttpCode()));
|
||||
} catch (Exception e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage());
|
||||
return new ResponseEntity<>(new ErrorResponseModel(500, 10000, trt.trt(false, "Internal_Server_Error"), null, uuid), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/get_checkpoints", "/api/locust/v01/get_checkpoints"},method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public ResponseEntity<Object> getCheckpoints(
|
||||
@ModelAttribute User user,
|
||||
@RequestBody byte[] reqData,
|
||||
@CookieValue(value = "jwt_a", defaultValue = "") String jwt_a,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
) {
|
||||
|
||||
Translation trt = new Translation(language_id,jdbcTemplate);
|
||||
try{
|
||||
if(user.id==null || user.id.equals("null")) {
|
||||
if (jwt_a.equals("") || Tools.countOccurrences(jwt_a, '.') != 2) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "Please_log_in"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
Jws<Claims> claims = null;
|
||||
PublicKey key_a = getPublicKey();
|
||||
try {
|
||||
claims = Jwts.parserBuilder()
|
||||
.setSigningKey(key_a)
|
||||
.build()
|
||||
.parseClaimsJws(jwt_a);
|
||||
} catch (Exception e) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "JWT_token_verification_error"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
user.id = claims.getBody().get("user_id").toString();
|
||||
}
|
||||
|
||||
Connection conn = null;
|
||||
try {
|
||||
@ -670,13 +827,10 @@ public class Products implements ServletContextAware {
|
||||
if (conn != null) {
|
||||
logger.info("Connect is OK!");
|
||||
} else {
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
throw new CustomException(200, 10000, trt.trt(false, "An error occurred while connecting to the database!"), UUID.randomUUID().toString(),true);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
throw new CustomException(200, 10000, trt.trt(false, "An error occurred while connecting to the database!"), UUID.randomUUID().toString(),true);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -685,9 +839,7 @@ public class Products implements ServletContextAware {
|
||||
stt0.executeUpdate("SET TIME ZONE 'Asia/Almaty';");
|
||||
stt0.close();
|
||||
} catch (SQLException ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="Failed to execute SQL query!";
|
||||
throw new CustomException(200, 10000, trt.trt(false, "Failed to execute SQL query!"), UUID.randomUUID().toString(),true);
|
||||
}
|
||||
|
||||
JSONObject doc=null;
|
||||
@ -727,7 +879,8 @@ public class Products implements ServletContextAware {
|
||||
f.lon,
|
||||
f.radius,
|
||||
f.name,
|
||||
f.temperature
|
||||
f.temperature_soil,
|
||||
f.temperature_air
|
||||
from
|
||||
main.frmcheckpoints f
|
||||
left join main._users u on u.id=f.user_id
|
||||
@ -762,227 +915,192 @@ public class Products implements ServletContextAware {
|
||||
obj.put("lat", lat);
|
||||
obj.put("lon", lon);
|
||||
obj.put("radius", rs.getFloat("radius"));
|
||||
obj.put("temperature", rs.getFloat("temperature"));
|
||||
obj.put("temperature_soil", rs.getFloat("temperature_soil"));
|
||||
obj.put("temperature_air", rs.getFloat("temperature_air"));
|
||||
array.put(obj);
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException ex) {
|
||||
errorCode=4;
|
||||
errorMessage+="Internal server error, sampling.";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), ex.getMessage());
|
||||
throw new CustomException(200, 10000, trt.trt(false, "Internal_server_error"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
errorCode=5;
|
||||
errorMessage+="Internal server error, sampling. ";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), ex.getMessage());
|
||||
throw new CustomException(200, 10000, trt.trt(false, "Internal_server_error"), UUID.randomUUID().toString(),false);
|
||||
}finally {
|
||||
if(rs!=null) try{rs.close();}catch(SQLException ex){}
|
||||
if(stt!=null) try{stt.close();}catch(SQLException ex){}
|
||||
}
|
||||
|
||||
|
||||
if(errorCode!=0) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",errorCode);
|
||||
obj.put("error_message", errorMessage);
|
||||
return obj.toString();
|
||||
}else {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",0);
|
||||
obj.put("error_message", "");
|
||||
obj.put("data",array);
|
||||
return obj.toString();
|
||||
return ResponseEntity.ok(obj.toString());
|
||||
|
||||
} catch (CustomException e) {
|
||||
if(e.isSaveToLog()) {
|
||||
logger.error(MarkerFactory.getMarker(e.getErrorMarker()), e.getMessage());
|
||||
}
|
||||
return new ResponseEntity<>(e.getErrorResponseModel(), getHttpStatus(e.getHttpCode()));
|
||||
} catch (Exception e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage());
|
||||
return new ResponseEntity<>(new ErrorResponseModel(500, 10000, trt.trt(false, "Internal_Server_Error"), null, uuid), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
//Получить плотность личинок за последние 5 лет в заданном радиусе
|
||||
@RequestMapping(value = "/get_density_larval",method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@RequestMapping(value = {"/get_density_larval", "/api/locust/v01/get_density_larval"},method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public String getDensityLarval(@ModelAttribute User user,@RequestBody byte[] reqData,@RequestParam(required=false,name="id") Integer id,@RequestParam(required=false,name="lng") String language_id) {
|
||||
int errorCode=0;
|
||||
String errorMessage="";
|
||||
|
||||
Connection conn = null;
|
||||
public ResponseEntity<Object> getDensityLarval(
|
||||
@ModelAttribute User user,
|
||||
@RequestBody byte[] reqData,
|
||||
@RequestParam(required=false,name="id") Integer id,
|
||||
@CookieValue(value = "jwt_a", defaultValue = "") String jwt_a,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
) {
|
||||
Translation trt = new Translation(language_id,jdbcTemplate);
|
||||
try{
|
||||
if(user.id==null || user.id.equals("null")) {
|
||||
if (jwt_a.equals("") || Tools.countOccurrences(jwt_a, '.') != 2) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "Please_log_in"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
Jws<Claims> claims = null;
|
||||
PublicKey key_a = getPublicKey();
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
conn = DriverManager.getConnection(db_url, db_login, db_password);
|
||||
if (conn != null) {
|
||||
logger.info("Connect is OK!");
|
||||
} else {
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
claims = Jwts.parserBuilder()
|
||||
.setSigningKey(key_a)
|
||||
.build()
|
||||
.parseClaimsJws(jwt_a);
|
||||
} catch (Exception e) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "JWT_token_verification_error"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
user.id = claims.getBody().get("user_id").toString();
|
||||
}
|
||||
|
||||
try {
|
||||
Statement stt0 = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
stt0.executeUpdate("SET TIME ZONE 'UTC';"); //зачем коментил?
|
||||
//stt0.executeUpdate("SET TIME ZONE 'Asia/Almaty';"); //Зачем нужно вообще?
|
||||
stt0.close();
|
||||
} catch (SQLException ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="Failed to execute SQL query!";
|
||||
}
|
||||
|
||||
|
||||
JSONArray array=new JSONArray(); //Результирующий набор данных
|
||||
|
||||
String sql_query = "";
|
||||
Statement stt=null;
|
||||
ResultSet rs=null;
|
||||
try {
|
||||
stt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
sql_query = """
|
||||
select * from main.get_density_larval(${id});
|
||||
String sql_query = """
|
||||
select * from main.get_density_larval(:id);
|
||||
""";
|
||||
PreparedStatementNamed stmtn = new PreparedStatementNamed(conn, sql_query);
|
||||
stmtn.setInt("id",id);
|
||||
PreparedStatement stmt=stmtn.getPreparedStatement();
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
if (rs != null) {
|
||||
try {
|
||||
while(rs.next()) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("year", rs.getLong(1));
|
||||
obj.put("density", rs.getFloat(2));
|
||||
array.put(obj);
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException ex) {
|
||||
errorCode=1;
|
||||
errorMessage+="Internal server error";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
errorCode=1;
|
||||
errorMessage+="Internal server error";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
}finally {
|
||||
if(rs!=null) try{rs.close();}catch(SQLException ex){}
|
||||
if(stt!=null) try{stt.close();}catch(SQLException ex){}
|
||||
MapSqlParameterSource parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("id", id);
|
||||
List<String> ret = jdbcTemplate.query(sql_query, parameters, new DBTools.JsonRowMapper());
|
||||
List<Map<String,String>> data = new ArrayList<>();
|
||||
for (String s : ret) {
|
||||
JSONObject row = new JSONObject(s);
|
||||
array.put(row);
|
||||
}
|
||||
|
||||
if(errorCode!=0) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",errorCode);
|
||||
obj.put("error_message", errorMessage);
|
||||
return obj.toString();
|
||||
}else {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",0);
|
||||
obj.put("error_message", "test");
|
||||
obj.put("data",array);
|
||||
return obj.toString();
|
||||
}
|
||||
}
|
||||
|
||||
//Получить плотность имаго за последние 5 лет
|
||||
@RequestMapping(value = "/get_density_imago",method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public String getDensityImago(@ModelAttribute User user,@RequestParam(required=false,name="id") Integer id,@RequestParam(required=false,name="lng") String language_id) {
|
||||
int errorCode=0;
|
||||
String errorMessage="";
|
||||
|
||||
Connection conn = null;
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
conn = DriverManager.getConnection(db_url, db_login, db_password);
|
||||
if (conn != null) {
|
||||
logger.info("Connect is OK!");
|
||||
} else {
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="An error occurred while connecting to the database!";
|
||||
}
|
||||
|
||||
try {
|
||||
Statement stt0 = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
stt0.executeUpdate("SET TIME ZONE 'UTC';"); //зачем коментил?
|
||||
//stt0.executeUpdate("SET TIME ZONE 'Asia/Almaty';"); //Зачем нужно вообще?
|
||||
stt0.close();
|
||||
} catch (SQLException ex) {
|
||||
logger.info(ex.getMessage());
|
||||
errorCode=1;
|
||||
errorMessage+="Failed to execute SQL query!";
|
||||
}
|
||||
|
||||
|
||||
JSONArray array=new JSONArray(); //Результирующий набор данных
|
||||
|
||||
String sql_query = "";
|
||||
Statement stt=null;
|
||||
ResultSet rs=null;
|
||||
try {
|
||||
stt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
sql_query = """
|
||||
select * from main.get_density_imago(${id});
|
||||
""";
|
||||
PreparedStatementNamed stmtn = new PreparedStatementNamed(conn, sql_query);
|
||||
stmtn.setInt("id",id);
|
||||
PreparedStatement stmt=stmtn.getPreparedStatement();
|
||||
|
||||
rs = stmt.executeQuery();
|
||||
if (rs != null) {
|
||||
try {
|
||||
while(rs.next()) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("year", rs.getLong(1));
|
||||
obj.put("density", rs.getFloat(2));
|
||||
array.put(obj);
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException ex) {
|
||||
errorCode=1;
|
||||
errorMessage+="Internal server error";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
errorCode=1;
|
||||
errorMessage+="Internal server error";
|
||||
ex.printStackTrace();
|
||||
logger.info(ex.getMessage());
|
||||
}finally {
|
||||
if(rs!=null) try{rs.close();}catch(SQLException ex){}
|
||||
if(stt!=null) try{stt.close();}catch(SQLException ex){}
|
||||
}
|
||||
|
||||
|
||||
if(errorCode!=0) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",errorCode);
|
||||
obj.put("error_message", errorMessage);
|
||||
return obj.toString();
|
||||
}else {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",0);
|
||||
obj.put("error_message", "");
|
||||
obj.put("data",array);
|
||||
return obj.toString();
|
||||
return ResponseEntity.ok(obj.toString());
|
||||
|
||||
} catch (CustomException e) {
|
||||
if(e.isSaveToLog()) {
|
||||
logger.error(MarkerFactory.getMarker(e.getErrorMarker()), e.getMessage());
|
||||
}
|
||||
return new ResponseEntity<>(e.getErrorResponseModel(), getHttpStatus(e.getHttpCode()));
|
||||
} catch (Exception e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage());
|
||||
return new ResponseEntity<>(new ErrorResponseModel(500, 10000, trt.trt(false, "Internal_Server_Error"), null, uuid), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
//Получить плотность имаго за последние 5 лет
|
||||
@RequestMapping(
|
||||
value = {"/get_density_imago", "/api/locust/v01/get_density_imago"},
|
||||
method = {RequestMethod.POST, RequestMethod.GET},
|
||||
produces = "application/json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public ResponseEntity<Object> getDensityImago(
|
||||
@ModelAttribute User user,
|
||||
@RequestParam(required=false,name="id") Integer id,
|
||||
@CookieValue(value = "jwt_a", defaultValue = "") String jwt_a,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
) {
|
||||
Translation trt = new Translation(language_id,jdbcTemplate);
|
||||
try{
|
||||
if(user.id==null || user.id.equals("null")) {
|
||||
if (jwt_a.equals("") || Tools.countOccurrences(jwt_a, '.') != 2) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "Please_log_in"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
Jws<Claims> claims = null;
|
||||
PublicKey key_a = getPublicKey();
|
||||
try {
|
||||
claims = Jwts.parserBuilder()
|
||||
.setSigningKey(key_a)
|
||||
.build()
|
||||
.parseClaimsJws(jwt_a);
|
||||
} catch (Exception e) {
|
||||
throw new CustomException(401, 10401, trt.trt(false, "JWT_token_verification_error"), UUID.randomUUID().toString(),false);
|
||||
}
|
||||
user.id = claims.getBody().get("user_id").toString();
|
||||
}
|
||||
|
||||
JSONArray array=new JSONArray(); //Результирующий набор данных
|
||||
String sql_query = """
|
||||
select * from main.get_density_imago(:id);
|
||||
""";
|
||||
MapSqlParameterSource parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("id", id);
|
||||
List<String> ret = jdbcTemplate.query(sql_query, parameters, new DBTools.JsonRowMapper());
|
||||
List<Map<String,String>> data = new ArrayList<>();
|
||||
for (String s : ret) {
|
||||
JSONObject row = new JSONObject(s);
|
||||
array.put(row);
|
||||
}
|
||||
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("error_code",0);
|
||||
obj.put("error_message", "");
|
||||
obj.put("data",array);
|
||||
return ResponseEntity.ok(obj.toString());
|
||||
|
||||
} catch (CustomException e) {
|
||||
if(e.isSaveToLog()) {
|
||||
logger.error(MarkerFactory.getMarker(e.getErrorMarker()), e.getMessage());
|
||||
}
|
||||
return new ResponseEntity<>(e.getErrorResponseModel(), getHttpStatus(e.getHttpCode()));
|
||||
} catch (Exception e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage());
|
||||
return new ResponseEntity<>(new ErrorResponseModel(500, 10000, trt.trt(false, "Internal_Server_Error"), null, uuid), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
@Override
|
||||
public void setServletContext(ServletContext servletContext) {
|
||||
this.context=servletContext;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
public static HttpStatus getHttpStatus(int code) {
|
||||
try {
|
||||
return HttpStatus.valueOf(code);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
private PublicKey getPublicKey(){
|
||||
try {
|
||||
byte[] keyBytes = Base64.getDecoder().decode(key_a_txt);
|
||||
X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
PublicKey key = keyFactory.generatePublic(spec);
|
||||
return key;
|
||||
} catch (Exception e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileInputStream;
|
||||
@ -29,12 +31,7 @@ import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
@ -66,9 +63,30 @@ public class QGIS implements ServletContextAware {
|
||||
// return new User("none");
|
||||
//}
|
||||
|
||||
@RequestMapping(value = "/QGIS",method = RequestMethod.GET,produces = "application/octet-stream")
|
||||
//TEST https://127.0.0.1:8083/api/locust/v01/QGIS?name=SMAP&date=2025-05-30
|
||||
//TEST https://ccalm.org/api/locust/v01/QGIS?name=SMAP&day=150
|
||||
@RequestMapping(
|
||||
value = {"/QGIS", "/api/locust/v01/QGIS"},
|
||||
method = RequestMethod.GET,produces = "application/octet-stream")
|
||||
@ResponseBody
|
||||
public HttpEntity<byte[]> ajaxTamer(@ModelAttribute User user, @RequestParam(required=false,name="day") String day, @RequestParam(required=false,name="name") String name, @RequestParam(required=false,name="time") String time, @RequestParam(required=false,name="time_start") String time_start, @RequestParam(required=false,name="time_end") String time_end, @RequestParam(required=false,name="country_id") String country_id, @RequestParam(required=false,name="locust_type_id") String locust_type_id, @RequestParam(required=false,name="date_start") String date_start, @RequestParam(required=false,name="date_end") String date_end, @RequestParam(required=false,name="registered") String registered, @RequestParam(required=false,name="year") String year, @RequestParam(required=false,name="region_id") String region_id, @RequestParam(required=false,name="country_name") String country_name, @RequestParam(required=false,name="lng") String language_id, HttpServletResponse response)
|
||||
public HttpEntity<byte[]> ajaxTamer(
|
||||
@ModelAttribute User user,
|
||||
@RequestParam(required=false,name="day") String day,
|
||||
@RequestParam(required=false,name="date") String date,
|
||||
@RequestParam(required=false,name="name") String name,
|
||||
@RequestParam(required=false,name="time") String time,
|
||||
@RequestParam(required=false,name="time_start") String time_start,
|
||||
@RequestParam(required=false,name="time_end") String time_end,
|
||||
@RequestParam(required=false,name="country_id") String country_id,
|
||||
@RequestParam(required=false,name="locust_type_id") String locust_type_id,
|
||||
@RequestParam(required=false,name="date_start") String date_start,
|
||||
@RequestParam(required=false,name="date_end") String date_end,
|
||||
@RequestParam(required=false,name="registered") String registered,
|
||||
@RequestParam(required=false,name="year") String year,
|
||||
@RequestParam(required=false,name="region_id") String region_id,
|
||||
@RequestParam(required=false,name="country_name") String country_name,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id,
|
||||
HttpServletResponse response)
|
||||
{
|
||||
if(language_id!=null && !language_id.isEmpty()) user.language_id=language_id;
|
||||
logger.info("user.id="+user.id+" user.name="+user.name+" user.language_id="+user.language_id);
|
||||
@ -85,7 +103,6 @@ public class QGIS implements ServletContextAware {
|
||||
logger.info(ex.getMessage());
|
||||
}
|
||||
|
||||
|
||||
//Return content QGIS file.
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
@ -94,9 +111,77 @@ public class QGIS implements ServletContextAware {
|
||||
|
||||
String fileAsString="";
|
||||
//Pods (кубышки)
|
||||
if(name!=null && (name.equals("frmlocust_pods_density") || name.equals("frmlocust_hoppers_density") || name.equals("frmlocust_bands") || name.equals("frmlocust_adults_density") || name.equals("frmlocust_swarms")))
|
||||
//TODO NEW format
|
||||
if(name!=null && (name.equals("frmlocust_pods_density")))
|
||||
{
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/" + name + ".qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/" + name + ".qgs");
|
||||
|
||||
//String country_id=request.getParameter("country_id");
|
||||
//String locust_type_id=request.getParameter("locust_type_id");
|
||||
//String date_start=request.getParameter("date_start");
|
||||
//String date_end=request.getParameter("date_end");
|
||||
//String registered=request.getParameter("registered");
|
||||
|
||||
//Make SQL
|
||||
String sql = "mode=1";
|
||||
String sql2 = "mode=1";
|
||||
if(country_id!=null && !country_id.isEmpty())
|
||||
{
|
||||
if(country_id.equals("-1"))
|
||||
{
|
||||
//sql+=" and country_id in (7,3,4,2)"; TODO
|
||||
//sql2+=" and country_id in (7,3,4,2)"; TODO
|
||||
}else if(country_id.equals("-2"))
|
||||
{
|
||||
//sql+=" and country_id in (7,1,5,6,8,9,10)"; TODO
|
||||
//sql2+=" and country_id in (7,1,5,6,8,9,10)"; TODO
|
||||
}else
|
||||
{
|
||||
sql+="&country_id="+country_id;
|
||||
sql2+="&country_id="+country_id;
|
||||
}
|
||||
}
|
||||
if(region_id!=null && !region_id.isEmpty())
|
||||
{
|
||||
sql+="&region_id="+region_id;
|
||||
}
|
||||
if(locust_type_id!=null && !locust_type_id.isEmpty())
|
||||
{
|
||||
sql+="&locust_type_id="+locust_type_id;
|
||||
}
|
||||
if(date_start!=null && !date_start.isEmpty())
|
||||
{
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime localDateTime = LocalDateTime.parse(date_start, formatter);
|
||||
long epochSeconds = localDateTime.toEpochSecond(ZoneOffset.UTC);
|
||||
sql+="&date_start="+epochSeconds;
|
||||
}
|
||||
if(date_end!=null && !date_end.isEmpty())
|
||||
{
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime localDateTime = LocalDateTime.parse(date_end, formatter);
|
||||
long epochSeconds = localDateTime.toEpochSecond(ZoneOffset.UTC);
|
||||
sql+="&date_end="+epochSeconds;
|
||||
}
|
||||
|
||||
if(registered!=null && registered.equals("1"))
|
||||
{
|
||||
sql+="&registered=true";
|
||||
}else
|
||||
if(registered!=null && registered.equals("0"))
|
||||
{
|
||||
sql+="&registered=false";
|
||||
}
|
||||
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{params\\}",sql);
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{params2\\}",sql2);
|
||||
|
||||
}
|
||||
//TODO OLD format
|
||||
if(name!=null && (name.equals("frmlocust_hoppers_density") || name.equals("frmlocust_bands") || name.equals("frmlocust_adults_density") || name.equals("frmlocust_swarms")))
|
||||
{
|
||||
fileAsString = fileToString("static/resources/QGIS/" + name + ".qgs");
|
||||
|
||||
//String country_id=request.getParameter("country_id");
|
||||
//String locust_type_id=request.getParameter("locust_type_id");
|
||||
@ -154,7 +239,7 @@ public class QGIS implements ServletContextAware {
|
||||
|
||||
if(name!=null && name.equals("frmlocustdel"))
|
||||
{
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/" + name + ".qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/" + name + ".qgs");
|
||||
|
||||
//String country_id=request.getParameter("country_id");
|
||||
//String date_start=request.getParameter("date_start");
|
||||
@ -231,7 +316,7 @@ public class QGIS implements ServletContextAware {
|
||||
sql+=" and locust_type_id="+locust_type_id;
|
||||
}
|
||||
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/" + name + ".qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/" + name + ".qgs");
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{year\\}",year);
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
|
||||
@ -254,7 +339,7 @@ public class QGIS implements ServletContextAware {
|
||||
sql+=" and locust_type_id="+locust_type_id;
|
||||
}
|
||||
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/" + name + ".qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/" + name + ".qgs");
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{year\\}",year);
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
|
||||
@ -277,7 +362,7 @@ public class QGIS implements ServletContextAware {
|
||||
}
|
||||
}
|
||||
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/" + name + ".qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/" + name + ".qgs");
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{country\\}",country_name);
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
|
||||
@ -301,7 +386,7 @@ public class QGIS implements ServletContextAware {
|
||||
}
|
||||
}
|
||||
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/" + name + ".qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/" + name + ".qgs");
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{country\\}",country_name);
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
|
||||
@ -325,7 +410,7 @@ public class QGIS implements ServletContextAware {
|
||||
}
|
||||
}
|
||||
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/" + name + ".qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/" + name + ".qgs");
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{country\\}",country_name);
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
|
||||
@ -349,7 +434,7 @@ public class QGIS implements ServletContextAware {
|
||||
}
|
||||
}
|
||||
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/" + name + ".qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/" + name + ".qgs");
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{country\\}",country_name);
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
|
||||
@ -358,7 +443,7 @@ public class QGIS implements ServletContextAware {
|
||||
}
|
||||
if(name!=null && name.equals("NDVI"))
|
||||
{
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/NDVI.qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/NDVI.qgs");
|
||||
if(day!=null && day.length()>0)
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{day\\}",day+"_");
|
||||
else
|
||||
@ -366,7 +451,7 @@ public class QGIS implements ServletContextAware {
|
||||
}
|
||||
if(name!=null && name.equals("NDWI"))
|
||||
{
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/NDWI.qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/NDWI.qgs");
|
||||
if(day!=null && day.length()>0)
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{day\\}",day+"_");
|
||||
else
|
||||
@ -374,7 +459,7 @@ public class QGIS implements ServletContextAware {
|
||||
}
|
||||
if(name!=null && name.equals("IVI"))
|
||||
{
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/IVI.qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/IVI.qgs");
|
||||
if(year!=null && year.length()>0)
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{year\\}",year+"_");
|
||||
else
|
||||
@ -382,7 +467,7 @@ public class QGIS implements ServletContextAware {
|
||||
}
|
||||
if(name!=null && name.equals("NDWI_CMP"))
|
||||
{
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/NDWI_CMP.qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/NDWI_CMP.qgs");
|
||||
if(day!=null && day.length()>0)
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{day\\}",day+"_");
|
||||
else
|
||||
@ -390,19 +475,19 @@ public class QGIS implements ServletContextAware {
|
||||
}
|
||||
if(name!=null && name.equals("NDSI"))
|
||||
{
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/NDSI.qgs"));
|
||||
fileAsString = fileToString("static/resources/QGIS/NDSI.qgs");
|
||||
if(day!=null && day.length()>0)
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{day\\}",day+"_");
|
||||
else
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{day\\}","");
|
||||
}
|
||||
if(name!=null && name.equals("SMAP"))
|
||||
if(name!=null && name.equals("SMAP")) //https://127.0.0.1:8083/api/locust/v01/QGIS?name=SMAP&date=2025-05-30
|
||||
{
|
||||
fileAsString = fileToString(context.getRealPath("/resources/QGIS/SMAP.qgs"));
|
||||
if(day!=null && day.length()>0)
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{day\\}",day+"_");
|
||||
fileAsString = fileToString("static/resources/QGIS/SMAP.qgs");
|
||||
if(date!=null && !date.isEmpty())
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{date\\}",date);
|
||||
else
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{day\\}","");
|
||||
fileAsString = fileAsString.replaceAll("\\$\\{date\\}","");
|
||||
}
|
||||
|
||||
//Send data
|
||||
@ -415,27 +500,42 @@ public class QGIS implements ServletContextAware {
|
||||
this.context=servletContext;
|
||||
}
|
||||
|
||||
public String fileToString(String fName)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
try
|
||||
{
|
||||
InputStream is = new FileInputStream(fName);
|
||||
BufferedReader buf = new BufferedReader(new InputStreamReader(is));
|
||||
String line = buf.readLine();
|
||||
while(line != null)
|
||||
{
|
||||
|
||||
public String fileToString(String fName) {
|
||||
StringBuilder sb = new StringBuilder(1024);
|
||||
|
||||
// 1. Сначала пробуем как внешний файл
|
||||
try (InputStream is = new FileInputStream(fName);
|
||||
BufferedReader buf = new BufferedReader(new InputStreamReader(is))) {
|
||||
|
||||
String line;
|
||||
while ((line = buf.readLine()) != null) {
|
||||
sb.append(line).append("\n");
|
||||
line = buf.readLine();
|
||||
}
|
||||
buf.close();
|
||||
}
|
||||
catch (Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("Не найден внешний файл, пробую искать в ресурсах: " + fName);
|
||||
}
|
||||
|
||||
// 2. Если файла нет, пробуем как ресурс из classpath
|
||||
try (InputStream is = new ClassPathResource(fName).getInputStream();
|
||||
BufferedReader buf = new BufferedReader(new InputStreamReader(is))) {
|
||||
|
||||
String line;
|
||||
while ((line = buf.readLine()) != null) {
|
||||
sb.append(line).append("\n");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("Ошибка при чтении из ресурсов: " + e.getMessage());
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String trt(Connection conn,String key,User user)
|
||||
{
|
||||
String result="";
|
||||
|
||||
@ -67,7 +67,7 @@ public class SendMail implements ServletContextAware {
|
||||
// return new User("none");
|
||||
//}
|
||||
|
||||
@RequestMapping(value = "/SendMail",method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@RequestMapping(value = {"/SendMail", "/api/locust/v01/SendMail"},method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public Object send(@ModelAttribute User user,@RequestParam(required=false,name="lng") String language_id) {
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package org.ccalm.main;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MarkerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.*;
|
||||
@ -47,7 +48,7 @@ public class SendWarning {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
public JSONObject getSoilTemperature(double lat,double lon){
|
||||
public JSONObject getAirTemperature(double lat,double lon){
|
||||
JSONObject result=null;
|
||||
// Формируем JSON-запрос
|
||||
Map<String, Object> request = new HashMap<>();
|
||||
@ -71,14 +72,46 @@ public class SendWarning {
|
||||
result.put("value", value);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Exception ex) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(uuid,e);
|
||||
logger.error(MarkerFactory.getMarker(uuid),ex.getMessage(), ex);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/api/main/v01/SendWarning",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
|
||||
public JSONObject getSoilTemperature(double lat,double lon){
|
||||
JSONObject result=null;
|
||||
// Формируем JSON-запрос
|
||||
Map<String, Object> request = new HashMap<>();
|
||||
request.put("date", null); //NULL to select the latest date available in the database
|
||||
request.put("hours", 0);
|
||||
request.put("lon", lon);
|
||||
request.put("lat", lat);
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
HttpEntity<Map<String, Object>> entity = new HttpEntity<>(request, headers);
|
||||
String url = "https://geoserver2.ccalm.org/geodatalist/getSoilTemperature";
|
||||
try {
|
||||
ResponseEntity<Map> response = restTemplate.exchange(url, HttpMethod.POST, entity, Map.class);
|
||||
if (response.getStatusCode() == HttpStatus.OK && response.getBody() != null) {
|
||||
Object date = response.getBody().get("date");
|
||||
Object value = response.getBody().get("value");
|
||||
if (value != null && date != null) {
|
||||
result = new JSONObject();
|
||||
result.put("date", date);
|
||||
result.put("value", value);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//https://ccalm.org/api/locust/v01/SendWarning
|
||||
@RequestMapping(value = {"/api/locust/v01/SendWarning"},method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public ResponseEntity<Object> send() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
@ -88,41 +121,46 @@ public class SendWarning {
|
||||
String sql = """
|
||||
select
|
||||
t.uid,
|
||||
t.name,
|
||||
t.user_uid,
|
||||
t.lat,
|
||||
t.lon,
|
||||
t.temperature as value,
|
||||
u.email,
|
||||
l.short_name
|
||||
l.short_name,
|
||||
t.temperature_air,
|
||||
t.warn_air,
|
||||
t.temperature_soil,
|
||||
t.warn_soil
|
||||
from
|
||||
main.frmcheckpoints t
|
||||
join main._users u on u.uid=t.user_uid
|
||||
join main._languages l on l.uid=u.language_uid
|
||||
where
|
||||
t.del=false
|
||||
and t.warn=true
|
||||
and (t.warn_soil=true or t.warn_air=true)
|
||||
""";
|
||||
MapSqlParameterSource parameters = new MapSqlParameterSource();
|
||||
//parameters.addValue("language_id", language_id, Types.INTEGER);
|
||||
List<String> ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
|
||||
for (String jsonString : ret) {
|
||||
JSONObject obj = new JSONObject(jsonString);
|
||||
JSONObject tmp = getSoilTemperature(obj.getDouble("lat"),obj.getDouble("lon"));
|
||||
if(tmp!=null) {
|
||||
Translation trt=new Translation(obj.getString("short_name"),jdbcTemplate);
|
||||
double value = obj.getDouble("value");
|
||||
if (value < tmp.getDouble("value")) {
|
||||
String email = obj.getString("email");
|
||||
if(email.equals("irigm@mail.ru") || email.equals("ivanov.i@istt.kz")){ //TODO для тестирования потом удалить
|
||||
|
||||
StringBuilder html = new StringBuilder();
|
||||
JSONObject tmp_air = getAirTemperature(obj.getDouble("lat"),obj.getDouble("lon"));
|
||||
JSONObject tmp_soil = getSoilTemperature(obj.getDouble("lat"),obj.getDouble("lon"));
|
||||
|
||||
if(tmp_air!=null && obj.getBoolean("warn_air") && !obj.isNull("temperature_air")) {
|
||||
Translation trt=new Translation(obj.getString("short_name"),jdbcTemplate);
|
||||
double value = obj.getDouble("temperature_air");
|
||||
if (value < tmp_air.getDouble("value")) {
|
||||
String email = obj.getString("email");
|
||||
StringBuilder html = new StringBuilder(1024);
|
||||
html.append("<html>")
|
||||
.append("<head>")
|
||||
.append("<style>")
|
||||
.append("body { font-family: Arial, sans-serif; background-color: #f4f4f4; color: #333; margin: 0; padding: 0; }")
|
||||
.append(".container { max-width: 600px; margin: 0 auto; padding: 20px; background-color: #fff; border: 1px solid #ddd; position: relative; }")
|
||||
.append(".container { max-width: 600px; margin: 20px auto 0 auto; padding: 20px; background-color: #fff; border: 1px solid #ddd; position: relative; }")
|
||||
.append(".logo { position: absolute; top: 10px; right: 10px; width: 100px; height: auto; }")
|
||||
.append("h2 { color: #d9534f; margin-top: 50px; }") // Отступ для логотипа
|
||||
.append("h2 { color: #d9534f; }")
|
||||
.append("table { border-collapse: collapse; width: 100%; margin: 20px 0; }")
|
||||
.append("th, td { padding: 10px; border: 1px solid #ddd; text-align: left; }")
|
||||
.append("th { background-color: #f9f9f9; }")
|
||||
@ -131,21 +169,22 @@ public class SendWarning {
|
||||
.append("</head>")
|
||||
.append("<body>")
|
||||
.append("<div class='container'>")
|
||||
.append("<img src='https://ccalm.org/resources/images/locust.png' alt='Logo' class='logo'>") // Логотип
|
||||
.append("<h2>").append(trt.trt("Warning")).append("</h2>")
|
||||
.append("<p>").append(trt.trt("The_soil_temperature_has_exceeded_the_set_value")).append(": ").append(value).append("</p>")
|
||||
.append("<h2>").append(trt.trt(true,"Warning")).append("</h2>")
|
||||
.append("<p>").append(trt.trt(true,"The_air_temperature_has_exceeded_the_set_value")).append(": ").append(value).append("</p>")
|
||||
.append("<table>")
|
||||
.append("<tr><th>").append(trt.trt("Date")).append("</th><td>").append(tmp.getString("date")).append("</td></tr>")
|
||||
.append("<tr><th>").append(trt.trt("Value")).append("</th><td>").append(tmp.getDouble("value")).append(" °C</td></tr>")
|
||||
.append("<tr><th>").append(trt.trt(true,"Name")).append("</th><td>").append(obj.getString("name")).append("</td></tr>")
|
||||
.append("<tr><th>").append(trt.trt(true,"Date")).append("</th><td>").append(tmp_air.getString("date")).append("</td></tr>")
|
||||
.append("<tr><th>").append(trt.trt(true,"Value")).append("</th><td>").append(tmp_air.getDouble("value")).append(" °C</td></tr>")
|
||||
.append("<tr><th>").append(trt.trt(true,"Location")).append("</th><td><a href='https://www.google.com/maps?q=").append(obj.getDouble("lat")).append(",").append(obj.getDouble("lon")).append("' target='_blank'>").append(obj.getDouble("lat")).append(", ").append(obj.getDouble("lon")).append("</a></td></tr>")
|
||||
.append("</table>")
|
||||
.append(trt.trt("To_resume_monitoring_please_set_the_warn_field_to_true"))
|
||||
.append(trt.trt(true,"To_resume_monitoring_please_set_the_warn_field_to_true"))
|
||||
.append("</div>") // Закрываем контейнер
|
||||
.append("</body>")
|
||||
.append("</html>");
|
||||
|
||||
boolean send = false;
|
||||
try {
|
||||
EmailUtility.sendEmail(mail_host, mail_port, mail_login, mail_password, email, trt.trt("Soil temperature"), html.toString());
|
||||
EmailUtility.sendEmail(mail_host, mail_port, mail_login, mail_password, email, trt.trt(true,"Air temperature"), html.toString());
|
||||
send = true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -155,22 +194,85 @@ public class SendWarning {
|
||||
update
|
||||
main.frmcheckpoints
|
||||
set
|
||||
warn=true
|
||||
where uid=:uid
|
||||
warn_air=false
|
||||
where
|
||||
uid=CAST(:uid AS uuid)
|
||||
and (warn_hold!=true or warn_hold is null)
|
||||
""";
|
||||
MapSqlParameterSource param = new MapSqlParameterSource();
|
||||
param.addValue("uid", obj.getString("uid"), Types.INTEGER);
|
||||
param.addValue("uid", obj.getString("uid"), Types.VARCHAR);
|
||||
int rowsUpdated = jdbcTemplate.update(sql, param);
|
||||
System.out.println("rowsUpdated = "+String.valueOf(rowsUpdated));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(tmp_soil!=null && obj.getBoolean("warn_soil") && !obj.isNull("temperature_soil")) {
|
||||
Translation trt=new Translation(obj.getString("short_name"),jdbcTemplate);
|
||||
double value = obj.getDouble("temperature_soil");
|
||||
if (value < tmp_soil.getDouble("value")) {
|
||||
String email = obj.getString("email");
|
||||
StringBuilder html = new StringBuilder(1024);
|
||||
html.append("<html>")
|
||||
.append("<head>")
|
||||
.append("<style>")
|
||||
.append("body { font-family: Arial, sans-serif; background-color: #f4f4f4; color: #333; margin: 0; padding: 0; }")
|
||||
.append(".container { max-width: 600px; margin: 20px auto 0 auto; padding: 20px; background-color: #fff; border: 1px solid #ddd; position: relative; }")
|
||||
.append(".logo { position: absolute; top: 10px; right: 10px; width: 100px; height: auto; }")
|
||||
.append("h2 { color: #d9534f; }")
|
||||
.append("table { border-collapse: collapse; width: 100%; margin: 20px 0; }")
|
||||
.append("th, td { padding: 10px; border: 1px solid #ddd; text-align: left; }")
|
||||
.append("th { background-color: #f9f9f9; }")
|
||||
.append("p { font-weight: bold; }")
|
||||
.append("</style>")
|
||||
.append("</head>")
|
||||
.append("<body>")
|
||||
.append("<div class='container'>")
|
||||
.append("<h2>").append(trt.trt(true,"Warning")).append("</h2>")
|
||||
.append("<p>").append(trt.trt(true,"The_soil_temperature_has_exceeded_the_set_value")).append(": ").append(value).append("</p>")
|
||||
.append("<table>")
|
||||
.append("<tr><th>").append(trt.trt(true,"Name")).append("</th><td>").append(obj.getString("name")).append("</td></tr>")
|
||||
.append("<tr><th>").append(trt.trt(true,"Date")).append("</th><td>").append(tmp_soil.getString("date")).append("</td></tr>")
|
||||
.append("<tr><th>").append(trt.trt(true,"Value")).append("</th><td>").append(tmp_soil.getDouble("value")).append(" °C</td></tr>")
|
||||
.append("<tr><th>").append(trt.trt(true,"Location")).append("</th><td><a href='https://www.google.com/maps?q=").append(obj.getDouble("lat")).append(",").append(obj.getDouble("lon")).append("' target='_blank'>").append(obj.getDouble("lat")).append(", ").append(obj.getDouble("lon")).append("</a></td></tr>")
|
||||
.append("</table>")
|
||||
.append(trt.trt(true,"To_resume_monitoring_please_set_the_warn_field_to_true"))
|
||||
.append("</div>") // Закрываем контейнер
|
||||
.append("</body>")
|
||||
.append("</html>");
|
||||
|
||||
boolean send = false;
|
||||
try {
|
||||
EmailUtility.sendEmail(mail_host, mail_port, mail_login, mail_password, email, trt.trt(true,"Soil temperature"), html.toString());
|
||||
send = true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(send) {
|
||||
sql= """
|
||||
update
|
||||
main.frmcheckpoints
|
||||
set
|
||||
warn_soil=false
|
||||
where
|
||||
uid=CAST(:uid AS uuid)
|
||||
and (warn_hold!=true or warn_hold is null)
|
||||
""";
|
||||
MapSqlParameterSource param = new MapSqlParameterSource();
|
||||
param.addValue("uid", obj.getString("uid"), Types.VARCHAR);
|
||||
int rowsUpdated = jdbcTemplate.update(sql, param);
|
||||
System.out.println("rowsUpdated = "+String.valueOf(rowsUpdated));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Exception ex) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(uuid,e);
|
||||
logger.error(MarkerFactory.getMarker(uuid),ex.getMessage(), ex);
|
||||
result.put("error_code", 10000);
|
||||
}
|
||||
return new ResponseEntity<>(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ public class SessionController {
|
||||
// return new User("none");
|
||||
//}
|
||||
|
||||
@RequestMapping(value = "/session", method = {RequestMethod.GET, RequestMethod.POST },produces = "application/json; charset=utf-8")
|
||||
@RequestMapping(value = {"/session", "/api/locust/v01/session"}, method = {RequestMethod.GET, RequestMethod.POST },produces = "application/json; charset=utf-8")
|
||||
@ResponseBody
|
||||
public Object ajaxTest(@ModelAttribute User user) {
|
||||
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
import ch.qos.logback.classic.pattern.ThrowableProxyConverter;
|
||||
import ch.qos.logback.classic.spi.IThrowableProxy;
|
||||
import ch.qos.logback.classic.spi.ThrowableProxyUtil;
|
||||
|
||||
public class SingleLineThrowableProxyConverter extends ThrowableProxyConverter {
|
||||
@Override
|
||||
protected String throwableProxyToString(IThrowableProxy tp) {
|
||||
if (tp == null) return "";
|
||||
String stackTrace = ThrowableProxyUtil.asString(tp);
|
||||
return stackTrace.replace("\r", "").replace("\n", "\\n").replace("\t", " ");
|
||||
}
|
||||
}
|
||||
23
src/main/java/org/ccalm/main/SpringContext.java
Normal file
@ -0,0 +1,23 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class SpringContext implements ApplicationContextAware {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SpringContext.class);
|
||||
private static ApplicationContext context;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) {
|
||||
context = applicationContext;
|
||||
logger.warn("App is start");
|
||||
}
|
||||
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return context;
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,7 @@ public class TestFiles implements ServletContextAware {
|
||||
|
||||
private ServletContext context;
|
||||
|
||||
@RequestMapping(value = "/TestFiles",method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@RequestMapping(value = {"/TestFiles", "/api/locust/v01/TestFiles"},method = RequestMethod.GET,produces = "text/html;charset=UTF-8")
|
||||
@ResponseBody
|
||||
public Object ajaxTamer()
|
||||
{
|
||||
|
||||
@ -42,7 +42,7 @@ public class TranslationController implements ServletContextAware {
|
||||
/**
|
||||
* Simply selects the home view to render by returning its name.
|
||||
*/
|
||||
@RequestMapping(value = "/translation", method = RequestMethod.GET)
|
||||
@RequestMapping(value = {"/translation", "/api/locust/v01/translation"}, method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public String home(
|
||||
Model model,
|
||||
@ -89,14 +89,13 @@ public class TranslationController implements ServletContextAware {
|
||||
}
|
||||
|
||||
/**
|
||||
* Функция для получения переводов в формате JSON.
|
||||
* Function for get translation in JSON format
|
||||
*/
|
||||
@GetMapping(value = "/api/translation", produces = "application/json")
|
||||
@GetMapping(value = {"/api/translation", "/api/locust/v01/translation"}, produces = "application/json")
|
||||
@ResponseBody
|
||||
public Map<String, String> getTranslations(
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
) {
|
||||
|
||||
Map<String, String> translations = new HashMap<>();
|
||||
|
||||
try {
|
||||
|
||||
432
src/main/java/org/ccalm/main/UpdateLocust.java
Normal file
@ -0,0 +1,432 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
import org.ccalm.main.models.FrmLocustModel;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MarkerFactory;
|
||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import tools.DBTools;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class UpdateLocust {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UpdateLocust.class);
|
||||
|
||||
private final NamedParameterJdbcTemplate jdbcTemplate;
|
||||
|
||||
UpdateLocust(NamedParameterJdbcTemplate jdbcTemplate){
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
//Update or insert locust survey form
|
||||
public boolean update(FrmLocustModel locust){
|
||||
|
||||
String sql;
|
||||
boolean exists=false; //Is there a record.
|
||||
MapSqlParameterSource parameters;
|
||||
|
||||
//Если данные пришли из внешнего источника то выбираю uid по eid
|
||||
if(locust.eid!=null && locust.uid==null) {
|
||||
|
||||
int year = locust.date.toLocalDateTime().getYear();
|
||||
|
||||
sql = """
|
||||
select uid from main.frmlocust where eid=:eid and company_uid=CAST(:company_uid AS uuid) and EXTRACT(YEAR FROM date)=:year
|
||||
""";
|
||||
parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("eid", locust.eid, Types.BIGINT);
|
||||
parameters.addValue("company_uid", locust.company_uid, Types.VARCHAR);
|
||||
parameters.addValue("year", year, Types.INTEGER);
|
||||
List<String> ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
|
||||
for (String s : ret) {
|
||||
JSONObject obj = new JSONObject(s);
|
||||
if(!obj.isNull("uid")) {
|
||||
locust.uid = obj.getString("uid");
|
||||
exists=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Check exist record by uid
|
||||
sql= """
|
||||
select uid from main.frmlocust where uid=CAST(:uid AS uuid);
|
||||
""";
|
||||
parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("uid", locust.uid, Types.VARCHAR);
|
||||
List<String> ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
|
||||
for (String s : ret) {
|
||||
exists=true;
|
||||
}
|
||||
|
||||
if(exists)
|
||||
{
|
||||
sql= """
|
||||
update main.frmlocust set
|
||||
eid=:eid,
|
||||
changed = false,
|
||||
company_uid=CAST(:company_uid AS uuid),
|
||||
user_id=:user_id,
|
||||
device_id=:device_id,
|
||||
image_name1=:image_name1,
|
||||
image_name2=:image_name2,
|
||||
image_name3=:image_name3,
|
||||
country_id=:country_id,
|
||||
region_id=:region_id,
|
||||
area=:area,
|
||||
district=:district,
|
||||
village=:village,
|
||||
terrain=:terrain,
|
||||
observer=:observer,
|
||||
date=:date,
|
||||
timezone=CAST(:timezone AS interval),
|
||||
lat_center=:lat_center,
|
||||
lon_center=:lon_center,
|
||||
bio_hectare=:bio_hectare,
|
||||
bio_biotope_id=:bio_biotope_id,
|
||||
bio_greenery_id=:bio_greenery_id,
|
||||
bio_greenery_cover_id=:bio_greenery_cover_id,
|
||||
bio_temperature=:bio_temperature,
|
||||
bio_wind=:bio_wind,
|
||||
locust_have=:locust_have,
|
||||
locust_type_id=:locust_type_id,
|
||||
locust_populated=:locust_populated,
|
||||
eggs_capsules_area=:eggs_capsules_area,
|
||||
eggs_capsules_density=:eggs_capsules_density,
|
||||
eggs_capsules_density_to=:eggs_capsules_density_to,
|
||||
eggs_capsules=:eggs_capsules,
|
||||
eggs_live=:eggs_live,
|
||||
eggs_enemies_id=:eggs_enemies_id,
|
||||
larva_born_id=:larva_born_id,
|
||||
larva_age_id=:larva_age_id,
|
||||
larva_painting_id=:larva_painting_id,
|
||||
larva_behavior_id=:larva_behavior_id,
|
||||
larva_density=:larva_density,
|
||||
larva_density_to=:larva_density_to,
|
||||
kuliguli_age_id=:kuliguli_age_id,
|
||||
kuliguli_density=:kuliguli_density,
|
||||
kuliguli_density_to=:kuliguli_density_to,
|
||||
kuliguli_size=:kuliguli_size,
|
||||
kuliguli_count=:kuliguli_count,
|
||||
kuliguli_action_id=:kuliguli_action_id,
|
||||
imago_wing_id=:imago_wing_id,
|
||||
imago_maturity=:imago_maturity,
|
||||
imago_phase_id=:imago_phase_id,
|
||||
imago_action_id=:imago_action_id,
|
||||
imago_density=:imago_density,
|
||||
imago_density_ga=:imago_density_ga,
|
||||
imago_feeding=:imago_feeding,
|
||||
imago_copulation=:imago_copulation,
|
||||
imago_laying=:imago_laying,
|
||||
imago_flying=:imago_flying,
|
||||
swarm_maturity=:swarm_maturity,
|
||||
swarm_density_id=:swarm_density_id,
|
||||
swarm_density_uid=main.strtouuid(:swarm_density_uid),
|
||||
swarm_size=:swarm_size,
|
||||
swarm_count=:swarm_count,
|
||||
swarm_copulation=:swarm_copulation,
|
||||
swarm_laying=:swarm_laying,
|
||||
swarm_flying_direction_id=:swarm_flying_direction_id,
|
||||
swarm_height_id=:swarm_height_id,
|
||||
description=:description,
|
||||
geom=ST_SetSRID(ST_GeomFromGeoJSON(:geom),4326),
|
||||
test=:test
|
||||
where uid=main.strtouuid(:uid)
|
||||
""";
|
||||
}else{
|
||||
sql="""
|
||||
insert into main.frmlocust(
|
||||
eid,
|
||||
changed,
|
||||
company_uid,
|
||||
user_id,
|
||||
device_id,
|
||||
image_name1,
|
||||
image_name2,
|
||||
image_name3,
|
||||
country_id,
|
||||
region_id,
|
||||
area,
|
||||
district,
|
||||
village,
|
||||
terrain,
|
||||
observer,
|
||||
date,
|
||||
timezone,
|
||||
lat_center,
|
||||
lon_center,
|
||||
bio_hectare,
|
||||
bio_biotope_id,
|
||||
bio_greenery_id,
|
||||
bio_greenery_cover_id,
|
||||
bio_temperature,
|
||||
bio_wind,
|
||||
locust_have,
|
||||
locust_type_id,
|
||||
locust_populated,
|
||||
eggs_capsules_area,
|
||||
eggs_capsules_density,
|
||||
eggs_capsules_density_to,
|
||||
eggs_capsules,
|
||||
eggs_live,
|
||||
eggs_enemies_id,
|
||||
larva_born_id,
|
||||
larva_age_id,
|
||||
larva_painting_id,
|
||||
larva_behavior_id,
|
||||
larva_density,
|
||||
larva_density_to,
|
||||
kuliguli_age_id,
|
||||
kuliguli_density,
|
||||
kuliguli_density_to,
|
||||
kuliguli_size,
|
||||
kuliguli_count,
|
||||
kuliguli_action_id,
|
||||
imago_wing_id,
|
||||
imago_maturity,
|
||||
imago_phase_id,
|
||||
imago_action_id,
|
||||
imago_density,
|
||||
imago_density_ga,
|
||||
imago_feeding,
|
||||
imago_copulation,
|
||||
imago_laying,
|
||||
imago_flying,
|
||||
swarm_maturity,
|
||||
swarm_density_id,
|
||||
swarm_density_uid,
|
||||
swarm_size,
|
||||
swarm_count,
|
||||
swarm_copulation,
|
||||
swarm_laying,
|
||||
swarm_flying_direction_id,
|
||||
swarm_height_id,
|
||||
description,
|
||||
geom,
|
||||
test,
|
||||
uid
|
||||
)values(
|
||||
:eid,
|
||||
false,
|
||||
CAST(:company_uid AS uuid),
|
||||
:user_id,
|
||||
:device_id,
|
||||
:image_name1,
|
||||
:image_name2,
|
||||
:image_name3,
|
||||
:country_id,
|
||||
:region_id,
|
||||
:area,
|
||||
:district,
|
||||
:village,
|
||||
:terrain,
|
||||
:observer,
|
||||
:date,
|
||||
CAST(:timezone AS interval),
|
||||
:lat_center,
|
||||
:lon_center,
|
||||
:bio_hectare,
|
||||
:bio_biotope_id,
|
||||
:bio_greenery_id,
|
||||
:bio_greenery_cover_id,
|
||||
:bio_temperature,
|
||||
:bio_wind,
|
||||
:locust_have,
|
||||
:locust_type_id,
|
||||
:locust_populated,
|
||||
:eggs_capsules_area,
|
||||
:eggs_capsules_density,
|
||||
:eggs_capsules_density_to,
|
||||
:eggs_capsules,
|
||||
:eggs_live,
|
||||
:eggs_enemies_id,
|
||||
:larva_born_id,
|
||||
:larva_age_id,
|
||||
:larva_painting_id,
|
||||
:larva_behavior_id,
|
||||
:larva_density,
|
||||
:larva_density_to,
|
||||
:kuliguli_age_id,
|
||||
:kuliguli_density,
|
||||
:kuliguli_density_to,
|
||||
:kuliguli_size,
|
||||
:kuliguli_count,
|
||||
:kuliguli_action_id,
|
||||
:imago_wing_id,
|
||||
:imago_maturity,
|
||||
:imago_phase_id,
|
||||
:imago_action_id,
|
||||
:imago_density,
|
||||
:imago_density_ga,
|
||||
:imago_feeding,
|
||||
:imago_copulation,
|
||||
:imago_laying,
|
||||
:imago_flying,
|
||||
:swarm_maturity,
|
||||
:swarm_density_id,
|
||||
main.strtouuid(:swarm_density_uid),
|
||||
:swarm_size,
|
||||
:swarm_count,
|
||||
:swarm_copulation,
|
||||
:swarm_laying,
|
||||
:swarm_flying_direction_id,
|
||||
:swarm_height_id,
|
||||
:description,
|
||||
ST_SetSRID(ST_GeomFromGeoJSON(:geom),4326),
|
||||
:test,
|
||||
COALESCE(main.strtouuid(:uid),gen_random_uuid())
|
||||
)
|
||||
""";
|
||||
}
|
||||
parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("uid", locust.uid, Types.VARCHAR);
|
||||
if(locust.eid==null) parameters.addValue("eid", null, Types.INTEGER); else parameters.addValue("eid", Integer.parseInt(locust.eid), Types.INTEGER);
|
||||
parameters.addValue("company_uid", locust.company_uid, Types.VARCHAR);
|
||||
|
||||
|
||||
if(locust.user_id == null) { parameters.addValue("user_id", null, Types.BIGINT); } else { parameters.addValue("user_id", Long.parseLong(locust.user_id), Types.BIGINT); }
|
||||
|
||||
parameters.addValue("device_id", locust.device_id, Types.VARCHAR);
|
||||
|
||||
parameters.addValue("image_name1", locust.image_name1, Types.VARCHAR);
|
||||
parameters.addValue("image_name2", locust.image_name2, Types.VARCHAR);
|
||||
parameters.addValue("image_name3", locust.image_name3, Types.VARCHAR);
|
||||
|
||||
if(locust.country_id == null) { parameters.addValue("country_id", null, Types.BIGINT); } else { parameters.addValue("country_id", Long.parseLong(locust.country_id), Types.BIGINT); }
|
||||
|
||||
|
||||
if(locust.region_id == null) { parameters.addValue("region_id", null, Types.BIGINT); } else { parameters.addValue("region_id", Long.parseLong(locust.region_id), Types.BIGINT); }
|
||||
|
||||
parameters.addValue("area", locust.area, Types.VARCHAR);
|
||||
parameters.addValue("district", locust.district, Types.VARCHAR);
|
||||
|
||||
parameters.addValue("village", locust.village, Types.VARCHAR);
|
||||
parameters.addValue("terrain", locust.terrain, Types.VARCHAR);
|
||||
|
||||
parameters.addValue("observer", locust.observer, Types.VARCHAR);
|
||||
if(locust.date==null)
|
||||
{
|
||||
parameters.addValue("date", null, Types.DATE);
|
||||
}else
|
||||
{
|
||||
parameters.addValue("date", locust.date, Types.TIMESTAMP);
|
||||
}
|
||||
|
||||
parameters.addValue("timezone", locust.timezone, Types.VARCHAR);
|
||||
|
||||
if(locust.lat_center==null) parameters.addValue("lat_center", null, Types.DOUBLE); else parameters.addValue("lat_center", Double.parseDouble(locust.lat_center), Types.DOUBLE);
|
||||
if(locust.lon_center==null) parameters.addValue("lon_center", null, Types.DOUBLE); else parameters.addValue("lon_center", Double.parseDouble(locust.lon_center), Types.DOUBLE);
|
||||
|
||||
if(locust.bio_hectare==null) parameters.addValue("bio_hectare", null, Types.DOUBLE); else parameters.addValue("bio_hectare",Double.parseDouble(locust.bio_hectare), Types.DOUBLE);
|
||||
if(locust.bio_biotope_id==null) parameters.addValue("bio_biotope_id", null, Types.BIGINT); else parameters.addValue("bio_biotope_id",Long.parseLong(locust.bio_biotope_id), Types.BIGINT);
|
||||
if(locust.bio_greenery_id==null) parameters.addValue("bio_greenery_id", null, Types.BIGINT); else parameters.addValue("bio_greenery_id", Long.parseLong(locust.bio_greenery_id), Types.BIGINT);
|
||||
if(locust.bio_greenery_cover_id==null) parameters.addValue("bio_greenery_cover_id", null, Types.BIGINT); else parameters.addValue("bio_greenery_cover_id",Long.parseLong(locust.bio_greenery_cover_id), Types.BIGINT);
|
||||
if(locust.bio_temperature==null) parameters.addValue("bio_temperature", null, Types.DOUBLE); else parameters.addValue("bio_temperature",Double.parseDouble(locust.bio_temperature), Types.DOUBLE);
|
||||
if(locust.bio_wind==null) parameters.addValue("bio_wind", null, Types.DOUBLE); else parameters.addValue("bio_wind",Double.parseDouble(locust.bio_wind), Types.DOUBLE);
|
||||
if(locust.locust_have==null) parameters.addValue("locust_have", null, Types.BIGINT); else parameters.addValue("locust_have",Long.parseLong(locust.locust_have), Types.BIGINT);
|
||||
if(locust.locust_type_id==null) parameters.addValue("locust_type_id", null, Types.BIGINT); else parameters.addValue("locust_type_id",Long.parseLong(locust.locust_type_id), Types.BIGINT);
|
||||
if(locust.locust_populated==null) parameters.addValue("locust_populated", null, Types.DOUBLE); else parameters.addValue("locust_populated",Double.parseDouble(locust.locust_populated), Types.DOUBLE);
|
||||
|
||||
if(locust.eggs_capsules_area==null) parameters.addValue("eggs_capsules_area", null, Types.DOUBLE); else parameters.addValue("eggs_capsules_area",Double.parseDouble(locust.eggs_capsules_area), Types.DOUBLE);
|
||||
if(locust.eggs_capsules_density==null) parameters.addValue("eggs_capsules_density", null, Types.DOUBLE); else parameters.addValue("eggs_capsules_density",Double.parseDouble(locust.eggs_capsules_density), Types.DOUBLE);
|
||||
if(locust.eggs_capsules_density_to==null) parameters.addValue("eggs_capsules_density_to", null, Types.DOUBLE); else parameters.addValue("eggs_capsules_density_to",Double.parseDouble(locust.eggs_capsules_density_to), Types.DOUBLE);
|
||||
if(locust.eggs_capsules==null) parameters.addValue("eggs_capsules", null, Types.DOUBLE); else parameters.addValue("eggs_capsules",Double.parseDouble(locust.eggs_capsules), Types.DOUBLE);
|
||||
if(locust.eggs_live==null) parameters.addValue("eggs_live", null, Types.DOUBLE); else parameters.addValue("eggs_live",Double.parseDouble(locust.eggs_live), Types.DOUBLE);
|
||||
if(locust.eggs_enemies_id==null) parameters.addValue("eggs_enemies_id", null, Types.BIGINT); else parameters.addValue("eggs_enemies_id",Long.parseLong(locust.eggs_enemies_id), Types.BIGINT);
|
||||
|
||||
if(locust.larva_born_id==null) parameters.addValue("larva_born_id", null, Types.BIGINT); else parameters.addValue("larva_born_id",Long.parseLong(locust.larva_born_id), Types.BIGINT);
|
||||
if(locust.larva_age_id==null) parameters.addValue("larva_age_id", null, Types.BIGINT); else parameters.addValue("larva_age_id",Long.parseLong(locust.larva_age_id), Types.BIGINT);
|
||||
if(locust.larva_painting_id==null) parameters.addValue("larva_painting_id", null, Types.BIGINT); else parameters.addValue("larva_painting_id",Long.parseLong(locust.larva_painting_id), Types.BIGINT);
|
||||
if(locust.larva_behavior_id==null) parameters.addValue("larva_behavior_id", null, Types.BIGINT); else parameters.addValue("larva_behavior_id",Long.parseLong(locust.larva_behavior_id), Types.BIGINT);
|
||||
|
||||
if(locust.larva_density==null) parameters.addValue("larva_density", null, Types.DOUBLE); else parameters.addValue("larva_density",Double.parseDouble(locust.larva_density), Types.DOUBLE);
|
||||
if(locust.larva_density_to==null) parameters.addValue("larva_density_to", null, Types.DOUBLE); else parameters.addValue("larva_density_to",Double.parseDouble(locust.larva_density_to), Types.DOUBLE);
|
||||
if(locust.kuliguli_age_id==null) parameters.addValue("kuliguli_age_id", null, Types.BIGINT); else parameters.addValue("kuliguli_age_id",Long.parseLong(locust.kuliguli_age_id), Types.BIGINT);
|
||||
|
||||
if(locust.kuliguli_density==null) parameters.addValue("kuliguli_density", null, Types.DOUBLE); else parameters.addValue("kuliguli_density",Double.parseDouble(locust.kuliguli_density), Types.DOUBLE);
|
||||
if(locust.kuliguli_density_to==null) parameters.addValue("kuliguli_density_to", null, Types.DOUBLE); else parameters.addValue("kuliguli_density_to",Double.parseDouble(locust.kuliguli_density_to), Types.DOUBLE);
|
||||
if(locust.kuliguli_size==null) parameters.addValue("kuliguli_size", null, Types.DOUBLE); else parameters.addValue("kuliguli_size",Double.parseDouble(locust.kuliguli_size), Types.DOUBLE);
|
||||
if(locust.kuliguli_count==null) parameters.addValue("kuliguli_count", null, Types.DOUBLE); else parameters.addValue("kuliguli_count",Double.parseDouble(locust.kuliguli_count), Types.DOUBLE);
|
||||
if(locust.kuliguli_action_id==null) parameters.addValue("kuliguli_action_id", null, Types.BIGINT); else parameters.addValue("kuliguli_action_id",Long.parseLong(locust.kuliguli_action_id), Types.BIGINT);
|
||||
if(locust.imago_wing_id==null) parameters.addValue("imago_wing_id", null, Types.BIGINT); else parameters.addValue("imago_wing_id",Long.parseLong(locust.imago_wing_id), Types.BIGINT);
|
||||
if(locust.imago_maturity==null) parameters.addValue("imago_maturity", null, Types.BOOLEAN);
|
||||
else {
|
||||
if(locust.imago_maturity.equals("1")) parameters.addValue("imago_maturity",true,Types.BOOLEAN);
|
||||
else parameters.addValue("imago_maturity",false,Types.BOOLEAN);
|
||||
}
|
||||
if(locust.imago_phase_id==null) parameters.addValue("imago_phase_id", null, Types.BIGINT); else parameters.addValue("imago_phase_id",Long.parseLong(locust.imago_phase_id), Types.BIGINT);
|
||||
if(locust.imago_action_id==null) parameters.addValue("imago_action_id", null, Types.BIGINT); else parameters.addValue("imago_action_id",Long.parseLong(locust.imago_action_id), Types.BIGINT);
|
||||
|
||||
if(locust.imago_density==null) parameters.addValue("imago_density", null, Types.DOUBLE); else parameters.addValue("imago_density",Double.parseDouble(locust.imago_density), Types.DOUBLE);
|
||||
if(locust.imago_density_ga==null) parameters.addValue("imago_density_ga", null, Types.DOUBLE); else parameters.addValue("imago_density_ga",Double.parseDouble(locust.imago_density_ga), Types.DOUBLE);
|
||||
if(locust.imago_feeding==null) parameters.addValue("imago_feeding", null, Types.BOOLEAN);
|
||||
else {
|
||||
if(locust.imago_feeding.equals("1")) parameters.addValue("imago_feeding",true,Types.BOOLEAN);
|
||||
else parameters.addValue("imago_feeding",false,Types.BOOLEAN);
|
||||
}
|
||||
if(locust.imago_copulation==null) parameters.addValue("imago_copulation", null, Types.BOOLEAN);
|
||||
else {
|
||||
if(locust.imago_copulation.equals("1")) parameters.addValue("imago_copulation",true,Types.BOOLEAN);
|
||||
else parameters.addValue("imago_copulation",false,Types.BOOLEAN);
|
||||
}
|
||||
if(locust.imago_laying==null) parameters.addValue("imago_laying", null, Types.BOOLEAN);
|
||||
else {
|
||||
if(locust.imago_laying.equals("1")) parameters.addValue("imago_laying",true,Types.BOOLEAN);
|
||||
else parameters.addValue("imago_laying",false,Types.BOOLEAN);
|
||||
}
|
||||
if(locust.imago_flying==null) parameters.addValue("imago_flying", null, Types.BOOLEAN);
|
||||
else {
|
||||
if(locust.imago_flying.equals("1")) parameters.addValue("imago_flying",true,Types.BOOLEAN);
|
||||
else parameters.addValue("imago_flying",false,Types.BOOLEAN);
|
||||
}
|
||||
if(locust.swarm_maturity==null) parameters.addValue("swarm_maturity", null, Types.BOOLEAN);
|
||||
else {
|
||||
if(locust.swarm_maturity.equals("1")) parameters.addValue("swarm_maturity",true,Types.BOOLEAN);
|
||||
else parameters.addValue("swarm_maturity",false,Types.BOOLEAN);
|
||||
}
|
||||
if(locust.swarm_density_id==null) parameters.addValue("swarm_density_id", null, Types.BIGINT); else parameters.addValue("swarm_density_id",Long.parseLong(locust.swarm_density_id), Types.BIGINT);
|
||||
if(locust.swarm_density_uid==null) parameters.addValue("swarm_density_uid", null, Types.VARCHAR); else parameters.addValue("swarm_density_uid",locust.swarm_density_uid, Types.VARCHAR);
|
||||
|
||||
if(locust.swarm_size==null) parameters.addValue("swarm_size", null, Types.DOUBLE); else parameters.addValue("swarm_size",Double.parseDouble(locust.swarm_size), Types.DOUBLE);
|
||||
if(locust.swarm_count==null) parameters.addValue("swarm_count", null, Types.DOUBLE); else parameters.addValue("swarm_count",Double.parseDouble(locust.swarm_count), Types.DOUBLE);
|
||||
if(locust.swarm_copulation==null) parameters.addValue("swarm_copulation", null, Types.BOOLEAN);
|
||||
else {
|
||||
if(locust.swarm_copulation.equals("1")) parameters.addValue("swarm_copulation",true,Types.DOUBLE);
|
||||
else parameters.addValue("swarm_copulation",false,Types.DOUBLE);
|
||||
}
|
||||
if(locust.swarm_laying==null) parameters.addValue("swarm_laying", null, Types.BOOLEAN);
|
||||
else {
|
||||
if(locust.swarm_laying.equals("1")) parameters.addValue("swarm_laying",true,Types.DOUBLE);
|
||||
else parameters.addValue("swarm_laying",false,Types.DOUBLE);
|
||||
}
|
||||
if(locust.swarm_flying_direction_id==null) parameters.addValue("swarm_flying_direction_id", null, Types.BIGINT); else parameters.addValue("swarm_flying_direction_id",Long.parseLong(locust.swarm_flying_direction_id), Types.BIGINT);
|
||||
if(locust.swarm_height_id==null) parameters.addValue("swarm_height_id", null, Types.BIGINT); else parameters.addValue("swarm_height_id",Long.parseLong(locust.swarm_height_id), Types.BIGINT);
|
||||
|
||||
parameters.addValue("description", locust.description, Types.VARCHAR);
|
||||
parameters.addValue("geom", locust.geom, Types.VARCHAR);
|
||||
|
||||
if(locust.test==null) parameters.addValue("test", null, Types.BOOLEAN);
|
||||
else {
|
||||
if(locust.test.equals("1")) parameters.addValue("test",true, Types.BOOLEAN);
|
||||
else parameters.addValue("test",false,Types.BOOLEAN);
|
||||
}
|
||||
|
||||
try {
|
||||
int rowsAffected = jdbcTemplate.update(sql, parameters);
|
||||
return rowsAffected > 0;
|
||||
} catch (Exception ex) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), ex.getMessage(), ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
119
src/main/java/org/ccalm/main/api/APICountries.java
Normal file
@ -0,0 +1,119 @@
|
||||
package org.ccalm.main.api;
|
||||
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import org.ccalm.main.models.ErrorResponseModel;
|
||||
import org.gdal.gdal.Band;
|
||||
import org.gdal.gdal.Dataset;
|
||||
import org.gdal.gdal.gdal;
|
||||
import org.gdal.gdalconst.gdalconstConstants;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
import tools.Translation;
|
||||
//import tools.Translation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
public class APICountries implements ServletContextAware {
|
||||
|
||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(APICountries.class);
|
||||
|
||||
private ServletContext context;
|
||||
private final NamedParameterJdbcTemplate jdbcTemplate;
|
||||
private final Environment environment;
|
||||
private HikariDataSource dataSource;
|
||||
|
||||
@Override
|
||||
public void setServletContext(ServletContext servletContext) {
|
||||
this.context=servletContext;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public APICountries(NamedParameterJdbcTemplate jdbcTemplate, HikariDataSource dataSource, Environment environment) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
this.environment = environment;
|
||||
this.dataSource = dataSource;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/api/locust/v01/download-countries"}, method = RequestMethod.GET, produces = "application/json")
|
||||
@ResponseBody
|
||||
public List<Map<String, Object>> downloadCountries() {
|
||||
String apiUrl = "https://api.worldbank.org/v2/country?format=json&per_page=600";
|
||||
|
||||
List<Map<String, Object>> countriesList = new ArrayList<>();
|
||||
|
||||
try {
|
||||
// 1. Запрос данных с API
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
ResponseEntity<String> response = restTemplate.getForEntity(apiUrl, String.class);
|
||||
|
||||
if (response.getStatusCode().is2xxSuccessful()) {
|
||||
// 2. Разбираем JSON
|
||||
JSONArray jsonArray = new JSONArray(response.getBody());
|
||||
JSONArray countries = jsonArray.getJSONArray(1);
|
||||
|
||||
for (int i = 0; i < countries.length(); i++) {
|
||||
JSONObject country = countries.getJSONObject(i);
|
||||
String code3 = country.optString("id", null); // Код страны (ISO3)
|
||||
String name = country.optString("name", "Unknown Country");
|
||||
if (code3 != null && !countryExists(code3)) {
|
||||
// 3. Добавляем страну в БД
|
||||
insertCountry(code3, name);
|
||||
Map<String, Object> countryMap = new HashMap<>();
|
||||
countryMap.put("code3", code3);
|
||||
countryMap.put("name", name);
|
||||
countriesList.add(countryMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Ошибка при загрузке стран: ", e);
|
||||
}
|
||||
|
||||
return countriesList;
|
||||
}
|
||||
|
||||
// Проверка наличия страны в базе
|
||||
private boolean countryExists(String code3) {
|
||||
String sql = "SELECT COUNT(*) FROM main.countries WHERE code3 = :code3";
|
||||
Map<String, Object> params = Collections.singletonMap("code3", code3);
|
||||
Integer count = jdbcTemplate.queryForObject(sql, params, Integer.class);
|
||||
return count != null && count > 0;
|
||||
}
|
||||
|
||||
// Вставка новой страны
|
||||
private void insertCountry(String code3, String name) {
|
||||
String sql = """
|
||||
INSERT INTO main.countries (name, code3)
|
||||
VALUES (:name, :code3)
|
||||
""";
|
||||
Map<String, Object> params = Map.of("name", name, "code3", code3);
|
||||
jdbcTemplate.update(sql, params);
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/api/locust/v01/get-countries"},method = {RequestMethod.GET},produces = "application/json;charset=utf-8")
|
||||
public ResponseEntity<Object> getCountries(@CookieValue(value = "lng",defaultValue="1") String language_id) {
|
||||
Translation trt = new Translation(language_id,jdbcTemplate);
|
||||
try {
|
||||
String sql = "SELECT id, name, code3 FROM main.countries where del=false and visible=true ORDER BY name";
|
||||
List<Map<String, Object>> countries = jdbcTemplate.queryForList(sql,Collections.emptyMap());
|
||||
return ResponseEntity.ok(countries);
|
||||
} catch (Exception e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(uuid, e);
|
||||
return new ResponseEntity<>(new ErrorResponseModel(200, 10500, trt.trt(false,"Internal_Server_Error"), null, uuid), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -5,10 +5,7 @@ import java.security.KeyFactory;
|
||||
import java.security.PublicKey;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.sql.*;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import jakarta.servlet.http.HttpServletResponse; //import javax.servlet.http.HttpServletResponse;
|
||||
@ -23,6 +20,7 @@ import org.ccalm.main.TranslationUtils;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MarkerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
@ -49,7 +47,7 @@ import tools.User;
|
||||
@Controller
|
||||
public class EngineController implements ServletContextAware {
|
||||
|
||||
private static final org.apache.logging.log4j.Logger logger = LogManager.getLogger(EngineController.class);
|
||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(EngineController.class);
|
||||
private ServletContext context;
|
||||
private Properties m_props=null;
|
||||
//private String m_props_loc="";
|
||||
@ -73,7 +71,8 @@ public class EngineController implements ServletContextAware {
|
||||
PublicKey key = keyFactory.generatePublic(spec);
|
||||
return key;
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -81,7 +80,7 @@ public class EngineController implements ServletContextAware {
|
||||
/**
|
||||
* Simply selects the home view to render by returning its name.
|
||||
*/
|
||||
@RequestMapping(value = "/engine", method = RequestMethod.GET)
|
||||
@RequestMapping(value = {"/engine", "/api/locust/v01/"}, method = RequestMethod.GET)
|
||||
public String home(
|
||||
Model model,
|
||||
HttpServletResponse response,
|
||||
@ -89,10 +88,11 @@ public class EngineController implements ServletContextAware {
|
||||
@CookieValue(value = "lng", defaultValue = "1") int language_id
|
||||
) {
|
||||
if (jwt_a.equals("") || Tools.countOccurrences(jwt_a, '.') != 2) {
|
||||
String redirectUrl = "/login/login?msg=Please_log_in";
|
||||
String redirectUrl = "/login/?msg=Please_log_in";
|
||||
model.addAttribute("url", redirectUrl);
|
||||
return "redirect";
|
||||
}
|
||||
|
||||
//Проверяю подпись токена
|
||||
Jws<Claims> claims = null;
|
||||
PublicKey key_a = getPublicKey(); //SecretKey key_a = new SecretKeySpec(Base64.getDecoder().decode(env.getProperty("access.key")), "HmacSHA256");
|
||||
@ -102,11 +102,15 @@ public class EngineController implements ServletContextAware {
|
||||
.build()
|
||||
.parseClaimsJws(jwt_a);
|
||||
} catch (Exception e) {
|
||||
String redirectUrl = "/login/login?msg=Please_log_in";
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage());
|
||||
|
||||
String redirectUrl = "/login/?msg=Please_log_in";
|
||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
model.addAttribute("url", redirectUrl);
|
||||
return "redirect";
|
||||
}
|
||||
//logger.warn("page engine is start");
|
||||
|
||||
//if(language_id!=null && !language_id.isEmpty()) user.language_id=language_id;
|
||||
//logger.info("user.id="+user.id+" user.name="+user.name+" user.language_id="+user.language_id);
|
||||
@ -125,7 +129,7 @@ public class EngineController implements ServletContextAware {
|
||||
}
|
||||
} catch( DataAccessException ex )
|
||||
{
|
||||
logger.info(ex.getMessage());
|
||||
logger.error(ex.getMessage());
|
||||
}
|
||||
|
||||
//Send user name and role
|
||||
@ -174,6 +178,7 @@ public class EngineController implements ServletContextAware {
|
||||
Document doc = null;
|
||||
try {
|
||||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
||||
dbFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||||
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
|
||||
doc = dBuilder.parse(isXML);
|
||||
} catch (Exception ex) {
|
||||
|
||||
@ -5,8 +5,12 @@ import io.jsonwebtoken.Jws;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.ccalm.main.AcceptJSON;
|
||||
import org.ccalm.main.engine.EngineController;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MarkerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@ -29,7 +33,7 @@ import java.util.UUID;
|
||||
@Controller
|
||||
public class LoginController implements ServletContextAware {
|
||||
|
||||
private static final org.apache.logging.log4j.Logger logger = LogManager.getLogger(EngineController.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(LoginController.class);
|
||||
|
||||
private javax.servlet.ServletContext context;
|
||||
private final NamedParameterJdbcTemplate jdbcTemplate;
|
||||
@ -63,7 +67,7 @@ public class LoginController implements ServletContextAware {
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(uuid, ex);
|
||||
logger.error(MarkerFactory.getMarker(uuid), ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
return "login/login";
|
||||
|
||||
107
src/main/java/org/ccalm/main/models/ErrorResponseModel.java
Normal file
@ -0,0 +1,107 @@
|
||||
package org.ccalm.main.models;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(
|
||||
description = "Error API response",
|
||||
example = "{ \"error_code\": 10000, \"error_message\": [\"Internal_Server_Error\",\"Please_log_in\"], \"error_setting\": [\"99;day\",\"1;2\"], \"error_marker\": \"2a449883-c7c6-468e-b3ae-5f73fc96627d\" }"
|
||||
)
|
||||
|
||||
public class ErrorResponseModel {
|
||||
|
||||
@JsonIgnore
|
||||
private int httpCode;
|
||||
|
||||
@Schema(description = "Error code", example = "10000")
|
||||
@JsonProperty("error_code")
|
||||
private int errorCode;
|
||||
|
||||
@Schema(description = "List of error descriptions", example = "[\"Internal_Server_Error\",\"Please_log_in\"]")
|
||||
@JsonProperty("error_message")
|
||||
private List<String> errorMessage;
|
||||
|
||||
@Schema(description = "Options for translated text", example = "[\"99;day\",\"1;2\"]")
|
||||
@JsonProperty("error_setting")
|
||||
private List<String> errorSetting;
|
||||
|
||||
@Schema(description = "Unique identifier for searching in the database", example = "4260aad8-f7ee-4be4-b52c-15d56ec83232")
|
||||
@JsonProperty("error_marker")
|
||||
private String errorMarker;
|
||||
|
||||
public ErrorResponseModel(int httpCode, int errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
this.errorMessage = null;
|
||||
this.errorSetting = null;
|
||||
this.errorMarker = null;
|
||||
}
|
||||
|
||||
public ErrorResponseModel(int httpCode, int errorCode, List<String> errorMessage, String errorMarker) {
|
||||
this.errorCode = errorCode;
|
||||
this.errorMessage = errorMessage;
|
||||
this.errorMarker = errorMarker;
|
||||
}
|
||||
|
||||
public ErrorResponseModel(int httpCode, int errorCode, String errorMessage, String errorMarker) {
|
||||
this.errorCode = errorCode;
|
||||
this.errorMessage = Collections.singletonList(errorMessage);
|
||||
this.errorMarker = errorMarker;
|
||||
}
|
||||
|
||||
public ErrorResponseModel(int httpCode, int errorCode, String errorMessage, String errorSetting, String errorMarker) {
|
||||
this.errorCode = errorCode;
|
||||
this.errorMessage = Collections.singletonList(errorMessage);
|
||||
this.errorSetting = Collections.singletonList(errorSetting);
|
||||
this.errorMarker = errorMarker;
|
||||
}
|
||||
|
||||
public ErrorResponseModel(int httpCode, int errorCode, List<String> errorMessage, List<String> errorSetting, String errorMarker) {
|
||||
this.errorCode = errorCode;
|
||||
this.errorMessage = errorMessage;
|
||||
this.errorSetting = errorSetting;
|
||||
this.errorMarker = errorMarker;
|
||||
}
|
||||
|
||||
public int getHttp_code() {
|
||||
return httpCode;
|
||||
}
|
||||
public void setHttp_code(int errorCode) {
|
||||
this.httpCode = httpCode;
|
||||
}
|
||||
|
||||
public int getError_code() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public void setError_code(int errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public List<String> getError_message() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public void setError_message(List<String> errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public void setError_setting(List<String> errorSetting) {
|
||||
this.errorSetting = errorSetting;
|
||||
}
|
||||
|
||||
public List<String> getError_setting() {
|
||||
return errorSetting;
|
||||
}
|
||||
|
||||
public void setError_marker(String errorMarker) {
|
||||
this.errorMarker = errorMarker;
|
||||
}
|
||||
|
||||
public String getError_marker() {
|
||||
return errorMarker;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package org.ccalm.main.models;
|
||||
|
||||
public class FrmLocustDelModel {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package org.ccalm.main.models;
|
||||
|
||||
public class FrmLocustHealthModel {
|
||||
}
|
||||
219
src/main/java/org/ccalm/main/models/FrmLocustModel.java
Normal file
@ -0,0 +1,219 @@
|
||||
package org.ccalm.main.models;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
//import org.ccalm.main.utils.CustomException;
|
||||
|
||||
import java.sql.Types;
|
||||
|
||||
public class FrmLocustModel {
|
||||
public String uid;
|
||||
public String eid; //Внешний идентификатор
|
||||
public long seq;
|
||||
public String country_id;
|
||||
public String country_uid;
|
||||
|
||||
public String user_id;
|
||||
|
||||
public String phytoType; //Вредители либо обработка
|
||||
public String observer;
|
||||
|
||||
public String device_id = null;
|
||||
|
||||
public String image_name1 = null;
|
||||
public String image_name2 = null;
|
||||
public String image_name3 = null;
|
||||
|
||||
public String lon_center;
|
||||
public String lat_center;
|
||||
//Область
|
||||
public String region_id; //Область
|
||||
public String region_uid; //Область
|
||||
|
||||
public String area; //Rayon
|
||||
public String district; //Район
|
||||
public String district_id; //
|
||||
|
||||
public String terrain=""; //Название месности
|
||||
|
||||
public String village; //Хозяйство или местность
|
||||
|
||||
public String locust; //Вид саранчи
|
||||
//public String locust_id; //Вид саранчи
|
||||
public String locust_type_id; //Locust species (Вид саранчи)
|
||||
public String locust_type_uid; //Locust species (Вид саранчи)
|
||||
public String locust_populated; //Area infested (ha)
|
||||
|
||||
|
||||
public String bio_hectare=null; //Обследованная площадь
|
||||
public String bio_biotope_id=null; //Тип биотопа
|
||||
public String bio_biotope_uid=null; //Тип биотопа
|
||||
public String bio_temperature; //air temperature
|
||||
public String bio_wind; //Ветер (м/с)
|
||||
public String bio_greenery_id; //растительность
|
||||
public String bio_greenery_uid; //растительность
|
||||
public String bio_greenery_cover_id; //Густота растительного покрова
|
||||
public String bio_greenery_cover_uid; //Густота растительного покрова
|
||||
|
||||
|
||||
public String phase=null; //Фаза саранчи
|
||||
public String locust_have; //id Фазы саранчи
|
||||
public String evp; //ЭФП
|
||||
public String drawPolygon="null"; //Область обследования GeoGSON
|
||||
public String size; //Заселённая площадь (polygonArea Площадь контура зоны распространения, в случае если специалист указал его)
|
||||
//public String date; //Дата
|
||||
public java.sql.Timestamp date; //Дата
|
||||
public String timezone;
|
||||
|
||||
public String description="";
|
||||
public String geom;
|
||||
|
||||
//Eggs
|
||||
public String eggs = null; // For CheckBox
|
||||
public String eggs_capsules_area = null; //Egg-bed (surface in ha)
|
||||
public String eggs_capsules_density = null; //Плотность яиц
|
||||
public String eggs_capsules_density_to = null; //Egg-pods (density) to
|
||||
public String eggs_capsules = null; //Eggs (average)
|
||||
public String eggs_live = null; //Eggs (viable)
|
||||
public String eggs_enemies_id = null; //Natural enemies present
|
||||
public String eggs_enemies_uid = null; //Natural enemies present
|
||||
//public String eggs_enemies = null; //not using TODO delete field from database
|
||||
|
||||
//Hopper (личинки разряженные)
|
||||
public String larva = null;
|
||||
public String larva_born = null; //Hatching character varying(255) COLLATE pg_catalog."default" DEFAULT NULL::character varying,
|
||||
public String larva_born_id = null; // integer,
|
||||
public String larva_born_uid = null;
|
||||
public String larva_age_id = null; //Hopper stages integer,
|
||||
public String larva_age_uid = null; //Hopper stages integer,
|
||||
public String larva_painting_id = null; //Appearance integer,
|
||||
public String larva_behavior = null; //Behaviour character varying(50) COLLATE pg_catalog."default" DEFAULT NULL::character varying,
|
||||
public String larva_behavior_id = null; // integer,
|
||||
public String larva_behavior_uid = null; // integer,
|
||||
public String larva_density = null; //Hopper density numeric, (Плотность личинок)
|
||||
public String larva_density_to = null; //Hopper density to numeric,
|
||||
|
||||
//Bands (кулиги)
|
||||
public String kuliguli = null; // For CheckBox
|
||||
public String kuliguli_density=null; //Плотность кулиг на м²
|
||||
public String kuliguli_density_to = null; //плотность максимальная в кулиге
|
||||
public String kuliguli_size = null; // Размер кулиг
|
||||
public String kuliguli_count = null; // Количество кулиг
|
||||
public String kuliguli_action_id = null; // Поведение
|
||||
public String kuliguli_action_uid = null; // Поведение
|
||||
public String kuliguli_age_id = null; // Возраст личинок
|
||||
public String kuliguli_age_uid = null; // Возраст личинок
|
||||
|
||||
//Adults (Имаго)
|
||||
public String imago = null; // For CheckBox
|
||||
public String imago_wing_id = null;
|
||||
public String imago_wing_uid = null;
|
||||
public String imago_maturity = null;
|
||||
//public String imago_phase = null; not using
|
||||
public String imago_phase_id = null;
|
||||
public String imago_phase_uid = null;
|
||||
public String imago_action = null;
|
||||
public String imago_action_id = null;
|
||||
public String imago_action_uid = null;
|
||||
public String imago_density = null; //Плотность имаго (/м²)*
|
||||
public String imago_density_ga = null;
|
||||
public String imago_feeding = null;
|
||||
public String imago_copulation = null;
|
||||
public String imago_laying = null; //Кладка яиц
|
||||
public String imago_flying = null;
|
||||
|
||||
|
||||
|
||||
public String swarms = null; // For CheckBox
|
||||
public String swarm_maturity = null; //Maturity boolean,
|
||||
public String swarm_density_id = null; //Density of swarm integer,
|
||||
public String swarm_density_uid = null; //Density of swarm integer,
|
||||
public String swarm_size = null; //Swarm size double precision,
|
||||
public String swarm_count = null; //Number of swarms double precision,
|
||||
public String swarm_copulation = null; //Not used boolean,
|
||||
public String swarm_laying = null; //Not used boolean,
|
||||
public String swarm_flying_direction_id = null; //Flying direction integer,
|
||||
public String swarm_height_id = null; //Flying height integer,
|
||||
public String swarm_height_uid = null; //Flying height integer,
|
||||
|
||||
public String company_uid=null;
|
||||
|
||||
//Ниже то что относиться только к обработке
|
||||
public String insecticide_name=null;
|
||||
public String insecticide_active_substance=null;
|
||||
public String insecticide_dose=null;
|
||||
public String spray_platform=null;
|
||||
|
||||
public String test=null;
|
||||
|
||||
public void update(){
|
||||
|
||||
if(
|
||||
larva_born != null ||
|
||||
larva_born_id != null ||
|
||||
larva_born_uid != null ||
|
||||
larva_age_id != null ||
|
||||
larva_age_uid != null ||
|
||||
larva_painting_id != null ||
|
||||
larva_behavior != null ||
|
||||
larva_behavior_id != null ||
|
||||
larva_behavior_uid != null ||
|
||||
larva_density != null ||
|
||||
larva_density_to != null
|
||||
) larva = "true";
|
||||
|
||||
if(
|
||||
eggs_capsules_area != null ||
|
||||
eggs_capsules_density != null ||
|
||||
eggs_capsules_density_to != null ||
|
||||
eggs_capsules != null ||
|
||||
eggs_live != null ||
|
||||
eggs_enemies_id != null ||
|
||||
eggs_enemies_uid != null
|
||||
) eggs = "true";
|
||||
|
||||
//Bands (кулиги)
|
||||
if(
|
||||
kuliguli_density != null ||
|
||||
kuliguli_density_to != null ||
|
||||
kuliguli_size != null ||
|
||||
kuliguli_count != null ||
|
||||
kuliguli_action_id != null ||
|
||||
kuliguli_action_uid != null ||
|
||||
kuliguli_age_id != null ||
|
||||
kuliguli_age_uid != null
|
||||
) kuliguli = "true";
|
||||
|
||||
//Adults (Имаго)
|
||||
if(
|
||||
imago_wing_id != null ||
|
||||
imago_wing_uid != null ||
|
||||
imago_maturity != null ||
|
||||
imago_phase_id != null ||
|
||||
imago_phase_uid != null ||
|
||||
imago_action != null ||
|
||||
imago_action_id != null ||
|
||||
imago_action_uid != null ||
|
||||
imago_density != null ||
|
||||
imago_density_ga != null ||
|
||||
imago_feeding != null ||
|
||||
imago_copulation != null ||
|
||||
imago_laying != null ||
|
||||
imago_flying != null
|
||||
) imago = "true";
|
||||
|
||||
if(
|
||||
swarm_maturity!=null ||
|
||||
swarm_density_id!=null ||
|
||||
swarm_size!=null ||
|
||||
swarm_count!=null ||
|
||||
swarm_copulation!=null ||
|
||||
swarm_laying!=null ||
|
||||
swarm_flying_direction_id!=null ||
|
||||
swarm_height_id!=null ||
|
||||
swarm_height_uid!=null
|
||||
) swarms = "true";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
84
src/main/java/org/ccalm/main/utils/CustomException.java
Normal file
@ -0,0 +1,84 @@
|
||||
package org.ccalm.main.utils;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.ccalm.main.models.ErrorResponseModel;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
public class CustomException extends Exception {
|
||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(CustomException.class);
|
||||
|
||||
private ErrorResponseModel error;
|
||||
@Getter
|
||||
private boolean saveToLog = false;
|
||||
|
||||
public CustomException(int httpCode, int errorCode, String errorMessage, String marker, boolean saveToLog) {
|
||||
super(errorMessage);
|
||||
error = new ErrorResponseModel(httpCode, errorCode, errorMessage, marker);
|
||||
this.saveToLog = saveToLog;
|
||||
}
|
||||
|
||||
public CustomException(int httpCode, int errorCode, String errorMessage, String errorSetting, String marker, boolean saveToLog) {
|
||||
super(errorMessage);
|
||||
error = new ErrorResponseModel(httpCode, errorCode, errorMessage, errorSetting, marker);
|
||||
this.saveToLog = saveToLog;
|
||||
}
|
||||
|
||||
public CustomException(int httpCode, int errorCode, List<String> errorMessages, String marker, boolean saveToLog) {
|
||||
super(String.join(" ", errorMessages));
|
||||
error = new ErrorResponseModel(httpCode, errorCode, errorMessages, marker);
|
||||
this.saveToLog = saveToLog;
|
||||
}
|
||||
|
||||
public CustomException(int httpCode, int errorCode, List<String> errorMessages, List<String> errorSettings, String marker, boolean saveToLog) {
|
||||
super(String.join(" ", errorMessages));
|
||||
error = new ErrorResponseModel(httpCode, errorCode, errorMessages, errorSettings, marker);
|
||||
this.saveToLog = saveToLog;
|
||||
}
|
||||
|
||||
public int getHttpCode() {
|
||||
return error.getHttp_code();
|
||||
}
|
||||
|
||||
public int getErrorCode() {
|
||||
return error.getError_code();
|
||||
}
|
||||
|
||||
public String getErrorMarker() {
|
||||
return error.getError_marker();
|
||||
}
|
||||
|
||||
public List<String> getErrorMessages() {
|
||||
return error.getError_message();
|
||||
}
|
||||
|
||||
public List<String> getErrorSettings() {
|
||||
return error.getError_setting();
|
||||
}
|
||||
|
||||
public JSONObject getJson() {
|
||||
JSONObject json = new JSONObject();
|
||||
try {
|
||||
json.put("error_code", this.getErrorCode());
|
||||
json.put("error_message", this.getErrorMessages());
|
||||
json.put("error_setting", this.getErrorSettings());
|
||||
json.put("error_marker", this.getErrorMarker());
|
||||
} catch (JSONException ex) {
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
public ErrorResponseModel getErrorResponseModel() {
|
||||
return error;
|
||||
}
|
||||
|
||||
}
|
||||
172
src/main/java/org/ccalm/main/utils/LTools.java
Normal file
@ -0,0 +1,172 @@
|
||||
package org.ccalm.main.utils;
|
||||
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import io.jsonwebtoken.security.Keys;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.ccalm.main.engine.EngineController;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MarkerFactory;
|
||||
|
||||
import javax.crypto.*;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class LTools {
|
||||
//---------------------------------------------------------------------------
|
||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(LTools.class);
|
||||
//---------------------------------------------------------------------------
|
||||
public static JSONObject createJSONError(int code, String message, String setting, String marker) {
|
||||
JSONObject json = new JSONObject();
|
||||
try {
|
||||
json.put("error_code", code);
|
||||
json.put("error_message", Arrays.asList(message));
|
||||
json.put("error_setting", Arrays.asList(setting));
|
||||
json.put("error_marker", marker);
|
||||
} catch (JSONException e) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage(), e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
//Зашифровать
|
||||
public static String encryptText(String pass,String data){
|
||||
String encryptedBase64="";
|
||||
String encryptionIV = "jazz_tyt_net_111"; // Ваш вектор инициализации
|
||||
try {
|
||||
Cipher cipher = Cipher.getInstance("AES/CTR/NoPadding");
|
||||
SecretKeySpec key = new SecretKeySpec(Base64.getDecoder().decode(pass), "AES");
|
||||
IvParameterSpec iv = new IvParameterSpec(encryptionIV.getBytes()); // Создание объекта IvParameterSpec для вектора инициализации
|
||||
cipher.init(Cipher.ENCRYPT_MODE, key, iv); // Инициализация шифра с ключом и вектором инициализации
|
||||
byte[] encrypted = cipher.doFinal(data.getBytes()); // Шифрование строки
|
||||
encryptedBase64 = Base64.getEncoder().encodeToString(encrypted); // Преобразование зашифрованных данных в base64
|
||||
} catch (InvalidKeyException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (InvalidAlgorithmParameterException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (NoSuchPaddingException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalBlockSizeException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (BadPaddingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return encryptedBase64;
|
||||
}
|
||||
|
||||
public static String decryptText(String pass,String data){
|
||||
String encryptionIV = "jazz_tyt_net_111"; // Ваш вектор инициализации
|
||||
String decryptedText= "";
|
||||
try {
|
||||
Cipher cipher = Cipher.getInstance("AES/CTR/NoPadding");
|
||||
SecretKeySpec key = new SecretKeySpec(Base64.getDecoder().decode(pass), "AES");
|
||||
IvParameterSpec iv = new IvParameterSpec(encryptionIV.getBytes()); // Создание объекта IvParameterSpec для вектора инициализации
|
||||
cipher.init(Cipher.DECRYPT_MODE, key, iv); // Инициализация шифра с ключом и вектором инициализации
|
||||
|
||||
byte[] decrypted = cipher.doFinal(Base64.getDecoder().decode(data)); // Расшифровка данных
|
||||
decryptedText = new String(decrypted); // Преобразование расшифрованных данных в строку
|
||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException |
|
||||
InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return decryptedText;
|
||||
}
|
||||
|
||||
public static String generateSignature(String pass,String input) {
|
||||
try {
|
||||
SecretKey secretKey = new SecretKeySpec(Base64.getDecoder().decode(pass), "HmacSHA256");
|
||||
|
||||
MessageDigest digest = MessageDigest.getInstance("SHA-256");
|
||||
byte[] encodedInput = digest.digest(input.getBytes(StandardCharsets.UTF_8));
|
||||
byte[] encodedKey = secretKey.getEncoded();
|
||||
|
||||
// Создание HMAC-подписи
|
||||
SecretKeySpec keySpec = new SecretKeySpec(encodedKey, "HmacSHA256");
|
||||
Mac mac = Mac.getInstance("HmacSHA256");
|
||||
mac.init(keySpec);
|
||||
byte[] rawHmac = mac.doFinal(encodedInput);
|
||||
|
||||
// Кодирование подписи в base64
|
||||
return Base64.getEncoder().encodeToString(rawHmac);
|
||||
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isValidEmail(String email) {
|
||||
if(email==null || email.isEmpty()) return false;
|
||||
String EMAIL_REGEX = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$";
|
||||
Pattern pattern = Pattern.compile(EMAIL_REGEX);
|
||||
Matcher matcher = pattern.matcher(email);
|
||||
return matcher.matches();
|
||||
}
|
||||
|
||||
public static boolean isInteger(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Integer.parseInt(str);
|
||||
return true;
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String genKey(){
|
||||
SecretKey key = Keys.secretKeyFor(SignatureAlgorithm.HS256);
|
||||
byte[] keyBytes = key.getEncoded();
|
||||
return Base64.getEncoder().encodeToString(keyBytes);
|
||||
}
|
||||
|
||||
public static String generatePassword(int length) {
|
||||
String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
SecureRandom random = new SecureRandom();
|
||||
StringBuilder sb = new StringBuilder(length);
|
||||
for (int i = 0; i < length; i++) {
|
||||
int randomIndex = random.nextInt(CHARACTERS.length());
|
||||
sb.append(CHARACTERS.charAt(randomIndex));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
// Метод для извлечения подписи из JWT токена
|
||||
public static String extractSignature(String jwtToken) {
|
||||
String[] jwtParts = jwtToken.split("\\.");
|
||||
if (jwtParts.length != 3) {
|
||||
return null;
|
||||
}
|
||||
return jwtParts[2];
|
||||
}
|
||||
|
||||
//Для извлечения содержимого токена
|
||||
public static JSONObject extractToken(String jwtToken) {
|
||||
String[] jwtParts = jwtToken.split("\\.");
|
||||
if (jwtParts.length != 3) {
|
||||
return null;
|
||||
}
|
||||
String payloadJson = new String(Base64.getUrlDecoder().decode(jwtParts[1]));
|
||||
JSONObject payload=null;
|
||||
try {
|
||||
payload = new JSONObject(payloadJson);
|
||||
} catch (JSONException e) {
|
||||
return null;
|
||||
}
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -14,11 +14,6 @@ import javax.mail.internet.AddressException;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
|
||||
/**
|
||||
* A utility class for sending e-mail messages
|
||||
* @author www.codejava.net
|
||||
*
|
||||
*/
|
||||
public class EmailUtility {
|
||||
|
||||
public static void sendEmail(String host, String port,
|
||||
@ -62,4 +57,5 @@ public class EmailUtility {
|
||||
// sends the e-mail
|
||||
Transport.send(msg);
|
||||
}
|
||||
|
||||
}
|
||||
@ -194,7 +194,7 @@ public class PreparedStatementNamed {
|
||||
try{
|
||||
tm = new java.sql.Timestamp(dfm.parse(value).getTime());
|
||||
} catch (Exception ex) {
|
||||
logger.error("Error",ex.getMessage());
|
||||
logger.error(ex.getMessage(), ex);
|
||||
}
|
||||
for (int i = 0; i < fields.size(); i++) {
|
||||
if (fields.get(i).name.equals(name)) {
|
||||
|
||||
@ -32,7 +32,8 @@ public class Translation {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
public String trt(String text){
|
||||
public String trt(boolean translate,String text){
|
||||
if(translate) {
|
||||
String sql = """
|
||||
select
|
||||
translation
|
||||
@ -56,5 +57,8 @@ public class Translation {
|
||||
text = text.replace("_", " ");
|
||||
}
|
||||
return text;
|
||||
}else {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<!-- Ваш кастомный conversionRule для single-line исключений -->
|
||||
<conversionRule conversionWord="exOneLine" converterClass="org.ccalm.dbms.SingleLineThrowableProxyConverter"/>
|
||||
|
||||
<property name="LOGS" value="logs" />
|
||||
<springProperty scope="context" name="appName" source="spring.application.name"/>
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${LOGS}/${appName}.log</file>
|
||||
<encoder>
|
||||
<pattern>{"timestamp":"%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}","thread":"[%thread]","level":"%level","logger":"%logger{36}","message":"%msg"}%n</pattern>
|
||||
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
|
||||
<!-- Кастомные имена полей -->
|
||||
<fieldNames>
|
||||
<timestamp>timestamp</timestamp> <!-- Без @ -->
|
||||
<level>level</level>
|
||||
<message>message</message>
|
||||
<stack_trace>exception</stack_trace>
|
||||
<version>[ignore]</version>
|
||||
<threadName>[ignore]</threadName>
|
||||
<loggerName>[ignore]</loggerName>
|
||||
<levelValue>[ignore]</levelValue>
|
||||
<mdc>[ignore]</mdc>
|
||||
</fieldNames>
|
||||
|
||||
<!-- Формат timestamp -->
|
||||
<timestampPattern>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</timestampPattern>
|
||||
<timestampTimeZone>UTC</timestampTimeZone>
|
||||
|
||||
<!-- Включаем маркеры (tags для MarkerFactory) -->
|
||||
<includeTags>true</includeTags>
|
||||
|
||||
<!-- Отключаем лишние данные -->
|
||||
<includeCallerData>false</includeCallerData>
|
||||
<includeContext>false</includeContext>
|
||||
|
||||
<!-- Single-line исключения -->
|
||||
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
|
||||
<maxDepthPerThrowable>1</maxDepthPerThrowable>
|
||||
<maxLength>1024</maxLength>
|
||||
<shortenedClassNameLength>20</shortenedClassNameLength>
|
||||
<exclude>$$FastClassByCGLIB$$</exclude>
|
||||
<exclude>$$EnhancerBySpringCGLIB$$</exclude>
|
||||
</throwableConverter>
|
||||
</encoder>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOGS}/${appName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
@ -19,12 +53,13 @@
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z'} | %level | %logger{36} | %msg%n</pattern>
|
||||
<pattern>
|
||||
%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z'} | %level | %logger{36} | %marker | %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--root level="info"-->
|
||||
<root level="warn">
|
||||
<root level="info">
|
||||
<appender-ref ref="FILE" />
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</root>
|
||||
|
||||
326
src/main/resources/static/resources/QGIS/IVI.qgs
Normal file
@ -0,0 +1,326 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis version="3.6.0-Noosa" projectname="">
|
||||
<homePath path=""/>
|
||||
<title></title>
|
||||
<autotransaction active="0"/>
|
||||
<evaluateDefaultValues active="0"/>
|
||||
<trust active="0"/>
|
||||
<projectCrs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</projectCrs>
|
||||
<layer-tree-group>
|
||||
<customproperties/>
|
||||
<layer-tree-layer name="IVI" id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b" source="contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=IVI:${year}IVI_h20v03&layers=IVI:${year}IVI_h20v04&layers=IVI:${year}IVI_h21v03&layers=IVI:${year}IVI_h21v04&layers=IVI:${year}IVI_h21v05&layers=IVI:${year}IVI_h22v03&layers=IVI:${year}IVI_h22v04&layers=IVI:${year}IVI_h22v05&layers=IVI:${year}IVI_h23v03&layers=IVI:${year}IVI_h23v04&layers=IVI:${year}IVI_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms" expanded="0" checked="Qt::Checked" providerKey="wms">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer name="OpenStreetMap" id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416" source="crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png" expanded="1" checked="Qt::Checked" providerKey="wms">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<custom-order enabled="0">
|
||||
<item>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</item>
|
||||
<item>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</item>
|
||||
</custom-order>
|
||||
</layer-tree-group>
|
||||
<snapping-settings mode="2" unit="1" type="1" enabled="0" intersection-snapping="0" tolerance="12">
|
||||
<individual-layer-settings/>
|
||||
</snapping-settings>
|
||||
<relations/>
|
||||
<mapcanvas name="theMapCanvas" annotationsVisible="1">
|
||||
<units>meters</units>
|
||||
<extent>
|
||||
<xmin>2465883.50908621679991484</xmin>
|
||||
<ymin>264579.77565301861613989</ymin>
|
||||
<xmax>12985575.38905057311058044</xmax>
|
||||
<ymax>10784271.65561737865209579</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<expressionContextScope/>
|
||||
</mapcanvas>
|
||||
<projectModels/>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer name="IVI" drawingOrder="-1" checked="Qt::Checked" showFeatureCount="0" open="false">
|
||||
<filegroup open="false" hidden="false">
|
||||
<legendlayerfile layerid="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b" visible="1" isInOverview="0"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer name="OpenStreetMap" drawingOrder="-1" checked="Qt::Checked" showFeatureCount="0" open="true">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile layerid="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416" visible="1" isInOverview="0"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<mapViewDocks/>
|
||||
<mapViewDocks3D/>
|
||||
<projectlayers>
|
||||
<maplayer type="raster" refreshOnNotifyEnabled="0" autoRefreshEnabled="0" hasScaleBasedVisibilityFlag="0" refreshOnNotifyMessage="" autoRefreshTime="0" minScale="1e+08" maxScale="0" styleCategories="AllStyleCategories">
|
||||
<extent>
|
||||
<xmin>-20037508.34278924390673637</xmin>
|
||||
<ymin>-20037508.34278925508260727</ymin>
|
||||
<xmax>20037508.34278924390673637</xmax>
|
||||
<ymax>20037508.34278924390673637</ymax>
|
||||
</extent>
|
||||
<id>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</id>
|
||||
<datasource>crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>OpenStreetMap</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent/>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="identify/format" value="Undefined"/>
|
||||
<property key="ol_layer_type" value="OpenStreetMap"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast brightness="0" contrast="0"/>
|
||||
<huesaturation colorizeStrength="100" grayscaleMode="0" colorizeGreen="128" colorizeBlue="128" colorizeOn="0" saturation="0" colorizeRed="255"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
<maplayer type="raster" refreshOnNotifyEnabled="0" autoRefreshEnabled="0" hasScaleBasedVisibilityFlag="0" refreshOnNotifyMessage="" autoRefreshTime="0" minScale="1e+08" maxScale="0" styleCategories="AllStyleCategories">
|
||||
<extent>
|
||||
<xmin>2906345.494111736305058</xmin>
|
||||
<ymin>3503584.68813749961555004</ymin>
|
||||
<xmax>13358323.19605071656405926</xmax>
|
||||
<ymax>8399737.88861873932182789</ymax>
|
||||
</extent>
|
||||
<id>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</id>
|
||||
<datasource>contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=IVI:${year}IVI_h20v03&layers=IVI:${year}IVI_h20v04&layers=IVI:${year}IVI_h21v03&layers=IVI:${year}IVI_h21v04&layers=IVI:${year}IVI_h21v05&layers=IVI:${year}IVI_h22v03&layers=IVI:${year}IVI_h22v04&layers=IVI:${year}IVI_h22v05&layers=IVI:${year}IVI_h23v03&layers=IVI:${year}IVI_h23v04&layers=IVI:${year}IVI_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>${year}IVI</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<contact>
|
||||
<name></name>
|
||||
<organization></organization>
|
||||
<position></position>
|
||||
<voice></voice>
|
||||
<fax></fax>
|
||||
<email></email>
|
||||
<role></role>
|
||||
</contact>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent>
|
||||
<spatial minx="0" dimensions="2" minz="0" maxz="0" maxy="0" crs="" miny="0" maxx="0"/>
|
||||
<temporal>
|
||||
<period>
|
||||
<start></start>
|
||||
<end></end>
|
||||
</period>
|
||||
</temporal>
|
||||
</extent>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="WMSBackgroundLayer" value="false"/>
|
||||
<property key="WMSPublishDataSourceUrl" value="false"/>
|
||||
<property key="embeddedWidgets/count" value="0"/>
|
||||
<property key="identify/format" value="Html"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast brightness="0" contrast="0"/>
|
||||
<huesaturation colorizeStrength="100" grayscaleMode="0" colorizeGreen="128" colorizeBlue="128" colorizeOn="0" saturation="0" colorizeRed="255"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<layerorder>
|
||||
<layer id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416"/>
|
||||
<layer id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b"/>
|
||||
</layerorder>
|
||||
<properties>
|
||||
<PositionPrecision>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
</PositionPrecision>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<Measure>
|
||||
<Ellipsoid type="QString">WGS84</Ellipsoid>
|
||||
</Measure>
|
||||
<Gui>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
</Gui>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
<PAL>
|
||||
<DrawOutlineLabels type="bool">true</DrawOutlineLabels>
|
||||
<DrawRectOnly type="bool">false</DrawRectOnly>
|
||||
<TextFormat type="int">0</TextFormat>
|
||||
<CandidatesPolygon type="int">30</CandidatesPolygon>
|
||||
<CandidatesPoint type="int">16</CandidatesPoint>
|
||||
<CandidatesLine type="int">50</CandidatesLine>
|
||||
<SearchMethod type="int">0</SearchMethod>
|
||||
<ShowingAllLabels type="bool">false</ShowingAllLabels>
|
||||
<ShowingPartialsLabels type="bool">true</ShowingPartialsLabels>
|
||||
<ShowingCandidates type="bool">false</ShowingCandidates>
|
||||
</PAL>
|
||||
<SpatialRefSys>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
</SpatialRefSys>
|
||||
<Measurement>
|
||||
<AreaUnits type="QString">m2</AreaUnits>
|
||||
<DistanceUnits type="QString">meters</DistanceUnits>
|
||||
</Measurement>
|
||||
</properties>
|
||||
<visibility-presets/>
|
||||
<transformContext/>
|
||||
<projectMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<author><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.</author>
|
||||
<creation>2019-06-10T14:55:55</creation>
|
||||
</projectMetadata>
|
||||
<Annotations/>
|
||||
<Layouts/>
|
||||
</qgis>
|
||||
354
src/main/resources/static/resources/QGIS/NDSI.qgs
Normal file
@ -0,0 +1,354 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis projectname="" saveUser="ivanov.i" version="3.12.3-București" saveUserFull="Иванов И.">
|
||||
<homePath path=""/>
|
||||
<title></title>
|
||||
<autotransaction active="0"/>
|
||||
<evaluateDefaultValues active="0"/>
|
||||
<trust active="0"/>
|
||||
<projectCrs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</projectCrs>
|
||||
<layer-tree-group>
|
||||
<customproperties/>
|
||||
<layer-tree-layer checked="Qt::Checked" providerKey="wms" expanded="1" source="contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=NDSI:${day}NDSI_h20v03&layers=NDSI:${day}NDSI_h20v04&layers=NDSI:${day}NDSI_h21v03&layers=NDSI:${day}NDSI_h21v04&layers=NDSI:${day}NDSI_h21v05&layers=NDSI:${day}NDSI_h22v03&layers=NDSI:${day}NDSI_h22v04&layers=NDSI:${day}NDSI_h22v05&layers=NDSI:${day}NDSI_h23v03&layers=NDSI:${day}NDSI_h23v04&layers=NDSI:${day}NDSI_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms" legend_exp="" id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b" name="NDSI">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer checked="Qt::Checked" providerKey="wms" expanded="1" source="crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png" legend_exp="" id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416" name="OpenStreetMap">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<custom-order enabled="0">
|
||||
<item>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</item>
|
||||
<item>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</item>
|
||||
</custom-order>
|
||||
</layer-tree-group>
|
||||
<snapping-settings intersection-snapping="0" enabled="0" type="1" mode="2" tolerance="12" unit="1">
|
||||
<individual-layer-settings/>
|
||||
</snapping-settings>
|
||||
<relations/>
|
||||
<mapcanvas annotationsVisible="1" name="theMapCanvas">
|
||||
<units>meters</units>
|
||||
<extent>
|
||||
<xmin>3863030.08689398271963</xmin>
|
||||
<ymin>3270963.49336460698395967</ymin>
|
||||
<xmax>9122876.02687616087496281</xmax>
|
||||
<ymax>8530809.43334678560495377</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<expressionContextScope/>
|
||||
</mapcanvas>
|
||||
<projectModels/>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer checked="Qt::Checked" showFeatureCount="0" drawingOrder="-1" open="true" name="NDSI">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" visible="1" layerid="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer checked="Qt::Checked" showFeatureCount="0" drawingOrder="-1" open="true" name="OpenStreetMap">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" visible="1" layerid="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<mapViewDocks/>
|
||||
<mapViewDocks3D/>
|
||||
<projectlayers>
|
||||
<maplayer styleCategories="AllStyleCategories" type="raster" refreshOnNotifyMessage="" refreshOnNotifyEnabled="0" minScale="1e+08" autoRefreshEnabled="0" maxScale="0" hasScaleBasedVisibilityFlag="0" autoRefreshTime="0">
|
||||
<extent>
|
||||
<xmin>-20037508.34278924390673637</xmin>
|
||||
<ymin>-20037508.34278925508260727</ymin>
|
||||
<xmax>20037508.34278924390673637</xmax>
|
||||
<ymax>20037508.34278924390673637</ymax>
|
||||
</extent>
|
||||
<id>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</id>
|
||||
<datasource>crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>OpenStreetMap</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent/>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="identify/format" value="Undefined"/>
|
||||
<property key="ol_layer_type" value="OpenStreetMap"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" nodataColor="" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast contrast="0" brightness="0"/>
|
||||
<huesaturation colorizeRed="255" colorizeStrength="100" grayscaleMode="0" colorizeOn="0" colorizeBlue="128" colorizeGreen="128" saturation="0"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
<maplayer styleCategories="AllStyleCategories" type="raster" refreshOnNotifyMessage="" refreshOnNotifyEnabled="0" minScale="1e+08" autoRefreshEnabled="0" maxScale="0" hasScaleBasedVisibilityFlag="0" autoRefreshTime="0">
|
||||
<extent>
|
||||
<xmin>2906345.49411173490807414</xmin>
|
||||
<ymin>3503584.68813749961555004</ymin>
|
||||
<xmax>13358323.19605071656405926</xmax>
|
||||
<ymax>8399737.88861873932182789</ymax>
|
||||
</extent>
|
||||
<id>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</id>
|
||||
<datasource>contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=NDSI:${day}NDSI_h20v03&layers=NDSI:${day}NDSI_h20v04&layers=NDSI:${day}NDSI_h21v03&layers=NDSI:${day}NDSI_h21v04&layers=NDSI:${day}NDSI_h21v05&layers=NDSI:${day}NDSI_h22v03&layers=NDSI:${day}NDSI_h22v04&layers=NDSI:${day}NDSI_h22v05&layers=NDSI:${day}NDSI_h23v03&layers=NDSI:${day}NDSI_h23v04&layers=NDSI:${day}NDSI_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>${day}NDSI</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<contact>
|
||||
<name></name>
|
||||
<organization></organization>
|
||||
<position></position>
|
||||
<voice></voice>
|
||||
<fax></fax>
|
||||
<email></email>
|
||||
<role></role>
|
||||
</contact>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent>
|
||||
<spatial minz="0" minx="0" miny="0" crs="" maxz="0" dimensions="2" maxy="0" maxx="0"/>
|
||||
<temporal>
|
||||
<period>
|
||||
<start></start>
|
||||
<end></end>
|
||||
</period>
|
||||
</temporal>
|
||||
</extent>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="WMSBackgroundLayer" value="false"/>
|
||||
<property key="WMSPublishDataSourceUrl" value="false"/>
|
||||
<property key="embeddedWidgets/count" value="0"/>
|
||||
<property key="identify/format" value="Html"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" nodataColor="" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast contrast="0" brightness="0"/>
|
||||
<huesaturation colorizeRed="255" colorizeStrength="100" grayscaleMode="0" colorizeOn="0" colorizeBlue="128" colorizeGreen="128" saturation="0"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<layerorder>
|
||||
<layer id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416"/>
|
||||
<layer id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b"/>
|
||||
</layerorder>
|
||||
<properties>
|
||||
<Gui>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
</Gui>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
<Measure>
|
||||
<Ellipsoid type="QString">WGS84</Ellipsoid>
|
||||
</Measure>
|
||||
<Measurement>
|
||||
<AreaUnits type="QString">m2</AreaUnits>
|
||||
<DistanceUnits type="QString">meters</DistanceUnits>
|
||||
</Measurement>
|
||||
<PAL>
|
||||
<CandidatesLine type="int">50</CandidatesLine>
|
||||
<CandidatesLinePerCM type="double">5</CandidatesLinePerCM>
|
||||
<CandidatesPoint type="int">16</CandidatesPoint>
|
||||
<CandidatesPolygon type="int">30</CandidatesPolygon>
|
||||
<CandidatesPolygonPerCM type="double">2.5</CandidatesPolygonPerCM>
|
||||
<DrawOutlineLabels type="bool">true</DrawOutlineLabels>
|
||||
<DrawRectOnly type="bool">false</DrawRectOnly>
|
||||
<DrawUnplaced type="bool">false</DrawUnplaced>
|
||||
<PlacementEngineVersion type="int">0</PlacementEngineVersion>
|
||||
<SearchMethod type="int">0</SearchMethod>
|
||||
<ShowingAllLabels type="bool">false</ShowingAllLabels>
|
||||
<ShowingCandidates type="bool">false</ShowingCandidates>
|
||||
<ShowingPartialsLabels type="bool">true</ShowingPartialsLabels>
|
||||
<TextFormat type="int">0</TextFormat>
|
||||
<UnplacedColor type="QString">255,0,0,255</UnplacedColor>
|
||||
</PAL>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<PositionPrecision>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
</PositionPrecision>
|
||||
<SpatialRefSys>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
</SpatialRefSys>
|
||||
</properties>
|
||||
<visibility-presets/>
|
||||
<transformContext/>
|
||||
<projectMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<author><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.</author>
|
||||
<creation>2019-06-10T14:55:55</creation>
|
||||
</projectMetadata>
|
||||
<Annotations/>
|
||||
<Layouts/>
|
||||
<Bookmarks/>
|
||||
<ProjectViewSettings UseProjectScales="0">
|
||||
<Scales/>
|
||||
</ProjectViewSettings>
|
||||
<ProjectDisplaySettings>
|
||||
<BearingFormat id="bearing">
|
||||
<Option type="Map">
|
||||
<Option type="QChar" value="" name="decimal_separator"/>
|
||||
<Option type="int" value="6" name="decimals"/>
|
||||
<Option type="int" value="0" name="direction_format"/>
|
||||
<Option type="int" value="0" name="rounding_type"/>
|
||||
<Option type="bool" value="false" name="show_plus"/>
|
||||
<Option type="bool" value="true" name="show_thousand_separator"/>
|
||||
<Option type="bool" value="false" name="show_trailing_zeros"/>
|
||||
<Option type="QChar" value="" name="thousand_separator"/>
|
||||
</Option>
|
||||
</BearingFormat>
|
||||
</ProjectDisplaySettings>
|
||||
</qgis>
|
||||
326
src/main/resources/static/resources/QGIS/NDVI.qgs
Normal file
@ -0,0 +1,326 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis version="3.6.0-Noosa" projectname="">
|
||||
<homePath path=""/>
|
||||
<title></title>
|
||||
<autotransaction active="0"/>
|
||||
<evaluateDefaultValues active="0"/>
|
||||
<trust active="0"/>
|
||||
<projectCrs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</projectCrs>
|
||||
<layer-tree-group>
|
||||
<customproperties/>
|
||||
<layer-tree-layer name="NDVI" id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b" source="contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=NDVI:${day}NDVI_h20v03&layers=NDVI:${day}NDVI_h20v04&layers=NDVI:${day}NDVI_h21v03&layers=NDVI:${day}NDVI_h21v04&layers=NDVI:${day}NDVI_h21v05&layers=NDVI:${day}NDVI_h22v03&layers=NDVI:${day}NDVI_h22v04&layers=NDVI:${day}NDVI_h22v05&layers=NDVI:${day}NDVI_h23v03&layers=NDVI:${day}NDVI_h23v04&layers=NDVI:${day}NDVI_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms" expanded="0" checked="Qt::Checked" providerKey="wms">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer name="OpenStreetMap" id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416" source="crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png" expanded="1" checked="Qt::Checked" providerKey="wms">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<custom-order enabled="0">
|
||||
<item>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</item>
|
||||
<item>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</item>
|
||||
</custom-order>
|
||||
</layer-tree-group>
|
||||
<snapping-settings mode="2" unit="1" type="1" enabled="0" intersection-snapping="0" tolerance="12">
|
||||
<individual-layer-settings/>
|
||||
</snapping-settings>
|
||||
<relations/>
|
||||
<mapcanvas name="theMapCanvas" annotationsVisible="1">
|
||||
<units>meters</units>
|
||||
<extent>
|
||||
<xmin>2465883.50908621679991484</xmin>
|
||||
<ymin>264579.77565301861613989</ymin>
|
||||
<xmax>12985575.38905057311058044</xmax>
|
||||
<ymax>10784271.65561737865209579</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<expressionContextScope/>
|
||||
</mapcanvas>
|
||||
<projectModels/>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer name="NDVI" drawingOrder="-1" checked="Qt::Checked" showFeatureCount="0" open="false">
|
||||
<filegroup open="false" hidden="false">
|
||||
<legendlayerfile layerid="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b" visible="1" isInOverview="0"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer name="OpenStreetMap" drawingOrder="-1" checked="Qt::Checked" showFeatureCount="0" open="true">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile layerid="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416" visible="1" isInOverview="0"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<mapViewDocks/>
|
||||
<mapViewDocks3D/>
|
||||
<projectlayers>
|
||||
<maplayer type="raster" refreshOnNotifyEnabled="0" autoRefreshEnabled="0" hasScaleBasedVisibilityFlag="0" refreshOnNotifyMessage="" autoRefreshTime="0" minScale="1e+08" maxScale="0" styleCategories="AllStyleCategories">
|
||||
<extent>
|
||||
<xmin>-20037508.34278924390673637</xmin>
|
||||
<ymin>-20037508.34278925508260727</ymin>
|
||||
<xmax>20037508.34278924390673637</xmax>
|
||||
<ymax>20037508.34278924390673637</ymax>
|
||||
</extent>
|
||||
<id>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</id>
|
||||
<datasource>crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>OpenStreetMap</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent/>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="identify/format" value="Undefined"/>
|
||||
<property key="ol_layer_type" value="OpenStreetMap"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast brightness="0" contrast="0"/>
|
||||
<huesaturation colorizeStrength="100" grayscaleMode="0" colorizeGreen="128" colorizeBlue="128" colorizeOn="0" saturation="0" colorizeRed="255"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
<maplayer type="raster" refreshOnNotifyEnabled="0" autoRefreshEnabled="0" hasScaleBasedVisibilityFlag="0" refreshOnNotifyMessage="" autoRefreshTime="0" minScale="1e+08" maxScale="0" styleCategories="AllStyleCategories">
|
||||
<extent>
|
||||
<xmin>2906345.494111736305058</xmin>
|
||||
<ymin>3503584.68813749961555004</ymin>
|
||||
<xmax>13358323.19605071656405926</xmax>
|
||||
<ymax>8399737.88861873932182789</ymax>
|
||||
</extent>
|
||||
<id>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</id>
|
||||
<datasource>contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=NDVI:${day}NDVI_h20v03&layers=NDVI:${day}NDVI_h20v04&layers=NDVI:${day}NDVI_h21v03&layers=NDVI:${day}NDVI_h21v04&layers=NDVI:${day}NDVI_h21v05&layers=NDVI:${day}NDVI_h22v03&layers=NDVI:${day}NDVI_h22v04&layers=NDVI:${day}NDVI_h22v05&layers=NDVI:${day}NDVI_h23v03&layers=NDVI:${day}NDVI_h23v04&layers=NDVI:${day}NDVI_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>${day}NDVI</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<contact>
|
||||
<name></name>
|
||||
<organization></organization>
|
||||
<position></position>
|
||||
<voice></voice>
|
||||
<fax></fax>
|
||||
<email></email>
|
||||
<role></role>
|
||||
</contact>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent>
|
||||
<spatial minx="0" dimensions="2" minz="0" maxz="0" maxy="0" crs="" miny="0" maxx="0"/>
|
||||
<temporal>
|
||||
<period>
|
||||
<start></start>
|
||||
<end></end>
|
||||
</period>
|
||||
</temporal>
|
||||
</extent>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="WMSBackgroundLayer" value="false"/>
|
||||
<property key="WMSPublishDataSourceUrl" value="false"/>
|
||||
<property key="embeddedWidgets/count" value="0"/>
|
||||
<property key="identify/format" value="Html"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast brightness="0" contrast="0"/>
|
||||
<huesaturation colorizeStrength="100" grayscaleMode="0" colorizeGreen="128" colorizeBlue="128" colorizeOn="0" saturation="0" colorizeRed="255"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<layerorder>
|
||||
<layer id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416"/>
|
||||
<layer id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b"/>
|
||||
</layerorder>
|
||||
<properties>
|
||||
<PositionPrecision>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
</PositionPrecision>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<Measure>
|
||||
<Ellipsoid type="QString">WGS84</Ellipsoid>
|
||||
</Measure>
|
||||
<Gui>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
</Gui>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
<PAL>
|
||||
<DrawOutlineLabels type="bool">true</DrawOutlineLabels>
|
||||
<DrawRectOnly type="bool">false</DrawRectOnly>
|
||||
<TextFormat type="int">0</TextFormat>
|
||||
<CandidatesPolygon type="int">30</CandidatesPolygon>
|
||||
<CandidatesPoint type="int">16</CandidatesPoint>
|
||||
<CandidatesLine type="int">50</CandidatesLine>
|
||||
<SearchMethod type="int">0</SearchMethod>
|
||||
<ShowingAllLabels type="bool">false</ShowingAllLabels>
|
||||
<ShowingPartialsLabels type="bool">true</ShowingPartialsLabels>
|
||||
<ShowingCandidates type="bool">false</ShowingCandidates>
|
||||
</PAL>
|
||||
<SpatialRefSys>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
</SpatialRefSys>
|
||||
<Measurement>
|
||||
<AreaUnits type="QString">m2</AreaUnits>
|
||||
<DistanceUnits type="QString">meters</DistanceUnits>
|
||||
</Measurement>
|
||||
</properties>
|
||||
<visibility-presets/>
|
||||
<transformContext/>
|
||||
<projectMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<author><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.</author>
|
||||
<creation>2019-06-10T14:55:55</creation>
|
||||
</projectMetadata>
|
||||
<Annotations/>
|
||||
<Layouts/>
|
||||
</qgis>
|
||||
354
src/main/resources/static/resources/QGIS/NDWI.qgs
Normal file
@ -0,0 +1,354 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis projectname="" saveUser="ivanov.i" version="3.12.3-București" saveUserFull="Иванов И.">
|
||||
<homePath path=""/>
|
||||
<title></title>
|
||||
<autotransaction active="0"/>
|
||||
<evaluateDefaultValues active="0"/>
|
||||
<trust active="0"/>
|
||||
<projectCrs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</projectCrs>
|
||||
<layer-tree-group>
|
||||
<customproperties/>
|
||||
<layer-tree-layer checked="Qt::Checked" providerKey="wms" expanded="1" source="contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=NDWI:${day}NDWI_h20v03&layers=NDWI:${day}NDWI_h20v04&layers=NDWI:${day}NDWI_h21v03&layers=NDWI:${day}NDWI_h21v04&layers=NDWI:${day}NDWI_h21v05&layers=NDWI:${day}NDWI_h22v03&layers=NDWI:${day}NDWI_h22v04&layers=NDWI:${day}NDWI_h22v05&layers=NDWI:${day}NDWI_h23v03&layers=NDWI:${day}NDWI_h23v04&layers=NDWI:${day}NDWI_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms" legend_exp="" id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b" name="NDWI">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer checked="Qt::Checked" providerKey="wms" expanded="1" source="crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png" legend_exp="" id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416" name="OpenStreetMap">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<custom-order enabled="0">
|
||||
<item>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</item>
|
||||
<item>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</item>
|
||||
</custom-order>
|
||||
</layer-tree-group>
|
||||
<snapping-settings intersection-snapping="0" enabled="0" type="1" mode="2" tolerance="12" unit="1">
|
||||
<individual-layer-settings/>
|
||||
</snapping-settings>
|
||||
<relations/>
|
||||
<mapcanvas annotationsVisible="1" name="theMapCanvas">
|
||||
<units>meters</units>
|
||||
<extent>
|
||||
<xmin>3863030.08689398271963</xmin>
|
||||
<ymin>3270963.49336460698395967</ymin>
|
||||
<xmax>9122876.02687616087496281</xmax>
|
||||
<ymax>8530809.43334678560495377</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<expressionContextScope/>
|
||||
</mapcanvas>
|
||||
<projectModels/>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer checked="Qt::Checked" showFeatureCount="0" drawingOrder="-1" open="true" name="NDWI">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" visible="1" layerid="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer checked="Qt::Checked" showFeatureCount="0" drawingOrder="-1" open="true" name="OpenStreetMap">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" visible="1" layerid="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<mapViewDocks/>
|
||||
<mapViewDocks3D/>
|
||||
<projectlayers>
|
||||
<maplayer styleCategories="AllStyleCategories" type="raster" refreshOnNotifyMessage="" refreshOnNotifyEnabled="0" minScale="1e+08" autoRefreshEnabled="0" maxScale="0" hasScaleBasedVisibilityFlag="0" autoRefreshTime="0">
|
||||
<extent>
|
||||
<xmin>-20037508.34278924390673637</xmin>
|
||||
<ymin>-20037508.34278925508260727</ymin>
|
||||
<xmax>20037508.34278924390673637</xmax>
|
||||
<ymax>20037508.34278924390673637</ymax>
|
||||
</extent>
|
||||
<id>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</id>
|
||||
<datasource>crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>OpenStreetMap</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent/>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="identify/format" value="Undefined"/>
|
||||
<property key="ol_layer_type" value="OpenStreetMap"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" nodataColor="" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast contrast="0" brightness="0"/>
|
||||
<huesaturation colorizeRed="255" colorizeStrength="100" grayscaleMode="0" colorizeOn="0" colorizeBlue="128" colorizeGreen="128" saturation="0"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
<maplayer styleCategories="AllStyleCategories" type="raster" refreshOnNotifyMessage="" refreshOnNotifyEnabled="0" minScale="1e+08" autoRefreshEnabled="0" maxScale="0" hasScaleBasedVisibilityFlag="0" autoRefreshTime="0">
|
||||
<extent>
|
||||
<xmin>2906345.49411173490807414</xmin>
|
||||
<ymin>3503584.68813749961555004</ymin>
|
||||
<xmax>13358323.19605071656405926</xmax>
|
||||
<ymax>8399737.88861873932182789</ymax>
|
||||
</extent>
|
||||
<id>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</id>
|
||||
<datasource>contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=NDWI:${day}NDWI_h20v03&layers=NDWI:${day}NDWI_h20v04&layers=NDWI:${day}NDWI_h21v03&layers=NDWI:${day}NDWI_h21v04&layers=NDWI:${day}NDWI_h21v05&layers=NDWI:${day}NDWI_h22v03&layers=NDWI:${day}NDWI_h22v04&layers=NDWI:${day}NDWI_h22v05&layers=NDWI:${day}NDWI_h23v03&layers=NDWI:${day}NDWI_h23v04&layers=NDWI:${day}NDWI_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>${day}NDWI</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<contact>
|
||||
<name></name>
|
||||
<organization></organization>
|
||||
<position></position>
|
||||
<voice></voice>
|
||||
<fax></fax>
|
||||
<email></email>
|
||||
<role></role>
|
||||
</contact>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent>
|
||||
<spatial minz="0" minx="0" miny="0" crs="" maxz="0" dimensions="2" maxy="0" maxx="0"/>
|
||||
<temporal>
|
||||
<period>
|
||||
<start></start>
|
||||
<end></end>
|
||||
</period>
|
||||
</temporal>
|
||||
</extent>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="WMSBackgroundLayer" value="false"/>
|
||||
<property key="WMSPublishDataSourceUrl" value="false"/>
|
||||
<property key="embeddedWidgets/count" value="0"/>
|
||||
<property key="identify/format" value="Html"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" nodataColor="" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast contrast="0" brightness="0"/>
|
||||
<huesaturation colorizeRed="255" colorizeStrength="100" grayscaleMode="0" colorizeOn="0" colorizeBlue="128" colorizeGreen="128" saturation="0"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<layerorder>
|
||||
<layer id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416"/>
|
||||
<layer id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b"/>
|
||||
</layerorder>
|
||||
<properties>
|
||||
<Gui>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
</Gui>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
<Measure>
|
||||
<Ellipsoid type="QString">WGS84</Ellipsoid>
|
||||
</Measure>
|
||||
<Measurement>
|
||||
<AreaUnits type="QString">m2</AreaUnits>
|
||||
<DistanceUnits type="QString">meters</DistanceUnits>
|
||||
</Measurement>
|
||||
<PAL>
|
||||
<CandidatesLine type="int">50</CandidatesLine>
|
||||
<CandidatesLinePerCM type="double">5</CandidatesLinePerCM>
|
||||
<CandidatesPoint type="int">16</CandidatesPoint>
|
||||
<CandidatesPolygon type="int">30</CandidatesPolygon>
|
||||
<CandidatesPolygonPerCM type="double">2.5</CandidatesPolygonPerCM>
|
||||
<DrawOutlineLabels type="bool">true</DrawOutlineLabels>
|
||||
<DrawRectOnly type="bool">false</DrawRectOnly>
|
||||
<DrawUnplaced type="bool">false</DrawUnplaced>
|
||||
<PlacementEngineVersion type="int">0</PlacementEngineVersion>
|
||||
<SearchMethod type="int">0</SearchMethod>
|
||||
<ShowingAllLabels type="bool">false</ShowingAllLabels>
|
||||
<ShowingCandidates type="bool">false</ShowingCandidates>
|
||||
<ShowingPartialsLabels type="bool">true</ShowingPartialsLabels>
|
||||
<TextFormat type="int">0</TextFormat>
|
||||
<UnplacedColor type="QString">255,0,0,255</UnplacedColor>
|
||||
</PAL>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<PositionPrecision>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
</PositionPrecision>
|
||||
<SpatialRefSys>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
</SpatialRefSys>
|
||||
</properties>
|
||||
<visibility-presets/>
|
||||
<transformContext/>
|
||||
<projectMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<author><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.</author>
|
||||
<creation>2019-06-10T14:55:55</creation>
|
||||
</projectMetadata>
|
||||
<Annotations/>
|
||||
<Layouts/>
|
||||
<Bookmarks/>
|
||||
<ProjectViewSettings UseProjectScales="0">
|
||||
<Scales/>
|
||||
</ProjectViewSettings>
|
||||
<ProjectDisplaySettings>
|
||||
<BearingFormat id="bearing">
|
||||
<Option type="Map">
|
||||
<Option type="QChar" value="" name="decimal_separator"/>
|
||||
<Option type="int" value="6" name="decimals"/>
|
||||
<Option type="int" value="0" name="direction_format"/>
|
||||
<Option type="int" value="0" name="rounding_type"/>
|
||||
<Option type="bool" value="false" name="show_plus"/>
|
||||
<Option type="bool" value="true" name="show_thousand_separator"/>
|
||||
<Option type="bool" value="false" name="show_trailing_zeros"/>
|
||||
<Option type="QChar" value="" name="thousand_separator"/>
|
||||
</Option>
|
||||
</BearingFormat>
|
||||
</ProjectDisplaySettings>
|
||||
</qgis>
|
||||
354
src/main/resources/static/resources/QGIS/NDWI_CMP.qgs
Normal file
@ -0,0 +1,354 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis projectname="" saveUser="ivanov.i" version="3.12.3-București" saveUserFull="Иванов И.">
|
||||
<homePath path=""/>
|
||||
<title></title>
|
||||
<autotransaction active="0"/>
|
||||
<evaluateDefaultValues active="0"/>
|
||||
<trust active="0"/>
|
||||
<projectCrs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</projectCrs>
|
||||
<layer-tree-group>
|
||||
<customproperties/>
|
||||
<layer-tree-layer checked="Qt::Checked" providerKey="wms" expanded="1" source="contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=NDWI_CMP:${day}NDWI_CMP_h20v03&layers=NDWI_CMP:${day}NDWI_CMP_h20v04&layers=NDWI_CMP:${day}NDWI_CMP_h21v03&layers=NDWI_CMP:${day}NDWI_CMP_h21v04&layers=NDWI_CMP:${day}NDWI_CMP_h21v05&layers=NDWI_CMP:${day}NDWI_CMP_h22v03&layers=NDWI_CMP:${day}NDWI_CMP_h22v04&layers=NDWI_CMP:${day}NDWI_CMP_h22v05&layers=NDWI_CMP:${day}NDWI_CMP_h23v03&layers=NDWI_CMP:${day}NDWI_CMP_h23v04&layers=NDWI_CMP:${day}NDWI_CMP_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms" legend_exp="" id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b" name="NDWI_CMP">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer checked="Qt::Checked" providerKey="wms" expanded="1" source="crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png" legend_exp="" id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416" name="OpenStreetMap">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<custom-order enabled="0">
|
||||
<item>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</item>
|
||||
<item>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</item>
|
||||
</custom-order>
|
||||
</layer-tree-group>
|
||||
<snapping-settings intersection-snapping="0" enabled="0" type="1" mode="2" tolerance="12" unit="1">
|
||||
<individual-layer-settings/>
|
||||
</snapping-settings>
|
||||
<relations/>
|
||||
<mapcanvas annotationsVisible="1" name="theMapCanvas">
|
||||
<units>meters</units>
|
||||
<extent>
|
||||
<xmin>3863030.08689398271963</xmin>
|
||||
<ymin>3270963.49336460698395967</ymin>
|
||||
<xmax>9122876.02687616087496281</xmax>
|
||||
<ymax>8530809.43334678560495377</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<expressionContextScope/>
|
||||
</mapcanvas>
|
||||
<projectModels/>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer checked="Qt::Checked" showFeatureCount="0" drawingOrder="-1" open="true" name="NDWI_CMP">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" visible="1" layerid="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer checked="Qt::Checked" showFeatureCount="0" drawingOrder="-1" open="true" name="OpenStreetMap">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" visible="1" layerid="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<mapViewDocks/>
|
||||
<mapViewDocks3D/>
|
||||
<projectlayers>
|
||||
<maplayer styleCategories="AllStyleCategories" type="raster" refreshOnNotifyMessage="" refreshOnNotifyEnabled="0" minScale="1e+08" autoRefreshEnabled="0" maxScale="0" hasScaleBasedVisibilityFlag="0" autoRefreshTime="0">
|
||||
<extent>
|
||||
<xmin>-20037508.34278924390673637</xmin>
|
||||
<ymin>-20037508.34278925508260727</ymin>
|
||||
<xmax>20037508.34278924390673637</xmax>
|
||||
<ymax>20037508.34278924390673637</ymax>
|
||||
</extent>
|
||||
<id>OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416</id>
|
||||
<datasource>crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>OpenStreetMap</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent/>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="identify/format" value="Undefined"/>
|
||||
<property key="ol_layer_type" value="OpenStreetMap"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" nodataColor="" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast contrast="0" brightness="0"/>
|
||||
<huesaturation colorizeRed="255" colorizeStrength="100" grayscaleMode="0" colorizeOn="0" colorizeBlue="128" colorizeGreen="128" saturation="0"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
<maplayer styleCategories="AllStyleCategories" type="raster" refreshOnNotifyMessage="" refreshOnNotifyEnabled="0" minScale="1e+08" autoRefreshEnabled="0" maxScale="0" hasScaleBasedVisibilityFlag="0" autoRefreshTime="0">
|
||||
<extent>
|
||||
<xmin>2906345.49411173490807414</xmin>
|
||||
<ymin>3503584.68813749961555004</ymin>
|
||||
<xmax>13358323.19605071656405926</xmax>
|
||||
<ymax>8399737.88861873932182789</ymax>
|
||||
</extent>
|
||||
<id>h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b</id>
|
||||
<datasource>contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=NDWI_CMP:${day}NDWI_CMP_h20v03&layers=NDWI_CMP:${day}NDWI_CMP_h20v04&layers=NDWI_CMP:${day}NDWI_CMP_h21v03&layers=NDWI_CMP:${day}NDWI_CMP_h21v04&layers=NDWI_CMP:${day}NDWI_CMP_h21v05&layers=NDWI_CMP:${day}NDWI_CMP_h22v03&layers=NDWI_CMP:${day}NDWI_CMP_h22v04&layers=NDWI_CMP:${day}NDWI_CMP_h22v05&layers=NDWI_CMP:${day}NDWI_CMP_h23v03&layers=NDWI_CMP:${day}NDWI_CMP_h23v04&layers=NDWI_CMP:${day}NDWI_CMP_h23v05&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&styles=&url=http://geoserver2.ccalm.org/wms</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>${day}NDWI_CMP</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["unknown"],AREA["World - 85°S to 85°N"],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<contact>
|
||||
<name></name>
|
||||
<organization></organization>
|
||||
<position></position>
|
||||
<voice></voice>
|
||||
<fax></fax>
|
||||
<email></email>
|
||||
<role></role>
|
||||
</contact>
|
||||
<links/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys>
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent>
|
||||
<spatial minz="0" minx="0" miny="0" crs="" maxz="0" dimensions="2" maxy="0" maxx="0"/>
|
||||
<temporal>
|
||||
<period>
|
||||
<start></start>
|
||||
<end></end>
|
||||
</period>
|
||||
</temporal>
|
||||
</extent>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="default">
|
||||
<map-layer-style name="default"/>
|
||||
</map-layer-style-manager>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<property key="WMSBackgroundLayer" value="false"/>
|
||||
<property key="WMSPublishDataSourceUrl" value="false"/>
|
||||
<property key="embeddedWidgets/count" value="0"/>
|
||||
<property key="identify/format" value="Html"/>
|
||||
</customproperties>
|
||||
<pipe>
|
||||
<rasterrenderer alphaBand="-1" type="singlebandcolordata" nodataColor="" opacity="1" band="1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast contrast="0" brightness="0"/>
|
||||
<huesaturation colorizeRed="255" colorizeStrength="100" grayscaleMode="0" colorizeOn="0" colorizeBlue="128" colorizeGreen="128" saturation="0"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<layerorder>
|
||||
<layer id="OpenStreetMap_b190df4b_967b_471d_9b9c_3cb1d5e3b416"/>
|
||||
<layer id="h23v05_h23v04_h23v03_h22v05_h22v04_h22v03_h21v05_h21v04_h21v03_h20v04_h20v03_9603ac31_1df8_4ac6_a749_7b7e66bb658b"/>
|
||||
</layerorder>
|
||||
<properties>
|
||||
<Gui>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
</Gui>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
<Measure>
|
||||
<Ellipsoid type="QString">WGS84</Ellipsoid>
|
||||
</Measure>
|
||||
<Measurement>
|
||||
<AreaUnits type="QString">m2</AreaUnits>
|
||||
<DistanceUnits type="QString">meters</DistanceUnits>
|
||||
</Measurement>
|
||||
<PAL>
|
||||
<CandidatesLine type="int">50</CandidatesLine>
|
||||
<CandidatesLinePerCM type="double">5</CandidatesLinePerCM>
|
||||
<CandidatesPoint type="int">16</CandidatesPoint>
|
||||
<CandidatesPolygon type="int">30</CandidatesPolygon>
|
||||
<CandidatesPolygonPerCM type="double">2.5</CandidatesPolygonPerCM>
|
||||
<DrawOutlineLabels type="bool">true</DrawOutlineLabels>
|
||||
<DrawRectOnly type="bool">false</DrawRectOnly>
|
||||
<DrawUnplaced type="bool">false</DrawUnplaced>
|
||||
<PlacementEngineVersion type="int">0</PlacementEngineVersion>
|
||||
<SearchMethod type="int">0</SearchMethod>
|
||||
<ShowingAllLabels type="bool">false</ShowingAllLabels>
|
||||
<ShowingCandidates type="bool">false</ShowingCandidates>
|
||||
<ShowingPartialsLabels type="bool">true</ShowingPartialsLabels>
|
||||
<TextFormat type="int">0</TextFormat>
|
||||
<UnplacedColor type="QString">255,0,0,255</UnplacedColor>
|
||||
</PAL>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<PositionPrecision>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
</PositionPrecision>
|
||||
<SpatialRefSys>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
</SpatialRefSys>
|
||||
</properties>
|
||||
<visibility-presets/>
|
||||
<transformContext/>
|
||||
<projectMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<author><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.</author>
|
||||
<creation>2019-06-10T14:55:55</creation>
|
||||
</projectMetadata>
|
||||
<Annotations/>
|
||||
<Layouts/>
|
||||
<Bookmarks/>
|
||||
<ProjectViewSettings UseProjectScales="0">
|
||||
<Scales/>
|
||||
</ProjectViewSettings>
|
||||
<ProjectDisplaySettings>
|
||||
<BearingFormat id="bearing">
|
||||
<Option type="Map">
|
||||
<Option type="QChar" value="" name="decimal_separator"/>
|
||||
<Option type="int" value="6" name="decimals"/>
|
||||
<Option type="int" value="0" name="direction_format"/>
|
||||
<Option type="int" value="0" name="rounding_type"/>
|
||||
<Option type="bool" value="false" name="show_plus"/>
|
||||
<Option type="bool" value="true" name="show_thousand_separator"/>
|
||||
<Option type="bool" value="false" name="show_trailing_zeros"/>
|
||||
<Option type="QChar" value="" name="thousand_separator"/>
|
||||
</Option>
|
||||
</BearingFormat>
|
||||
</ProjectDisplaySettings>
|
||||
</qgis>
|
||||
726
src/main/resources/static/resources/QGIS/SMAP.qgs
Normal file
@ -0,0 +1,726 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis version="3.40.10-Bratislava" saveDateTime="2025-09-14T16:54:26" projectname="" saveUser="ccalm.org" saveUserFull="ccalm.org">
|
||||
<homePath path=""/>
|
||||
<title></title>
|
||||
<transaction mode="Disabled"/>
|
||||
<projectFlags set=""/>
|
||||
<projectCrs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],MEMBER["World Geodetic System 1984 (G2296)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</projectCrs>
|
||||
<verticalCrs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</verticalCrs>
|
||||
<elevation-shading-renderer edl-distance="0.5" hillshading-is-active="0" is-active="0" combined-method="0" hillshading-z-factor="1" light-altitude="45" hillshading-is-multidirectional="0" edl-is-active="1" edl-distance-unit="0" light-azimuth="315" edl-strength="1000"/>
|
||||
<layer-tree-group>
|
||||
<customproperties>
|
||||
<Option/>
|
||||
</customproperties>
|
||||
<layer-tree-layer checked="Qt::Checked" legend_exp="" id="_8357e0b1_ef46_4436_ac52_f7a1b071a7a1" name="${date}" source="IgnoreGetMapUrl=1&contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=SMAP:${date}&styles&tilePixelRatio=0&url=http://geoserver2.ccalm.org/wms?viewparams%3Dtime_start:1667260800;time_end%3D1665532800;" providerKey="wms" patch_size="-1,-1" legend_split_behavior="0" expanded="1">
|
||||
<customproperties>
|
||||
<Option/>
|
||||
</customproperties>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer checked="Qt::Checked" legend_exp="" id="OpenStreetMap_3eefb26a_f2d2_4a0b_b3e0_3ed661cbbc5d" name="OpenStreetMap" source="crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png" providerKey="wms" patch_size="-1,-1" legend_split_behavior="0" expanded="1">
|
||||
<customproperties>
|
||||
<Option/>
|
||||
</customproperties>
|
||||
</layer-tree-layer>
|
||||
<custom-order enabled="0">
|
||||
<item>OpenStreetMap_3eefb26a_f2d2_4a0b_b3e0_3ed661cbbc5d</item>
|
||||
<item>_8357e0b1_ef46_4436_ac52_f7a1b071a7a1</item>
|
||||
</custom-order>
|
||||
</layer-tree-group>
|
||||
<snapping-settings maxScale="0" self-snapping="0" enabled="0" intersection-snapping="0" unit="1" scaleDependencyMode="0" type="1" mode="2" minScale="0" tolerance="12">
|
||||
<individual-layer-settings/>
|
||||
</snapping-settings>
|
||||
<relations/>
|
||||
<polymorphicRelations/>
|
||||
<mapcanvas name="theMapCanvas" annotationsVisible="1">
|
||||
<units>meters</units>
|
||||
<extent>
|
||||
<xmin>-21039383.75992870703339577</xmin>
|
||||
<ymin>-21039383.75992871075868607</ymin>
|
||||
<xmax>21039383.75992870703339577</xmax>
|
||||
<ymax>21039383.75992876291275024</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<destinationsrs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],MEMBER["World Geodetic System 1984 (G2296)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<expressionContextScope/>
|
||||
</mapcanvas>
|
||||
<projectModels/>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer checked="Qt::Checked" drawingOrder="-1" name="${date}" open="true" showFeatureCount="0">
|
||||
<filegroup hidden="false" open="true">
|
||||
<legendlayerfile isInOverview="0" layerid="_8357e0b1_ef46_4436_ac52_f7a1b071a7a1" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer checked="Qt::Checked" drawingOrder="-1" name="OpenStreetMap" open="true" showFeatureCount="0">
|
||||
<filegroup hidden="false" open="true">
|
||||
<legendlayerfile isInOverview="0" layerid="OpenStreetMap_3eefb26a_f2d2_4a0b_b3e0_3ed661cbbc5d" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<mapViewDocks/>
|
||||
<main-annotation-layer hasScaleBasedVisibilityFlag="0" maxScale="0" refreshOnNotifyEnabled="0" refreshOnNotifyMessage="" type="annotation" autoRefreshMode="Disabled" styleCategories="AllStyleCategories" autoRefreshTime="0" legendPlaceholderImage="" minScale="1e+08">
|
||||
<id>__________558d9f32_96f4_4271_9cb4_b90b4ebc6580</id>
|
||||
<datasource></datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>Аннотации</layername>
|
||||
<srs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],MEMBER["World Geodetic System 1984 (G2296)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<dates/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent/>
|
||||
</resourceMetadata>
|
||||
<items/>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
<Private>0</Private>
|
||||
</flags>
|
||||
<customproperties>
|
||||
<Option/>
|
||||
</customproperties>
|
||||
<layerOpacity>1</layerOpacity>
|
||||
<blendMode>0</blendMode>
|
||||
<paintEffect/>
|
||||
</main-annotation-layer>
|
||||
<projectlayers>
|
||||
<maplayer hasScaleBasedVisibilityFlag="0" maxScale="0" refreshOnNotifyEnabled="0" refreshOnNotifyMessage="" type="raster" autoRefreshMode="Disabled" styleCategories="AllStyleCategories" autoRefreshTime="0" legendPlaceholderImage="" minScale="1e+08">
|
||||
<extent>
|
||||
<xmin>-20037508.34278924390673637</xmin>
|
||||
<ymin>-20037508.34278924763202667</ymin>
|
||||
<xmax>20037508.34278924390673637</xmax>
|
||||
<ymax>20037508.34278924763202667</ymax>
|
||||
</extent>
|
||||
<wgs84extent>
|
||||
<xmin>-180</xmin>
|
||||
<ymin>-85.05112877980660357</ymin>
|
||||
<xmax>180</xmax>
|
||||
<ymax>85.05112877980660357</ymax>
|
||||
</wgs84extent>
|
||||
<id>OpenStreetMap_3eefb26a_f2d2_4a0b_b3e0_3ed661cbbc5d</id>
|
||||
<datasource>crs=EPSG:3857&format&type=xyz&url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>OpenStreetMap</layername>
|
||||
<srs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],MEMBER["World Geodetic System 1984 (G2296)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier>Тайлы OpenStreetMap</identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type>dataset</type>
|
||||
<title>Тайлы OpenStreetMap</title>
|
||||
<abstract>Проект OpenStreetMap создан картографическим сообществом, создающим и распространяющим данные о дорогах, территориях, границах и многом другом по всему миру.</abstract>
|
||||
<links>
|
||||
<link name="Источник" mimeType="" size="" description="" format="" type="WWW:LINK" url="https://www.openstreetmap.org/"/>
|
||||
</links>
|
||||
<dates/>
|
||||
<fees></fees>
|
||||
<rights>Базовая карта и данные подготовлены сообществом OpenStreetMap (CC-BY-SA). © https://www.openstreetmap.org and contributors.</rights>
|
||||
<license>Лицензия Open Data Commons Open Database (ODbL)</license>
|
||||
<license>Creative Commons Attribution-ShareAlike (CC-BY-SA)</license>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],MEMBER["World Geodetic System 1984 (G2296)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent>
|
||||
<spatial miny="-85.05112877980660357" crs="EPSG:4326" dimensions="2" minx="-180" maxz="0" minz="0" maxx="180" maxy="85.05112877980660357"/>
|
||||
</extent>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="по умолчанию">
|
||||
<map-layer-style name="по умолчанию"/>
|
||||
</map-layer-style-manager>
|
||||
<metadataUrls/>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
<Private>0</Private>
|
||||
</flags>
|
||||
<temporal bandNumber="1" enabled="0" mode="0" fetchMode="0">
|
||||
<fixedRange>
|
||||
<start></start>
|
||||
<end></end>
|
||||
</fixedRange>
|
||||
</temporal>
|
||||
<elevation enabled="0" band="1" symbology="Line" zscale="1" mode="RepresentsElevationSurface" zoffset="0">
|
||||
<data-defined-properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data-defined-properties>
|
||||
<profileLineSymbol>
|
||||
<symbol alpha="1" clip_to_extent="1" is_animated="0" frame_rate="10" name="" type="line" force_rhr="0">
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
<layer id="{d5b45c66-5ba4-4ffe-928b-b76180ae5d44}" locked="0" enabled="1" class="SimpleLine" pass="0">
|
||||
<Option type="Map">
|
||||
<Option value="0" name="align_dash_pattern" type="QString"/>
|
||||
<Option value="square" name="capstyle" type="QString"/>
|
||||
<Option value="5;2" name="customdash" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="customdash_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="customdash_unit" type="QString"/>
|
||||
<Option value="0" name="dash_pattern_offset" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="dash_pattern_offset_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="dash_pattern_offset_unit" type="QString"/>
|
||||
<Option value="0" name="draw_inside_polygon" type="QString"/>
|
||||
<Option value="bevel" name="joinstyle" type="QString"/>
|
||||
<Option value="196,60,57,255,rgb:0.7686274509803922,0.23529411764705882,0.22352941176470589,1" name="line_color" type="QString"/>
|
||||
<Option value="solid" name="line_style" type="QString"/>
|
||||
<Option value="0.6" name="line_width" type="QString"/>
|
||||
<Option value="MM" name="line_width_unit" type="QString"/>
|
||||
<Option value="0" name="offset" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="offset_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="offset_unit" type="QString"/>
|
||||
<Option value="0" name="ring_filter" type="QString"/>
|
||||
<Option value="0" name="trim_distance_end" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="trim_distance_end_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="trim_distance_end_unit" type="QString"/>
|
||||
<Option value="0" name="trim_distance_start" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="trim_distance_start_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="trim_distance_start_unit" type="QString"/>
|
||||
<Option value="0" name="tweak_dash_pattern_on_corners" type="QString"/>
|
||||
<Option value="0" name="use_custom_dash" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="width_map_unit_scale" type="QString"/>
|
||||
</Option>
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
</layer>
|
||||
</symbol>
|
||||
</profileLineSymbol>
|
||||
<profileFillSymbol>
|
||||
<symbol alpha="1" clip_to_extent="1" is_animated="0" frame_rate="10" name="" type="fill" force_rhr="0">
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
<layer id="{b4e5f16d-cf22-4f7a-a750-417fa434755d}" locked="0" enabled="1" class="SimpleFill" pass="0">
|
||||
<Option type="Map">
|
||||
<Option value="3x:0,0,0,0,0,0" name="border_width_map_unit_scale" type="QString"/>
|
||||
<Option value="196,60,57,255,rgb:0.7686274509803922,0.23529411764705882,0.22352941176470589,1" name="color" type="QString"/>
|
||||
<Option value="bevel" name="joinstyle" type="QString"/>
|
||||
<Option value="0,0" name="offset" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="offset_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="offset_unit" type="QString"/>
|
||||
<Option value="35,35,35,255,rgb:0.13725490196078433,0.13725490196078433,0.13725490196078433,1" name="outline_color" type="QString"/>
|
||||
<Option value="no" name="outline_style" type="QString"/>
|
||||
<Option value="0.26" name="outline_width" type="QString"/>
|
||||
<Option value="MM" name="outline_width_unit" type="QString"/>
|
||||
<Option value="solid" name="style" type="QString"/>
|
||||
</Option>
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
</layer>
|
||||
</symbol>
|
||||
</profileFillSymbol>
|
||||
</elevation>
|
||||
<customproperties>
|
||||
<Option type="Map">
|
||||
<Option value="Value" name="identify/format" type="QString"/>
|
||||
<Option value="OpenStreetMap" name="ol_layer_type" type="QString"/>
|
||||
</Option>
|
||||
</customproperties>
|
||||
<mapTip enabled="1"></mapTip>
|
||||
<pipe-data-defined-properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</pipe-data-defined-properties>
|
||||
<pipe>
|
||||
<provider>
|
||||
<resampling zoomedInResamplingMethod="nearestNeighbour" zoomedOutResamplingMethod="nearestNeighbour" maxOversampling="2" enabled="false"/>
|
||||
</provider>
|
||||
<rasterrenderer opacity="1" nodataColor="" type="singlebandcolordata" band="1" alphaBand="-1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast brightness="0" gamma="1" contrast="0"/>
|
||||
<huesaturation colorizeOn="0" colorizeGreen="128" colorizeStrength="100" colorizeRed="255" saturation="0" colorizeBlue="128" grayscaleMode="0" invertColors="0"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
<resamplingStage>resamplingFilter</resamplingStage>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
<maplayer hasScaleBasedVisibilityFlag="0" maxScale="0" refreshOnNotifyEnabled="0" refreshOnNotifyMessage="" type="raster" autoRefreshMode="Disabled" styleCategories="AllStyleCategories" autoRefreshTime="0" legendPlaceholderImage="" minScale="1e+08">
|
||||
<extent>
|
||||
<xmin>-20037508.33720675110816956</xmin>
|
||||
<ymin>-19983484.6311938650906086</ymin>
|
||||
<xmax>20037055.05812187492847443</xmax>
|
||||
<ymax>20028962.62836629152297974</ymax>
|
||||
</extent>
|
||||
<wgs84extent>
|
||||
<xmin>-179.99999994985159901</xmin>
|
||||
<ymin>-85.00908611398735104</ymin>
|
||||
<xmax>179.99592807455246657</xmax>
|
||||
<ymax>85.04450187956545903</ymax>
|
||||
</wgs84extent>
|
||||
<id>_8357e0b1_ef46_4436_ac52_f7a1b071a7a1</id>
|
||||
<datasource>IgnoreGetMapUrl=1&contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=SMAP:${date}&styles&tilePixelRatio=0&url=http://geoserver2.ccalm.org/wms?viewparams%3Dtime_start:1667260800;time_end%3D1665532800;</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>${date}</layername>
|
||||
<srs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],MEMBER["World Geodetic System 1984 (G2296)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<resourceMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<dates/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent/>
|
||||
</resourceMetadata>
|
||||
<provider>wms</provider>
|
||||
<noData>
|
||||
<noDataList bandNo="1" useSrcNoData="0"/>
|
||||
</noData>
|
||||
<map-layer-style-manager current="по умолчанию">
|
||||
<map-layer-style name="по умолчанию"/>
|
||||
</map-layer-style-manager>
|
||||
<metadataUrls/>
|
||||
<flags>
|
||||
<Identifiable>1</Identifiable>
|
||||
<Removable>1</Removable>
|
||||
<Searchable>1</Searchable>
|
||||
<Private>0</Private>
|
||||
</flags>
|
||||
<temporal bandNumber="1" enabled="0" mode="0" fetchMode="0">
|
||||
<fixedRange>
|
||||
<start></start>
|
||||
<end></end>
|
||||
</fixedRange>
|
||||
</temporal>
|
||||
<elevation enabled="0" band="1" symbology="Line" zscale="1" mode="RepresentsElevationSurface" zoffset="0">
|
||||
<data-defined-properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data-defined-properties>
|
||||
<profileLineSymbol>
|
||||
<symbol alpha="1" clip_to_extent="1" is_animated="0" frame_rate="10" name="" type="line" force_rhr="0">
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
<layer id="{1dfb735b-fea3-4003-9474-23a8751d6963}" locked="0" enabled="1" class="SimpleLine" pass="0">
|
||||
<Option type="Map">
|
||||
<Option value="0" name="align_dash_pattern" type="QString"/>
|
||||
<Option value="square" name="capstyle" type="QString"/>
|
||||
<Option value="5;2" name="customdash" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="customdash_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="customdash_unit" type="QString"/>
|
||||
<Option value="0" name="dash_pattern_offset" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="dash_pattern_offset_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="dash_pattern_offset_unit" type="QString"/>
|
||||
<Option value="0" name="draw_inside_polygon" type="QString"/>
|
||||
<Option value="bevel" name="joinstyle" type="QString"/>
|
||||
<Option value="145,82,45,255,rgb:0.56862745098039214,0.32156862745098042,0.17647058823529413,1" name="line_color" type="QString"/>
|
||||
<Option value="solid" name="line_style" type="QString"/>
|
||||
<Option value="0.6" name="line_width" type="QString"/>
|
||||
<Option value="MM" name="line_width_unit" type="QString"/>
|
||||
<Option value="0" name="offset" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="offset_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="offset_unit" type="QString"/>
|
||||
<Option value="0" name="ring_filter" type="QString"/>
|
||||
<Option value="0" name="trim_distance_end" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="trim_distance_end_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="trim_distance_end_unit" type="QString"/>
|
||||
<Option value="0" name="trim_distance_start" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="trim_distance_start_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="trim_distance_start_unit" type="QString"/>
|
||||
<Option value="0" name="tweak_dash_pattern_on_corners" type="QString"/>
|
||||
<Option value="0" name="use_custom_dash" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="width_map_unit_scale" type="QString"/>
|
||||
</Option>
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
</layer>
|
||||
</symbol>
|
||||
</profileLineSymbol>
|
||||
<profileFillSymbol>
|
||||
<symbol alpha="1" clip_to_extent="1" is_animated="0" frame_rate="10" name="" type="fill" force_rhr="0">
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
<layer id="{78080609-56f0-4394-b59b-96a6fe98a63f}" locked="0" enabled="1" class="SimpleFill" pass="0">
|
||||
<Option type="Map">
|
||||
<Option value="3x:0,0,0,0,0,0" name="border_width_map_unit_scale" type="QString"/>
|
||||
<Option value="145,82,45,255,rgb:0.56862745098039214,0.32156862745098042,0.17647058823529413,1" name="color" type="QString"/>
|
||||
<Option value="bevel" name="joinstyle" type="QString"/>
|
||||
<Option value="0,0" name="offset" type="QString"/>
|
||||
<Option value="3x:0,0,0,0,0,0" name="offset_map_unit_scale" type="QString"/>
|
||||
<Option value="MM" name="offset_unit" type="QString"/>
|
||||
<Option value="35,35,35,255,rgb:0.13725490196078433,0.13725490196078433,0.13725490196078433,1" name="outline_color" type="QString"/>
|
||||
<Option value="no" name="outline_style" type="QString"/>
|
||||
<Option value="0.26" name="outline_width" type="QString"/>
|
||||
<Option value="MM" name="outline_width_unit" type="QString"/>
|
||||
<Option value="solid" name="style" type="QString"/>
|
||||
</Option>
|
||||
<data_defined_properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</data_defined_properties>
|
||||
</layer>
|
||||
</symbol>
|
||||
</profileFillSymbol>
|
||||
</elevation>
|
||||
<customproperties>
|
||||
<Option type="Map">
|
||||
<Option value="Html" name="identify/format" type="QString"/>
|
||||
</Option>
|
||||
</customproperties>
|
||||
<mapTip enabled="1"></mapTip>
|
||||
<pipe-data-defined-properties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</pipe-data-defined-properties>
|
||||
<pipe>
|
||||
<provider>
|
||||
<resampling zoomedInResamplingMethod="nearestNeighbour" zoomedOutResamplingMethod="nearestNeighbour" maxOversampling="2" enabled="false"/>
|
||||
</provider>
|
||||
<rasterrenderer opacity="1" nodataColor="" type="singlebandcolordata" band="1" alphaBand="-1">
|
||||
<rasterTransparency/>
|
||||
<minMaxOrigin>
|
||||
<limits>None</limits>
|
||||
<extent>WholeRaster</extent>
|
||||
<statAccuracy>Estimated</statAccuracy>
|
||||
<cumulativeCutLower>0.02</cumulativeCutLower>
|
||||
<cumulativeCutUpper>0.98</cumulativeCutUpper>
|
||||
<stdDevFactor>2</stdDevFactor>
|
||||
</minMaxOrigin>
|
||||
</rasterrenderer>
|
||||
<brightnesscontrast brightness="0" gamma="1" contrast="0"/>
|
||||
<huesaturation colorizeOn="0" colorizeGreen="128" colorizeStrength="100" colorizeRed="255" saturation="0" colorizeBlue="128" grayscaleMode="0" invertColors="0"/>
|
||||
<rasterresampler maxOversampling="2"/>
|
||||
<resamplingStage>resamplingFilter</resamplingStage>
|
||||
</pipe>
|
||||
<blendMode>0</blendMode>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<layerorder>
|
||||
<layer id="OpenStreetMap_3eefb26a_f2d2_4a0b_b3e0_3ed661cbbc5d"/>
|
||||
<layer id="_8357e0b1_ef46_4436_ac52_f7a1b071a7a1"/>
|
||||
</layerorder>
|
||||
<labelEngineSettings/>
|
||||
<properties>
|
||||
<Digitizing>
|
||||
<AvoidIntersectionsMode type="int">0</AvoidIntersectionsMode>
|
||||
</Digitizing>
|
||||
<Gui>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
</Gui>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
<Measure>
|
||||
<Ellipsoid type="QString">EPSG:7030</Ellipsoid>
|
||||
</Measure>
|
||||
<Measurement>
|
||||
<AreaUnits type="QString">m2</AreaUnits>
|
||||
<DistanceUnits type="QString">meters</DistanceUnits>
|
||||
</Measurement>
|
||||
<PAL>
|
||||
<CandidatesLinePerCM type="double">5</CandidatesLinePerCM>
|
||||
<CandidatesPolygonPerCM type="double">2.5</CandidatesPolygonPerCM>
|
||||
<DrawLabelMetrics type="bool">false</DrawLabelMetrics>
|
||||
<DrawRectOnly type="bool">false</DrawRectOnly>
|
||||
<DrawUnplaced type="bool">false</DrawUnplaced>
|
||||
<PlacementEngineVersion type="int">1</PlacementEngineVersion>
|
||||
<SearchMethod type="int">0</SearchMethod>
|
||||
<ShowingAllLabels type="bool">false</ShowingAllLabels>
|
||||
<ShowingCandidates type="bool">false</ShowingCandidates>
|
||||
<ShowingPartialsLabels type="bool">true</ShowingPartialsLabels>
|
||||
<TextFormat type="int">0</TextFormat>
|
||||
<UnplacedColor type="QString">255,0,0,255,rgb:1,0,0,1</UnplacedColor>
|
||||
</PAL>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<PositionPrecision>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
</PositionPrecision>
|
||||
<SpatialRefSys>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
</SpatialRefSys>
|
||||
</properties>
|
||||
<dataDefinedServerProperties>
|
||||
<Option type="Map">
|
||||
<Option value="" name="name" type="QString"/>
|
||||
<Option name="properties"/>
|
||||
<Option value="collection" name="type" type="QString"/>
|
||||
</Option>
|
||||
</dataDefinedServerProperties>
|
||||
<visibility-presets/>
|
||||
<transformContext/>
|
||||
<projectMetadata>
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<dates>
|
||||
<date value="2023-09-08T15:00:38" type="Created"/>
|
||||
</dates>
|
||||
<author>Igor Ivanov</author>
|
||||
<creation>2023-09-08T15:00:38</creation>
|
||||
</projectMetadata>
|
||||
<Annotations/>
|
||||
<Layouts/>
|
||||
<mapViewDocks3D/>
|
||||
<Bookmarks/>
|
||||
<Sensors/>
|
||||
<ProjectViewSettings UseProjectScales="0" rotation="0">
|
||||
<Scales/>
|
||||
<DefaultViewExtent xmin="-33704768.02996301651000977" ymin="-21039383.75992871075868607" xmax="33704768.02996301651000977" ymax="21039383.75992876291275024">
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],MEMBER["World Geodetic System 1984 (G2296)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo-Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</DefaultViewExtent>
|
||||
</ProjectViewSettings>
|
||||
<ProjectStyleSettings iccProfileId="attachment:///" RandomizeDefaultSymbolColor="1" DefaultSymbolOpacity="1" colorModel="Rgb" projectStyleId="attachment:///TNjckE_styles.db">
|
||||
<databases/>
|
||||
</ProjectStyleSettings>
|
||||
<ProjectTimeSettings timeStepUnit="h" cumulativeTemporalRange="0" timeStep="1" totalMovieFrames="100" frameRate="1"/>
|
||||
<ElevationProperties FilterInvertSlider="0">
|
||||
<terrainProvider type="flat">
|
||||
<TerrainProvider scale="1" offset="0"/>
|
||||
</terrainProvider>
|
||||
</ElevationProperties>
|
||||
<ProjectDisplaySettings CoordinateType="MapCrs" CoordinateAxisOrder="Default">
|
||||
<BearingFormat id="bearing">
|
||||
<Option type="Map">
|
||||
<Option name="decimal_separator" type="invalid"/>
|
||||
<Option value="6" name="decimals" type="int"/>
|
||||
<Option value="0" name="direction_format" type="int"/>
|
||||
<Option value="0" name="rounding_type" type="int"/>
|
||||
<Option value="false" name="show_plus" type="bool"/>
|
||||
<Option value="true" name="show_thousand_separator" type="bool"/>
|
||||
<Option value="false" name="show_trailing_zeros" type="bool"/>
|
||||
<Option name="thousand_separator" type="invalid"/>
|
||||
</Option>
|
||||
</BearingFormat>
|
||||
<GeographicCoordinateFormat id="geographiccoordinate">
|
||||
<Option type="Map">
|
||||
<Option value="DecimalDegrees" name="angle_format" type="QString"/>
|
||||
<Option name="decimal_separator" type="invalid"/>
|
||||
<Option value="6" name="decimals" type="int"/>
|
||||
<Option value="0" name="rounding_type" type="int"/>
|
||||
<Option value="false" name="show_leading_degree_zeros" type="bool"/>
|
||||
<Option value="false" name="show_leading_zeros" type="bool"/>
|
||||
<Option value="false" name="show_plus" type="bool"/>
|
||||
<Option value="false" name="show_suffix" type="bool"/>
|
||||
<Option value="true" name="show_thousand_separator" type="bool"/>
|
||||
<Option value="false" name="show_trailing_zeros" type="bool"/>
|
||||
<Option name="thousand_separator" type="invalid"/>
|
||||
</Option>
|
||||
</GeographicCoordinateFormat>
|
||||
<CoordinateCustomCrs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt>GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],MEMBER["World Geodetic System 1984 (G2296)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]]</wkt>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>EPSG:7030</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</CoordinateCustomCrs>
|
||||
</ProjectDisplaySettings>
|
||||
<ProjectGpsSettings autoAddTrackVertices="0" autoCommitFeatures="0" destinationFollowsActiveLayer="1" destinationLayer="">
|
||||
<timeStampFields/>
|
||||
</ProjectGpsSettings>
|
||||
</qgis>
|
||||
1924
src/main/resources/static/resources/QGIS/air_temperature.qgs
Normal file
3720
src/main/resources/static/resources/QGIS/frmlocust_bands.qgs
Normal file
2998
src/main/resources/static/resources/QGIS/frmlocust_pods_density.qgs
Normal file
3720
src/main/resources/static/resources/QGIS/frmlocust_swarms.qgs
Normal file
3803
src/main/resources/static/resources/QGIS/frmlocustdel.qgs
Normal file
1230
src/main/resources/static/resources/QGIS/frmlocustinfo_p2.qgs
Normal file
509
src/main/resources/static/resources/QGIS/frmlocustinfo_p2r.qgs
Normal file
@ -0,0 +1,509 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis projectname="" version="2.18.6">
|
||||
<title></title>
|
||||
<autotransaction active="0"/>
|
||||
<evaluateDefaultValues active="0"/>
|
||||
<layer-tree-group expanded="1" checked="Qt::PartiallyChecked" name="">
|
||||
<customproperties/>
|
||||
<layer-tree-layer expanded="1" providerKey="postgres" checked="Qt::Checked" id="view_frmlocustinfo_p2r_${year}20170221133600806" source="dbname='CCALM' host=ccalm.org port=5432 user='guest' sslmode=disable key='region_id' estimatedmetadata=true srid=4326 type=MultiPolygon table="public"."view_frmlocustinfo_p2r_${year}" (geom) sql=${sql}" name="trt('Maps_of_areas_infested_above_Economic_Threshold_(ET)')">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer expanded="1" providerKey="" checked="Qt::Unchecked" id="OpenLayers_plugin_layer20170821155911549" source="" name="Bing Aerial with labels">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
</layer-tree-group>
|
||||
<relations/>
|
||||
<mapcanvas>
|
||||
<units>meters</units>
|
||||
<extent>
|
||||
<xmin>4606484.6726676719263196</xmin>
|
||||
<ymin>3728012.39886604063212872</ymin>
|
||||
<xmax>9866330.61264913156628609</xmax>
|
||||
<ymax>8074944.57324538938701153</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<projections>1</projections>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<layer_coordinate_transform_info>
|
||||
<layer_coordinate_transform destAuthId="EPSG:3857" srcAuthId="EPSG:4326" srcDatumTransform="-1" destDatumTransform="-1" layerid="view_frmlocustinfo_p2r_${year}20170221133600806"/>
|
||||
<layer_coordinate_transform destAuthId="EPSG:3857" srcAuthId="EPSG:3857" srcDatumTransform="-1" destDatumTransform="-1" layerid="OpenLayers_plugin_layer20170821155911549"/>
|
||||
</layer_coordinate_transform_info>
|
||||
</mapcanvas>
|
||||
<layer-tree-canvas>
|
||||
<custom-order enabled="0">
|
||||
<item>view_frmlocustinfo_p2r_${year}20170221133600806</item>
|
||||
<item>OpenStreetMap20170221155223210</item>
|
||||
</custom-order>
|
||||
</layer-tree-canvas>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer drawingOrder="-1" open="true" checked="Qt::Checked" name="trt('Maps_of_areas_infested_above_Economic_Threshold_(ET)')" showFeatureCount="0">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="view_frmlocustinfo_p2r_${year}20170221133600806" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer drawingOrder="-1" open="true" checked="Qt::Unchecked" name="Bing Aerial with labels" showFeatureCount="0">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="OpenLayers_plugin_layer20170821155911549" visible="0"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<projectlayers>
|
||||
|
||||
|
||||
<maplayer simplifyAlgorithm="0" minimumScale="0" maximumScale="1e+08" simplifyDrawingHints="1" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" readOnly="0" geometry="Polygon" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
|
||||
<extent>
|
||||
<xmin>-180</xmin>
|
||||
<ymin>38.39295510000000178</ymin>
|
||||
<xmax>180</xmax>
|
||||
<ymax>82.05862320000009902</ymax>
|
||||
</extent>
|
||||
<id>view_frmlocustinfo_p2r_${year}20170221133600806</id>
|
||||
<datasource>dbname='CCALM' host=ccalm.org port=5432 user='guest' password='B2C0D5C60590' sslmode=disable key='region_id' estimatedmetadata=true srid=4326 type=MultiPolygon table="main"."view_frmlocustinfo_p2r_${year}" (geom) sql=${sql}</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>trt('Maps_of_areas_infested_above_Economic_Threshold_(ET)')</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<provider encoding="System">postgres</provider>
|
||||
<vectorjoins/>
|
||||
<layerDependencies/>
|
||||
<expressionfields/>
|
||||
<map-layer-style-manager current="">
|
||||
<map-layer-style name=""/>
|
||||
</map-layer-style-manager>
|
||||
<edittypes>
|
||||
<edittype widgetv2type="TextEdit" name="country_id">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="region_id">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="locust_type_id">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="name">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="percent">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
</edittypes>
|
||||
<renderer-v2 forceraster="0" symbollevels="0" type="RuleRenderer" enableorderby="0">
|
||||
<rules key="{d1a60575-15b9-4869-b52b-df5b4d4f16de}">
|
||||
<rule filter=" "percent" > 15" key="{659cc803-83ee-4573-a115-4a5c3cfc7629}" symbol="0" label=">15% trt('Increase')"/>
|
||||
<rule filter=" "percent" < 15 AND "percent" > -15" key="{9ceb56b1-6469-4f8a-9527-51a1d2151967}" symbol="2" label=">=15% trt('and') <=15% trt('On_the_same_level')"/>
|
||||
<rule filter=" "percent" < -15" key="{b6d444f7-e753-4650-a049-92c6e40dd0bc}" symbol="1" label="<15% trt('Decrease')"/>
|
||||
<rule filter=" "percent" is null" key="{c017f2c4-f56f-48a8-bbc4-987fa0f239a9}" symbol="3" label="trt('No_data')"/>
|
||||
</rules>
|
||||
<symbols>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="0">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="255,0,0,102"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,255,128"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="2">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="255,238,0,102"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,255,128"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="1">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="0,255,76,102"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,255,128"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="3">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="150,150,150,102"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,0,255"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</symbols>
|
||||
</renderer-v2>
|
||||
<labeling type="simple"/>
|
||||
<customproperties>
|
||||
<property key="embeddedWidgets/count" value="0"/>
|
||||
<property key="labeling" value="pal"/>
|
||||
<property key="labeling/addDirectionSymbol" value="false"/>
|
||||
<property key="labeling/angleOffset" value="0"/>
|
||||
<property key="labeling/blendMode" value="0"/>
|
||||
<property key="labeling/bufferBlendMode" value="0"/>
|
||||
<property key="labeling/bufferColorA" value="255"/>
|
||||
<property key="labeling/bufferColorB" value="255"/>
|
||||
<property key="labeling/bufferColorG" value="255"/>
|
||||
<property key="labeling/bufferColorR" value="255"/>
|
||||
<property key="labeling/bufferDraw" value="true"/>
|
||||
<property key="labeling/bufferJoinStyle" value="128"/>
|
||||
<property key="labeling/bufferNoFill" value="false"/>
|
||||
<property key="labeling/bufferSize" value="1"/>
|
||||
<property key="labeling/bufferSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/bufferSizeMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/bufferTransp" value="0"/>
|
||||
<property key="labeling/centroidInside" value="true"/>
|
||||
<property key="labeling/centroidWhole" value="false"/>
|
||||
<property key="labeling/dataDefined/CentroidWhole" value="0~~0~~~~name"/>
|
||||
<property key="labeling/dataDefined/ScaleVisibility" value="0~~0~~~~name"/>
|
||||
<property key="labeling/decimals" value="3"/>
|
||||
<property key="labeling/displayAll" value="true"/>
|
||||
<property key="labeling/dist" value="0"/>
|
||||
<property key="labeling/distInMapUnits" value="true"/>
|
||||
<property key="labeling/distMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/drawLabels" value="true"/>
|
||||
<property key="labeling/enabled" value="true"/>
|
||||
<property key="labeling/fieldName" value=""name"||'\n'|| "percent"||'%' "/>
|
||||
<property key="labeling/fitInPolygonOnly" value="true"/>
|
||||
<property key="labeling/fontCapitals" value="4"/>
|
||||
<property key="labeling/fontFamily" value="Arial"/>
|
||||
<property key="labeling/fontItalic" value="false"/>
|
||||
<property key="labeling/fontLetterSpacing" value="0"/>
|
||||
<property key="labeling/fontLimitPixelSize" value="false"/>
|
||||
<property key="labeling/fontMaxPixelSize" value="10000"/>
|
||||
<property key="labeling/fontMinPixelSize" value="3"/>
|
||||
<property key="labeling/fontSize" value="7"/>
|
||||
<property key="labeling/fontSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/fontSizeMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/fontStrikeout" value="false"/>
|
||||
<property key="labeling/fontUnderline" value="false"/>
|
||||
<property key="labeling/fontWeight" value="75"/>
|
||||
<property key="labeling/fontWordSpacing" value="0"/>
|
||||
<property key="labeling/formatNumbers" value="false"/>
|
||||
<property key="labeling/isExpression" value="true"/>
|
||||
<property key="labeling/labelOffsetInMapUnits" value="false"/>
|
||||
<property key="labeling/labelOffsetMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/labelPerPart" value="false"/>
|
||||
<property key="labeling/leftDirectionSymbol" value="<"/>
|
||||
<property key="labeling/limitNumLabels" value="false"/>
|
||||
<property key="labeling/maxCurvedCharAngleIn" value="25"/>
|
||||
<property key="labeling/maxCurvedCharAngleOut" value="-25"/>
|
||||
<property key="labeling/maxNumLabels" value="2000"/>
|
||||
<property key="labeling/mergeLines" value="false"/>
|
||||
<property key="labeling/minFeatureSize" value="3"/>
|
||||
<property key="labeling/multilineAlign" value="4294967295"/>
|
||||
<property key="labeling/multilineHeight" value="1"/>
|
||||
<property key="labeling/namedStyle" value="Bold"/>
|
||||
<property key="labeling/obstacle" value="false"/>
|
||||
<property key="labeling/obstacleFactor" value="0"/>
|
||||
<property key="labeling/obstacleType" value="0"/>
|
||||
<property key="labeling/offsetType" value="0"/>
|
||||
<property key="labeling/placeDirectionSymbol" value="0"/>
|
||||
<property key="labeling/placement" value="1"/>
|
||||
<property key="labeling/placementFlags" value="7"/>
|
||||
<property key="labeling/plussign" value="false"/>
|
||||
<property key="labeling/predefinedPositionOrder" value="TR,TL,BR,BL,R,L,TSR,BSR"/>
|
||||
<property key="labeling/preserveRotation" value="true"/>
|
||||
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
|
||||
<property key="labeling/priority" value="5"/>
|
||||
<property key="labeling/quadOffset" value="1"/>
|
||||
<property key="labeling/repeatDistance" value="0"/>
|
||||
<property key="labeling/repeatDistanceMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/repeatDistanceUnit" value="1"/>
|
||||
<property key="labeling/reverseDirectionSymbol" value="false"/>
|
||||
<property key="labeling/rightDirectionSymbol" value=">"/>
|
||||
<property key="labeling/scaleMax" value="35000000"/>
|
||||
<property key="labeling/scaleMin" value="1"/>
|
||||
<property key="labeling/scaleVisibility" value="true"/>
|
||||
<property key="labeling/shadowBlendMode" value="6"/>
|
||||
<property key="labeling/shadowColorB" value="0"/>
|
||||
<property key="labeling/shadowColorG" value="0"/>
|
||||
<property key="labeling/shadowColorR" value="0"/>
|
||||
<property key="labeling/shadowDraw" value="false"/>
|
||||
<property key="labeling/shadowOffsetAngle" value="135"/>
|
||||
<property key="labeling/shadowOffsetDist" value="1"/>
|
||||
<property key="labeling/shadowOffsetGlobal" value="true"/>
|
||||
<property key="labeling/shadowOffsetMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shadowOffsetUnits" value="1"/>
|
||||
<property key="labeling/shadowRadius" value="1.5"/>
|
||||
<property key="labeling/shadowRadiusAlphaOnly" value="false"/>
|
||||
<property key="labeling/shadowRadiusMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shadowRadiusUnits" value="1"/>
|
||||
<property key="labeling/shadowScale" value="100"/>
|
||||
<property key="labeling/shadowTransparency" value="30"/>
|
||||
<property key="labeling/shadowUnder" value="0"/>
|
||||
<property key="labeling/shapeBlendMode" value="0"/>
|
||||
<property key="labeling/shapeBorderColorA" value="255"/>
|
||||
<property key="labeling/shapeBorderColorB" value="128"/>
|
||||
<property key="labeling/shapeBorderColorG" value="128"/>
|
||||
<property key="labeling/shapeBorderColorR" value="128"/>
|
||||
<property key="labeling/shapeBorderWidth" value="0"/>
|
||||
<property key="labeling/shapeBorderWidthMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeBorderWidthUnits" value="1"/>
|
||||
<property key="labeling/shapeDraw" value="false"/>
|
||||
<property key="labeling/shapeFillColorA" value="255"/>
|
||||
<property key="labeling/shapeFillColorB" value="255"/>
|
||||
<property key="labeling/shapeFillColorG" value="255"/>
|
||||
<property key="labeling/shapeFillColorR" value="255"/>
|
||||
<property key="labeling/shapeJoinStyle" value="64"/>
|
||||
<property key="labeling/shapeOffsetMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeOffsetUnits" value="1"/>
|
||||
<property key="labeling/shapeOffsetX" value="0"/>
|
||||
<property key="labeling/shapeOffsetY" value="0"/>
|
||||
<property key="labeling/shapeRadiiMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeRadiiUnits" value="1"/>
|
||||
<property key="labeling/shapeRadiiX" value="0"/>
|
||||
<property key="labeling/shapeRadiiY" value="0"/>
|
||||
<property key="labeling/shapeRotation" value="0"/>
|
||||
<property key="labeling/shapeRotationType" value="0"/>
|
||||
<property key="labeling/shapeSVGFile" value=""/>
|
||||
<property key="labeling/shapeSizeMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeSizeType" value="0"/>
|
||||
<property key="labeling/shapeSizeUnits" value="1"/>
|
||||
<property key="labeling/shapeSizeX" value="0"/>
|
||||
<property key="labeling/shapeSizeY" value="0"/>
|
||||
<property key="labeling/shapeTransparency" value="0"/>
|
||||
<property key="labeling/shapeType" value="0"/>
|
||||
<property key="labeling/substitutions" value="<substitutions/>"/>
|
||||
<property key="labeling/textColorA" value="255"/>
|
||||
<property key="labeling/textColorB" value="0"/>
|
||||
<property key="labeling/textColorG" value="0"/>
|
||||
<property key="labeling/textColorR" value="0"/>
|
||||
<property key="labeling/textTransp" value="0"/>
|
||||
<property key="labeling/upsidedownLabels" value="2"/>
|
||||
<property key="labeling/useSubstitutions" value="false"/>
|
||||
<property key="labeling/wrapChar" value=""/>
|
||||
<property key="labeling/xOffset" value="0"/>
|
||||
<property key="labeling/yOffset" value="0"/>
|
||||
<property key="labeling/zIndex" value="1"/>
|
||||
<property key="variableNames"/>
|
||||
<property key="variableValues"/>
|
||||
</customproperties>
|
||||
<blendMode>0</blendMode>
|
||||
<featureBlendMode>0</featureBlendMode>
|
||||
<layerTransparency>0</layerTransparency>
|
||||
<displayfield>name</displayfield>
|
||||
<label>0</label>
|
||||
<labelattributes>
|
||||
<label fieldname="" text="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"/>
|
||||
<family fieldname="" name="MS Shell Dlg 2"/>
|
||||
<size fieldname="" units="pt" value="12"/>
|
||||
<bold fieldname="" on="0"/>
|
||||
<italic fieldname="" on="0"/>
|
||||
<underline fieldname="" on="0"/>
|
||||
<strikeout fieldname="" on="0"/>
|
||||
<color fieldname="" red="0" blue="0" green="0"/>
|
||||
<x fieldname=""/>
|
||||
<y fieldname=""/>
|
||||
<offset x="0" y="0" units="pt" yfieldname="" xfieldname=""/>
|
||||
<angle fieldname="" value="0" auto="0"/>
|
||||
<alignment fieldname="" value="center"/>
|
||||
<buffercolor fieldname="" red="255" blue="255" green="255"/>
|
||||
<buffersize fieldname="" units="pt" value="1"/>
|
||||
<bufferenabled fieldname="" on=""/>
|
||||
<multilineenabled fieldname="" on=""/>
|
||||
<selectedonly on=""/>
|
||||
</labelattributes>
|
||||
<SingleCategoryDiagramRenderer diagramType="Histogram" sizeLegend="0" attributeLegend="1">
|
||||
<DiagramCategory penColor="#000000" labelPlacementMethod="XHeight" penWidth="0" diagramOrientation="Up" sizeScale="0,0,0,0,0,0" minimumSize="0" barWidth="5" penAlpha="255" maxScaleDenominator="1e+08" backgroundColor="#ffffff" transparency="0" width="15" scaleDependency="Area" backgroundAlpha="255" angleOffset="1440" scaleBasedVisibility="0" enabled="0" height="15" lineSizeScale="0,0,0,0,0,0" sizeType="MM" lineSizeType="MM" minScaleDenominator="inf">
|
||||
<fontProperties description="MS Shell Dlg 2,7.8,-1,5,50,0,0,0,0,0" style=""/>
|
||||
<attribute field="" color="#000000" label=""/>
|
||||
</DiagramCategory>
|
||||
<symbol alpha="1" clip_to_extent="1" type="marker" name="sizeSymbol">
|
||||
<layer pass="0" class="SimpleMarker" locked="0">
|
||||
<prop k="angle" v="0"/>
|
||||
<prop k="color" v="255,0,0,255"/>
|
||||
<prop k="horizontal_anchor_point" v="1"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="name" v="circle"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,0,255"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0"/>
|
||||
<prop k="outline_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="scale_method" v="diameter"/>
|
||||
<prop k="size" v="2"/>
|
||||
<prop k="size_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="size_unit" v="MM"/>
|
||||
<prop k="vertical_anchor_point" v="1"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</SingleCategoryDiagramRenderer>
|
||||
<DiagramLayerSettings yPosColumn="-1" showColumn="-1" linePlacementFlags="10" placement="0" dist="0" xPosColumn="-1" priority="0" obstacle="0" zIndex="0" showAll="1"/>
|
||||
<annotationform>.</annotationform>
|
||||
<aliases>
|
||||
<alias field="country_id" index="0" name=""/>
|
||||
<alias field="region_id" index="1" name=""/>
|
||||
<alias field="locust_type_id" index="2" name=""/>
|
||||
<alias field="name" index="3" name=""/>
|
||||
<alias field="percent" index="4" name=""/>
|
||||
</aliases>
|
||||
<excludeAttributesWMS/>
|
||||
<excludeAttributesWFS/>
|
||||
<attributeactions default="-1"/>
|
||||
<attributetableconfig actionWidgetStyle="dropDown" sortExpression="" sortOrder="762605167">
|
||||
<columns>
|
||||
<column width="-1" hidden="0" type="field" name="country_id"/>
|
||||
<column width="-1" hidden="0" type="field" name="region_id"/>
|
||||
<column width="-1" hidden="0" type="field" name="locust_type_id"/>
|
||||
<column width="-1" hidden="0" type="field" name="name"/>
|
||||
<column width="-1" hidden="0" type="field" name="percent"/>
|
||||
<column width="-1" hidden="1" type="actions"/>
|
||||
</columns>
|
||||
</attributetableconfig>
|
||||
<editform>.</editform>
|
||||
<editforminit/>
|
||||
<editforminitcodesource>0</editforminitcodesource>
|
||||
<editforminitfilepath>.</editforminitfilepath>
|
||||
<editforminitcode><![CDATA[# -*- coding: utf-8 -*-
|
||||
"""
|
||||
QGIS forms can have a Python function that is called when the form is
|
||||
opened.
|
||||
|
||||
Use this function to add extra logic to your forms.
|
||||
|
||||
Enter the name of the function in the "Python Init function"
|
||||
field.
|
||||
An example follows:
|
||||
"""
|
||||
from qgis.PyQt.QtWidgets import QWidget
|
||||
|
||||
def my_form_open(dialog, layer, feature):
|
||||
geom = feature.geometry()
|
||||
control = dialog.findChild(QWidget, "MyLineEdit")
|
||||
]]></editforminitcode>
|
||||
<featformsuppress>0</featformsuppress>
|
||||
<editorlayout>generatedlayout</editorlayout>
|
||||
<widgets/>
|
||||
<conditionalstyles>
|
||||
<rowstyles/>
|
||||
<fieldstyles/>
|
||||
</conditionalstyles>
|
||||
<defaults>
|
||||
<default field="country_id" expression=""/>
|
||||
<default field="region_id" expression=""/>
|
||||
<default field="locust_type_id" expression=""/>
|
||||
<default field="name" expression=""/>
|
||||
<default field="percent" expression=""/>
|
||||
</defaults>
|
||||
<previewExpression></previewExpression>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<properties>
|
||||
<Measurement>
|
||||
<DistanceUnits type="QString">meters</DistanceUnits>
|
||||
<AreaUnits type="QString">m2</AreaUnits>
|
||||
</Measurement>
|
||||
<SpatialRefSys>
|
||||
<ProjectCRSProj4String type="QString">+proj=longlat +datum=WGS84 +no_defs</ProjectCRSProj4String>
|
||||
<ProjectCrs type="QString">EPSG:4326</ProjectCrs>
|
||||
<ProjectCRSID type="int">3452</ProjectCRSID>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
</SpatialRefSys>
|
||||
<PAL>
|
||||
<SearchMethod type="int">0</SearchMethod>
|
||||
<ShowingShadowRects type="bool">false</ShowingShadowRects>
|
||||
<CandidatesPolygon type="int">30</CandidatesPolygon>
|
||||
<ShowingCandidates type="bool">false</ShowingCandidates>
|
||||
<DrawRectOnly type="bool">false</DrawRectOnly>
|
||||
<ShowingPartialsLabels type="bool">true</ShowingPartialsLabels>
|
||||
<CandidatesLine type="int">50</CandidatesLine>
|
||||
<CandidatesPoint type="int">16</CandidatesPoint>
|
||||
<ShowingAllLabels type="bool">true</ShowingAllLabels>
|
||||
<DrawOutlineLabels type="bool">false</DrawOutlineLabels>
|
||||
</PAL>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<Gui>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
</Gui>
|
||||
<Digitizing>
|
||||
<DefaultSnapToleranceUnit type="int">2</DefaultSnapToleranceUnit>
|
||||
<LayerSnappingList type="QStringList">
|
||||
<value>view_frmlocustinfo_p2r_${year}20170221133600806</value>
|
||||
</LayerSnappingList>
|
||||
<LayerSnappingEnabledList type="QStringList">
|
||||
<value>disabled</value>
|
||||
</LayerSnappingEnabledList>
|
||||
<SnappingMode type="QString">current_layer</SnappingMode>
|
||||
<AvoidIntersectionsList type="QStringList"/>
|
||||
<LayerSnappingToleranceUnitList type="QStringList">
|
||||
<value>2</value>
|
||||
</LayerSnappingToleranceUnitList>
|
||||
<LayerSnapToList type="QStringList">
|
||||
<value>to_vertex_and_segment</value>
|
||||
</LayerSnapToList>
|
||||
<DefaultSnapType type="QString">off</DefaultSnapType>
|
||||
<DefaultSnapTolerance type="double">0</DefaultSnapTolerance>
|
||||
<LayerSnappingToleranceList type="QStringList">
|
||||
<value>0.000000</value>
|
||||
</LayerSnappingToleranceList>
|
||||
</Digitizing>
|
||||
<PositionPrecision>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
</PositionPrecision>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
</properties>
|
||||
<visibility-presets/>
|
||||
</qgis>
|
||||
1196
src/main/resources/static/resources/QGIS/frmlocustinfo_p3.qgs
Normal file
508
src/main/resources/static/resources/QGIS/frmlocustinfo_p3r.qgs
Normal file
@ -0,0 +1,508 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis projectname="" version="2.18.3">
|
||||
<title></title>
|
||||
<autotransaction active="0"/>
|
||||
<evaluateDefaultValues active="0"/>
|
||||
<layer-tree-group expanded="1" checked="Qt::PartiallyChecked" name="">
|
||||
<customproperties/>
|
||||
<layer-tree-layer expanded="1" checked="Qt::Checked" id="view_frmlocustinfo_p3r_201520170221141235646" name="trt('Maps_of_treated_areas_above_ET')">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer expanded="1" providerKey="" checked="Qt::Unchecked" id="OpenLayers_plugin_layer20170821155911549" source="" name="Bing Aerial with labels">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
</layer-tree-group>
|
||||
<relations/>
|
||||
<mapcanvas>
|
||||
<units>meters</units>
|
||||
<extent>
|
||||
<xmin>4606484.6726676719263196</xmin>
|
||||
<ymin>3728012.39886604063212872</ymin>
|
||||
<xmax>9866330.61264913156628609</xmax>
|
||||
<ymax>8074944.57324538938701153</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<projections>1</projections>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<layer_coordinate_transform_info>
|
||||
<layer_coordinate_transform destAuthId="EPSG:3857" srcAuthId="EPSG:4326" srcDatumTransform="-1" destDatumTransform="-1" layerid="view_frmlocustinfo_p3r_201520170221141235646"/>
|
||||
<layer_coordinate_transform destAuthId="EPSG:3857" srcAuthId="EPSG:3857" srcDatumTransform="-1" destDatumTransform="-1" layerid="OpenLayers_plugin_layer20170821155911549"/>
|
||||
</layer_coordinate_transform_info>
|
||||
</mapcanvas>
|
||||
<layer-tree-canvas>
|
||||
<custom-order enabled="0">
|
||||
<item>view_frmlocustinfo_p3r_201520170221141235646</item>
|
||||
<item>OpenStreetMap20170221162957823</item>
|
||||
</custom-order>
|
||||
</layer-tree-canvas>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer drawingOrder="-1" open="true" checked="Qt::Checked" name="trt('Maps_of_treated_areas_above_ET')" showFeatureCount="0">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="view_frmlocustinfo_p3r_201520170221141235646" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer drawingOrder="-1" open="true" checked="Qt::Unchecked" name="Bing Aerial with labels" showFeatureCount="0">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="OpenLayers_plugin_layer20170821155911549" visible="0"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<projectlayers>
|
||||
|
||||
<maplayer minimumScale="0" maximumScale="1e+08" type="plugin" hasScaleBasedVisibilityFlag="0" name="openlayers">
|
||||
<extent>
|
||||
<xmin>-20037508.33999999985098839</xmin>
|
||||
<ymin>-20037508.33999999985098839</ymin>
|
||||
<xmax>20037508.33999999985098839</xmax>
|
||||
<ymax>20037508.33999999985098839</ymax>
|
||||
</extent>
|
||||
<id>OpenLayers_plugin_layer20170821155911549</id>
|
||||
<datasource></datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>Bing Aerial with labels</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<customproperties>
|
||||
<property key="ol_layer_type" value="Bing Aerial with labels"/>
|
||||
</customproperties>
|
||||
</maplayer>
|
||||
|
||||
<maplayer simplifyAlgorithm="0" minimumScale="0" maximumScale="1e+08" simplifyDrawingHints="1" readOnly="0" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Polygon" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
|
||||
<extent>
|
||||
<xmin>-180</xmin>
|
||||
<ymin>38.39295510000000178</ymin>
|
||||
<xmax>180</xmax>
|
||||
<ymax>82.05862320000009902</ymax>
|
||||
</extent>
|
||||
<id>view_frmlocustinfo_p3r_201520170221141235646</id>
|
||||
<datasource>dbname='CCALM' host=ccalm.org port=5432 user='guest' password='B2C0D5C60590' sslmode=disable key='region_id' estimatedmetadata=true srid=4326 type=MultiPolygon table="main"."view_frmlocustinfo_p3r_${year}" (geom) sql=${sql}</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>trt('Maps_of_treated_areas_above_ET')</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<provider encoding="System">postgres</provider>
|
||||
<previewExpression>COALESCE( "name", '<NULL>' )</previewExpression>
|
||||
<vectorjoins/>
|
||||
<layerDependencies/>
|
||||
<expressionfields/>
|
||||
<defaults>
|
||||
<default field="country_id" expression=""/>
|
||||
<default field="region_id" expression=""/>
|
||||
<default field="locust_type_id" expression=""/>
|
||||
<default field="name" expression=""/>
|
||||
<default field="percent" expression=""/>
|
||||
</defaults>
|
||||
<map-layer-style-manager current="">
|
||||
<map-layer-style name=""/>
|
||||
</map-layer-style-manager>
|
||||
<edittypes>
|
||||
<edittype widgetv2type="TextEdit" name="country_id">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="region_id">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="locust_type_id">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="name">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="percent">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
</edittypes>
|
||||
<renderer-v2 forceraster="0" symbollevels="0" type="RuleRenderer" enableorderby="0">
|
||||
<rules key="{4228a59e-abca-4465-b39b-83a899e32c5b}">
|
||||
<rule filter=" "percent" > 15" key="{fad70a76-868e-45d5-a7d0-88e1b6b670c6}" symbol="0" label=">15% trt('Increase')"/>
|
||||
<rule filter=" "percent" < 15 AND "percent" > -15" key="{52cc3773-b4d3-4790-aaf0-eee5e70f5cad}" symbol="2" label=">=15% trt('and') <=15% trt('On_the_same_level')"/>
|
||||
<rule filter=" "percent" < -15" key="{f9d3135a-22bc-481f-96a9-ea2743e1bb3c}" symbol="1" label="<15% trt('Decrease')"/>
|
||||
<rule filter=" "percent" is null" key="{c017f2c4-f56f-48a8-bbc4-987fa0f239a9}" symbol="3" label="trt('No_data')"/>
|
||||
</rules>
|
||||
<symbols>
|
||||
<symbol alpha="0.960784" clip_to_extent="1" type="fill" name="0">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="255,0,0,77"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,255,128"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="2">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="255,238,0,77"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,255,128"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="1">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="0,255,76,77"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,255,128"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="3">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="150,150,150,102"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,0,255"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</symbols>
|
||||
</renderer-v2>
|
||||
<labeling type="simple"/>
|
||||
<customproperties>
|
||||
<property key="embeddedWidgets/count" value="0"/>
|
||||
<property key="labeling" value="pal"/>
|
||||
<property key="labeling/addDirectionSymbol" value="false"/>
|
||||
<property key="labeling/angleOffset" value="0"/>
|
||||
<property key="labeling/blendMode" value="0"/>
|
||||
<property key="labeling/bufferBlendMode" value="0"/>
|
||||
<property key="labeling/bufferColorA" value="255"/>
|
||||
<property key="labeling/bufferColorB" value="255"/>
|
||||
<property key="labeling/bufferColorG" value="255"/>
|
||||
<property key="labeling/bufferColorR" value="255"/>
|
||||
<property key="labeling/bufferDraw" value="true"/>
|
||||
<property key="labeling/bufferJoinStyle" value="128"/>
|
||||
<property key="labeling/bufferNoFill" value="false"/>
|
||||
<property key="labeling/bufferSize" value="1"/>
|
||||
<property key="labeling/bufferSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/bufferSizeMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/bufferTransp" value="0"/>
|
||||
<property key="labeling/centroidInside" value="true"/>
|
||||
<property key="labeling/centroidWhole" value="false"/>
|
||||
<property key="labeling/decimals" value="3"/>
|
||||
<property key="labeling/displayAll" value="false"/>
|
||||
<property key="labeling/dist" value="0"/>
|
||||
<property key="labeling/distInMapUnits" value="false"/>
|
||||
<property key="labeling/distMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/drawLabels" value="true"/>
|
||||
<property key="labeling/enabled" value="true"/>
|
||||
<property key="labeling/fieldName" value=" "name"||'\n'||"percent" || '%'"/>
|
||||
<property key="labeling/fitInPolygonOnly" value="true"/>
|
||||
<property key="labeling/fontCapitals" value="0"/>
|
||||
<property key="labeling/fontFamily" value="Arial"/>
|
||||
<property key="labeling/fontItalic" value="false"/>
|
||||
<property key="labeling/fontLetterSpacing" value="0"/>
|
||||
<property key="labeling/fontLimitPixelSize" value="false"/>
|
||||
<property key="labeling/fontMaxPixelSize" value="10000"/>
|
||||
<property key="labeling/fontMinPixelSize" value="3"/>
|
||||
<property key="labeling/fontSize" value="7"/>
|
||||
<property key="labeling/fontSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/fontSizeMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/fontStrikeout" value="false"/>
|
||||
<property key="labeling/fontUnderline" value="false"/>
|
||||
<property key="labeling/fontWeight" value="75"/>
|
||||
<property key="labeling/fontWordSpacing" value="0"/>
|
||||
<property key="labeling/formatNumbers" value="false"/>
|
||||
<property key="labeling/isExpression" value="true"/>
|
||||
<property key="labeling/labelOffsetInMapUnits" value="false"/>
|
||||
<property key="labeling/labelOffsetMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/labelPerPart" value="false"/>
|
||||
<property key="labeling/leftDirectionSymbol" value="<"/>
|
||||
<property key="labeling/limitNumLabels" value="false"/>
|
||||
<property key="labeling/maxCurvedCharAngleIn" value="25"/>
|
||||
<property key="labeling/maxCurvedCharAngleOut" value="-25"/>
|
||||
<property key="labeling/maxNumLabels" value="2000"/>
|
||||
<property key="labeling/mergeLines" value="false"/>
|
||||
<property key="labeling/minFeatureSize" value="0"/>
|
||||
<property key="labeling/multilineAlign" value="4294967295"/>
|
||||
<property key="labeling/multilineHeight" value="1"/>
|
||||
<property key="labeling/namedStyle" value="Bold"/>
|
||||
<property key="labeling/obstacle" value="false"/>
|
||||
<property key="labeling/obstacleFactor" value="1"/>
|
||||
<property key="labeling/obstacleType" value="0"/>
|
||||
<property key="labeling/offsetType" value="0"/>
|
||||
<property key="labeling/placeDirectionSymbol" value="0"/>
|
||||
<property key="labeling/placement" value="1"/>
|
||||
<property key="labeling/placementFlags" value="10"/>
|
||||
<property key="labeling/plussign" value="false"/>
|
||||
<property key="labeling/predefinedPositionOrder" value="TR,TL,BR,BL,R,L,TSR,BSR"/>
|
||||
<property key="labeling/preserveRotation" value="false"/>
|
||||
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
|
||||
<property key="labeling/priority" value="0"/>
|
||||
<property key="labeling/quadOffset" value="4"/>
|
||||
<property key="labeling/repeatDistance" value="0"/>
|
||||
<property key="labeling/repeatDistanceMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/repeatDistanceUnit" value="1"/>
|
||||
<property key="labeling/reverseDirectionSymbol" value="false"/>
|
||||
<property key="labeling/rightDirectionSymbol" value=">"/>
|
||||
<property key="labeling/scaleMax" value="35000000"/>
|
||||
<property key="labeling/scaleMin" value="1"/>
|
||||
<property key="labeling/scaleVisibility" value="true"/>
|
||||
<property key="labeling/shadowBlendMode" value="6"/>
|
||||
<property key="labeling/shadowColorB" value="0"/>
|
||||
<property key="labeling/shadowColorG" value="0"/>
|
||||
<property key="labeling/shadowColorR" value="0"/>
|
||||
<property key="labeling/shadowDraw" value="false"/>
|
||||
<property key="labeling/shadowOffsetAngle" value="135"/>
|
||||
<property key="labeling/shadowOffsetDist" value="1"/>
|
||||
<property key="labeling/shadowOffsetGlobal" value="true"/>
|
||||
<property key="labeling/shadowOffsetMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shadowOffsetUnits" value="1"/>
|
||||
<property key="labeling/shadowRadius" value="1.5"/>
|
||||
<property key="labeling/shadowRadiusAlphaOnly" value="false"/>
|
||||
<property key="labeling/shadowRadiusMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shadowRadiusUnits" value="1"/>
|
||||
<property key="labeling/shadowScale" value="100"/>
|
||||
<property key="labeling/shadowTransparency" value="30"/>
|
||||
<property key="labeling/shadowUnder" value="0"/>
|
||||
<property key="labeling/shapeBlendMode" value="0"/>
|
||||
<property key="labeling/shapeBorderColorA" value="255"/>
|
||||
<property key="labeling/shapeBorderColorB" value="128"/>
|
||||
<property key="labeling/shapeBorderColorG" value="128"/>
|
||||
<property key="labeling/shapeBorderColorR" value="128"/>
|
||||
<property key="labeling/shapeBorderWidth" value="0"/>
|
||||
<property key="labeling/shapeBorderWidthMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeBorderWidthUnits" value="1"/>
|
||||
<property key="labeling/shapeDraw" value="false"/>
|
||||
<property key="labeling/shapeFillColorA" value="255"/>
|
||||
<property key="labeling/shapeFillColorB" value="255"/>
|
||||
<property key="labeling/shapeFillColorG" value="255"/>
|
||||
<property key="labeling/shapeFillColorR" value="255"/>
|
||||
<property key="labeling/shapeJoinStyle" value="64"/>
|
||||
<property key="labeling/shapeOffsetMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeOffsetUnits" value="1"/>
|
||||
<property key="labeling/shapeOffsetX" value="0"/>
|
||||
<property key="labeling/shapeOffsetY" value="0"/>
|
||||
<property key="labeling/shapeRadiiMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeRadiiUnits" value="1"/>
|
||||
<property key="labeling/shapeRadiiX" value="0"/>
|
||||
<property key="labeling/shapeRadiiY" value="0"/>
|
||||
<property key="labeling/shapeRotation" value="0"/>
|
||||
<property key="labeling/shapeRotationType" value="0"/>
|
||||
<property key="labeling/shapeSVGFile" value=""/>
|
||||
<property key="labeling/shapeSizeMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeSizeType" value="0"/>
|
||||
<property key="labeling/shapeSizeUnits" value="1"/>
|
||||
<property key="labeling/shapeSizeX" value="0"/>
|
||||
<property key="labeling/shapeSizeY" value="0"/>
|
||||
<property key="labeling/shapeTransparency" value="0"/>
|
||||
<property key="labeling/shapeType" value="0"/>
|
||||
<property key="labeling/substitutions" value="<substitutions/>"/>
|
||||
<property key="labeling/textColorA" value="255"/>
|
||||
<property key="labeling/textColorB" value="0"/>
|
||||
<property key="labeling/textColorG" value="0"/>
|
||||
<property key="labeling/textColorR" value="0"/>
|
||||
<property key="labeling/textTransp" value="0"/>
|
||||
<property key="labeling/upsidedownLabels" value="0"/>
|
||||
<property key="labeling/useSubstitutions" value="false"/>
|
||||
<property key="labeling/wrapChar" value=""/>
|
||||
<property key="labeling/xOffset" value="0.2"/>
|
||||
<property key="labeling/yOffset" value="0.2"/>
|
||||
<property key="labeling/zIndex" value="0"/>
|
||||
<property key="variableNames"/>
|
||||
<property key="variableValues"/>
|
||||
</customproperties>
|
||||
<blendMode>0</blendMode>
|
||||
<featureBlendMode>0</featureBlendMode>
|
||||
<layerTransparency>0</layerTransparency>
|
||||
<displayfield>name</displayfield>
|
||||
<label>0</label>
|
||||
<labelattributes>
|
||||
<label fieldname="" text="Подпись"/>
|
||||
<family fieldname="" name="MS Shell Dlg 2"/>
|
||||
<size fieldname="" units="pt" value="12"/>
|
||||
<bold fieldname="" on="0"/>
|
||||
<italic fieldname="" on="0"/>
|
||||
<underline fieldname="" on="0"/>
|
||||
<strikeout fieldname="" on="0"/>
|
||||
<color fieldname="" red="0" blue="0" green="0"/>
|
||||
<x fieldname=""/>
|
||||
<y fieldname=""/>
|
||||
<offset x="0" y="0" units="pt" yfieldname="" xfieldname=""/>
|
||||
<angle fieldname="" value="0" auto="0"/>
|
||||
<alignment fieldname="" value="center"/>
|
||||
<buffercolor fieldname="" red="255" blue="255" green="255"/>
|
||||
<buffersize fieldname="" units="pt" value="1"/>
|
||||
<bufferenabled fieldname="" on=""/>
|
||||
<multilineenabled fieldname="" on=""/>
|
||||
<selectedonly on=""/>
|
||||
</labelattributes>
|
||||
<SingleCategoryDiagramRenderer diagramType="Histogram" sizeLegend="0" attributeLegend="1">
|
||||
<DiagramCategory penColor="#000000" labelPlacementMethod="XHeight" penWidth="0" diagramOrientation="Up" sizeScale="0,0,0,0,0,0" minimumSize="0" barWidth="5" penAlpha="255" maxScaleDenominator="1e+08" backgroundColor="#ffffff" transparency="0" width="15" scaleDependency="Area" backgroundAlpha="255" angleOffset="1440" scaleBasedVisibility="0" enabled="0" height="15" lineSizeScale="0,0,0,0,0,0" sizeType="MM" lineSizeType="MM" minScaleDenominator="inf">
|
||||
<fontProperties description="MS Shell Dlg 2,7.8,-1,5,50,0,0,0,0,0" style=""/>
|
||||
<attribute field="" color="#000000" label=""/>
|
||||
</DiagramCategory>
|
||||
<symbol alpha="1" clip_to_extent="1" type="marker" name="sizeSymbol">
|
||||
<layer pass="0" class="SimpleMarker" locked="0">
|
||||
<prop k="angle" v="0"/>
|
||||
<prop k="color" v="255,0,0,255"/>
|
||||
<prop k="horizontal_anchor_point" v="1"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="name" v="circle"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,0,255"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0"/>
|
||||
<prop k="outline_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="scale_method" v="diameter"/>
|
||||
<prop k="size" v="2"/>
|
||||
<prop k="size_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="size_unit" v="MM"/>
|
||||
<prop k="vertical_anchor_point" v="1"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</SingleCategoryDiagramRenderer>
|
||||
<DiagramLayerSettings yPosColumn="-1" showColumn="-1" linePlacementFlags="10" placement="0" dist="0" xPosColumn="-1" priority="0" obstacle="0" zIndex="0" showAll="1"/>
|
||||
<annotationform>.</annotationform>
|
||||
<aliases>
|
||||
<alias field="country_id" index="0" name=""/>
|
||||
<alias field="region_id" index="1" name=""/>
|
||||
<alias field="locust_type_id" index="2" name=""/>
|
||||
<alias field="name" index="3" name=""/>
|
||||
<alias field="percent" index="4" name=""/>
|
||||
</aliases>
|
||||
<excludeAttributesWMS/>
|
||||
<excludeAttributesWFS/>
|
||||
<attributeactions default="-1"/>
|
||||
<attributetableconfig actionWidgetStyle="dropDown" sortExpression=""name"" sortOrder="0">
|
||||
<columns>
|
||||
<column width="-1" hidden="0" type="field" name="country_id"/>
|
||||
<column width="-1" hidden="0" type="field" name="region_id"/>
|
||||
<column width="-1" hidden="0" type="field" name="locust_type_id"/>
|
||||
<column width="394" hidden="0" type="field" name="name"/>
|
||||
<column width="212" hidden="0" type="field" name="percent"/>
|
||||
<column width="-1" hidden="1" type="actions"/>
|
||||
</columns>
|
||||
</attributetableconfig>
|
||||
<editform>.</editform>
|
||||
<editforminit/>
|
||||
<editforminitcodesource>0</editforminitcodesource>
|
||||
<editforminitfilepath>.</editforminitfilepath>
|
||||
<editforminitcode><![CDATA[# -*- coding: utf-8 -*-
|
||||
"""
|
||||
QGIS forms can have a Python function that is called when the form is
|
||||
opened.
|
||||
|
||||
Use this function to add extra logic to your forms.
|
||||
|
||||
Enter the name of the function in the "Python Init function"
|
||||
field.
|
||||
An example follows:
|
||||
"""
|
||||
from qgis.PyQt.QtWidgets import QWidget
|
||||
|
||||
def my_form_open(dialog, layer, feature):
|
||||
geom = feature.geometry()
|
||||
control = dialog.findChild(QWidget, "MyLineEdit")
|
||||
]]></editforminitcode>
|
||||
<featformsuppress>0</featformsuppress>
|
||||
<editorlayout>generatedlayout</editorlayout>
|
||||
<widgets/>
|
||||
<conditionalstyles>
|
||||
<rowstyles/>
|
||||
<fieldstyles/>
|
||||
</conditionalstyles>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<properties>
|
||||
<Measurement>
|
||||
<DistanceUnits type="QString">meters</DistanceUnits>
|
||||
<AreaUnits type="QString">m2</AreaUnits>
|
||||
</Measurement>
|
||||
<SpatialRefSys>
|
||||
<ProjectCRSProj4String type="QString">+proj=longlat +datum=WGS84 +no_defs</ProjectCRSProj4String>
|
||||
<ProjectCrs type="QString">EPSG:4326</ProjectCrs>
|
||||
<ProjectCRSID type="int">3452</ProjectCRSID>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
</SpatialRefSys>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<Gui>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
</Gui>
|
||||
<Digitizing>
|
||||
<DefaultSnapToleranceUnit type="int">2</DefaultSnapToleranceUnit>
|
||||
<SnappingMode type="QString">current_layer</SnappingMode>
|
||||
<DefaultSnapType type="QString">off</DefaultSnapType>
|
||||
<DefaultSnapTolerance type="double">0</DefaultSnapTolerance>
|
||||
</Digitizing>
|
||||
<PositionPrecision>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
</PositionPrecision>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
</properties>
|
||||
<visibility-presets/>
|
||||
</qgis>
|
||||
1182
src/main/resources/static/resources/QGIS/frmlocustinfo_p4.qgs
Normal file
509
src/main/resources/static/resources/QGIS/frmlocustinfo_p4r.qgs
Normal file
@ -0,0 +1,509 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis projectname="" version="2.18.3">
|
||||
<title></title>
|
||||
<autotransaction active="0"/>
|
||||
<evaluateDefaultValues active="0"/>
|
||||
<layer-tree-group expanded="1" checked="Qt::PartiallyChecked" name="">
|
||||
<customproperties/>
|
||||
<layer-tree-layer expanded="1" checked="Qt::Checked" id="view_frmlocustinfo_p4r_201520170221164520581" name="trt('Map_of_the_level_of_threat')">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
<layer-tree-layer expanded="1" providerKey="" checked="Qt::Unchecked" id="OpenLayers_plugin_layer20170821155911549" source="" name="Bing Aerial with labels">
|
||||
<customproperties/>
|
||||
</layer-tree-layer>
|
||||
</layer-tree-group>
|
||||
<relations/>
|
||||
<mapcanvas>
|
||||
<units>meters</units>
|
||||
<extent>
|
||||
<xmin>4606484.6726676719263196</xmin>
|
||||
<ymin>3728012.39886604063212872</ymin>
|
||||
<xmax>9866330.61264913156628609</xmax>
|
||||
<ymax>8074944.57324538938701153</ymax>
|
||||
</extent>
|
||||
<rotation>0</rotation>
|
||||
<projections>1</projections>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<rendermaptile>0</rendermaptile>
|
||||
<layer_coordinate_transform_info>
|
||||
<layer_coordinate_transform destAuthId="EPSG:3857" srcAuthId="EPSG:4326" srcDatumTransform="-1" destDatumTransform="-1" layerid="view_frmlocustinfo_p4r_201520170221164520581"/>
|
||||
<layer_coordinate_transform destAuthId="EPSG:3857" srcAuthId="EPSG:3857" srcDatumTransform="-1" destDatumTransform="-1" layerid="OpenLayers_plugin_layer20170821155911549"/>
|
||||
</layer_coordinate_transform_info>
|
||||
</mapcanvas>
|
||||
<layer-tree-canvas>
|
||||
<custom-order enabled="0">
|
||||
<item>view_frmlocustinfo_p4r_201520170221164520581</item>
|
||||
<item>OpenStreetMap20170221170817493</item>
|
||||
</custom-order>
|
||||
</layer-tree-canvas>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer drawingOrder="-1" open="true" checked="Qt::Checked" name="trt('Map_of_the_level_of_threat')" showFeatureCount="0">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="view_frmlocustinfo_p4r_201520170221164520581" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer drawingOrder="-1" open="true" checked="Qt::Unchecked" name="Bing Aerial with labels" showFeatureCount="0">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="OpenLayers_plugin_layer20170821155911549" visible="0"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
</legend>
|
||||
<projectlayers>
|
||||
|
||||
|
||||
<maplayer minimumScale="0" maximumScale="1e+08" type="plugin" hasScaleBasedVisibilityFlag="0" name="openlayers">
|
||||
<extent>
|
||||
<xmin>-20037508.33999999985098839</xmin>
|
||||
<ymin>-20037508.33999999985098839</ymin>
|
||||
<xmax>20037508.33999999985098839</xmax>
|
||||
<ymax>20037508.33999999985098839</ymax>
|
||||
</extent>
|
||||
<id>OpenLayers_plugin_layer20170821155911549</id>
|
||||
<datasource></datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>Bing Aerial with labels</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs</proj4>
|
||||
<srsid>3857</srsid>
|
||||
<srid>3857</srid>
|
||||
<authid>EPSG:3857</authid>
|
||||
<description>WGS 84 / Pseudo Mercator</description>
|
||||
<projectionacronym>merc</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<customproperties>
|
||||
<property key="ol_layer_type" value="Bing Aerial with labels"/>
|
||||
</customproperties>
|
||||
</maplayer>
|
||||
|
||||
<maplayer simplifyAlgorithm="0" minimumScale="0" maximumScale="1e+08" simplifyDrawingHints="1" readOnly="0" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Polygon" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
|
||||
<extent>
|
||||
<xmin>-180</xmin>
|
||||
<ymin>38.39295510000000178</ymin>
|
||||
<xmax>180</xmax>
|
||||
<ymax>82.05862320000009902</ymax>
|
||||
</extent>
|
||||
<id>view_frmlocustinfo_p4r_201520170221164520581</id>
|
||||
<datasource>dbname='CCALM' host=ccalm.org port=5432 user='guest' password='B2C0D5C60590' sslmode=disable key='region_id' estimatedmetadata=true srid=4326 type=MultiPolygon table="main"."view_frmlocustinfo_p4r_${year}" (geom) sql=${sql}</datasource>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>trt('Map_of_the_level_of_threat')</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<provider encoding="System">postgres</provider>
|
||||
<previewExpression></previewExpression>
|
||||
<vectorjoins/>
|
||||
<layerDependencies/>
|
||||
<expressionfields/>
|
||||
<defaults>
|
||||
<default field="country_id" expression=""/>
|
||||
<default field="region_id" expression=""/>
|
||||
<default field="locust_type_id" expression=""/>
|
||||
<default field="name" expression=""/>
|
||||
<default field="percent" expression=""/>
|
||||
</defaults>
|
||||
<map-layer-style-manager current="">
|
||||
<map-layer-style name=""/>
|
||||
</map-layer-style-manager>
|
||||
<edittypes>
|
||||
<edittype widgetv2type="TextEdit" name="country_id">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="region_id">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="locust_type_id">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="name">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
<edittype widgetv2type="TextEdit" name="percent">
|
||||
<widgetv2config IsMultiline="0" fieldEditable="1" constraint="" UseHtml="0" labelOnTop="0" constraintDescription="" notNull="0"/>
|
||||
</edittype>
|
||||
</edittypes>
|
||||
<renderer-v2 forceraster="0" symbollevels="0" type="RuleRenderer" enableorderby="0">
|
||||
<rules key="{d544320a-3c0f-4ff0-97cd-14e77a01f052}">
|
||||
<rule description="" filter=" "percent" >= -25 AND "percent" <= 25" key="{7c75fcc4-03a0-49be-a6e9-f1fd4612e11f}" symbol="0" label="trt('Normal/Multiyear_average_level')"/>
|
||||
<rule description="" filter=" "percent" > 25 OR "percent" < -25" key="{708b86f0-c637-43b1-b85b-823ad0a54776}" symbol="1" label="trt('Danger')"/>
|
||||
<rule filter=" "percent" is null" key="{c017f2c4-f56f-48a8-bbc4-987fa0f239a9}" symbol="2" label="trt('No_data')"/>
|
||||
</rules>
|
||||
<symbols>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="0">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="0,255,76,77"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,255,128"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="1">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="255,0,0,77"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,255,128"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" clip_to_extent="1" type="fill" name="2">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="color" v="150,150,150,102"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,0,255"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.26"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</symbols>
|
||||
</renderer-v2>
|
||||
<labeling type="simple"/>
|
||||
<customproperties>
|
||||
<property key="embeddedWidgets/count" value="0"/>
|
||||
<property key="labeling" value="pal"/>
|
||||
<property key="labeling/addDirectionSymbol" value="false"/>
|
||||
<property key="labeling/angleOffset" value="0"/>
|
||||
<property key="labeling/blendMode" value="0"/>
|
||||
<property key="labeling/bufferBlendMode" value="0"/>
|
||||
<property key="labeling/bufferColorA" value="255"/>
|
||||
<property key="labeling/bufferColorB" value="255"/>
|
||||
<property key="labeling/bufferColorG" value="255"/>
|
||||
<property key="labeling/bufferColorR" value="255"/>
|
||||
<property key="labeling/bufferDraw" value="true"/>
|
||||
<property key="labeling/bufferJoinStyle" value="128"/>
|
||||
<property key="labeling/bufferNoFill" value="false"/>
|
||||
<property key="labeling/bufferSize" value="1"/>
|
||||
<property key="labeling/bufferSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/bufferSizeMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/bufferTransp" value="0"/>
|
||||
<property key="labeling/centroidInside" value="true"/>
|
||||
<property key="labeling/centroidWhole" value="false"/>
|
||||
<property key="labeling/decimals" value="3"/>
|
||||
<property key="labeling/displayAll" value="true"/>
|
||||
<property key="labeling/dist" value="0"/>
|
||||
<property key="labeling/distInMapUnits" value="false"/>
|
||||
<property key="labeling/distMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/drawLabels" value="true"/>
|
||||
<property key="labeling/enabled" value="true"/>
|
||||
<property key="labeling/fieldName" value=" "name" || '\n' || "percent" || '%'"/>
|
||||
<property key="labeling/fitInPolygonOnly" value="true"/>
|
||||
<property key="labeling/fontCapitals" value="0"/>
|
||||
<property key="labeling/fontFamily" value="Arial"/>
|
||||
<property key="labeling/fontItalic" value="false"/>
|
||||
<property key="labeling/fontLetterSpacing" value="0"/>
|
||||
<property key="labeling/fontLimitPixelSize" value="false"/>
|
||||
<property key="labeling/fontMaxPixelSize" value="10000"/>
|
||||
<property key="labeling/fontMinPixelSize" value="3"/>
|
||||
<property key="labeling/fontSize" value="7"/>
|
||||
<property key="labeling/fontSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/fontSizeMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/fontStrikeout" value="false"/>
|
||||
<property key="labeling/fontUnderline" value="false"/>
|
||||
<property key="labeling/fontWeight" value="75"/>
|
||||
<property key="labeling/fontWordSpacing" value="0"/>
|
||||
<property key="labeling/formatNumbers" value="false"/>
|
||||
<property key="labeling/isExpression" value="true"/>
|
||||
<property key="labeling/labelOffsetInMapUnits" value="true"/>
|
||||
<property key="labeling/labelOffsetMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/labelPerPart" value="false"/>
|
||||
<property key="labeling/leftDirectionSymbol" value="<"/>
|
||||
<property key="labeling/limitNumLabels" value="false"/>
|
||||
<property key="labeling/maxCurvedCharAngleIn" value="25"/>
|
||||
<property key="labeling/maxCurvedCharAngleOut" value="-25"/>
|
||||
<property key="labeling/maxNumLabels" value="2000"/>
|
||||
<property key="labeling/mergeLines" value="false"/>
|
||||
<property key="labeling/minFeatureSize" value="0"/>
|
||||
<property key="labeling/multilineAlign" value="4294967295"/>
|
||||
<property key="labeling/multilineHeight" value="1"/>
|
||||
<property key="labeling/namedStyle" value="Bold"/>
|
||||
<property key="labeling/obstacle" value="false"/>
|
||||
<property key="labeling/obstacleFactor" value="1"/>
|
||||
<property key="labeling/obstacleType" value="0"/>
|
||||
<property key="labeling/offsetType" value="0"/>
|
||||
<property key="labeling/placeDirectionSymbol" value="0"/>
|
||||
<property key="labeling/placement" value="1"/>
|
||||
<property key="labeling/placementFlags" value="10"/>
|
||||
<property key="labeling/plussign" value="false"/>
|
||||
<property key="labeling/predefinedPositionOrder" value="TR,TL,BR,BL,R,L,TSR,BSR"/>
|
||||
<property key="labeling/preserveRotation" value="true"/>
|
||||
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
|
||||
<property key="labeling/priority" value="0"/>
|
||||
<property key="labeling/quadOffset" value="4"/>
|
||||
<property key="labeling/repeatDistance" value="0"/>
|
||||
<property key="labeling/repeatDistanceMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/repeatDistanceUnit" value="1"/>
|
||||
<property key="labeling/reverseDirectionSymbol" value="false"/>
|
||||
<property key="labeling/rightDirectionSymbol" value=">"/>
|
||||
<property key="labeling/scaleMax" value="35000000"/>
|
||||
<property key="labeling/scaleMin" value="1"/>
|
||||
<property key="labeling/scaleVisibility" value="true"/>
|
||||
<property key="labeling/shadowBlendMode" value="6"/>
|
||||
<property key="labeling/shadowColorB" value="0"/>
|
||||
<property key="labeling/shadowColorG" value="0"/>
|
||||
<property key="labeling/shadowColorR" value="0"/>
|
||||
<property key="labeling/shadowDraw" value="false"/>
|
||||
<property key="labeling/shadowOffsetAngle" value="135"/>
|
||||
<property key="labeling/shadowOffsetDist" value="1"/>
|
||||
<property key="labeling/shadowOffsetGlobal" value="true"/>
|
||||
<property key="labeling/shadowOffsetMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shadowOffsetUnits" value="1"/>
|
||||
<property key="labeling/shadowRadius" value="1.5"/>
|
||||
<property key="labeling/shadowRadiusAlphaOnly" value="false"/>
|
||||
<property key="labeling/shadowRadiusMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shadowRadiusUnits" value="1"/>
|
||||
<property key="labeling/shadowScale" value="100"/>
|
||||
<property key="labeling/shadowTransparency" value="30"/>
|
||||
<property key="labeling/shadowUnder" value="0"/>
|
||||
<property key="labeling/shapeBlendMode" value="0"/>
|
||||
<property key="labeling/shapeBorderColorA" value="255"/>
|
||||
<property key="labeling/shapeBorderColorB" value="128"/>
|
||||
<property key="labeling/shapeBorderColorG" value="128"/>
|
||||
<property key="labeling/shapeBorderColorR" value="128"/>
|
||||
<property key="labeling/shapeBorderWidth" value="0"/>
|
||||
<property key="labeling/shapeBorderWidthMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeBorderWidthUnits" value="1"/>
|
||||
<property key="labeling/shapeDraw" value="false"/>
|
||||
<property key="labeling/shapeFillColorA" value="255"/>
|
||||
<property key="labeling/shapeFillColorB" value="255"/>
|
||||
<property key="labeling/shapeFillColorG" value="255"/>
|
||||
<property key="labeling/shapeFillColorR" value="255"/>
|
||||
<property key="labeling/shapeJoinStyle" value="64"/>
|
||||
<property key="labeling/shapeOffsetMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeOffsetUnits" value="1"/>
|
||||
<property key="labeling/shapeOffsetX" value="0"/>
|
||||
<property key="labeling/shapeOffsetY" value="0"/>
|
||||
<property key="labeling/shapeRadiiMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeRadiiUnits" value="1"/>
|
||||
<property key="labeling/shapeRadiiX" value="0"/>
|
||||
<property key="labeling/shapeRadiiY" value="0"/>
|
||||
<property key="labeling/shapeRotation" value="0"/>
|
||||
<property key="labeling/shapeRotationType" value="0"/>
|
||||
<property key="labeling/shapeSVGFile" value=""/>
|
||||
<property key="labeling/shapeSizeMapUnitScale" value="0,0,0,0,0,0"/>
|
||||
<property key="labeling/shapeSizeType" value="0"/>
|
||||
<property key="labeling/shapeSizeUnits" value="1"/>
|
||||
<property key="labeling/shapeSizeX" value="0"/>
|
||||
<property key="labeling/shapeSizeY" value="0"/>
|
||||
<property key="labeling/shapeTransparency" value="0"/>
|
||||
<property key="labeling/shapeType" value="0"/>
|
||||
<property key="labeling/substitutions" value="<substitutions/>"/>
|
||||
<property key="labeling/textColorA" value="255"/>
|
||||
<property key="labeling/textColorB" value="0"/>
|
||||
<property key="labeling/textColorG" value="0"/>
|
||||
<property key="labeling/textColorR" value="0"/>
|
||||
<property key="labeling/textTransp" value="0"/>
|
||||
<property key="labeling/upsidedownLabels" value="0"/>
|
||||
<property key="labeling/useSubstitutions" value="false"/>
|
||||
<property key="labeling/wrapChar" value=""/>
|
||||
<property key="labeling/xOffset" value="0.2"/>
|
||||
<property key="labeling/yOffset" value="0.2"/>
|
||||
<property key="labeling/zIndex" value="0"/>
|
||||
<property key="variableNames"/>
|
||||
<property key="variableValues"/>
|
||||
</customproperties>
|
||||
<blendMode>0</blendMode>
|
||||
<featureBlendMode>0</featureBlendMode>
|
||||
<layerTransparency>0</layerTransparency>
|
||||
<displayfield>name</displayfield>
|
||||
<label>0</label>
|
||||
<labelattributes>
|
||||
<label fieldname="" text="Подпись"/>
|
||||
<family fieldname="" name="MS Shell Dlg 2"/>
|
||||
<size fieldname="" units="pt" value="12"/>
|
||||
<bold fieldname="" on="0"/>
|
||||
<italic fieldname="" on="0"/>
|
||||
<underline fieldname="" on="0"/>
|
||||
<strikeout fieldname="" on="0"/>
|
||||
<color fieldname="" red="0" blue="0" green="0"/>
|
||||
<x fieldname=""/>
|
||||
<y fieldname=""/>
|
||||
<offset x="0" y="0" units="pt" yfieldname="" xfieldname=""/>
|
||||
<angle fieldname="" value="0" auto="0"/>
|
||||
<alignment fieldname="" value="center"/>
|
||||
<buffercolor fieldname="" red="255" blue="255" green="255"/>
|
||||
<buffersize fieldname="" units="pt" value="1"/>
|
||||
<bufferenabled fieldname="" on=""/>
|
||||
<multilineenabled fieldname="" on=""/>
|
||||
<selectedonly on=""/>
|
||||
</labelattributes>
|
||||
<SingleCategoryDiagramRenderer diagramType="Histogram" sizeLegend="0" attributeLegend="1">
|
||||
<DiagramCategory penColor="#000000" labelPlacementMethod="XHeight" penWidth="0" diagramOrientation="Up" sizeScale="0,0,0,0,0,0" minimumSize="0" barWidth="5" penAlpha="255" maxScaleDenominator="1e+08" backgroundColor="#ffffff" transparency="0" width="15" scaleDependency="Area" backgroundAlpha="255" angleOffset="1440" scaleBasedVisibility="0" enabled="0" height="15" lineSizeScale="0,0,0,0,0,0" sizeType="MM" lineSizeType="MM" minScaleDenominator="inf">
|
||||
<fontProperties description="MS Shell Dlg 2,7.8,-1,5,50,0,0,0,0,0" style=""/>
|
||||
<attribute field="" color="#000000" label=""/>
|
||||
</DiagramCategory>
|
||||
<symbol alpha="1" clip_to_extent="1" type="marker" name="sizeSymbol">
|
||||
<layer pass="0" class="SimpleMarker" locked="0">
|
||||
<prop k="angle" v="0"/>
|
||||
<prop k="color" v="255,0,0,255"/>
|
||||
<prop k="horizontal_anchor_point" v="1"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="name" v="circle"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_color" v="0,0,0,255"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0"/>
|
||||
<prop k="outline_width_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="scale_method" v="diameter"/>
|
||||
<prop k="size" v="2"/>
|
||||
<prop k="size_map_unit_scale" v="0,0,0,0,0,0"/>
|
||||
<prop k="size_unit" v="MM"/>
|
||||
<prop k="vertical_anchor_point" v="1"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</SingleCategoryDiagramRenderer>
|
||||
<DiagramLayerSettings yPosColumn="-1" showColumn="-1" linePlacementFlags="10" placement="0" dist="0" xPosColumn="-1" priority="0" obstacle="0" zIndex="0" showAll="1"/>
|
||||
<annotationform>.</annotationform>
|
||||
<aliases>
|
||||
<alias field="country_id" index="0" name=""/>
|
||||
<alias field="region_id" index="1" name=""/>
|
||||
<alias field="locust_type_id" index="2" name=""/>
|
||||
<alias field="name" index="3" name=""/>
|
||||
<alias field="percent" index="4" name=""/>
|
||||
</aliases>
|
||||
<excludeAttributesWMS/>
|
||||
<excludeAttributesWFS/>
|
||||
<attributeactions default="-1"/>
|
||||
<attributetableconfig actionWidgetStyle="dropDown" sortExpression="" sortOrder="1380262664">
|
||||
<columns>
|
||||
<column width="-1" hidden="0" type="field" name="country_id"/>
|
||||
<column width="-1" hidden="0" type="field" name="region_id"/>
|
||||
<column width="-1" hidden="0" type="field" name="locust_type_id"/>
|
||||
<column width="-1" hidden="0" type="field" name="name"/>
|
||||
<column width="-1" hidden="0" type="field" name="percent"/>
|
||||
<column width="-1" hidden="1" type="actions"/>
|
||||
</columns>
|
||||
</attributetableconfig>
|
||||
<editform>.</editform>
|
||||
<editforminit/>
|
||||
<editforminitcodesource>0</editforminitcodesource>
|
||||
<editforminitfilepath>.</editforminitfilepath>
|
||||
<editforminitcode><![CDATA[# -*- coding: utf-8 -*-
|
||||
"""
|
||||
QGIS forms can have a Python function that is called when the form is
|
||||
opened.
|
||||
|
||||
Use this function to add extra logic to your forms.
|
||||
|
||||
Enter the name of the function in the "Python Init function"
|
||||
field.
|
||||
An example follows:
|
||||
"""
|
||||
from qgis.PyQt.QtWidgets import QWidget
|
||||
|
||||
def my_form_open(dialog, layer, feature):
|
||||
geom = feature.geometry()
|
||||
control = dialog.findChild(QWidget, "MyLineEdit")
|
||||
]]></editforminitcode>
|
||||
<featformsuppress>0</featformsuppress>
|
||||
<editorlayout>generatedlayout</editorlayout>
|
||||
<widgets/>
|
||||
<conditionalstyles>
|
||||
<rowstyles/>
|
||||
<fieldstyles/>
|
||||
</conditionalstyles>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<properties>
|
||||
<Measurement>
|
||||
<DistanceUnits type="QString">meters</DistanceUnits>
|
||||
<AreaUnits type="QString">m2</AreaUnits>
|
||||
</Measurement>
|
||||
<SpatialRefSys>
|
||||
<ProjectCRSProj4String type="QString">+proj=longlat +datum=WGS84 +no_defs</ProjectCRSProj4String>
|
||||
<ProjectCrs type="QString">EPSG:4326</ProjectCrs>
|
||||
<ProjectCRSID type="int">3452</ProjectCRSID>
|
||||
<ProjectionsEnabled type="int">1</ProjectionsEnabled>
|
||||
</SpatialRefSys>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<Gui>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
</Gui>
|
||||
<Digitizing>
|
||||
<DefaultSnapToleranceUnit type="int">2</DefaultSnapToleranceUnit>
|
||||
<LayerSnappingList type="QStringList">
|
||||
<value>view_frmlocustinfo_p4r_201520170221164520581</value>
|
||||
</LayerSnappingList>
|
||||
<LayerSnappingEnabledList type="QStringList">
|
||||
<value>disabled</value>
|
||||
</LayerSnappingEnabledList>
|
||||
<SnappingMode type="QString">current_layer</SnappingMode>
|
||||
<AvoidIntersectionsList type="QStringList"/>
|
||||
<LayerSnappingToleranceUnitList type="QStringList">
|
||||
<value>2</value>
|
||||
</LayerSnappingToleranceUnitList>
|
||||
<LayerSnapToList type="QStringList">
|
||||
<value>to_vertex_and_segment</value>
|
||||
</LayerSnapToList>
|
||||
<DefaultSnapType type="QString">off</DefaultSnapType>
|
||||
<DefaultSnapTolerance type="double">0</DefaultSnapTolerance>
|
||||
<LayerSnappingToleranceList type="QStringList">
|
||||
<value>0.000000</value>
|
||||
</LayerSnappingToleranceList>
|
||||
</Digitizing>
|
||||
<PositionPrecision>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
</PositionPrecision>
|
||||
<Legend>
|
||||
<filterByMap type="bool">false</filterByMap>
|
||||
</Legend>
|
||||
</properties>
|
||||
<visibility-presets/>
|
||||
</qgis>
|
||||
2506
src/main/resources/static/resources/QGIS/htc_selyaninov.qgs
Normal file
365
src/main/resources/static/resources/QGIS/index.jsp
Normal file
@ -0,0 +1,365 @@
|
||||
<%@ page language="java" contentType="application/octet-stream" pageEncoding="UTF-8"%>
|
||||
<%@ page session="true" %>
|
||||
|
||||
<%@page import="java.sql.*"%>
|
||||
<%@page import="java.io.FileReader"%>
|
||||
<%@page import="java.io.InputStreamReader"%>
|
||||
<%@page import="java.io.InputStream"%>
|
||||
<%@page import="java.io.FileInputStream"%>
|
||||
<%@page import="java.io.BufferedReader"%>
|
||||
<%@page import="java.util.Locale"%>
|
||||
<%@page import="java.util.ResourceBundle"%>
|
||||
|
||||
<%@ page import="java.io.File" %>
|
||||
<%@page import="javax.xml.parsers.DocumentBuilderFactory"%>
|
||||
<%@page import="javax.xml.parsers.DocumentBuilder"%>
|
||||
<%@page import="org.w3c.dom.Document"%>
|
||||
<%@page import="org.w3c.dom.Element"%>
|
||||
<%@page import="org.w3c.dom.NamedNodeMap"%>
|
||||
<%@page import="org.w3c.dom.Node"%>
|
||||
<%@page import="org.w3c.dom.NodeList"%>
|
||||
<%@page import="org.w3c.dom.ls.DOMImplementationLS"%>
|
||||
<%@page import="org.w3c.dom.ls.LSSerializer"%>
|
||||
<%@page import="org.w3c.dom.ls.LSOutput"%>
|
||||
<%@page import="org.w3c.dom.CDATASection"%>
|
||||
<%@page import="org.w3c.dom.CharacterData"%>
|
||||
<%@ page import="java.util.Properties" %>
|
||||
|
||||
<%!
|
||||
//application/octet-stream
|
||||
|
||||
public String m_locale = "en";
|
||||
|
||||
/*public String trt(String val)
|
||||
{
|
||||
String locale = m_locale;
|
||||
try
|
||||
{
|
||||
ResourceBundle rb = ResourceBundle.getBundle("messages", new Locale(locale));
|
||||
val=rb.getString(val);
|
||||
val=new String(val.getBytes("ISO-8859-1"), "UTF-8");
|
||||
return val;
|
||||
}catch(Exception exception){
|
||||
System.out.println("Exception: "+exception.getMessage());
|
||||
}
|
||||
return val.replaceAll("_", " ");
|
||||
}
|
||||
|
||||
//Translate text by patterns
|
||||
public String getText(String text)
|
||||
{
|
||||
int pos1=0;
|
||||
while(true)
|
||||
{
|
||||
pos1=text.indexOf("trt('",pos1);
|
||||
if(pos1==-1) break;
|
||||
int pos2=text.indexOf("')",pos1);
|
||||
if(pos2==-1) break;
|
||||
|
||||
text=text.substring(0,pos1)+trt(text.substring(pos1+3,pos2))+text.substring(pos2+2);
|
||||
}
|
||||
return text;
|
||||
}*/
|
||||
|
||||
/*public String fileToString(String fName)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
try
|
||||
{
|
||||
InputStream is = new FileInputStream(fName);
|
||||
BufferedReader buf = new BufferedReader(new InputStreamReader(is));
|
||||
String line = buf.readLine();
|
||||
while(line != null)
|
||||
{
|
||||
sb.append(line).append("\n");
|
||||
line = buf.readLine();
|
||||
}
|
||||
buf.close();
|
||||
}
|
||||
catch (Exception e){
|
||||
System.out.println("Error: "+e.getMessage());
|
||||
}
|
||||
return sb.toString();
|
||||
}*/
|
||||
%>
|
||||
<%
|
||||
|
||||
String db_url="";
|
||||
String db_login="";
|
||||
String db_password="";
|
||||
//String data_dir = "";
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
prop.load(new FileInputStream("org_ccalm_main.properties")); // load a properties file
|
||||
db_url = prop.getProperty("spring.datasource.url");
|
||||
db_login = prop.getProperty("spring.datasource.username");
|
||||
db_password = prop.getProperty("spring.datasource.password");
|
||||
//data_dir = prop.getProperty("data.dir");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Error load org_ccalm_main.properties",e);
|
||||
}
|
||||
|
||||
|
||||
//Connection to database
|
||||
Connection conn = null;
|
||||
try{
|
||||
Class.forName("org.postgresql.Driver");
|
||||
conn = DriverManager.getConnection(db_url,db_login,db_password);
|
||||
if(conn!=null)
|
||||
{
|
||||
System.out.println("Connect is OK!");
|
||||
}else
|
||||
{
|
||||
out.write("<br>Connect is ERROR<br>");
|
||||
}
|
||||
}catch(Exception e)
|
||||
{
|
||||
out.write("<br>Connect Exception:"+e.getMessage()+"<br>");
|
||||
}
|
||||
|
||||
|
||||
//Select language for current user
|
||||
String user_id = (String)request.getSession().getAttribute("USER_ID");
|
||||
if(user_id==null) user_id="null";
|
||||
|
||||
Statement st = conn.createStatement();
|
||||
ResultSet rs=null;
|
||||
try {
|
||||
String sql="select l.short_name lng from main._users u LEFT JOIN main._languages l ON l.id = u.language_id where u.id="+user_id+";";
|
||||
rs = st.executeQuery(sql);
|
||||
} catch( SQLException ex )
|
||||
{
|
||||
out.write("<br>SQLException:"+ex.getMessage()+"<br>");
|
||||
}
|
||||
|
||||
if(rs!=null)
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
m_locale = rs.getString("lng");
|
||||
}
|
||||
}
|
||||
st.close();
|
||||
|
||||
String jspPath = application.getRealPath("/")+"QGIS/";
|
||||
|
||||
String fileAsString="";
|
||||
String name=request.getParameter("name");
|
||||
|
||||
//Pods (кубышки)
|
||||
if(name!=null && (name.equals("frmlocust_pods_density") || name.equals("frmlocust_hoppers_density") || name.equals("frmlocust_bands") || name.equals("frmlocust_adults_density") || name.equals("frmlocust_swarms")))
|
||||
{
|
||||
fileAsString = fileToString(jspPath + name + ".qgs");
|
||||
|
||||
String country_id=request.getParameter("country_id");
|
||||
String locust_type_id=request.getParameter("locust_type_id");
|
||||
String date_start=request.getParameter("date_start");
|
||||
String date_end=request.getParameter("date_end");
|
||||
String registered=request.getParameter("registered");
|
||||
|
||||
//Make SQL
|
||||
String sql = "1=1";
|
||||
String sql2 = "1=1";
|
||||
if(country_id!=null && !country_id.equals(""))
|
||||
{
|
||||
if(country_id.equals("-1"))
|
||||
{
|
||||
sql+=" and country_id in (7,3,4,2)";
|
||||
sql2+=" and country_id in (7,3,4,2)";
|
||||
}else if(country_id.equals("-2"))
|
||||
{
|
||||
sql+=" and country_id in (7,1,5,6,8,9,10)";
|
||||
sql2+=" and country_id in (7,1,5,6,8,9,10)";
|
||||
}else
|
||||
{
|
||||
sql+=" and country_id="+country_id;
|
||||
sql2+=" and country_id="+country_id;
|
||||
}
|
||||
}
|
||||
if(locust_type_id!=null && !locust_type_id.equals(""))
|
||||
{
|
||||
sql+=" and locust_type_id="+locust_type_id;
|
||||
}
|
||||
if(date_start!=null && !date_start.equals(""))
|
||||
{
|
||||
sql+=" and date>='"+date_start+"'";
|
||||
}
|
||||
if(date_end!=null && !date_end.equals(""))
|
||||
{
|
||||
sql+=" and date<='"+date_end+"'";
|
||||
}
|
||||
|
||||
if(registered!=null && registered.equals("1"))
|
||||
{
|
||||
sql+=" and registered=true";
|
||||
}else
|
||||
if(registered!=null && registered.equals("0"))
|
||||
{
|
||||
sql+=" and registered=false";
|
||||
}
|
||||
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
|
||||
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
|
||||
|
||||
}
|
||||
|
||||
if(name!=null && name.equals("frmlocustdel"))
|
||||
{
|
||||
fileAsString = fileToString(jspPath + name + ".qgs");
|
||||
|
||||
String country_id=request.getParameter("country_id");
|
||||
String date_start=request.getParameter("date_start");
|
||||
String date_end=request.getParameter("date_end");
|
||||
String registered=request.getParameter("registered");
|
||||
|
||||
//Make SQL
|
||||
String sql = "1=1";
|
||||
String sql2 = "1=1";
|
||||
if(country_id!=null && !country_id.equals(""))
|
||||
{
|
||||
//sql+=" and country_id="+country_id;
|
||||
if(country_id.equals("-1"))
|
||||
{
|
||||
sql+=" and country_id in (7,3,4,2)";
|
||||
sql2+=" and country_id in (7,3,4,2)";
|
||||
}else if(country_id.equals("-2"))
|
||||
{
|
||||
sql+=" and country_id in (7,1,5,6,8,9,10)";
|
||||
sql2+=" and country_id in (7,1,5,6,8,9,10)";
|
||||
}else
|
||||
{
|
||||
sql+=" and country_id="+country_id;
|
||||
sql2+=" and country_id="+country_id;
|
||||
}
|
||||
}
|
||||
if(date_start!=null && !date_start.equals(""))
|
||||
{
|
||||
sql+=" and date>='"+date_start+"'";
|
||||
}
|
||||
if(date_end!=null && !date_end.equals(""))
|
||||
{
|
||||
sql+=" and date<='"+date_end+"'";
|
||||
}
|
||||
|
||||
if(registered!=null && registered.equals("1"))
|
||||
{
|
||||
sql+=" and registered=true";
|
||||
}else
|
||||
if(registered!=null && registered.equals("0"))
|
||||
{
|
||||
sql+=" and registered=false";
|
||||
}
|
||||
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
|
||||
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
|
||||
}
|
||||
|
||||
if(name!=null && (name.equals("frmlocustinfo_p2") || name.equals("frmlocustinfo_p3") || name.equals("frmlocustinfo_p4")))
|
||||
{
|
||||
String country_id=request.getParameter("country_id");
|
||||
String year=request.getParameter("year");
|
||||
String locust_type_id=request.getParameter("locust_type_id");
|
||||
|
||||
//Make SQL
|
||||
String sql = "1=1";
|
||||
if(country_id!=null && !country_id.equals(""))
|
||||
{
|
||||
if(country_id.equals("-1"))
|
||||
{
|
||||
sql+=" and country_id in (7,3,4,2)";
|
||||
}else if(country_id.equals("-2"))
|
||||
{
|
||||
sql+=" and country_id in (7,1,5,6,8,9,10)";
|
||||
}else
|
||||
{
|
||||
sql+=" and country_id="+country_id;
|
||||
}
|
||||
}
|
||||
if(locust_type_id!=null && !locust_type_id.equals(""))
|
||||
{
|
||||
sql+=" and locust_type_id="+locust_type_id;
|
||||
}
|
||||
|
||||
String fileName = jspPath + name + ".qgs";
|
||||
fileAsString = fileToString(fileName);
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{year\\}",year);
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
|
||||
}
|
||||
|
||||
if(name!=null && (name.equals("frmlocustinfo_p2r") || name.equals("frmlocustinfo_p3r") || name.equals("frmlocustinfo_p4r")))
|
||||
{
|
||||
String region_id=request.getParameter("region_id");
|
||||
String year=request.getParameter("year");
|
||||
String locust_type_id=request.getParameter("locust_type_id");
|
||||
|
||||
//Make SQL
|
||||
String sql = "1=1";
|
||||
if(region_id!=null && !region_id.equals(""))
|
||||
{
|
||||
sql+=" and region_id="+region_id;
|
||||
}
|
||||
if(locust_type_id!=null && !locust_type_id.equals(""))
|
||||
{
|
||||
sql+=" and locust_type_id="+locust_type_id;
|
||||
}
|
||||
|
||||
String fileName = jspPath + name + ".qgs";
|
||||
fileAsString = fileToString(fileName);
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{year\\}",year);
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql\\}",sql);
|
||||
}
|
||||
|
||||
if(name!=null && name.equals("weather"))
|
||||
{
|
||||
String country_id=request.getParameter("country_id");
|
||||
String country_name=request.getParameter("country_name");
|
||||
|
||||
//Make SQL
|
||||
String sql2 = "1=1";
|
||||
if(country_id!=null && !country_id.equals(""))
|
||||
{
|
||||
//sql+=" and country_id="+country_id;
|
||||
if(country_id.equals("-1"))
|
||||
{
|
||||
sql2+=" and country_id in (7,3,4,2)";
|
||||
}else if(country_id.equals("-2"))
|
||||
{
|
||||
sql2+=" and country_id in (7,1,5,6,8,9,10)";
|
||||
}else
|
||||
{
|
||||
sql2+=" and country_id="+country_id;
|
||||
}
|
||||
}
|
||||
|
||||
String fileName = jspPath + name + ".qgs";
|
||||
fileAsString = fileToString(fileName);
|
||||
//Apply variables to text
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{country\\}",country_name);
|
||||
|
||||
fileAsString=fileAsString.replaceAll("\\$\\{sql2\\}",sql2);
|
||||
}
|
||||
if(name!=null && name.equals("NDVI"))
|
||||
{
|
||||
|
||||
String fileName = jspPath + "NDVI.qgs";
|
||||
fileAsString = fileToString(fileName);
|
||||
}
|
||||
if(name!=null && name.equals("NDWI"))
|
||||
{
|
||||
|
||||
String fileName = jspPath + "NDWI.qgs";
|
||||
fileAsString = fileToString(fileName);
|
||||
}
|
||||
|
||||
//Send file to client.
|
||||
response.setHeader("Content-Disposition", "attachment;filename=Locust.qgs");
|
||||
out.write(fileAsString); //out.write(getText(fileAsString));
|
||||
|
||||
%>
|
||||
1924
src/main/resources/static/resources/QGIS/precipitation.qgs
Normal file
1924
src/main/resources/static/resources/QGIS/soil_temperature.qgs
Normal file
BIN
src/main/resources/static/resources/engine/b.png
Normal file
|
After Width: | Height: | Size: 341 B |
BIN
src/main/resources/static/resources/engine/config.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
115
src/main/resources/static/resources/engine/css/buttons.css
Normal file
@ -0,0 +1,115 @@
|
||||
/*https://1stwebdesigner.com/free-code-snippets-css-buttons/*/
|
||||
|
||||
:root{
|
||||
--btn-color: #d9d9cc; /*Цвет кнопки*/
|
||||
--btn-color2: #E0E0FF; /*Цвет кнопки при наведении на неё мышкой*/
|
||||
}
|
||||
|
||||
/* Normal white Button as seen on Google.com*/
|
||||
button
|
||||
{
|
||||
color: #444444;
|
||||
background: var(--btn-color);
|
||||
border: 1px #AAAAAA solid;
|
||||
padding: 5px 10px;
|
||||
border-radius: 2px;
|
||||
font-weight: bold;
|
||||
font-size: 9pt;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
border: 1px #C6C6C6 solid;
|
||||
box-shadow: 1px 1px 1px #EAEAEA;
|
||||
color: #333333;
|
||||
background: var(--btn-color2);
|
||||
}
|
||||
|
||||
button:active {
|
||||
box-shadow: inset 1px 1px 1px #DFDFDF;
|
||||
}
|
||||
|
||||
/* Blue button as seen on translate.google.com*/
|
||||
button.button-secondary,
|
||||
button.main,
|
||||
input[type="button"].main,
|
||||
input[type="button"].button-secondary,
|
||||
button.blue {
|
||||
color: white;
|
||||
background: #1b6ec2;
|
||||
border: 1px #1861ac solid;
|
||||
border-radius: 4px;
|
||||
box-shadow: inset 0 1px 0 #80B0FB;
|
||||
padding: 3px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
button.button-secondary:hover,
|
||||
button.main:hover,
|
||||
input[type="button"].main:hover,
|
||||
input[type="button"].button-secondary:hover,
|
||||
button.blue:hover {
|
||||
border: 1px #13487e solid;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 1px #EAEAEA, inset 0 1px 0 #5A94F1;
|
||||
background: #0b5ed7;
|
||||
padding: 3px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
button.button-secondary:active,
|
||||
button.main:active,
|
||||
input[type="button"].main:active,
|
||||
input[type="button"].button-secondary:active,
|
||||
button.blue:active {
|
||||
box-shadow: inset 0 2px 5px #2370FE;
|
||||
padding: 3px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
/* Orange button as seen on blogger.com*/
|
||||
button.orange {
|
||||
color: white;
|
||||
border: 1px solid #FB8F3D;
|
||||
background: -webkit-linear-gradient(top, #FDA251, #FB8F3D);
|
||||
background: -moz-linear-gradient(top, #FDA251, #FB8F3D);
|
||||
background: -ms-linear-gradient(top, #FDA251, #FB8F3D);
|
||||
}
|
||||
|
||||
button.orange:hover {
|
||||
border: 1px solid #EB5200;
|
||||
background: -webkit-linear-gradient(top, #FD924C, #F9760B);
|
||||
background: -moz-linear-gradient(top, #FD924C, #F9760B);
|
||||
background: -ms-linear-gradient(top, #FD924C, #F9760B);
|
||||
box-shadow: 0 1px #EFEFEF;
|
||||
}
|
||||
|
||||
button.orange:active {
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
/* Red Google Button as seen on drive.google.com */
|
||||
button.red {
|
||||
background: -webkit-linear-gradient(top, #DD4B39, #D14836);
|
||||
background: -moz-linear-gradient(top, #DD4B39, #D14836);
|
||||
background: -ms-linear-gradient(top, #DD4B39, #D14836);
|
||||
border: 1px solid #DD4B39;
|
||||
color: white;
|
||||
text-shadow: 0 1px 0 #C04131;
|
||||
}
|
||||
|
||||
button.red:hover {
|
||||
background: -webkit-linear-gradient(top, #DD4B39, #C53727);
|
||||
background: -moz-linear-gradient(top, #DD4B39, #C53727);
|
||||
background: -ms-linear-gradient(top, #DD4B39, #C53727);
|
||||
border: 1px solid #AF301F;
|
||||
}
|
||||
|
||||
button.red:active {
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,0.2);
|
||||
background: -webkit-linear-gradient(top, #D74736, #AD2719);
|
||||
background: -moz-linear-gradient(top, #D74736, #AD2719);
|
||||
background: -ms-linear-gradient(top, #D74736, #AD2719);
|
||||
}
|
||||
|
||||
|
||||
BIN
src/main/resources/static/resources/engine/exit.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/main/resources/static/resources/engine/g.png
Normal file
|
After Width: | Height: | Size: 767 B |
88
src/main/resources/static/resources/engine/geo_json.jsp
Normal file
@ -0,0 +1,88 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.io.*"%>
|
||||
<%@ page import="java.sql.*"%>
|
||||
<%@ page import="java.util.ResourceBundle"%>
|
||||
<%@page import="javax.xml.parsers.DocumentBuilderFactory"%>
|
||||
<%@page import="javax.xml.parsers.DocumentBuilder"%>
|
||||
<%@page import="org.w3c.dom.Document"%>
|
||||
<%@page import="org.w3c.dom.Element"%>
|
||||
<%@page import="org.w3c.dom.NamedNodeMap"%>
|
||||
<%@page import="org.w3c.dom.Node"%>
|
||||
<%@page import="org.w3c.dom.NodeList"%>
|
||||
<%@page import="org.w3c.dom.ls.DOMImplementationLS"%>
|
||||
<%@page import="org.w3c.dom.ls.LSSerializer"%>
|
||||
<%@page import="org.w3c.dom.ls.LSOutput"%>
|
||||
<%@page import="org.w3c.dom.CDATASection"%>
|
||||
<%@page import="org.w3c.dom.CharacterData"%>
|
||||
<%@ page import="java.util.Properties" %>
|
||||
<%
|
||||
|
||||
String db_url="";
|
||||
String db_login="";
|
||||
String db_password="";
|
||||
//String data_dir = "";
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
prop.load(new FileInputStream("org_ccalm_main.properties")); // load a properties file
|
||||
db_url = prop.getProperty("spring.datasource.url");
|
||||
db_login = prop.getProperty("spring.datasource.username");
|
||||
db_password = prop.getProperty("spring.datasource.password");
|
||||
//data_dir = prop.getProperty("data.dir");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Error load org_ccalm_main.properties",e);
|
||||
}
|
||||
|
||||
|
||||
String table = request.getParameter("table");
|
||||
String id = request.getParameter("id");
|
||||
|
||||
//Selection of geometric information and sending it to the client using JSON
|
||||
Connection conn = null;
|
||||
try{
|
||||
Class.forName("org.postgresql.Driver");
|
||||
conn = DriverManager.getConnection(db_url,db_login,db_password);
|
||||
if(conn!=null)
|
||||
{
|
||||
System.out.println("Connect is OK!");
|
||||
}else
|
||||
{
|
||||
out.write("<br>Connect is ERROR<br>");
|
||||
}
|
||||
}catch(Exception e)
|
||||
{
|
||||
out.write("<br>Connect Exception:"+e.getMessage()+"<br>");
|
||||
}
|
||||
|
||||
Statement st = conn.createStatement();
|
||||
ResultSet rs=null;
|
||||
try {
|
||||
String sql="select id,name,ST_AsGeoJSON(geom,3,0) as geom from main."+table+" where id="+id+";";
|
||||
rs = st.executeQuery(sql);
|
||||
} catch( SQLException ex )
|
||||
{
|
||||
out.write("<br>SQLException:"+ex.getMessage()+"<br>");
|
||||
}
|
||||
|
||||
if(rs!=null)
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
String geom=null;
|
||||
try {
|
||||
geom=rs.getString("geom");
|
||||
} catch( Exception ex )
|
||||
{
|
||||
out.write("<br>SQLException:"+ex.getMessage()+"<br>");
|
||||
System.out.println("Error: "+ex.getMessage());
|
||||
}
|
||||
if(geom==null) geom="";
|
||||
out.write(geom);
|
||||
}
|
||||
}
|
||||
st.close();
|
||||
|
||||
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
BIN
src/main/resources/static/resources/engine/help.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
37
src/main/resources/static/resources/engine/help/index.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>HELP</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
html,body
|
||||
{
|
||||
height:100%;
|
||||
min-height:100%;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
text-align:center;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3>ASDC Guidelines</h3>
|
||||
<a href="ASDC_for_Android_ENG.pdf" target="_blank">ASDC_for_Android_ENG_v2.4.3.pdf</a><br/>
|
||||
<a href="ASDC_for_Android_RUS.pdf" target="_blank">ASDC_for_Android_RUS_v2.4.3.pdf</a>
|
||||
|
||||
<h3>CCALM Guidelines</h3>
|
||||
<a href="CCALM_help_ENG.pdf" target="_blank">CCALM_help_ENG.pdf</a><br/>
|
||||
<a href="CCALM_help_RUS.pdf" target="_blank">CCALM_help_RUS.pdf</a>
|
||||
|
||||
<h3>QGIS Guidelines</h3>
|
||||
<a href="QGIS_Guide_ENG.doc" target="_blank">QGIS_Guide_ENG.doc</a><br/>
|
||||
<a href="QGIS_Guide_RUS.doc" target="_blank">QGIS_Guide_RUS.doc</a>
|
||||
|
||||
<h3>Technical support and administration.</h3>
|
||||
<a href="Administration CCALM v 0.3_ENG.doc" target="_blank">Administration CCALM v 0.3_ENG.doc</a><br/>
|
||||
<a href="Administration CCALM v 0.3_RUS.doc" target="_blank">Administration CCALM v 0.3_RUS.doc</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
src/main/resources/static/resources/engine/horizontal.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
src/main/resources/static/resources/engine/images/1x32.gif
Normal file
|
After Width: | Height: | Size: 43 B |
BIN
src/main/resources/static/resources/engine/images/2px.gif
Normal file
|
After Width: | Height: | Size: 64 B |
BIN
src/main/resources/static/resources/engine/images/blank.png
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
src/main/resources/static/resources/engine/images/closed.png
Normal file
|
After Width: | Height: | Size: 237 B |
BIN
src/main/resources/static/resources/engine/images/datepicker.jpg
Normal file
|
After Width: | Height: | Size: 488 B |
BIN
src/main/resources/static/resources/engine/images/document.png
Normal file
|
After Width: | Height: | Size: 204 B |
BIN
src/main/resources/static/resources/engine/images/excel.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/main/resources/static/resources/engine/images/g.png
Normal file
|
After Width: | Height: | Size: 957 B |