CN117149936A - Method, system and storage medium for establishing spatial database - Google Patents

Method, system and storage medium for establishing spatial database Download PDF

Info

Publication number
CN117149936A
CN117149936A CN202311423346.8A CN202311423346A CN117149936A CN 117149936 A CN117149936 A CN 117149936A CN 202311423346 A CN202311423346 A CN 202311423346A CN 117149936 A CN117149936 A CN 117149936A
Authority
CN
China
Prior art keywords
pixel
image
data
point
value
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.)
Granted
Application number
CN202311423346.8A
Other languages
Chinese (zh)
Other versions
CN117149936B (en
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.)
Beijing Jiage Tiandi Technology Co ltd
Original Assignee
Beijing Jiage Tiandi Technology 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 Beijing Jiage Tiandi Technology Co ltd filed Critical Beijing Jiage Tiandi Technology Co ltd
Priority to CN202311423346.8A priority Critical patent/CN117149936B/en
Publication of CN117149936A publication Critical patent/CN117149936A/en
Application granted granted Critical
Publication of CN117149936B publication Critical patent/CN117149936B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • G06V20/13Satellite images

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Remote Sensing (AREA)
  • Software Systems (AREA)
  • Astronomy & Astrophysics (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The application belongs to the technical field of geographic information systems, and discloses a method, a system and a storage medium for establishing a spatial database: acquiring space data and agricultural production data of a target area; partitioning the space data, wherein each land comprises N land features, acquiring first attribute data of each land feature based on the space data and a mapping relation between a preset land feature and an attribute, and acquiring second attribute data of each land feature based on the mapping relation between the preset land feature and the attribute; acquiring third attribute data of each land block based on agricultural production data; and establishing a corresponding relation between each land parcel and the first attribute data and a corresponding relation between each land parcel and the second attribute data to generate a spatial database. The technical scheme of the application is beneficial to improving the database construction efficiency of the spatial database.

Description

Method, system and storage medium for establishing spatial database
Technical Field
The application belongs to the technical field of geographic information systems, and particularly relates to a method, a system and a storage medium for establishing a spatial database.
Background
The method provides full-industry-chain data application support for agricultural production management, rural digital management and agricultural financial services by combining multisource space-time data such as satellite remote sensing, weather, internet of things and the like with a leading artificial intelligent algorithm, and can improve the digitization and informatization level of agricultural rural production management.
The spatial database refers to the sum of application-related geospatial data stored by a geographic information system on a computer physical storage medium, and agricultural production planning is a complex project, has the characteristics of large data volume, multiple crop types and the like, and is established based on agricultural production information so as to meet the requirements of the information era on agricultural production data extraction, analysis, comprehensive treatment, deep learning and the like, and is an important research direction.
In the prior art, for example, chinese patent application CN111143503a, a method for establishing a spatial database based on a unified coordinate system and a database device are disclosed, a standard warehousing template for geographic information data is established, the spatial coordinate information and the acquired time information are used as key items of the standard warehousing template, and data to be warehoused are converted and checked, and data are warehoused. When the method is used for establishing the space database, templates are required to be established first, data conversion is carried out, and the workload is high. For example, chinese patent application CN103593450a discloses a system and a method for creating a street view space database, obtaining the longitude and latitude of the center of the photographing point of the street view picture and the pixel value of each object on the street view picture, and constructing a three-dimensional space coordinate system of the street view picture according to the longitude and latitude and the pixel value, so as to implement positioning of the street view picture, construct a GIS data table including the longitude and latitude and the pixel value, and add labels and attribute values in the GIS data table. When the method is used for constructing the space database, the three-dimensional space coordinate system of the object is firstly constructed, and the database construction workload is increased.
Therefore, providing a method, a system and a storage medium for creating a spatial database to improve database creation efficiency is a problem to be solved.
Disclosure of Invention
Aiming at the technical problems, the application provides a method, a system and a storage medium for establishing a spatial database.
In a first aspect, the present application provides a method for establishing a spatial database, where the method includes:
step 1, acquiring space data of a target area and agricultural production data, wherein the space data comprises satellite images;
step 2, partitioning the space data, wherein each land block comprises N land features, acquiring first attribute data of each land block based on the space data and a mapping relation between a preset land block and an attribute, and acquiring second attribute data of each land block based on the mapping relation between the preset land block and the attribute, wherein the first attribute data comprises colors, symbols, areas, coordinates and the number of vertexes, and the second attribute data comprises colors, symbols and coordinates;
step 3, acquiring third attribute data of each land block based on agricultural production data, wherein the third attribute data comprises crop types and soil types;
and 4, establishing a corresponding relation between each land parcel and the first attribute data and a corresponding relation between each land parcel and the second attribute data to generate a spatial database.
Specifically, step 2 includes:
step 211, obtaining a guardPixel value (R i ,G i ,B i ) The weighted value of the ith pixel point is calculated, and the calculation formula is as follows:wherein PI is i Weighting value for the ith pixel, < >>、/>And->Is a parameter weight coefficient;
step 212, setting the pixel value of the ith pixel point to (PI i ,PI i ,PI i ) After traversing each pixel point in the satellite image, generating a first image;
step 213, performing histogram equalization and edge extraction processing on the first image to obtain a second image;
step 214, acquiring a gray value of any pixel point on the second image, setting the gray value of any pixel point to be a maximum gray value when the gray value of any pixel point is larger than a first preset value, setting the gray value of any pixel point to be a minimum gray value when the gray value of any pixel point is smaller than the first preset value, and generating a third image after traversing all the pixel points in the second image;
step 215, obtaining the number of pixel points of all the edges in the third image, deleting any edge when the number of pixel points of any edge is smaller than a third preset value, and generating a fourth image after traversing all the edges in the third image;
and 216, performing expansion processing on the edge in the fourth image to obtain a fifth image, and then automatically extracting all polygons in the fifth image, and distributing unique identifiers for each polygon according to a preset rule.
Specifically, step 216 includes:
step 2161, randomly setting H first center points in the fifth image, obtaining coordinates of the H first center points, allocating a first identifier to each first center point, and storing the coordinates of any first center point and the first identifier of any first center point in a first list correspondingly;
step 2162, acquiring an h first center point, judging whether the h first center point is positioned in the acquired first polygon or on a side line, if not, sequentially drawing T extension lines with the h first center point as a starting point according to an angle interval of 360/T, acquiring an intersection point of each extension line and each side line in a fifth image, and connecting the T intersection points to generate the first polygon; if H is less than H, h=h+1, returning to step 2162, wherein H is a positive integer from 1 to H;
step 2163, after traversing the H first center points, obtaining H1 first polygons, setting the center points of the H1 first polygons as second center points, obtaining coordinates of the H1 second center points, setting the H1 second center points in the fifth image, distributing a second identifier for each second center point, and storing the coordinates of any second center point and the second identifier of any second center point in a second list correspondingly;
step 2164, obtain the 1 st second central point, judge whether the 1 st second central point is located in the second polygonal interior or on the side line already obtained, if not, regard 1 st second central point as the starting point, draw T and extend the line sequentially according to 360/T angular intervals, and obtain each and extend the intersection point of every side line in the fifth image, connect T and intersect and produce the second polygonal; if H1 is less than H1, h1=h1+1, returning to step 2164, wherein H1 is a positive integer from 1 to H1;
step 2615, after traversing the H1 second center points, acquires the H2 second polygons.
Specifically, step 216 further includes:
acquiring an H2 second polygon in the H2 second polygons, calculating the angle value of each inner angle of the H2 second polygons, deleting the vertex corresponding to any inner angle when the angle value of any inner angle is smaller than a fourth preset value, and generating a third polygon based on the rest vertex after traversing all inner angles of the H2 second polygons, wherein H2 is a positive integer of 1-H2;
after traversing the H2 second polygons, generating H2 third polygons.
Specifically, step 2 further includes:
step 221, drawing outlines of all polygons in the first image to generate a sixth image;
step 222, acquiring a kth polygon in the sixth image, and defining the pixel points except the pixel points on the edge line in the kth polygon as first pixel points;
step 223, acquiring the q first pixel point, judging whether the q first pixel point participates in the calculation, if not, acquiring the pixel value PV of the q first pixel point q Judging PV q Whether or not in a preset range [ second pixel threshold, first pixel threshold]An inner part;
step 224, when PV q When the number of the pixel points included in the first pattern is larger than the first pixel threshold, defining the first pixel point which is adjacent to the first pixel point with the q-TH pixel point and the pixel value larger than the first pixel threshold as a second pixel point, extracting the edge of the first pixel point and the second pixel point with the q-TH pixel point to generate a first pattern, calculating the number NU1 of the pixel points included in the first pattern, when NU1 is larger than TH1, judging that the first pattern is a first type of ground object, when TH2 is smaller than or equal to NU1 and smaller than TH1, judging that the first pattern is a second type of ground object, and when NU1 is smaller than TH2, judging that the first pattern is a third type of ground object, wherein TH1 and TH2 are preset values;
step 225, when PV q When the number of the pixels is larger than the second pixel threshold, defining a first pixel point which is adjacent to the first pixel point with the q-TH pixel point and the pixel value smaller than the second pixel threshold as a third pixel point, extracting the edge of the first pixel point and the third pixel point with the q-TH pixel point to generate a second graph, calculating the number NU2 of the pixel points contained in the second graph, judging the second graph as a fourth type ground object when NU2 is larger than TH3, judging the second graph as a fifth type ground object when NU2 is smaller than TH3, and judging the second graph as a sixth type ground object when NU2 is smaller than TH4, wherein TH3 and TH4 are preset values;
and 226, traversing each polygon in the sixth image, and extracting all the ground objects in each polygon.
Specifically, a pixel average value PA of all first pixel points in the kth polygon is calculated, where the first pixel threshold is: pt1=pa+th, the second pixel threshold is: pt2=pa-TH, where PT1 is a first pixel threshold, PT2 is a second pixel threshold, and TH is an adjustment parameter.
Specifically, step 3 includes: third attribute data of any land block is obtained from agricultural production data based on the identification information of any land block.
In a second aspect, the present application also provides a system for creating a spatial database, where the system includes: the system comprises a data acquisition module, a data processing module and a database construction module;
the data acquisition module is used for acquiring space data of a target area and agricultural production data, wherein the space data comprises satellite images;
the data processing module is used for partitioning the space data, each land block comprises N land features, first attribute data of each land block are obtained based on the space data and the mapping relation between the preset land block and the attributes, second attribute data of each land block are obtained based on the mapping relation between the preset land block and the attributes, the first attribute data comprise colors, symbols, areas, coordinates and the number of vertexes, and the second attribute data comprise colors, symbols and coordinates; acquiring third attribute data of each land block based on agricultural production data, wherein the third attribute data comprises crop types and soil types;
the database construction module is used for establishing the corresponding relation between each land parcel and the first attribute data and the corresponding relation between each land parcel and the second attribute data so as to generate a spatial database.
In a third aspect, the present application provides a computer storage medium, where program instructions are stored, where the program instructions, when executed, control a device in which the computer storage medium is located to execute a method for creating a spatial database according to any one of the above.
The application discloses a method, a system and a storage medium for establishing a spatial database, wherein spatial data are firstly segmented, then a plurality of ground objects on a ground are acquired, first attribute data of each ground are acquired in response to a mapping relation between the spatial data and a preset ground object and attributes, second attribute data of each ground are acquired based on the mapping relation between the preset ground object and attributes, then third attribute data of each ground are acquired based on agricultural production data, and finally the corresponding relation between each ground object and the first attribute data and the corresponding relation between each ground object and the third attribute data are established, and the spatial database is established. According to the application, the space database is built based on the preset mapping relation among plots, features and attributes and the attribute data extracted from the agricultural production data, so that the workload is reduced, the database building efficiency and accuracy of the space database are improved, and the built space database containing the space data and the agricultural production data provides a precise and comprehensive data base for agricultural production.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of creating a spatial database according to the present application;
FIG. 2 is a schematic diagram of a polygon block extraction in an embodiment of the present application;
FIG. 3 is a schematic diagram of performing feature judgment in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a system for creating a spatial database according to the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be apparent that the particular embodiments described herein are merely illustrative of the present application and are some, but not all embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden on the person of ordinary skill in the art based on embodiments of the present application, are within the scope of the present application.
It should be noted that, if there is a description of "first", "second", etc. in the embodiments of the present application, the description of "first", "second", etc. is only for descriptive purposes, and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present application.
Fig. 1 is a flowchart of an embodiment of a method for creating a spatial database according to the present application, where the flowchart specifically includes:
step 1, acquiring space data of a target area and agricultural production data, wherein the space data comprises satellite images.
Preferably, the spatial data may further include: live action maps, aerial images, etc.
If one satellite image does not cover all plots in the target area, a plurality of satellite images can be spliced.
Preferably, after the satellite image of the target area is acquired, the satellite image can be cut out, so that other images outside the area to be analyzed can be cut out, and the analysis efficiency is improved.
Preferably, the agricultural production material may be form data, word, PDF, and the like.
Step 2, partitioning the space data, wherein each land block comprises N land features, acquiring first attribute data of each land block based on the space data and a mapping relation between a preset land block and an attribute, and acquiring second attribute data of each land block based on the mapping relation between the preset land block and the attribute, wherein the first attribute data comprises colors, symbols, areas, coordinates and the number of vertexes, and the second attribute data comprises colors, symbols and coordinates.
Specifically, step 2 includes:
step 211, obtaining a pixel value (R) of an ith pixel point in the satellite image i ,G i ,B i ) The weighted value of the ith pixel point is calculated, and the calculation formula is as follows:wherein PI is i Weighting value for the ith pixel, < >>、/>And->Is a parameter weight coefficient.
Step 212, setting the pixel value of the ith pixel point to (PI i ,PI i ,PI i ) After traversing each pixel point in the satellite image, a first image is generated.
Step 213, performing histogram equalization and edge extraction processing on the first image to obtain a second image.
Step 214, acquiring a gray value of any pixel point on the second image, setting the gray value of any pixel point to be a maximum gray value when the gray value of any pixel point is larger than a first preset value, setting the gray value of any pixel point to be a minimum gray value when the gray value of any pixel point is smaller than the first preset value, and generating a third image after traversing all the pixel points in the second image.
Step 215, obtaining the number of pixels of all the edges in the third image, deleting any edge when the number of pixels of any edge is smaller than a third preset value, and generating a fourth image after traversing all the edges in the third image.
And 216, performing expansion processing on the edge in the fourth image to obtain a fifth image, and then automatically extracting all polygons in the fifth image, and distributing unique identifiers for each polygon according to a preset rule.
Preferably, before step 211, it is determined whether the satellite image is a color image or a black-and-white image, and if the satellite image is a color image, steps 211 and 212 are performed, and if the satellite image is a black-and-white image, step 213 is performed directly.
In order to extract edge data from an image with small pixel change, histogram equalization processing is performed on the image, then edge extraction processing is performed on the image, and a second image is obtained, wherein the second image is an image which is extracted from the first image and displays edge lines.
The first preset value and the third preset value are set according to experience of a person skilled in the art or according to an actual application scenario, which is not limited in the embodiment of the present application. The maximum gray value is 255 and the minimum gray value is 0. The gray value of the pixel with the gray value larger than the first preset value is set as the maximum gray value (namely 255), the gray value of the pixel with the gray value smaller than the first preset value is set as the minimum gray value (namely 0), and the pixel in the second image is divided into two parts of the borderline pixel and the non-borderline pixel based on the gray value. And then, based on the number of pixel points on the edge, shorter edges are filtered, interference edges are reduced, and the accuracy of polygon extraction is improved.
And 216, performing expansion processing on the edge in the fourth image to obtain a fifth image, and then automatically extracting all polygons in the fifth image, and distributing unique identifiers for each polygon according to a preset rule.
The boundary of the edge is expanded through expansion treatment, so that two edges which are closer to each other are integrated, and the accuracy of polygon extraction is improved. After the polygons are extracted, unique identifiers are allocated to each polygon according to preset rules, and preferably, the preset rules are consistent with the rules of allocating the identifiers to each land block in the agricultural production data. Illustratively, if the target area is a cultivation area of 2×24 plots, the rule for assigning an identifier to a plot is: the plot at the upper left corner is identified as 1, the plot at the upper right corner is identified as 2, the plot at the lower left corner is identified as 3, and the plot at the lower right corner is identified as 4.
Specifically, step 216 includes:
in step 2161, H first center points are arbitrarily set in the fifth image, coordinates of the H first center points are obtained, a first identifier is allocated to each first center point, and the coordinates of any first center point and the first identifier of any first center point are stored in the first list correspondingly.
Step 2162, acquiring an h first center point, judging whether the h first center point is positioned in the acquired first polygon or on a side line, if not, sequentially drawing T extension lines with the h first center point as a starting point according to an angle interval of 360/T, acquiring an intersection point of each extension line and each side line in a fifth image, and connecting the T intersection points to generate the first polygon; if H < H, h=h+1, returning to step 2162, where H is a positive integer from 1 to H.
In step 2163, after traversing the H first center points, obtaining H1 first polygons, setting the center points of the H1 first polygons as second center points, obtaining coordinates of the H1 second center points, setting the H1 second center points in the fifth image, distributing a second identifier to each second center point, and storing the coordinates of any second center point and the second identifier of any second center point in the second list correspondingly.
Step 2164, obtain the 1 st second central point, judge whether the 1 st second central point is located in the second polygonal interior or on the side line already obtained, if not, regard 1 st second central point as the starting point, draw T and extend the line sequentially according to 360/T angular intervals, and obtain each and extend the intersection point of every side line in the fifth image, connect T and intersect and produce the second polygonal; if H1 is less than H1, h1=h1+1, returning to step 2164, wherein H1 is a positive integer from 1 to H1;
step 2615, after traversing the H1 second center points, acquires the H2 second polygons.
T is set according to experience of those skilled in the art or according to actual application scenarios, which is not limited in the embodiment of the present application.
Illustratively, when extracting polygons representing a plot, 5 points are randomly set as first center points, the 5 first center points being identified as a, b, c, d and e. First, generating a first polygon based on a point a, then acquiring a first center point b when the first polygon is generated by a point b, judging whether the first center point b is positioned in a 1 st first polygon drawn by taking the first center point a as a starting point, if so, deleting the information of the first center point b, and re-judging the first center point c, wherein if the polygon of the land is extracted, the polygon is not extracted again. If not, the polygon drawing is started, as shown in fig. 2, an extension line is drawn in a vertical upward direction with the first center point b as a starting point, an intersection b1 of the extension line and a side line is obtained, then 7 extension lines are drawn in a clockwise direction with the extension line as a reference extension line according to an included angle of 45 degrees, intersection points (b 2, b3, b4, b5, b6, b7, b 8) of each extension line and the side line are obtained, and the 8 intersection points are connected to generate a 2 nd first polygon with the point b as the first center point.
Since the 5 points are randomly arranged, if a certain point is close to a side line, the shape of the polygon drawn based on the point is inaccurate, so that in order to improve the accuracy of drawing the polygon, after generating a plurality of first polygons, the center points (center/gravity centers) of the plurality of first polygons are set as new center points, and the polygons are redrawn by taking the new center points as the center points.
Specifically, step 216 further includes:
acquiring an H2 second polygon in the H2 second polygons, calculating the angle value of each inner angle of the H2 second polygons, deleting the vertex corresponding to any inner angle when the angle value of any inner angle is smaller than a fourth preset value, and generating a third polygon based on the rest vertex after traversing all inner angles of the H2 second polygons, wherein H2 is a positive integer of 1-H2;
after traversing the H2 second polygons, generating H2 third polygons.
The fourth preset value may be set according to experience of a person skilled in the art or according to an actual application scenario, which is not limited in the embodiment of the present application.
The land parcels are generally regular, the situation that the included angle between two side lines of the land parcels is too small cannot occur, but when the polygon is drawn due to noise or gaps on the side lines of the land parcels, a certain extension line extends to the outside of the land parcels, and at the moment, the situation that the included angle between two side lines of the land parcels is too small can occur. For example, if there is a gap on the edge line CD, when drawing the polygon, a certain extension line towards the direction of the edge line CD may extend to the outside of the edge line CD, resulting in the land 1 becoming 7 polygons of (A, B, C, E, F, G, D), and the included angle between EF and GF being too small, it is known that the vertex F is an erroneous vertex and needs to be deleted, and a new polygon is generated based on the vertex (A, B, C, E, G, D). After the second polygon is generated, whether the generated polygon is reasonable or not is judged based on the angle value of any inner angle of any polygon, the generated polygon is further adjusted, and the accuracy of drawing the polygon is improved.
Specifically, step 2 further includes:
step 221, drawing outlines of all polygons in the first image to generate a sixth image.
Step 222, acquiring a kth polygon in the sixth image, and defining the pixel points except the pixel points on the edge line in the kth polygon as the first pixel point.
Step 223, acquiring the q first pixel point, judging whether the q first pixel point participates in the calculation, if not, acquiring the pixel value PV of the q first pixel point q Judging PV q Whether or not in a preset range [ second pixel threshold, first pixel threshold]And (3) inner part.
Step 224, when PV q When the pixel value is larger than the first pixel threshold value, defining a first pixel point which is adjacent to the first pixel point with the q-TH pixel point and has a pixel value larger than the first pixel threshold value as a second pixel point, extracting the edge of the first pixel point and the second pixel point with the q-TH pixel point to generate a first graph, calculating the number NU1 of the pixel points contained in the first graph, and judging the first graph as the first graph when NU1 is larger than TH1And when the NU1 is less than or equal to the TH2 and less than or equal to the TH1, judging that the first graph is a second type of ground object, and when the NU1 is less than or equal to the TH2, judging that the first graph is a third type of ground object, wherein the TH1 and the TH2 are preset values.
Step 225, when PV q When the number of the pixels included in the second pattern is larger than the second pixel threshold, defining the first pixel point which is adjacent to the first pixel point with the q-TH pixel point and the pixel value smaller than the second pixel threshold as a third pixel point, extracting the edge of the first pixel point with the q-TH pixel point and the edge of the third pixel point to generate a second pattern, calculating the number NU2 of the pixels included in the second pattern, judging the second pattern as a fourth type of ground object when NU2 is larger than TH3, judging the second pattern as a fifth type of ground object when NU2 is smaller than or equal to TH3, and judging the second pattern as a sixth type of ground object when NU2 is smaller than TH4, wherein TH3 and TH4 are preset values.
And 226, traversing each polygon in the sixth image, and extracting all the ground objects in each polygon.
Specifically, a pixel average value PA of all first pixel points in the kth polygon is calculated, where the first pixel threshold is: pt1=pa+th, the second pixel threshold is: pt2=pa-TH, where PT1 is a first pixel threshold, PT2 is a second pixel threshold, and TH is an adjustment parameter.
And extracting the edge of each land block, and then extracting the land features on each land block. Illustratively, the terrain on the plot includes: irrigation well houses, telegraph poles, iron towers, irrigation water outlets and the like.
Crops on any polygonal land parcel occupy most of the polygonal area, so that the land parcel can be distinguished based on pixel differences, if the pixel value of a certain pixel point exceeds a preset range, the pixel point is judged to be the land parcel, and then the land parcel is judged to be any land parcel according to the number of the pixel points contained in the land parcel. As shown in fig. 3, the pixel value of the pixel X1 is out of a preset range, then the pixels X2, X3, X4 and X5 whose pixel values are out of the preset range and adjacent to or connected to the pixel X1 are obtained, the edge of the 5 pixels is extracted to generate an edge pattern (i.e. the first image or the second image), the edge pattern contains 5 pixels, that is, the area occupied by the feature in the polygon is 5 pixels, and then the number of pixels contained in the edge pattern is compared with the preset value to determine which feature is the feature.
Preferably, the maximum value and the minimum value of the preset range of any polygonal land block are set based on the average pixel value of the any polygonal land block.
And step 3, acquiring third attribute data of each land block based on agricultural production data, wherein the third attribute data comprises crop types and soil types.
Specifically, step 3 includes: third attribute data of any land block is obtained from agricultural production data based on the identification information of any land block.
When the agricultural generation data is formed, a unique identifier is allocated to each land according to a preset rule in advance, and when third attribute data of any land is obtained, the third attribute data is directly extracted from the agricultural generation data according to the identifier information of the land.
Each plot may be used to plant a plurality of crops, the yield of each crop being different, and preferably the third attribute data may also include the time period and yield of the crop being planted. Continuous cropping obstacles can appear when the same crop is continuously planted on the same land, and the crop cultivation time period is displayed in the space database, so that cultivated crop types can be adjusted according to the planting conditions of the land and the adjacent land.
And 4, establishing a corresponding relation between each land parcel and the first attribute data and a corresponding relation between each land parcel and the second attribute data to generate a spatial database.
Fig. 4 is a schematic structural diagram of an embodiment of a spatial database building system according to the present application. As shown in fig. 4, the system includes: a data acquisition module 10, a data processing module 20 and a database construction module 30.
The data acquisition module 10 is used for acquiring spatial data of the target area and agricultural production data, wherein the spatial data comprises satellite images.
The data processing module 20 is configured to segment the spatial data, where each land includes N land features, obtain first attribute data of each land feature based on the spatial data and a mapping relationship between a preset land feature and an attribute, and obtain second attribute data of each land feature based on the mapping relationship between the preset land feature and the attribute, where the first attribute data includes color, symbol, area, coordinates and number of vertices, and the second attribute data includes color, symbol and coordinates; and acquiring third attribute data of each land block based on the agricultural production data, wherein the third attribute data comprises crop types and soil types.
The database construction module 30 is configured to establish a correspondence between each land parcel and the first attribute data, and a correspondence between each land parcel and the second attribute data, so as to generate a spatial database.
According to another aspect of the embodiment of the present application, there is provided a computer storage medium, where the computer storage medium stores program instructions, where the program instructions, when executed, control a device in which the computer storage medium is located to perform a method for creating a spatial database according to any one of the above.
It should be understood that, although the steps in the flowcharts of the embodiments of the present application are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in various embodiments may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of computer programs, which may be stored on a non-transitory computer readable storage medium, and which, when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The foregoing examples have shown only the preferred embodiments of the application, which are described in more detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (9)

