OPTIONS: -f Use this option to specify the name of the file to create. -h Allows you to specify connection to a database on a machine other than the default. -p Allows you to specify a database port other than the default. -P Connect to the database with the specified password. -u Connect to the database as the specified user. -g Specify the geometry column to be exported. -b Use a binary cursor. -r Raw mode. Do not assume table has been created by the loader. This would not unescape attribute names and will not skip the 'gid' attribute. -k Keep PostgreSQL identifiers case. -m Specify a file containing a set of mappings of (long) column names to 10 character DBF column names. The content of the file is one or more lines of two names separated by white space and no trailing or leading space. For example: COLUMNNAME DBFFIELD1 AVERYLONGCOLUMNNAME DBFFIELD2 -? Display this help screen.
将 PostgreSQL 数据库中的 geometry 表导出为 shapefile 导出 testdb01 数据库的 public 模式下的 shapefile 表 [root@pgmaster ~]# cd /usr/pgsql-12/bin/ [root@pgmaster bin]# mkdir -p "/opt/geom_exp/shape/geom_test01_point" [root@pgmaster bin]# pgsql2shp -f "/opt/geom_exp/shape/geom_test01_point/geom_test01_point.shp" -h 127.0.0.1 -u test -p 5432 -P 1q2w3e testdb01 public.geom_test01_point Initializing... Done (postgis major version: 3). Output shape: Point Dumping: X [2 rows]. [root@pgmaster bin]# [root@pgmaster bin]# ls -l /opt/geom_exp/shape/geom_test01_point/ total 20 -rw-r--r-- 1 root root 5 Jun 6 16:45 geom_test01_point.cpg -rw-r--r-- 1 root root 631 Jun 6 16:45 geom_test01_point.dbf -rw-r--r-- 1 root root 256 Jun 6 16:45 geom_test01_point.prj -rw-r--r-- 1 root root 156 Jun 6 16:45 geom_test01_point.shp -rw-r--r-- 1 root root 116 Jun 6 16:45 geom_test01_point.shx [root@pgmaster bin]# 导出成功后,自动生成了5个相关文件:.cpg,.dbf,.prj,.shp,.shx
] OPTIONS: -s [:] Set the SRID field. Defaults to 0. Optionally reprojects from given SRID. (-d|a|c|p) These are mutually exclusive options: -d Drops the table, then recreates it and populates it with current shape file data. -a Appends shape file into current table, must be exactly the same table schema. -c Creates a new table and populates it, this is the default if you do not specify any options. -p Prepare mode, only creates the table. -g Specify the name of the geometry/geography column (mostly useful in append mode). -D Use postgresql dump format (defaults to SQL insert statements). -e Execute each statement individually, do not use a transaction. Not compatible with -D. -G Use geography type (requires lon/lat data or -s to reproject). -k Keep postgresql identifiers case. -i Use int4 type for all integer dbf fields. -I Create a spatial index on the geocolumn. -m Specify a file containing a set of mappings of (long) column names to 10 character DBF column names. The content of the file is one or more lines of two names separated by white space and no trailing or leading space. For example: COLUMNNAME DBFFIELD1 AVERYLONGCOLUMNNAME DBFFIELD2 -S Generate simple geometries instead of MULTI geometries. -t Force geometry to be one of '2D', '3DZ', '3DM', or '4D' -w Output WKT instead of WKB. Note that this can result in coordinate drift. -W Specify the character encoding of Shape's attribute column. (default: "UTF-8") -N NULL geometries handling policy (insert*,skip,abort). -n Only import DBF file. -T Specify the tablespace for the new table. Note that indexes will still use the default tablespace unless the -X flag is also used. -X Specify the tablespace for the table's indexes. This applies to the primary key, and the spatial index if the -I flag is used. -? Display this help screen.
An argument of `--' disables further option processing. (useful for unusual file names starting with '-') [root@pgmaster bin]#
[root@pgmaster bin]# shp2pgsql -s 4326 -c -W UTF-8 "/opt/geom_exp/shape/geom_test01_point/geom_test01_point.shp" test_schema.geom_test01_point | psql -h 127.0.0.1 -U test -d testdb01 -p 5432 Field id is an FTDouble with width 11 and precision 0 Shapefile type: Point Postgis type: POINT[2] Password for user test: SET SET BEGIN CREATE TABLE ALTER TABLE addgeometrycolumn ----------------------------------------------------------------- test_schema.geom_test01_point.geom SRID:4326 TYPE:POINT DIMS:2 (1 row)
[root@pgmaster geom_exp]# shp2pgsql -s 4326 -c -W UTF-8 "/opt/geom_exp/shape/geom_test01_point/geom_test01_point.shp" test_schema.geom_test01_point > ./shp2sql/geom_test01_point.4326.sql Field id is an FTDouble with width 11 and precision 0 Shapefile type: Point Postgis type: POINT[2] [root@pgmaster geom_exp]# [root@pgmaster geom_exp]# [root@pgmaster geom_exp]# [root@pgmaster geom_exp]# shp2pgsql -s 3857 -c -W UTF-8 "/opt/geom_exp/shape/geom_test01_point/geom_test01_point.shp" test_schema.geom_test01_point > ./shp2sql/geom_test01_point.3857.sql Field id is an FTDouble with width 11 and precision 0 Shapefile type: Point Postgis type: POINT[2] [root@pgmaster geom_exp]# [root@pgmaster geom_exp]# [root@pgmaster geom_exp]# shp2pgsql -c -W UTF-8 "/opt/geom_exp/shape/geom_test01_point/geom_test01_point.shp" test_schema.geom_test01_point > ./shp2sql/geom_test01_point.noSRID.sql Field id is an FTDouble with width 11 and precision 0 Shapefile type: Point Postgis type: POINT[2] [root@pgmaster geom_exp]#
SRID=4326方式导入的数据的内容如下:
testdb01=> select id,name,st_asewkt(geom) from test_schema.geom_test01_point ; id | name | st_asewkt ----+------+--------------------------------------- 1 | test | SRID=4326;POINT(-0.125 52.5) 2 | test | SRID=4326;POINT(27.9116248 -33.01532) (2 rows)
testdb01=> select * from test_schema.geom_test01_point ; gid | id | name | geom -----+----+------+---------------------------------------------------- 1 | 1 | test | 0101000020E6100000000000000000C0BF0000000000404A40 2 | 2 | test | 0101000020E6100000F8382E3E60E93B40C47C7901F68140C0 (2 rows)
OGC: Open Geospatial Consortium (OGC) 开放地理空间信息联盟,它是一个非盈利的、国际化的、自愿协商的标准化组织,制定了一套标准,各种大厂商都几乎执行这些标准,使得不同厂商、不同产品之间可以通过统一的接口进行互操作。
EPSG: European Petroleum Survey Group (EPSG) 是一个协会,现在已经改名叫 OGP(Internation Association of Oil & Gas Producers)。它负责维护并发布坐标参考系统的数据集参数,以及坐标转换描述,该数据集被广泛接受并使用。例如:CGCS2000、WGS84坐标系在 EPSG 中都有定义,并有对应的code。查询官网:https://spatialreference.org/ SRS & CRS: 是同一个东西,都是坐标系。例如:WGS84。
终端仿真器是一款用其它显示架构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台连接上了服务器的客户机。终端仿真器允许最终用户用文本用户界面和命令行来访问控制台和应用程序。(LCTT 译注:终端仿真器原意指对大型机-哑终端方式的模拟,不过在当今的 Linux 环境中,常指通过远程或本地方式连接的伪终端,俗称“终端”。)
你能从开源世界中找到大量的终端仿真器,它们
功能:在控制台每秒输出一次
代码:
package Main;
import javax.swing.Timer;
import java.awt.event.*;
public class T {
private static int count = 0;
public static void main(String[] args){
1,获取样式属性值
top 与顶部的距离
left 与左边的距离
right 与右边的距离
bottom 与下边的距离
zIndex 层叠层次
例子:获取左边的宽度,当css写在body标签中时
<div id="adver" style="position:absolute;top:50px;left:1000p
spring data jpa 支持以方法名进行查询/删除/统计。
查询的关键字为find
删除的关键字为delete/remove (>=1.7.x)
统计的关键字为count (>=1.7.x)
修改需要使用@Modifying注解
@Modifying
@Query("update User u set u.firstna
项目中controller的方法跳转的到ModelAndView类,一直很好奇spring怎么实现的?
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* yo
(1)npm是什么
npm is the package manager for node
官方网站:https://www.npmjs.com/
npm上有很多优秀的nodejs包,来解决常见的一些问题,比如用node-mysql,就可以方便通过nodejs链接到mysql,进行数据库的操作
在开发过程往往会需要用到其他的包,使用npm就可以下载这些包来供程序调用
&nb
Controller层的拦截器继承于HandlerInterceptorAdapter
HandlerInterceptorAdapter.java 1 public abstract class HandlerInterceptorAdapter implements HandlerIntercep