CN107193856B - Method for cutting vector pattern spots based on android system and JTS library - Google Patents

Method for cutting vector pattern spots based on android system and JTS library Download PDF

Info

Publication number
CN107193856B
CN107193856B CN201710009361.6A CN201710009361A CN107193856B CN 107193856 B CN107193856 B CN 107193856B CN 201710009361 A CN201710009361 A CN 201710009361A CN 107193856 B CN107193856 B CN 107193856B
Authority
CN
China
Prior art keywords
inner ring
ring
tangent line
circle
cutting
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.)
Active
Application number
CN201710009361.6A
Other languages
Chinese (zh)
Other versions
CN107193856A (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.)
Central South University of Forestry and Technology
Original Assignee
Central South University of Forestry and Technology
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 Central South University of Forestry and Technology filed Critical Central South University of Forestry and Technology
Priority to CN201710009361.6A priority Critical patent/CN107193856B/en
Publication of CN107193856A publication Critical patent/CN107193856A/en
Application granted granted Critical
Publication of CN107193856B publication Critical patent/CN107193856B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/56Information retrieval; Database structures therefor; File system structures therefor of still image data having vectorial format

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Remote Sensing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method for cutting vector graphic spots based on an android system and a JTS library, which comprises the following steps of: s1: drawing a tangent line, converting the pattern spot and the tangent line into a JTS form through a JTS library, automatically decomposing the selected cut pattern spot into an outer ring and a plurality of inner rings, taking an intersection point at a self-intersection position as a division point, and decomposing the tangent line into a non-self-intersection tangent line and a plurality of single-ring tangent lines; s2: and judging the relation between each circular tangent line in the circular line and each inner ring in the pattern spot, wherein the relation between the circular tangent line and each inner ring comprises inclusion, intersection and phase separation, performing corresponding processing, and adding the circular tangent line meeting the conditions into an inner ring set. The method can realize the vector graphic editing function in the android forest resource survey software, and can improve the precision and efficiency of small class sketching; the working links and human errors are reduced, the working process of investigators is optimized, and the forest resource investigation efficiency is improved.

Description