1. The method for establishing the spatial database is characterized by comprising the following steps:
step 1, acquiring space data of a target area and agricultural production data, wherein the space data comprises satellite images;
step 2, partitioning the space data, wherein each land block comprises N land features, first attribute data of each land block are obtained based on the space data and a mapping relation between a preset land block and an attribute, second attribute data of each land block are obtained based on the mapping relation between the preset land block and the attribute, the first attribute data comprise colors, symbols, areas, coordinates and the number of vertexes, and the second attribute data comprise colors, symbols and coordinates;
step 3, based on the agricultural production data, obtaining third attribute data of each land block, wherein the third attribute data comprise crop types and soil types;
and 4, establishing a corresponding relation between each land parcel and the first attribute data and a corresponding relation between each land parcel and the third attribute data, and establishing a corresponding relation between each land parcel and the second attribute data so as to generate a spatial database.
2. The method for creating a spatial database according to claim 1, wherein said step 2 comprises:
step 211, obtaining a pixel value (R i ,G i ,B i ) And calculating the weighted value of the ith pixel point, wherein the calculation formula is as follows:wherein PI is i For the weighting value of the i-th pixel,/->、/>And->Is a parameter weight coefficient;
step 212, setting the pixel value of the ith pixel point to (PI) i ,PI i ,PI i ) After traversing each pixel point in the satellite image, generating a first image;
step 213, performing histogram equalization and edge extraction processing on the first image to obtain a second image;
step 214, acquiring a gray value of any pixel point on the second image, setting the gray value of any pixel point to be a maximum gray value when the gray value of any pixel point is greater than a first preset value, setting the gray value of any pixel point to be a minimum gray value when the gray value of any pixel point is less than the first preset value, and generating a third image after traversing all the pixel points in the second image;
step 215, acquiring the number of pixel points of all the edges in the third image, deleting any edge when the number of pixel points of any edge is smaller than a third preset value, and generating a fourth image after traversing all the edges in the third image;
and 216, performing expansion processing on the edge in the fourth image to obtain a fifth image, and then automatically extracting all polygons in the fifth image, and distributing unique identifiers for each polygon according to a preset rule.
3. The method of claim 2, wherein step 216 comprises:
step 2161, setting H first center points in the fifth image at will, obtaining coordinates of the H first center points, allocating a first identifier to each first center point, and storing the coordinates of any first center point and the first identifier of any first center point in a first list correspondingly;
step 2162, acquiring an h first center point, judging whether the h first center point is positioned in the acquired first polygon or on a side line, if not, sequentially drawing T extension lines with the h first center point as a starting point according to an angle interval of 360/T, acquiring intersection points of each extension line and each side line in the fifth image, and connecting the T intersection points to generate the first polygon; if H < H, h=h+1, returning to step 2162, wherein H is a positive integer from 1 to H;
step 2163, after traversing the H first center points, obtaining H1 first polygons, setting the center points of the H1 first polygons as second center points, obtaining coordinates of the H1 second center points, setting the H1 second center points in the fifth image, allocating a second identifier to each second center point, and storing the coordinates of any second center point and the second identifier of any second center point in a second list correspondingly;
step 2164, acquiring an h1 second center point, judging whether the h1 second center point is positioned in the acquired second polygon or on a side line, if not, sequentially drawing T extension lines with the h1 second center point as a starting point according to an angle interval of 360/T, acquiring an intersection point of each extension line and each side line in the fifth image, and connecting the T intersection points to generate the second polygon; if H1 is less than H1, then h1=h1+1, returning to step 2164, wherein H1 is a positive integer from 1 to H1;
step 2615, after traversing the H1 second center points, obtaining H2 second polygons.
4. A method of creating a spatial database according to claim 3, wherein said step 216 further comprises:
acquiring an H2 second polygon in the H2 second polygons, calculating the angle value of each inner angle of the H2 second polygons, deleting the vertex corresponding to any inner angle when the angle value of any inner angle is smaller than a fourth preset value, and generating a third polygon based on the rest vertex after traversing all inner angles of the H2 second polygons, wherein H2 is a positive integer of 1-H2;
and after traversing the H2 second polygons, generating H2 third polygons.
5. The method for creating a spatial database according to claim 2, wherein said step 2 further comprises:
step 221, drawing outlines of all polygons in the first image to generate a sixth image;
step 222, acquiring a kth polygon in the sixth image, and defining the pixel points except the pixel points on the edge line in the kth polygon as first pixel points;
step 223, acquiring the qth first pixel, and judging the qth first pixelWhether the first pixel point participates in calculation or not, if not, acquiring a pixel value PV of the q-th first pixel point q Judging PV q Whether or not in a preset range [ second pixel threshold, first pixel threshold]An inner part;
step 224, when PV q Defining a first pixel point adjacent to the first pixel point with a pixel value larger than the first pixel threshold value as a second pixel point when the pixel value is larger than the first pixel threshold value, extracting the edge of the first pixel point and the edge of the second pixel point to generate a first graph, calculating the number NU1 of the pixel points contained in the first graph, judging the first graph as a first type of ground object when NU1 is larger than TH1, judging the first graph as a second type of ground object when NU1 is smaller than or equal to TH1, and judging the first graph as a third type of ground object when NU1 is smaller than TH2, wherein TH1 and TH2 are preset values;
step 225, when PV q Defining a first pixel point adjacent to the first pixel point with a pixel value smaller than the second pixel threshold value as a third pixel point when the pixel value is larger than the second pixel threshold value, extracting the edge lines of the first pixel point and the third pixel point to generate a second graph, calculating the number NU2 of the pixel points contained in the second graph, judging the second graph as a fourth type ground object when NU2 is larger than TH3, judging the second graph as a fifth type ground object when NU2 is smaller than or equal to TH3, and judging the second graph as a sixth type ground object when NU2 is smaller than TH4, wherein TH3 and TH4 are preset values;
and 226, traversing each polygon in the sixth image, and extracting all ground objects in each polygon.
6. The method for building a spatial database according to claim 5, wherein a pixel average PA of all the first pixel points in the kth polygon is calculated, and the first pixel threshold is: pt1=pa+th, the second pixel threshold is: pt2=pa-TH, where PT1 is the first pixel threshold, PT2 is the second pixel threshold, and TH is an adjustment parameter.
7. The method for creating a spatial database according to claim 1, wherein the step 3 comprises: and acquiring the third attribute data of any land block from the agricultural production data based on the identification information of the any land block.
8. A space database creation system for implementing the space database creation method according to any one of claims 1 to 7, comprising: the system comprises a data acquisition module, a data processing module and a database construction module;
the data acquisition module is used for acquiring space data of a target area and agricultural production data, wherein the space data comprises satellite images;
the data processing module is used for partitioning the space data, each plot comprises N plots, first attribute data of each plot are obtained based on the space data and a mapping relation between a preset plot and attributes, second attribute data of each plot are obtained based on the mapping relation between the preset plot and the attributes, the first attribute data comprise colors, symbols, areas, coordinates and the number of vertexes, and the second attribute data comprise colors, symbols and coordinates; acquiring third attribute data of each land block based on the agricultural production data, wherein the third attribute data comprises crop types and soil types;
the database construction module is used for establishing a corresponding relation between each land parcel and the first attribute data and a corresponding relation between each land parcel and the second attribute data so as to generate a spatial database.
9. A computer storage medium storing program instructions, wherein the program instructions, when executed, control a device in which the computer storage medium is located to perform the method of creating a spatial database according to any one of claims 1 to 7.
CN202311423346.8A 2023-10-31 2023-10-31 Method, system and storage medium for establishing spatial database Active CN117149936B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311423346.8A CN117149936B (en) 2023-10-31 2023-10-31 Method, system and storage medium for establishing spatial database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311423346.8A CN117149936B (en) 2023-10-31 2023-10-31 Method, system and storage medium for establishing spatial database

