CN111814017A - Method for automatically publishing data by unified coordinate system and computer program product - Google Patents

Method for automatically publishing data by unified coordinate system and computer program product Download PDF

Info

Publication number
CN111814017A
CN111814017A CN202010442703.5A CN202010442703A CN111814017A CN 111814017 A CN111814017 A CN 111814017A CN 202010442703 A CN202010442703 A CN 202010442703A CN 111814017 A CN111814017 A CN 111814017A
Authority
CN
China
Prior art keywords
coordinate system
shape file
data
conversion
converted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010442703.5A
Other languages
Chinese (zh)
Inventor
李申章
赵志宇
马文
黄祖源
田园
李辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Information Center of Yunnan Power Grid Co Ltd
Original Assignee
Information Center of Yunnan Power Grid Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Information Center of Yunnan Power Grid Co Ltd filed Critical Information Center of Yunnan Power Grid Co Ltd
Priority to CN202010442703.5A priority Critical patent/CN111814017A/en
Publication of CN111814017A publication Critical patent/CN111814017A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/907Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/909Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using geographical or spatial information, e.g. location
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method for automatically issuing data by a unified coordinate system and a computer program product, comprising the steps of (1) determining a core coordinate system; (2) pre-writing a conversion function, wherein the conversion function is divided into a same ellipsoid and different ellipsoids, the conversion function of the same ellipsoid is written according to the projection principle, the conversion functions of the different ellipsoids need to be converted into a spatial rectangular coordinate system firstly, and are converted into a target spatial rectangular coordinate system by utilizing seven parameters correspondingly, and then are converted into a target coordinate system; (3) inputting a pre-conversion coordinate system, and unifying the pre-conversion coordinate system and a conversion function corresponding completion coordinate system; (4) calling a Rest interface in the Geoserver; (5) creating a working area; (6) creating a data store; (7) and releasing the layer. The invention sets a uniform target coordinate system aiming at the condition that a plurality of coordinate systems are to be converted, performs uniform conversion on the target coordinate system, automatically releases data, can directly call and display a conversion result, and greatly improves the working efficiency.

Description