Method for cutting vector pattern spots based on android system and JTS library
Technical Field
The invention relates to the technical field of vector space data processing of a geographic information system, in particular to a method for cutting vector pattern spots based on an android system and a JTS library.
Background
The small spots are basic units for forest resource investigation, planning, design and operation, and are represented by the pattern spots in the vector space data of the geographic information system in order to reflect the shape, the spatial position and the area of the forest land more intuitively and vividly and participate in the calculation of the forest resource accumulation amount.
The JTS library (Java Topology Suite) is an open source Java application program interface, uses an accurate model and a powerful geometric algorithm to realize a set of core spatial data operation, can be used for vector-based geographic software such as a GIS (geographic information system) and the like, and can also be regarded as a multipurpose function library for providing an algorithm for calculating geometry. The method provides spatial data models of points, multiple points, lines, linear rings, multiple lines, planes, multiple planes, sets and the like, calculates equal, disjointed, intersected, contacted, crossed, contained and overlapped spatial relations, processes overlapping operations of intersection, combination, difference and symmetrical difference, and performs Buffer area analysis, multilateralization, combination of a group of lines and the like. The JTS library takes WKT (Well-Known Text) format as IO stream, and the WKT form of the pattern spot is Polygon ((outer ring), (inner ring 1), (inner ring 2), …), each ring contains at least four points, and the vertex form is
x1y1z1,x2y2z2,...,xiyizi,...,xnynzn,x1y1z1(n is more than or equal to 3), the top points of the outer ring are arranged clockwise, and the inner ring is arranged anticlockwise.
In the development of Android forest resource survey software, vector pattern editing is difficult to realize. Due to memory limitations of single application in the Android system, complex vector patches and hundreds of vertices, it is more difficult to edit the patches on the mobile device. The cutting of vector pattern spots is realized by the aid of the GIS development platforms such as ArcGIS for Android and MapZone Mobile on the market. However, these platforms have high charge and high use cost; the secondary development is carried out based on the platforms, and the characteristics of no source opening cause that the aspects of project function extension, interface style, data structure and the like are limited.
Disclosure of Invention
Based on the technical problems in the background art, the invention provides a method for cutting vector patches based on an android system and a JTS library.
The invention provides a method for cutting vector pattern spots based on an android system and a JTS library, which comprises the following steps of:
s1: drawing a tangent line, converting the pattern spot and the tangent line into a JTS form through a JTS library, automatically decomposing the selected cut pattern spot into an outer ring and a plurality of inner rings, taking an intersection point at a self-intersection position as a division point, and decomposing the tangent line into a non-self-intersection tangent line and a plurality of single-ring tangent lines;
s2: judging the relation between each circular tangent line in the circular line and each inner ring in the pattern spot, wherein the relation between the circular tangent line and each inner ring comprises inclusion, intersection and phase separation, performing corresponding processing, and adding circular tangent lines meeting conditions into an inner ring set;
s3: judging whether the outer ring of the pattern spot and each inner ring in the inner ring set meet the intersection, inclusion, phase separation and inclusion relations, if no inner ring exists in the outer ring, adding all ring tangent lines to the inner ring set, and removing the inner ring which does not meet the conditions from the inner ring set;
s4: using each short cutting line in the cutting line set, externally cutting each inner ring in the inner ring set, using each short cutting line in the cutting line set, internally cutting the outer ring of the pattern spot, using each inner ring in the inner ring set, and internally cutting the result set of the previous step;
s5: and finally, regenerating the pattern spots and updating the pattern spots to a Shapefile vector file in a mode of arranging the outer ring vertexes clockwise and arranging the inner ring vertexes anticlockwise.
Preferably, the outer ring and the inner ring which are self-decomposed by the cutting pattern spots in the S1 are both simple rings without inner rings.
Preferably, in S2, the ring tangent line is separated from the inner ring, the ring tangent line is added to the inner ring set, the ring tangent line intersects with the inner ring, a union of the two rings is calculated, the outer ring of the union replaces the inner ring, the inner ring of the union is used as a result, the ring tangent line and the inner ring are in an inclusion relationship, the ring tangent line is invalid, the ring tangent line and the inner ring are in an inclusion relationship, the ring tangent line and the inner ring are added to the result set, and the ring tangent line replaces the inner ring.
Preferably, in S3, if the outer ring of the pattern spot is in an inclusion relationship with the inner ring in the inner ring set, the inner ring is retained, the outer ring of the pattern spot is in an inclusion or separation relationship with the inner ring in the inner ring set, the inner ring in the inner ring set is an invalid inner ring, the invalid inner ring is removed from the inner ring set, the outer ring of the pattern spot is in an intersection relationship with the inner ring in the inner ring set, the inner ring makes a ring tangent line, the inner ring is added to the result set, and if the inner ring is not a ring tangent line, the difference set of the outer ring and the inner ring is used as the outer.
Preferably, the non-self-intersecting tangent line in S4 circumscribe each inner ring, returning the largest area in the pattern spot as the inner ring, and others added to the result set.
Preferably, when the patch in S5 is regenerated and updated to the sharefile vector file, the cut patch is deleted, and the resulting patch is saved.
The invention has the beneficial effects that: the method can realize the vector graphic editing function in the android forest resource survey software, and can improve the precision and efficiency of small class sketching; the working links and human errors are reduced, the working flow of investigators is optimized, the forest resource investigation efficiency is improved, the operation cost is reduced, and the intelligent mobile terminal can better serve forest resource information acquisition work; the invention can also be applied to the related industries of geographic information systems, such as homeland surveying and mapping, city planning and construction, road traffic management, earthquake disaster and loss estimation and the like.
Drawings
FIG. 1 shows the implementation steps of the cutting vector pattern spots of the method for cutting vector pattern spots based on the android system and JTS library;
FIG. 2 is a flow chart of an external tangent cutting ring of the method for cutting vector patches based on the android system and JTS library;
fig. 3 is a schematic structural diagram of a planar pattern spot based on the android system and JTS library vector pattern spot cutting method provided by the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
In the embodiment, referring to fig. 1-3, a method for cutting vector graphic patches based on an android system and a JTS library takes vector space data of a forest resource secondary survey of atlantic village, shang yang county, zhejiang as an example, the file size is 1.80MB, the number of graphic patches is 209, and the shape format is shapefil; the Android mobile device adopts Samsung GT-N5100, an Android4.1 operating system, a quad-core 1.6GHz processor, an 8-inch screen, 1831MB memory and 1280 x 800 resolution.
On an Android system, a method for realizing vector graphics spots by using a JTS open source library comprises the following steps:
(1) cut object initialization
First, a vector cutting line is drawn by selecting a cut pattern spot, and the drawn line and the cut pattern spot are converted into JTS form.
Second, the tangent line is self-disintegrating. The drawn tangent line may be a simple non-self-intersecting line or a complex self-intersecting line, the intersection point of the self-intersecting position is taken as a dividing point, the tangent line is decomposed into a plurality of non-self-intersecting short cut lines, if more than four short tangent lines intersect at one point, the tangent lines cannot be sequentially self-decomposed, and the cutting of the pattern spots fails; and (3) regarding each short cut line with the same starting point and end point as a single ring tangent line, and sequentially connecting other short cut lines into a non-self-intersecting tangent line.
Again, self-decomposition of the cut pattern spot. The self-decomposition pattern spot is a pattern spot formed by a plurality of rings, which is decomposed into an outer ring and a plurality of inner rings, wherein each ring is a single ring without the inner rings.
(2) Judging the relation between each ring tangent line and the inner ring of the pattern spot
The ring tangent line and the inner ring have four relations of containing, contained, separated and intersected. When the ring tangent line comprises an inner ring, constructing a new pattern spot Polygon (ring tangent line, inner ring) which takes the ring tangent line as an outer ring and the inner ring of the pattern spot as an inner ring as a pattern spot of a cutting result, and replacing the inner ring with the ring tangent line; when the inner ring comprises a ring tangent line, the ring tangent line is invalid; when intersecting, calculating a union set of the ring tangent line and the inner ring, replacing the inner ring by the outer ring of the union set, and adding the inner ring of the union set to the result spot set; when the two are separated, the tangent line of the ring is regarded as an inner ring, and the inner ring is added and concentrated. If the cut patch has no inner ring, all the ring tangent lines are added to the inner ring set, and the ring tangent lines contained in the outer ring are added to the result patch set.
(3) Determining the relationship between the outer ring and each inner ring
When the inner ring is in the outer ring, the inner ring is stopped; when the relationship of the outer ring and the inner ring is contained or separated, indicating that the inner ring is invalid, it should be removed from the inner ring set; when the inner rings are intersected, the fact that a part of the inner rings are not in the cut image spots is indicated, a difference set of the outer ring difference inner rings needs to be calculated to replace the outer rings, and if the inner rings are tangent lines of the source rings, the inner rings are added into a result image spot set.
(4) Each inner ring is cut using a non-self-intersecting tangent line.
The external cutting is a line outside the ring and with two ends on the ring, and two closed areas are formed by the ring. When each inner ring is externally cut by using non-self-intersecting tangent lines, the tangent lines are decomposed into a plurality of short tangent lines by using difference operation according to the intersection points of the rings and the tangent lines, and if two end points of each short tangent line are on the rings and are not contained by the rings, the external cutting condition is met; calculating the positions of the two end points on the ring in point concentration, traversing all the points of the ring, taking the two end points as boundaries, and forming two result rings by a tangent and the ring; and replacing the cut ring by the result ring with a larger area, continuing the external cutting of the next short tangent line, and adding the result ring with a smaller area into the result pattern spot set.
(5) Inner cutting of outer ring using non-self-intersecting tangent lines
Internally cutting the outer ring by using non-self-intersecting tangent lines, decomposing the tangent lines into a plurality of short tangent lines by using a difference operation at an intersection point with the outer ring, and splitting the ring into two rings by using the short tangent lines with each short tangent line in the ring and two end points on the ring in the same way as the external cutting; and the next short cutting line meeting the conditions is the result of cutting the previous line in an internal cutting mode.
(6) Each inner ring cuts the result set of the previous step
Concentrating each inner ring in the inner ring set, judging the relation with the result concentration ring in the previous step, if the inner rings are intersected, regarding the inner rings as a non-self-intersected tangent line, and cutting the result concentration ring into two rings in an internal cutting mode; if the inner ring tangent is included, the difference between the two rings is calculated by using difference operation.
(7) All results are regenerated into a pattern spot.
Self-decomposing each result in the result set of the tangent vector pattern spots into an outer ring and a plurality of inner rings, and using a formula for each point on the surface according to a method for judging whether the section is clockwise or anticlockwise by Paul Bourke
(xi-xi-1)×(yi+1-yi)-(yi-yi-1)×(xi+1-xi)
Counting, counting the times of positive values and negative values, and if more positive values appear, indicating that the surface is anticlockwise; if the negative value is more, the result shows that the current is clockwise; if they are equal, it cannot be determined. According to the judgment principle, the rings which do not meet the condition are inverted, so that the vertexes of the outer ring of the image spot are arranged clockwise, and the inner ring of the image spot is arranged anticlockwise.
(8) And storing the result of the cutting pattern spots.
And writing the cut result pattern spots and the attributes of the cut pattern spots into a Shapefile, deleting the information of the cut pattern spots, and storing the cut results.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.