Publications (2)

Publication Number Publication Date
CN117149936A true CN117149936A (en) 2023-12-01
CN117149936B CN117149936B (en) 2024-01-12

Family

ID=88912453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311423346.8A Active CN117149936B (en) 2023-10-31 2023-10-31 Method, system and storage medium for establishing spatial database

Country Status (1)

Country Link
CN (1) CN117149936B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180365267A1 (en) * 2016-02-12 2018-12-20 Tata Consultancy Services Limited Methods and systems for automated identification of agro-climatic zones
CN114610829A (en) * 2022-03-18 2022-06-10 中国科学院空天信息创新研究院 Land information management method based on intelligent terminal and remote sensing intelligent identification
CN116662473A (en) * 2023-07-14 2023-08-29 中煤航测遥感集团有限公司 Space database establishment method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180365267A1 (en) * 2016-02-12 2018-12-20 Tata Consultancy Services Limited Methods and systems for automated identification of agro-climatic zones
CN114610829A (en) * 2022-03-18 2022-06-10 中国科学院空天信息创新研究院 Land information management method based on intelligent terminal and remote sensing intelligent identification
CN116662473A (en) * 2023-07-14 2023-08-29 中煤航测遥感集团有限公司 Space database establishment method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
史学正;于东升;高鹏;王洪杰;孙维侠;赵永存;龚子同;: "中国土壤信息系统(SISChina)及其应用基础研究", 土壤, no. 03 *