Method for automatically publishing data by unified coordinate system and computer program product
Technical Field
The invention relates to a method for automatically publishing data by a unified coordinate system and a computer program product, belonging to the technical field of WebGIS.
Background
In recent years, with the popularization of the internet and the development of the GIS technology, the development and application of the WebGIS at home and abroad are in a new stage, data release is often involved in the development and application process of the WebGIS, and the problem of non-uniform coordinate systems exists in the data release.
The traditional solution is to convert the coordinate system to realize unification by means of a projection tool in an ArcGIS toolbox, or sequentially realize coordinate conversion based on a GIS secondary development tool, and then perform data distribution through manual configuration operation.
Disclosure of Invention
The invention designs a method which enables the coordinate systems of all data in the GIS to be uniformly converted at one time and automatically release the data through a specific interface, thereby greatly improving the working efficiency and solving the problem of low data release efficiency due to non-uniform coordinate systems in the WebGIS.
A unified coordinate system data automatic publishing method and computer program product, realizes GIS original data automatic unified service publishing of geographic and projection coordinate system, the steps are as follows:
determining a core coordinate system, wherein the core coordinate system is a conversion target of all coordinate systems;
pre-writing a conversion function, wherein the conversion function is divided into a same ellipsoid and different ellipsoids, the conversion function of the same ellipsoid is written according to a projection principle, the conversion functions of the different ellipsoids need to be converted into a spatial rectangular coordinate system firstly, and are converted into a target spatial rectangular coordinate system by utilizing seven parameters correspondingly, and then are converted into a target coordinate system;
inputting a pre-conversion coordinate system, and unifying the pre-conversion coordinate system and a conversion function corresponding completion coordinate system;
step (4) calling a Rest interface in the Geoserver;
step (5), a working area is created;
step (6) creating a data storage;
and (7) releasing the layer.
Further, in the step (2), JAVA-based shape file coordinate information acquisition is also performed, including:
shape format files contain a minimum of 3 files, with their suffixes: shp, dbf, and. shx, where. The method uses geotools to obtain the coordinate information in the shape file to serve as the basis for subsequent coordinate unification. After the storage path of the shape file is known, coordinate information of the shape file can be obtained by combining geotools.
Further, generating a shape file after coordinate unification in the step (3), including:
and (4) carrying out coordinate unification after the Shape file is analyzed by geotools, and then converting the Shape file into a Shape file to be stored in a specified path to prepare for subsequent data release. The class objects mainly involved are:
(4) FeatureCollection, which saves the created elements;
(5) ShapefileDataStore, a new shape file is generated.
(6) SimpleFeatureSource, newly building a data source.
Further, the step (7) further performs automatic data publishing, including:
WebGIS based on Rest service is the main development mode of the current network GIS, and a network user can issue GIS Server service through the Rest service to provide the user with access to geographic information resources on the network, analyze spatial data and return results. Currently, the most popular GIS servers mainly include ArcGIS Server of ESRI, SuperMap of hypergraph, and GeoServer of open source. Based on the advantage of GeoServer open source, the automatic data publishing function of the invention is realized based on GeoServer. The GeoServer-based automatic service release can be performed through a background request Rest interface or an ajax at the front end, and the invention performs automatic data release based on a JAVA request Rest interface.
The request Rest interface for data distribution mainly relates to the following class objects:
(3) the GeoServerRESTPublesher is used for creating a working space and releasing data;
(4) and the GeoServerRESTManager establishes a data storage and releases the image layer.
A computer program product for automatic data distribution with a unified coordinate system, comprising a non-transitory readable storage medium and a computer program, the computer program being tangibly stored on the non-transitory readable storage medium, the computer program being executable by a processor in a computer to perform the steps of the method for automatic data distribution with a unified coordinate system.
Compared with the prior art, the invention has the following beneficial effects:
at present, the mainstream coordinate system conversion method is to perform coordinate conversion based on ArcMap and call a projection tool in a tool kit to realize the coordinate conversion, or to compile a coordinate conversion tool based on a secondary development interface. The invention sets a uniform target coordinate system aiming at the condition of a plurality of coordinate systems to be converted, judges the conversion conditions (the same ellipsoid and different ellipsoids), performs uniform conversion on the target coordinate system and automatically releases data, can directly call and display the conversion result, and greatly improves the working efficiency.
Drawings
Fig. 1 is a flowchart of a method for automatically publishing data in a unified coordinate system according to the present invention.
Detailed Description
In this embodiment, referring to fig. 1, a flowchart of an implementation of the method for automatically publishing data by using a unified coordinate system according to the present invention is as follows:
(1) selecting a core coordinate system as a target coordinate system with unified coordinates, wherein wgs84 is selected as the core coordinate system in the example;
(2) pre-compiling a conversion function, wherein the conversion function covers all coordinates involved in coordinate unification, the conversion function is mainly divided into two categories, namely coordinate conversion (projection) under the same ellipsoid and coordinate conversion (seven parameters) under different ellipsoids, a plurality of typical coordinate systems are added into a conversion function library firstly, and the typical coordinate systems are compiled and converted into wgs84 conversion functions;
(3) inputting a shape file path, and acquiring a data set based on Java and acquiring coordinate system information of the data set by using geoTools;
3.1 configuring a Maven warehouse address;
3.2 introduction of pom dependence
3.3 creating an entity class (ShapeModel) mapped by the shape file, wherein the entity class is required to cover the layer name, the set information, the coordinate information and the creation date, and if the shape file contains the administrative area, the administrative area name and the administrative area code attribute are required to be added into the entity class;
3.4 creating a function (convertFileToShape) for converting the shape file into the shape model by referring to the geotools, creating a function (convertFileToShape) for reading the shape file according to the file path, and calling the convertFileToShape function to convert the shape file into the shape model for returning;
and 3.5 calling the readShapeFile to read the input shape file and acquire the coordinate information of the shape file.
(4) The coordinate unification work is finished by corresponding the coordinate with the conversion function;
(5) converting the converted data into a shape file based on geotools and storing the shape file in a specified path;
5.1 defining a shape file storage path;
5.2 establishing data storage by using ShapefileDataStore according to the shape file storage path, and setting codes;
5.3 combining ShapeFileDataStore to build a data source by using SimpleFeatureSource;
5.4 combine ShapeFileDataStore to obtain the element set and store it in SimpleFeatureCollection;
5.5 obtaining each element in the element set by using SimpleFeatureInterator;
5.6 creating a shape file object by using ShapefileDataStoreFactory;
5.7 obtaining shape file field name based on SimpleFeatureSource
5.8 defining graph information and attribute information based on SimpleFeatureTypeBuilder;
5.9 generate feature using FeatureWriter.
(6) Acquiring a management object based on GeoServer connection by a user name and a password, acquiring a release object on the basis of the management object, and acquiring a working space name at the same time;
(7) judging whether the working space exists or not, and if not, building a new working space based on GeoServerRESTPublesher;
(8) judging whether the data storage already exists based on the path of the shape file storage, and if not, establishing the data storage by using a GSShapefileDatastoreEncoder;
(9) and judging whether the layer exists by utilizing the GeoServerRESTManager through the working space and the layer name, and if so, issuing by utilizing the GeoServerRESTManager.
A computer program product for automatic data distribution with a unified coordinate system, comprising a non-transitory readable storage medium and a computer program, the computer program being tangibly stored on the non-transitory readable storage medium, the computer program being executable by a processor in a computer to perform the steps of the method for automatic data distribution with a unified coordinate system.

