Method and device for displaying geospatial data in open format document
By converting geospatial data into structured data in open-type documents and performing coordinate conversion, the efficiency and compatibility problems of existing GeoPDF technology when displaying geospatial data is solved, and efficient and clear data display and analysis are achieved.
Patent Information
- Application Number
- CN202411899547.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing GeoPDF technology has problems such as slow loading and rendering, limited processing power, strong enclosure and dependency, poor compatibility and integration when presenting geospatial data, especially in scenarios where efficient display and analysis of geospatial data is required.
By organizing geospatial data into structure data in the target format, a basic template for an open-type document is created, and vector data and raster data are converted based on page coordinates, and geospatial data and multiple map features are written into an open-type document for display.
It realizes efficient display of geospatial data in fixed layout documents, improves data loading and rendering speed, supports higher-level geographic analysis needs, reduces dependence on third-party plug-ins, and improves autonomous control capabilities and data security.
Smart Images

Figure CN119739802A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic document processing and geographic information system, and in particular to a method and device for displaying geographic space data in an open format document. Background Art
[0002] At present, the portable document format (PDF) has been widely used in the display of geographic information, especially the embedding of geospatial data into PDF documents through the GeoPDF standard. GeoPDF allows the integration of geographic information in fixed-layout documents, allowing users to view, annotate and analyze geographic data in PDF documents. GeoPDF is a standard that extends the functionality of PDF and supports the embedding of geospatial information into PDF documents. With GeoPDF, information such as vector graphics, raster images and geographic coordinates can be saved in PDF files, and basic Geographic Information System (GIS) functions such as measuring distances, querying coordinates and geographic annotation are supported. GeoPDF technology is widely used in map publishing, geographic information sharing and other fields. By using GeoPDF, users can view and operate geographic information directly in the PDF reader without the need for professional GIS software. This method is particularly suitable for scenarios where geographic information needs to be shared with non-professional users, such as planning documents and disaster relief manuals, geospatial intelligence, etc.
[0003] Although GeoPDF provides convenience and practicality in specific application scenarios, it also has some technical limitations and risks. First, PDF documents are usually large in size, especially when containing complex geographic data, which leads to slow loading and rendering speeds; second, GeoPDF's geographic information processing capabilities are relatively limited, and it is difficult to meet higher-level geographic analysis needs; third, due to the closed nature of the PDF format and its reliance on third-party tools, the application and expansion of GeoPDF are subject to certain restrictions; finally, since GeoPDF is not an international standard, existing domestic geographic information systems and document processing systems may have problems in compatibility and integration, and it is difficult to seamlessly connect with existing domestic software and systems. In addition to the problems with GeoPDF's own technology, the risks brought by non-localization are also great. GeoPDF is a technology developed by TerraGo Technologies in the United States and has not been officially adopted as a standard by international standardization organizations (such as ISO or OGC). Therefore, GeoPDF may face some problems brought by non-localization when applied in China, such as: Technical dependence: GeoPDF's core technology and tools rely on American companies and developers, and are limited in domestic application promotion and technical support. Data security: In application scenarios involving national security and data privacy, such as geospatial intelligence, the use of GeoPDF may face the risk of data leakage. Insufficient autonomy and controllability: The use of non-localized technology has weakened the autonomy and controllability of China in the field of geographic information display to a certain extent, and may face the situation of not being able to obtain timely technical support or upgrades at critical moments. Summary of the invention
[0004] The present invention provides a method and device for displaying geospatial data in an open-format document, which are used to solve the limitations and risks of the prior art and realize the efficient display of geospatial data in a fixed-format document.
[0005] The present invention provides a method for displaying geospatial data in an open layout document, comprising: Organizing geospatial data into structured data in a target format, wherein the geospatial data includes vector data and raster data; Create basic templates for open layout documents; Based on the page coordinates in the basic template, converting the geographic coordinates and pixel coordinates of the vector data and raster data respectively; Based on the coordinate conversion result, the geospatial data and a plurality of map elements are written into an open layout document and displayed.
[0006] In a possible implementation, the method further includes: Based on a preset standard, define a page coordinate space in which the upper left corner of the page in the basic template is the coordinate origin, the X axis increases to the right, and the Y axis increases downward; Define the upper left corner point in the grid data as the coordinate origin, the pixel coordinate space in which the X axis increases rightwards and the Y axis increases downwards; A geographic coordinate space is defined based on the latitude and longitude coordinates of the geographic spatial data.
[0007] In a possible implementation, the method further includes: The pixel horizontal coordinate of the pixel coordinate is converted into the page horizontal coordinate of the page coordinate by a first formula, wherein the first formula is: ; The pixel ordinate of the pixel coordinate is converted into the page ordinate of the page coordinate by a second formula, wherein the second formula is: ; in, is the horizontal coordinate of the page, is the pixel horizontal coordinate, is the horizontal offset of the origin of the raster data in the page space. is the area occupied by a pixel in the raster data in the page space. is the vertical coordinate of the page, is the pixel ordinate, The vertical offset of the origin of the raster data in page space.
[0008] In a possible implementation, the method further includes: The geographic abscissa of the geographic coordinate is converted into the pixel abscissa of the pixel coordinate by a third formula, and the third formula is: ; The geographic ordinate of the geographic coordinate is converted into the pixel ordinate of the pixel coordinate by a fourth formula, and the fourth formula is: ; in, is the pixel horizontal coordinate, is the geographic horizontal coordinate, The geographic X coordinate of the point whose pixel coordinates are (0,0) in the upper left corner of the image. is the pixel resolution in the X direction, is the pixel ordinate, is the geographic vertical coordinate, The geographic Y coordinate of the point whose pixel coordinates are (0,0) in the upper left corner of the image. is the pixel resolution in the Y direction; The pixel coordinates obtained by converting the geographic coordinates are converted into page coordinates based on the first formula and the second formula.
[0009] In a possible implementation, the method further includes: Storing the geospatial data in a resource folder of the open layout document; Recording the relative path and ID of the geospatial data in a document index file of the open layout document; Describing the attributes of the geospatial data in a page in a page description file of the open layout document; The geospatial data in the page description file is displayed in the page space.
[0010] In a possible implementation, the method further includes: The plurality of map elements include a compass, a latitude and longitude grid, map annotation lines, map annotation text, source, scale, shooting date and mapping unit; The compass image, map annotation lines, map annotation text, source, scale, shooting date and mapping unit are stored in a resource folder of the open layout document and recorded in a document index file and described in a page description file; Expressing the longitude and latitude grid by image elements and describing it in the page description file; A plurality of map elements in the page description file are displayed in the page space.
[0011] The present invention also provides a device for displaying geospatial data in an open format document, comprising the following modules: An organization module, used for organizing the geospatial data into structured data in a target format, wherein the geospatial data includes vector data and raster data; Creation module, used to create basic templates for open layout documents; A conversion module, for converting the geographic coordinates and pixel coordinates of the vector data and raster data respectively based on the page coordinates in the basic template; The display module is used to write the geographic spatial data and multiple map elements into an open layout document and display them based on the coordinate conversion result.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for displaying geospatial data in an open layout document as described in any one of the above is implemented.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for displaying geospatial data in an open-format document.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above methods for presenting geospatial data in an open format document.
[0015] The method and device for displaying geospatial data in an open layout document provided by the present invention organizes geospatial data into structured data in a target format, wherein the geospatial data includes vector data and raster data; creates a basic template for an open layout document; based on the page coordinates in the basic template, converts the geographic coordinates and pixel coordinates of the vector data and raster data respectively; based on the coordinate conversion result, writes the geospatial data and multiple map elements into the open layout document and displays them. Compared with the technical limitations and risks existing in the existing GeoPDF standard geospatial data display method, this solution, by utilizing the fixed layout characteristics of the OFD format, through data compression, clipping and optimization and other technical means, realizes efficient and clear display of geospatial data. By embedding geospatial data (such as vector data and raster data) into an OFD document, the consistency and readability of the data in different devices and environments can be ensured, thereby improving the user experience. Through OFD-based technology, it supports the application needs of localization, reduces the dependence on third-party plug-ins, improves the autonomous control capability, and ensures data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a flowchart of a method for displaying geographic spatial data in an open layout document provided by the present invention.
[0018] Figure 2 It is a logical structure diagram of the OFD document provided by the present invention.
[0019] Figure 3 This is a relationship diagram between pixel space and page space provided by the present invention.
[0020] Figure 4 This is a physical structure diagram of the OFD document provided by the present invention.
[0021] Figure 5 It is a flow chart of generating OFD document from geographic spatial data provided by the present invention.
[0022] Figure 6 This is the final result diagram of the OFD document geospatial data display provided by the present invention.
[0023] Figure 7 It is a structural schematic diagram of the device for displaying geographic spatial data in an open format document provided by the present invention.
[0024] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present invention.
[0027] Figure 1 is a flow chart of a method for displaying geospatial data in an open format document provided by the present invention, such as Figure 1 As shown, the method specifically includes: S11. Organize the geospatial data into structured data in a target format.
[0028] The embodiment of the present invention realizes the display of geographic space data by performing coordinate transformation based on the OFD coding rule and directly modifying the OFD base code.
[0029] First, the basic concepts in the embodiments of the present invention are explained: geographic spatial data can be divided into vector data and raster data. Vector data is suitable for representing geographic features with clear boundaries, and is usually used to store geographic information that requires precise positioning, such as shapefile and geojson formats. Raster data consists of pixels or cells, each of which has a corresponding geographic location and value, and is usually used in scenarios that require continuous data representation, such as tif and img formats.
[0030] Cartographic expression is the process of visually presenting geographic information and spatial data through visual means such as maps, charts or graphics. It uses elements such as symbols, colors, and scales to effectively communicate and analyze complex geographic phenomena and data, helping the audience understand and interpret spatial information. In addition to the representation of geographic spatial data, geographic information cartographic expression also includes elements such as scale, compass, latitude and longitude grid, map annotation, and legend.
[0031] OFD template facilitates the storage, reading and editing of electronic documents. It is a national standard for layout documents formulated by the layout writing group established by the China Electronics Technology Standardization Institute and is an independent format in China. Figure 2 As shown in the logical structure diagram of OFD document, the OFD document structure is divided into three layers: virtual storage system: including package organization structure and directory organization structure within the package; document model: including organization structures such as documents, pages, outlines, and file-level resources; page content description: including page-level resources, graphics, images, and text. If you want to express geographic information cartography in an OFD document, you need to match the elements in the cartographic expression with the elements in the OFD document one by one. Among them, the graphic object corresponds to the expression of vector data and longitude and latitude grids; the image corresponds to the expression of raster data and compass (a picture prepared in advance); the text corresponds to the expression of other map elements such as scale, map annotation, and legend.
[0032] The technical principle of the present invention is to display geospatial data by performing coordinate transformation based on OFD coding rules and directly modifying OFD base code. Since OFD coding rules are fully complied with, the results can be opened and previewed in any OFD decoder, which not only avoids dependence on third-party plug-ins, but also ensures the universality and cross-platform nature of OFD documents, giving full play to the advantages of OFD standards.
[0033] In the embodiment of the present invention, combined with Figure 5 The flowchart of generating OFD document from geospatial data is shown as follows: To facilitate the generation of OFD document, data preparation is first performed: the geospatial data to be expressed by OFD is organized into structured data in the target format, including vector data and raster data. The target format can be JSON format. The structure is as follows: { "date": "2022-06-07", "graphTitle": "HZDFW", "cartographUnit": "Beijing Guanwei Technology Co., Ltd." "source": "Google", "scale": "1:2000", "compassPath": " / recognition / ofd / img / compass.png", "tifPath": " / recognition / ofd / 1704846320880 / 1704846320880-clip-compress.tif", "shapes": [{ "label": "FSC", "type": "mark", "points": [ [37.6026949711, 56.2054600903], [37.6027445314, 56.2054800545], [37.6028723376, 56.2053693848], [37.6028188324, 56.2053515321], [37.6026949711, 56.2054600903] ] }, { "label": "FSC", "type": "label", "points": [ [37.60276512872, 56.2054242304], [37.60294249522, 56.2054242304] ] }...] } Among them, date indicates the mapping date; graphTitle indicates the title; cartographUnit indicates the mapping unit; source indicates the data source; scale indicates the scale; compassPath indicates the physical path where the compass image is stored; tifPath indicates the physical path where the image map (raster data) is stored; shapes is a JSON array that stores vector feature objects. Each object consists of three attributes: label indicates the annotation name; type indicates the feature type. If the type value is mark, it means that the feature is a labeled vector; if the type value is label, it means that the feature is a labeled line; points is a JSON array that stores the coordinate information of the vector feature.
[0034] S12. Create a basic template for an open-layout document.
[0035] Create an OFD basic template according to national standards, including the main index file and related resource folders. The basic template contains: OFD.xml and Doc_0 folder. OFD.xml is the main index file, which is the entrance to the entire OFD document; the Doc_0 folder contains the Res folder (resource folder) and the Pages folder and DocumentRes.xml and Document.xml; the Res folder stores tif image maps and png compass resources, and the Pages folder contains the content.xml file for page description; Document.xml is a document index file that associates resources and pages; Figure 4 The physical structure diagram of the OFD document is shown.
[0036] Furthermore, the coordinate space is determined according to the rules, and the coordinate space includes a page coordinate space, a pixel coordinate space, and a geographic coordinate space.
[0037] In the OFD document standard, the page coordinate space specifies that the upper left corner of the page is the origin, the X axis grows to the right, and the Y axis grows downward, with millimeters as the unit. For example, if A4 paper is used as the page size, the width of an A4 paper is 210 mm and the height is 297 mm, the page width pageWidth=210, and the page height pageHeight=297.
[0038] In image raster data, the coordinate origin is the upper left corner, the X axis grows to the right, and the Y axis grows downward, and the unit is pixel.
[0039] Geographic coordinates are the coordinates of geographic spatial data, expressed by longitude and latitude, with the unit being degrees. The X-axis grows to the right and the Y-axis grows upward. The X-axis represents longitude and the Y-axis represents latitude.
[0040] S13. Based on the page coordinates in the basic template, convert the geographic coordinates and pixel coordinates of the vector data and raster data respectively.
[0041] According to the rules, geographic coordinates, pixel coordinates and page coordinates are converted to ensure accurate display of data in OFD documents.
[0042] Specifically, pixel coordinates and page coordinates conversion: Pixel coordinates are mainly used for images, that is, raster data of geographic spatial data. Figure 3The relationship between pixel space and page space is shown in the figure. Assuming a TIF image, the width is pixelWidth, the height is pixelHeight, the width in the page space is tifWidth, the height is tifHeight, in order to ensure that the TIF image is not deformed on the page, the following relationship should be met: ;set up The actual meaning of r can be understood as how many millimeters a pixel in the TIF image occupies in the page space. Suppose the pixel coordinates of a point P in the TIF are (pixelX, pixelY), then the calculation formula for the page coordinates corresponding to point P is: Formula 1 Formula 2 in, is the horizontal coordinate of the page, is the pixel horizontal coordinate, is the horizontal offset of the origin of the raster data in the page space. is the area occupied by a pixel in the raster data in the page space. is the vertical coordinate of the page, is the pixel ordinate, The vertical offset of the origin of the raster data in page space.
[0043] Conversion between geographic coordinates and pixel coordinates: The conversion of geographic coordinates of TIF images into pixel coordinates can be accomplished through the GeoTIFF radiation transformation matrix. The GeoTIFF radiation transformation matrix is usually an array of 6 elements, expressed as follows: GeoTransform=[originX,resolutionX,rotationX,originY,rotationY,resolutionY], where: originX represents the geographic X coordinate of the upper left corner of the image (pixel (0, 0)). Usually corresponds to longitude or easting coordinate. resolutionX represents the resolution of the pixel in the X direction, that is, the geographic distance corresponding to each pixel (units can be degrees, meters, etc.). This value is usually a positive number. rotationX represents the rotation parameter in the X direction. If the image is not rotated, this value is usually 0. originY represents the geographic Y coordinate of the upper left corner of the image (pixel (0, 0)). Usually corresponds to latitude or northing coordinate. rotationY represents the rotation parameter in the Y direction. If the image is not rotated, this value is usually 0. resolutionY represents the resolution of the pixel in the Y direction, that is, the geographic distance corresponding to each pixel. Since the Y coordinate usually increases from top to bottom in the pixel coordinate system and from bottom to top in the geographic coordinate system, this value is usually a negative number. The construction relationship of the radial transformation matrix is as follows: Formula 3 From formula 3, we can get: Formula 4 Formula 5 From formula 4 and formula 5, we can deduce: Formula 6 Formula 7 In practical applications, images are usually not rotated, that is, rotationX and rotationY are both 0. Formula 6 and Formula 7 can be further simplified as: Formula 8 Formula 9 in, is the pixel horizontal coordinate, is the geographic horizontal coordinate, The geographic X coordinate of the point whose pixel coordinates are (0,0) in the upper left corner of the image. is the pixel resolution in the X direction, is the pixel ordinate, is the geographic vertical coordinate, The geographic Y coordinate of the point whose pixel coordinates are (0,0) in the upper left corner of the image. is the pixel resolution in the Y direction; Based on the above formulas 1 and 2, the pixel coordinates obtained by geographic coordinate conversion are converted into page coordinates.
[0044] S14. Based on the coordinate conversion result, the geospatial data and the plurality of map elements are written into an open layout document and displayed.
[0045] The geospatial data is stored in a resource folder of an open layout document; the relative path and ID of the geospatial data are recorded in a document index file of the open layout document; the properties of the geospatial data in the page are described in a page description file of the open layout document; and the geospatial data in the page description file are displayed in the page space.
[0046] Specifically, the specific process of writing geospatial raster data into OFD documents is as follows: Geospatial raster data is mainly a GeoTIFF image map, the data format is TIF or TIFF, and it is called GeoTIFF because it carries geospatial information. The process of writing image data into OFD documents is as follows: The TIF file is saved in the Res folder and recorded in the DocumentRes.xml file, which mainly records the relative path and ID of the TIF in the Res folder.
[0047] <ofd:multimedia type="Image" format="TIFF" id="52"> <ofd:mediafile> 4.tif< / ofd:mediafile> < / ofd:multimedia> The properties of TIF in the page are described in the Content.xml file, and the main descriptions include: the associated resource ID (ResourceID); the type of layer (Background, set to Background, other elements are drawn above the TIF); the coordinates of the upper left corner of the TIF in the page space; the width and height of the TIF in the page space, etc.
[0048] <ofd:layer id="120" type="Background"> <ofd:imageobject ID="122" ResourceID="52" Boundary="15.100 29.100 18068.305" CTM="180.0 0.0 0.0 68.30519918973667 0.0 0.0" / > < / ofd:layer> The specific process of writing geographic spatial vector data into OFD documents is as follows: vector data is written into OFD documents in the form of graphic elements in OFD documents, which is specifically reflected in the Content.xml description of the page. The key to writing vector data into OFD documents is to determine the coordinates of the vector elements in the page space. According to Formula 8 and Formula 9, the geographic coordinates of the vector elements can be converted into pixel coordinates, and then according to Formula 1 and Formula 2, the pixel coordinates can be converted into page coordinates. Finally, according to the OFD document standard, the OFD base code Content.xml is modified to write the vector data into the OFD document.
[0049] <ofd:pathobject boundary="0 0 210 297" stroke="true" drawparam="59" id="107"> <ofd:abbreviateddata> M 82.418 83.138 L 89.051 82.110< / ofd:abbreviateddata> < / ofd:pathobject> Furthermore, a plurality of map elements are written into the open layout document and displayed, and the plurality of map elements include a compass, a latitude and longitude grid, map annotation lines, map annotation text, source, scale, shooting date and mapping unit.
[0050] The compass is a png image, and the way to write it into the OFD document is the same as the way to write the image: the compass png file is saved in the Res folder; it is recorded in the DocumentRes.xml file; and it is described in the Content.xml file.
[0051] The longitude and latitude grid is expressed through the graphic elements of the OFD document. The map area in the page space is divided horizontally and vertically at equal distances, and the relative division points are connected into lines to form a longitude and latitude grid. Then, according to the transformation of formulas 1 and 2, the page coordinates are converted into pixel coordinates. According to the transformation of formulas 8 and 9, the pixel coordinates are converted into geographic coordinates. Finally, the east-west coordinates and north-south coordinates of the converted geographic coordinates are marked at the division points at the top and bottom and the left and right ends of the longitude and latitude grid. The modification of the OFD document base code is described in the Content.xml of the page, just like the geographic space vector data.
[0052] Map annotation consists of two parts: one is the annotation line, and the other is the annotation text. The annotation line is expressed through the graphic elements in the OFD document. Like the geographic space vector data, the coordinate space conversion is first performed. The geographic coordinates are converted to pixel coordinates using formulas 8 and 9, and then the pixel coordinates are converted to page coordinates using formulas 1 and 2. Finally, the annotation line is described by modifying the bottom code Content.xml of the OFD document page. The annotation text is expressed through the text elements in the OFD document. The start and end point coordinates of the annotation line have been converted to page space coordinates. The text annotation only needs to be described in text at the end of the annotation line, which can be achieved by modifying the bottom code Content.xml.
[0053] <ofd:textobject id="115" boundary="89 9 32 11.125" font="3" size="8" weight="800"> <ofd:fillcolor Value="0 0 0" / > <ofd:textcode x="0" y="9.125" deltax="8 8 8"> FSC< / ofd:textcode> < / ofd:textobject> Other map elements include source, scale, shooting date, mapping unit, etc. All these elements can be described by text elements in the OFD document. There is no need to convert the coordinate space here, just determine the position of the map element in the page space, and then modify the Content.xml to achieve it.
[0054] Finally, compress the generated OFD template, including an OFD.xml and Doc_0 folder, to form a file with the suffix ofd. Figure 6 Shown is a final result diagram of the OFD document geospatial data provided by the present invention.
[0055] The present invention defines pixel coordinate space as an intermediate transition, and vector data is first converted from geographic coordinates to pixel coordinates, and then from pixel coordinates to page coordinates. Finally, by modifying the OFD document page bottom code Content.xml, the expression of vector space data in the OFD document is realized.
[0056] The method and device for displaying geospatial data in an open layout document provided by the present invention organizes geospatial data into structured data in a target format, wherein the geospatial data includes vector data and raster data; creates a basic template for an open layout document; based on the page coordinates in the basic template, converts the geographic coordinates and pixel coordinates of the vector data and raster data respectively; based on the coordinate conversion result, writes the geospatial data and multiple map elements into an open layout document and displays them. Compared with the technical limitations and risks existing in the existing GeoPDF standard geospatial data display method, the method, by utilizing the fixed layout characteristics of the OFD format, through data compression, clipping and optimization and other technical means, realizes efficient and clear display of geospatial data. By embedding geospatial data (such as vector data and raster data) into an OFD document, the consistency and readability of the data in different devices and environments can be ensured, thereby improving the user experience. Through OFD-based technology, it supports the application needs of localization, reduces the dependence on third-party plug-ins, improves the autonomous control capability, and ensures data security.
[0057] The following is a description of the apparatus for displaying geospatial data in an open layout document provided by the present invention. The apparatus for displaying geospatial data in an open layout document described below and the method for displaying geospatial data in an open layout document described above can be referenced to each other.
[0058] Figure 7 : is a schematic diagram of the structure of the device for displaying geographic spatial data in an open layout document provided by the present invention, which specifically includes: An organization module 701, used to organize geographic spatial data into structured data in a target format, wherein the geographic spatial data includes vector data and raster data; A creation module 702 is used to create a basic template for an open layout document; A conversion module 703, used for converting the geographic coordinates and pixel coordinates of the vector data and raster data respectively based on the page coordinates in the basic template; The display module 704 is used to write the geospatial data and multiple map elements into an open layout document based on the coordinate conversion result and display them.
[0059] In one possible implementation, the conversion module 703 is also used to define a page coordinate space based on a preset standard, in which the upper left corner of the page in the basic template is the coordinate origin, the X-axis grows to the right, and the Y-axis grows downward; define a pixel coordinate space in which the upper left corner of the raster data is the coordinate origin, the X-axis grows to the right, and the Y-axis grows downward; and define a geographic coordinate space based on the latitude and longitude coordinates of the geographic spatial data.
[0060] In a possible implementation, the conversion module 703 is further configured to convert the pixel horizontal coordinate of the pixel coordinate into the page horizontal coordinate of the page coordinate by using a first formula, wherein the first formula is: ; The pixel ordinate of the pixel coordinate is converted into the page ordinate of the page coordinate by a second formula, wherein the second formula is: ;in, is the horizontal coordinate of the page, is the pixel horizontal coordinate, is the horizontal offset of the origin of the raster data in the page space. is the area occupied by a pixel in the raster data in the page space. is the vertical coordinate of the page, is the pixel ordinate, The vertical offset of the origin of the raster data in page space.
[0061] In a possible implementation, the conversion module 703 is further configured to convert the geographic abscissa of the geographic coordinates into the pixel abscissa of the pixel coordinates by using a third formula, wherein the third formula is: ; The geographic ordinate of the geographic coordinate is converted into the pixel ordinate of the pixel coordinate by a fourth formula, and the fourth formula is: ;in, is the pixel horizontal coordinate, is the geographic horizontal coordinate, The geographic X coordinate of the point whose pixel coordinates are (0,0) in the upper left corner of the image. is the pixel resolution in the X direction, is the pixel ordinate, is the geographic vertical coordinate, The geographic Y coordinate of the point whose pixel coordinates are (0,0) in the upper left corner of the image. is the resolution of pixels in the Y direction; based on the first formula and the second formula, the pixel coordinates obtained by converting the geographic coordinates are converted into page coordinates.
[0062] In one possible implementation, the display module 704 is further used to store the geospatial data into a resource folder of the open layout document; record the relative path and ID of the geospatial data in a document index file of the open layout document; describe the properties of the geospatial data in a page in a page description file of the open layout document; and display the geospatial data in the page description file in the page space.
[0063] In one possible implementation, the display module 704 is further used to store the compass image, map annotation lines, map annotation text, source, scale, shooting date and mapping unit in the resource folder of the open layout document and record them in the document index file and describe them in the page description file; express the longitude and latitude grid through image elements and describe them in the page description file; and display multiple map elements in the page description file in the page space.
[0064] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute a method for displaying geospatial data in an open layout document, the method comprising: organizing the geospatial data into structured data in a target format, wherein the geospatial data includes vector data and raster data; creating a basic template for the open layout document; based on the page coordinates in the basic template, converting the geographic coordinates and pixel coordinates of the vector data and the raster data respectively; based on the coordinate conversion result, writing the geospatial data and a plurality of map elements into the open layout document and displaying them.
[0065] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0066] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method provided by the above methods for displaying geospatial data in an open layout document, the method including: organizing the geospatial data into structured data in a target format, wherein the geospatial data includes vector data and raster data; creating a basic template for the open layout document; based on the page coordinates in the basic template, converting the geographic coordinates and pixel coordinates of the vector data and raster data respectively; based on the coordinate conversion result, writing the geospatial data and multiple map elements into the open layout document and displaying them.
[0067] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the method for displaying geospatial data in an open layout document provided by the above-mentioned methods, the method comprising: organizing geospatial data into structured data in a target format, wherein the geospatial data comprises vector data and raster data; creating a basic template for the open layout document; based on the page coordinates in the basic template, converting the geographic coordinates and pixel coordinates of the vector data and raster data respectively; based on the coordinate conversion result, writing the geospatial data and multiple map elements into the open layout document and displaying them.
[0068] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0069] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for presenting geospatial data in an open format document, characterized in that: include: Organizing geospatial data into structured data in a target format, wherein the geospatial data includes vector data and raster data; Create basic templates for open layout documents; Based on a preset standard, define a page coordinate space in which the upper left corner of the page in the basic template is the coordinate origin, the X axis increases to the right, and the Y axis increases downward; Define the upper left corner point in the grid data as the coordinate origin, the pixel coordinate space in which the X axis increases rightwards and the Y axis increases downwards; defining a geographic coordinate space based on the latitude and longitude coordinates of the geographic spatial data; Based on the page coordinates in the basic template, converting the geographic coordinates and pixel coordinates of the vector data and raster data respectively; Based on the coordinate conversion result, the geospatial data and a plurality of map elements are written into an open layout document and displayed.
2. The method according to claim 1, characterized in that: The converting of the geographic coordinates and pixel coordinates of the vector data and the raster data based on the page coordinates in the basic template includes: The pixel horizontal coordinate of the pixel coordinate is converted into the page horizontal coordinate of the page coordinate by a first formula, wherein the first formula is: ; The pixel ordinate of the pixel coordinate is converted into the page ordinate of the page coordinate by a second formula, wherein the second formula is: ; in, is the horizontal coordinate of the page, is the pixel horizontal coordinate, is the horizontal offset of the origin of the raster data in the page space. is the area occupied by a pixel in the raster data in the page space. is the vertical coordinate of the page, is the pixel ordinate, The vertical offset of the origin of the raster data in page space.
3. The method according to claim 2, characterized in that The step of converting the geographic coordinates and pixel coordinates of the vector data and the raster data based on the page coordinates in the basic template further includes: The geographic abscissa of the geographic coordinate is converted into the pixel abscissa of the pixel coordinate by a third formula, and the third formula is: ; The geographic ordinate of the geographic coordinate is converted into the pixel ordinate of the pixel coordinate by a fourth formula, and the fourth formula is: ; in, is the pixel horizontal coordinate, is the geographic horizontal coordinate, The geographic X coordinate of the point whose pixel coordinates are (0,0) in the upper left corner of the image. is the pixel resolution in the X direction, is the pixel ordinate, is the geographic vertical coordinate, The geographic Y coordinate of the point whose pixel coordinates are (0,0) in the upper left corner of the image. is the pixel resolution in the Y direction.
4. The method according to claim 3, characterized in that The method further comprises: The pixel coordinates obtained by converting the geographic coordinates are converted into page coordinates based on the first formula and the second formula.
5. The method according to claim 4, characterized in that The step of writing the geospatial data into an open layout document and displaying the geospatial data based on the coordinate conversion result includes: Storing the geospatial data in a resource folder of the open layout document; Recording the relative path and ID of the geospatial data in a document index file of the open layout document; Describing the attributes of the geospatial data in a page in a page description file of the open layout document; The geospatial data in the page description file is displayed in the page space.
6. The method according to claim 5, characterized in that The plurality of map elements include a compass, a latitude and longitude grid, map annotation lines, map annotation text, source, scale, shooting date and mapping unit; The step of writing a plurality of map elements into an open layout document and displaying the same comprises: The compass image, map annotation lines, map annotation text, source, scale, shooting date and mapping unit are stored in a resource folder of the open layout document and recorded in a document index file and described in a page description file; Expressing the longitude and latitude grid by image elements and describing it in the page description file; A plurality of map elements in the page description file are displayed in the page space.
7. A device for displaying geospatial data in an open format document, characterized in that: include: An organization module, used for organizing the geospatial data into structured data in a target format, wherein the geospatial data includes vector data and raster data; A creation module is used to create a basic template for an open layout document; based on a preset standard, a page coordinate space is defined in which the upper left corner of a page in the basic template is the origin of the coordinates, the X axis grows rightward, and the Y axis grows downward; a pixel coordinate space is defined in which the upper left corner of the raster data is the origin of the coordinates, the X axis grows rightward, and the Y axis grows downward; a geographic coordinate space is defined based on the latitude and longitude coordinates of the geographic space data; A conversion module, for converting the geographic coordinates and pixel coordinates of the vector data and raster data respectively based on the page coordinates in the basic template; The display module is used to write the geographic spatial data and multiple map elements into an open layout document and display them based on the coordinate conversion result.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for presenting geospatial data in an open layout document according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for presenting geospatial data in an open layout document as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for presenting geospatial data in an open layout document as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for representing geographic information by OFD format file
CN113157988A
Vector data visualization method and device
CN117519697A
Meteorological temperature grid linear rendering method and device based on inverse distance weighting method
CN118503321A
Compensation for print shift in standardized forms to facilitate extraction of data therefrom
US9411547B1