Also Published As

Publication number Publication date
CN117149936B (en) 2024-01-12

Similar Documents

Publication Publication Date Title
Zaragozí et al. Modelling farmland abandonment: A study combining GIS and data mining techniques
Lark Forming spatially coherent regions by classification of multi-variate data: an example from the analysis of maps of crop yield
Kloiber et al. A semi-automated, multi-source data fusion update of a wetland inventory for east-central Minnesota, USA
Aslami et al. Object-based land-use/land-cover change detection using Landsat imagery: a case study of Ardabil, Namin, and Nir counties in northwest Iran
Dai et al. Integrated edge detection and terrain analysis for agricultural terrace delineation from remote sensing images
Ghorbani et al. Land use mapping using visual vs. digital image interpretation of TM and Google earth derived imagery in Shrivan-Darasi watershed (Northwest of Iran)
Zou et al. Detecting individual abandoned houses from google street view: A hierarchical deep learning approach
Shalaby et al. Urban sprawl impact assessment on the agricultural land in Egypt using remote sensing and GIS: a case study, Qalubiya Governorate
US10089712B2 (en) System and method providing automatic alignment of aerial/satellite imagery to known ground features
Godone et al. Progressive fragmentation of a traditional Mediterranean landscape by hazelnut plantations: The impact of CAP over time in the Langhe region (NW Italy)
Mishra et al. Urban heat island in Kathmandu, Nepal: Evaluating relationship between NDVI and LST from 2000 to 2018
CN109657540B (en) Withered tree positioning method and system
Dai et al. A contour-directional detection for deriving terrace ridge from open source images and digital elevation models
Yang et al. An adaptive synchronous extraction (ASE) method for estimating intensity and footprint of surface urban heat islands: A case study of 254 North American cities
CN117149936B (en) Method, system and storage medium for establishing spatial database
Prerna et al. Evaluation of LiDAR and image segmentation based classification techniques for automatic building footprint extraction for a segment of Atlantic County, New Jersey
US9299191B2 (en) Adaptive artifact removal
US20240028957A1 (en) Methods and systems for high resolution and scalable crop yield forecasting
Shen et al. A raster-based typification method for multiscale visualization of building features considering distribution patterns
CN114431124B (en) Intelligent spraying control method for agricultural planting
CN108985154B (en) Small-size ground object sub-pixel positioning method and system based on image concentration
Günlü et al. Forest site classification using Landsat 7 ETM data: a case study of Maçka-Ormanüstü forest, Turkey
Gruszczyński et al. Correction of low vegetation impact on UAV-Derived point cloud heights with U-Net networks
Giraldo Spatial Scale and land use fragmentation in monitoring water processes in the Colombian Andes
Kumbhar et al. Assessment of irrigation and agriculture potential using geospatial techniques: a case study of “Bhima-Ujjani” project

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
GR01 Patent grant
GR01 Patent grant