Claims (5)

1. A method for cutting vector pattern spots based on an android system and a JTS library is characterized by comprising the following steps:
s1: drawing a tangent line, converting the pattern spot and the tangent line into a JTS form through a JTS library, automatically decomposing the selected cut pattern spot into an outer ring and a plurality of inner rings, taking an intersection point at a self-intersection position as a division point, and decomposing the tangent line into a non-self-intersection tangent line and a plurality of single-ring tangent lines;
s2: judging the relation between each ring tangent line in the ring line and each inner ring in the pattern spot, wherein the relation between the ring tangent line and the inner ring comprises inclusion, intersection and phase separation, and performing corresponding processing, and when the ring tangent line is separated, regarding the ring tangent line as an inner ring to be added into the inner ring set; if the cut image spot has no inner ring, adding all ring tangents to the inner ring set;
s3: judging whether the outer ring of the pattern spot and each inner ring in the inner ring set meet the intersection, inclusion, phase separation and inclusion relations, if no inner ring exists in the outer ring, adding all ring tangent lines to the inner ring set, and removing the inner ring from the inner ring set when the relation between the outer ring and the inner ring is inclusion or phase separation;
s4: externally cutting each inner ring in the inner ring set by using each short cutting line in the cutting line set, internally cutting the outer ring of the pattern spot by using each short cutting line in the cutting line set, and internally cutting the result set of S3 by using each inner ring in the inner ring set;
s5: and finally, regenerating the pattern spots and updating the pattern spots to a Shapefile vector file in a mode of arranging the outer ring vertexes clockwise and arranging the inner ring vertexes anticlockwise.
2. The android system and JTS library-based vector spot cutting method of claim 1, wherein the outer ring and the inner ring of S1, which are self-decomposed by the cut spot, are both simple rings without inner rings.
3. The method according to claim 1, wherein in S2, the circle tangent line is in a separated relationship with the inner circle, the circle tangent line is added to the inner circle set, the circle tangent line is in an intersecting relationship with the inner circle, a union of the two circles is calculated, the outer circle of the union replaces the inner circle, the inner circle of the union is used as a result, the circle tangent line is in an included relationship with the inner circle, the circle tangent line is invalid, the circle tangent line and the inner circle are in an included relationship, the circle tangent line and the inner circle are added to the result set, and the circle tangent line replaces the inner circle.
4. The method according to claim 1, wherein if the outer ring of the pattern spot in S3 and the inner ring in the inner ring set are in an inclusion relationship, the inner ring is retained, the outer ring of the pattern spot and the inner ring in the inner ring set are in an inclusion or separation relationship, the inner ring in the inner ring set is an invalid inner ring, the invalid inner ring is removed from the inner ring set, the outer ring of the pattern spot and the inner ring in the inner ring set are in an intersection relationship, the inner ring is a ring tangent line, the inner ring is added to the result set, and if the inner ring is not a ring tangent line, the difference set between the outer ring and the inner ring is used as the outer ring.
5. The method for cutting vector patches based on the android system and JTS library, according to claim 1, wherein each inner ring is cut outside a non-self-intersecting tangent line in S4, the largest area in the patches is returned as the inner ring, and the others are added into the result set.
CN201710009361.6A 2017-01-06 2017-01-06 Method for cutting vector pattern spots based on android system and JTS library Active CN107193856B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710009361.6A CN107193856B (en) 2017-01-06 2017-01-06 Method for cutting vector pattern spots based on android system and JTS library

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710009361.6A CN107193856B (en) 2017-01-06 2017-01-06 Method for cutting vector pattern spots based on android system and JTS library