Claims (7)

1. A method for automatically releasing data by a unified coordinate system is characterized by comprising the following steps:
determining a core coordinate system, wherein the core coordinate system is a conversion target of all coordinate systems;
pre-writing a conversion function, wherein the conversion function is divided into a same ellipsoid and different ellipsoids, the conversion function of the same ellipsoid is written according to a projection principle, the conversion functions of the different ellipsoids need to be converted into a spatial rectangular coordinate system firstly, and are converted into a target spatial rectangular coordinate system by utilizing seven parameters correspondingly, and then are converted into a target coordinate system;
inputting a pre-conversion coordinate system, and unifying the pre-conversion coordinate system and a conversion function corresponding completion coordinate system;
step (4) calling a Rest interface in the Geoserver;
step (5), a working area is created;
step (6) creating a data storage;
and (7) releasing the layer.
2. The method for automatically releasing data according to the unified coordinate system of claim 1, wherein the step (2) further obtains the JAVA-based shape file coordinate information, which includes:
and acquiring coordinate information in the shape file by using the geotools to serve as a basis for subsequent coordinate unification, and acquiring the coordinate information of the shape file by combining the geotools after a storage path of the shape file is known.
3. The method for performing automatic data distribution by using a unified coordinate system according to claim 2, wherein the step (3) further performs coordinate unification and then generates a shape file, which comprises:
the coordinate unification is carried out after the Shape file is analyzed by geotools, then the Shape file needs to be converted into a Shape file to be stored in a specified path to prepare for subsequent data release, and related class objects are as follows:
(1) FeatureCollection, which saves the created elements;
(2) ShapefileDataStore, generating a new shape file;
(3) SimpleFeatureSource, newly building a data source.
4. The method for automatically releasing data in unified coordinate system as claimed in claim 3, wherein the data is released by using Rest interface, and the related class objects comprise:
(1) the GeoServerRESTPublesher is used for creating a working space and releasing data;
(2) and the GeoServerRESTManager establishes a data storage and releases the image layer.
5. The method for automatic data distribution in a unified coordinate system according to claim 2, wherein the step of obtaining the data set based on Java and obtaining the coordinate system information thereof by geoTools comprises:
(1) configuring a Maven warehouse address;
(2) introduction of pom dependence
(3) Creating an entity class ShapeModel mapped by the shape file, wherein the entity class is required to cover the layer name, the set information, the coordinate information and the creation date, and if the shape file contains the administrative district, the administrative district name and the administrative district code attribute are required to be added into the entity class;
(4) creating a function convertFileToShape for quoting the geotools to convert the shape file into a ShapeModel, creating a function convertFileToShape for reading the shape file according to a file path, and calling a convertFileToShape function to convert the shape file into a ShapeModel class for returning;
(5) and calling readShapeFile to read the input shape file and acquire the coordinate information of the shape file.
6. The method for automatically releasing data by using a unified coordinate system as claimed in claim 3, wherein the step of converting the converted data into a shape file based on geotools comprises:
(1) defining a shape file storage path;
(2) establishing data storage by using ShapefileDataStore according to the shape file storage path, and setting codes;
(3) combining ShapeFileDataStore and utilizing SimpleFeatureSource to newly establish a data source;
(4) acquiring an element set by combining ShapeFileDataStore and storing the element set in SimpleFeatureCollection;
(5) acquiring each element in the element set by using a SimpleFeatureInterator;
(6) creating a shape file object by using ShapeFileDataStoreFactory;
(7) acquiring a shape file field name based on SimpleFeatureSource;
(8) defining graphic information and attribute information based on SimpleFeatureTypeBuilder;
(9) feature is generated using a FeatureWriter.
7. A computer program product for automatic data distribution with a unified coordinate system, comprising a non-transitory readable storage medium and a computer program, the computer program being tangibly stored on the non-transitory readable storage medium, characterized in that:
the computer program is executed by a processor in a computer to perform the steps of the unified coordinate system for automatic data distribution method according to any one of claims 1 to 6.
CN202010442703.5A 2020-05-22 2020-05-22 Method for automatically publishing data by unified coordinate system and computer program product Pending CN111814017A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010442703.5A CN111814017A (en) 2020-05-22 2020-05-22 Method for automatically publishing data by unified coordinate system and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010442703.5A CN111814017A (en) 2020-05-22 2020-05-22 Method for automatically publishing data by unified coordinate system and computer program product