Publications (2)

Publication Number Publication Date
CN107193856A CN107193856A (en) 2017-09-22
CN107193856B true CN107193856B (en) 2020-06-26

Family

ID=59870852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710009361.6A Active CN107193856B (en) 2017-01-06 2017-01-06 Method for cutting vector pattern spots based on android system and JTS library

Country Status (1)

Country Link
CN (1) CN107193856B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110162650B (en) * 2019-04-18 2020-10-27 中国测绘科学研究院 Small image spot melting method considering local optimization and overall area balance
CN111090657B (en) * 2019-10-28 2024-04-12 吉奥时空信息技术股份有限公司 Automatic updating and instant service system for vector tiles
CN111915614B (en) * 2020-08-12 2024-03-22 苏州中科蓝迪软件技术有限公司 Vector map production method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009064779A3 (en) * 2007-11-14 2009-09-03 Microsoft Corporation Tiled projections for planar processing of round earth data
CN104298734A (en) * 2014-09-30 2015-01-21 东南大学 Mobile updating method for change pattern spots in land use status change survey
CN104616356A (en) * 2014-12-31 2015-05-13 中国林业科学研究院资源信息研究所 Sub-compartment boundary three-dimensional visual editing method
CN104679822A (en) * 2014-12-30 2015-06-03 北京市测绘设计研究院 Geographic national condition field investigation and plotting method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7092957B2 (en) * 2002-01-18 2006-08-15 Boundary Solutions Incorporated Computerized national online parcel-level map data portal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009064779A3 (en) * 2007-11-14 2009-09-03 Microsoft Corporation Tiled projections for planar processing of round earth data
CN104298734A (en) * 2014-09-30 2015-01-21 东南大学 Mobile updating method for change pattern spots in land use status change survey
CN104679822A (en) * 2014-12-30 2015-06-03 北京市测绘设计研究院 Geographic national condition field investigation and plotting method
CN104616356A (en) * 2014-12-31 2015-05-13 中国林业科学研究院资源信息研究所 Sub-compartment boundary three-dimensional visual editing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Android的森林资源数据外业采集系统研建;朱煜;《中国优秀硕士学位论文全文数据库农业科技辑》;20150115;全文 *

Also Published As

Publication number Publication date
CN107193856A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
US10504284B2 (en) Method for automatic modeling of complex buildings with high accuracy
Peterson et al. STARS: An ArcGIS toolset used to calculate the spatial information needed to fit spatial statistical models to stream network data
CN107193856B (en) Method for cutting vector pattern spots based on android system and JTS library
CN106898045B (en) Large-area true three-dimensional geographic scene self-adaptive construction method based on SGOG tiles
CN107564077B (en) method and device for drawing road network
CN108229740B (en) Method and device for determining business circle boundary, server and storage medium
CN110633262B (en) Spark-based map intersection area calculation method and system
CN114398691B (en) Intelligent design method and equipment for two-dimensional view of tire mold
CN110489511B (en) Contour line edge-contact elevation error correction method and system, electronic device and medium
Tienaah et al. Contextual douglas-peucker simplification
US20190243336A1 (en) Geometric modelling for facilitating simulation for manufacturing operations
CN109949421B (en) Triangular net cutting method and device
Kraemer et al. Extension of half-edges for the representation of multiresolution subdivision surfaces
CN109000650B (en) Method and device for determining relative position of ground object
JP2010032379A (en) Standard air current field data creation apparatus, method, program, and mass diffusion forecasting system
CN107644139B (en) Attribute mapping method from CAD model to CAE model
CN113066151B (en) Map data processing method, device, equipment and storage medium
Huang et al. Advancing digital earth modeling: Hexagonal multi-structural elements in icosahedral DGGS for enhanced geospatial data processing
Renjian et al. Line simplification based on geographic-feature constraint
CN117422810B (en) Structure and parameter guided indoor element regularization and relationship reasoning method and terminal
CN117725255B (en) GIS data and CAD data conversion method and device, electronic equipment and storage medium
CN112445838B (en) Efficient space k-kernel mining method for space data
CN115828110B (en) Water system space feature similarity detection method, device, storage medium and apparatus
CN113066148B (en) Map data processing method, device, equipment and storage medium
CN117234195A (en) Map region segmentation method, chip, terminal and robot system

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