Publications (1)

Publication Number Publication Date
CN111814017A true CN111814017A (en) 2020-10-23

Family

ID=72848364

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010442703.5A Pending CN111814017A (en) 2020-05-22 2020-05-22 Method for automatically publishing data by unified coordinate system and computer program product

Country Status (1)

Country Link
CN (1) CN111814017A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7032173B1 (en) * 2000-06-16 2006-04-18 Microsoft Corporation Automatic republication of data
KR20060100157A (en) * 2005-03-16 2006-09-20 윤홍식 Distorting modeling method for transforming the presize position of partial/positional information
US20100145979A1 (en) * 2008-12-08 2010-06-10 Continental Airlines, Inc. Geospatial data interaction
CN106777811A (en) * 2017-01-16 2017-05-31 昆明理工大学 A kind of traffic channelling Map Design development approach
CN110263116A (en) * 2019-06-21 2019-09-20 苏州超擎图形软件科技发展有限公司 A kind of tile map dissemination method and device for supporting dynamic projection to convert

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7032173B1 (en) * 2000-06-16 2006-04-18 Microsoft Corporation Automatic republication of data
KR20060100157A (en) * 2005-03-16 2006-09-20 윤홍식 Distorting modeling method for transforming the presize position of partial/positional information
US20100145979A1 (en) * 2008-12-08 2010-06-10 Continental Airlines, Inc. Geospatial data interaction
CN106777811A (en) * 2017-01-16 2017-05-31 昆明理工大学 A kind of traffic channelling Map Design development approach
CN110263116A (en) * 2019-06-21 2019-09-20 苏州超擎图形软件科技发展有限公司 A kind of tile map dissemination method and device for supporting dynamic projection to convert

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
HPUGISERS: "Geoserver的rest接口使用(后台或者前端调实现自动发布服务)", pages 1 - 3, Retrieved from the Internet <URL:https://blog.csdn.net/weixin_40184249/article/details/87877740> *
LZU-GIS: "geotools实现shp数据的缓冲区分析", pages 1 - 3, Retrieved from the Internet <URL:https://www.cnblogs.com/lzugis/p/7224349.html> *
SUPERBEYONE: "Java使用GeoTools读取shapefile文件", pages 1 - 3, Retrieved from the Internet <URL:https://blog.csdn.net/superbeyone/article/details/82799645> *
仇海亮: "基于GIS开源框架的地理信息服务应用", 电子技术与软件工程, pages 43 - 44 *
靳卫华等: "空间数据产品坐标系统转换方法与实现", 测绘与空间地理信息, pages 195 - 197 *

Similar Documents

Publication Publication Date Title
Hesselbarth et al. landscapemetrics: an open‐source R tool to calculate landscape metrics
CN110705237B (en) Automatic document generation method, data processing device and storage medium
KR20140121145A (en) BIM based Integrated Management System for Constrcution Data
CN113179489B (en) Satellite terminal access management method, core network, computer device, and storage medium
US20070033570A1 (en) Method and system for transforming a process flow
CN112668181B (en) Simulation test method and device, electronic equipment and storage medium
CN103677821A (en) Method and device for publishing software development tool code
WO2021068692A1 (en) Method, apparatus and device for workflow migration, and computer-readable storage medium
KR20220078107A (en) Method and system for converting object code of bim data with different kind of structure
CN111026938B (en) Space-time big data integration analysis method, device, equipment and storage medium
CN112685447A (en) Cross-time-zone operation database system, data query method, medium, and server
CN112685616A (en) Precise power component management method based on space grid and building information model
CN111026670B (en) Test case generation method, test case generation device and storage medium
CN104750468A (en) Server side topological data conversion method and device
CN111814017A (en) Method for automatically publishing data by unified coordinate system and computer program product
CN111737330A (en) Spatial data standardization method and device, computer equipment and storage medium
CN116956837A (en) Project determining method and device for engineering quantity list
WO2022266153A1 (en) Mobile viewer object statusing
CN112346736B (en) Data processing method and system
CN115115787A (en) Method for converting two-dimensional drawing into 3D model based on DirectVR
CN113610512A (en) Electronic signature generation method, device, equipment and storage medium
Bocevska et al. An example of application design using solidworks application programming interface
CN107861725B (en) iOS data reverse automatic analysis strategy
CN113326034A (en) Policy implementation calling method and device, electronic equipment and storage medium
CN116755684B (en) OAS Schema generation method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination