JTS Developer Guide(JTS开发指南)

4星(超过85%的资源)
所需积分/C币:50 2017-05-16 18:53:19 543KB PDF
274
收藏 收藏
举报

JTS提供了一套JAVA的GIS空间分析接口。此文档是JTS官方提供的入门文档。
Document converted by PDF Moto freeware version GDBC/CTI-S JTS Topology Suite- Version 1 eo connections Developer's Guide Table of contents OVERVIEW 1.1 OTHER RESOURCES 2. GETTING STARTED 3. COMPUTING SPATIAL RELATIONSHIPS 44455 4. COMPUTING OVERLAY OPERATIONS 99999999499499. 5 5. COMPUTING BUFFERS 9.90490994999044999044999946999404909999.7 5.1 BASIC BUFFERING 7 5.2 END CAP STYLES,..9.99994990444999994499994999999449407 5.3 SPECIFYING THE APPROXIMATION QUANTIZATION 8 6. POLYGONIZATION MERGING A SET OF LINESTRINGS 10 8. USING CUSTOM COORDINATE SEQUENCES 9. TIPS &t TECHNIQUES...,... 9.1 NODING A SET OF LINESTRINGS ..4944494444494444494444444444444944994411 9.2 UNIONING MANY POLYGONS EFFICIENTLY ERROR! BOOKMARK NOT DEFINED VIVID SOLUTION S Document converted by PDF Moto freeware version GDBC/CTI-S JTS Topology Suite- Version 1 eo connections Developer's Guide OVERVIEW The JTS Topology Suite is a Java APi that implements a core set of spatial data operations using an explicit precision model and robust geometric algorithms. It provides a complete model for specifying 2-D linear Geometry. Many common operations in computational geometry and spatial data processing are exposed in a clear, consistent and integrated API JTS is intended to be used in the development of applications that support the validation cleaning, integration and querying of spatial datasets This document is intended for developers who would like to use JTs to accomplish their spatial data processing requirements. It describes common uses of the JTS API and gives code examples △ Note: This document is under construction 1.1 OTHER RESOURCES Open GIS Simple Features Specification For SQL Revision 1. 1 ( referred to as SFS in this document). The reference specification for the spatial data model and the spatia predicates and functions implemented by JTs JTS Technical Specifications. The design specification for the classes, methods and algorithms implemented in the JTS Topology suite JTS JavaDoC. Documentation for all of the packages, classes and methods in JTS GETTING STARTED The most common ]Ts tasks involve creating and using Geometry objects. The easiest way to create a geometry by hand is to use a WKtreader to generate one from a Well-Known Text (WKT) string For example Geomery gl =new WKTReader(). read("lINeSTRING (00, 1010, 20 20)) A precise specification for WKT is given in the JTS Technical Specifications. And many examples of WKT may be found in the files in the test directory In a real program, it's easier to use a Geometry Factory, because you don't need to build up a WKt string; rather you work with the objects directly Coordinate[ coordinates new Coordinate[] new Coordinate(0, 0), new Coordinate(10, 10) new Coordinate(20, 20)) Geome=ry gl new GeometryFactory(). createLineString(coordinates)i Once youve made your Geometry, there are many things you can do with it. You can easily find the intersection of two geometries VIVID SOLUTIONS Document converted by PDF Moto freeware version GDBC/CTI-S JTS Topology Suite- Version 1 eo connections Developer's Guide Geometry g3=gl intersection(g2) Other computations built into Geometries include: area, envelope, centroid and buffer. For more information about what a geometry can do, see the JavaDoc for Geometry in the com.vividsolutions, jts geom package, as well as subsequent sections in this document. 3.computIngSpaTialRelaTioNshiPs An important application of ]Ts is computing the spatial relationships between Geometries Various methods of computing relationships are provided jTs follows the dimensionally Extended 9 Intersection Matrix model specified by the OGC. To compute the dE-9IM for two Geometries, use the relate method geome cry a Geomery b= IntersectionMatrix m= a relate(b) Most relationships of interest can be specified as a pattern which matches a set of intersection matrices. JTS also provides a set of boolean predicates which compute common spatial relationships directly. these are Method Meaning qua⊥s The geometries are topologically equal Disjoint The Geometries have no point in common Intersects The Geometries have at least one point in common( the inverse of Disjoint)] Touches The Geometries have at least one boundary point in common, but no nterior points Crosses The Geometries share some but not all interior points and the dimension of the intersection is less than that of at least one of the geometries 闪 ithin Geometry a lies in the interior of Geometry B Contains Geometryb lies in the interior of geometry a(the inverse of Within) Overlaps The Geometries share some but not all points in common and the intersection has the same dimension as the geometries themselves In some cases the precise definition of the predicates is subtle. You should refer to the JTS Technical Specifications to determine exactly what will be returned in any given case 4. COMPUTING OVERLAY OPERATIONS The previous section discussed functions that return true or false like intersects and Contains. We will now present the ]ts overlay operations, some of which are illustrated in Figure 4-1 below VIVID SOLUTIONS Document converted by PDF Moto freeware version GDBC/CTI-S JTS Topology Suite- Version 1 eo connections Developer's Guide A intersection(B) Aunion (B) A difference(B) B difference(A) A. symDifference (B) Figure 4-1 -overlay operations Descriptions for the overlay operations are tabulated below Method Meaning Butter The polygon or MultiPolygon which contains all points within a specified distance of the geometry. For more information, see 5 Computing Buffers on page 7 Convexhull The smallest convex Polygon that contains all the points in the Geometry Intersection The intersection of two Geometries a and b is the set of all points which lie in both a and b Union The union of two Geometries a and b is the set of all points which lie in A or b Difference The difference between two Geometries A and B is the set of all points which lie in a but not in b SymDifference The symmetric difference of two Geometries a and b is the set of all points which lie in either aor b but not both As with the spatial relationships described in the previous section these overlay operations have precise definitions given in the JTS Technical Specifications VIVID SOLUTION S Document converted by PDF Moto freeware version GDBC/CTI-S JTS Topology Suite- Version 1 GeoConnections Developer's Guide 5. COMPUTING BUFFERS In gis, buffering is an operation which in gis is used to compute the area containing all points within a given distance of a Geometry. In mathematical terms, this is called computing the Min kowski sum of the geometry with a disc of radius equal to the buffer distance. Finding positive and negative buffers is sometimes referred to as the operations of erosion and dilation. In Cad CAM buffer curves are called offset curves You can use Jts to compute the buffer of a geometry using the geometry buffer method or the Bufferop class. The input Geometry to the buffer operation may be of any type (including arbitrary Geometry Collections ) the result of a buffer operation is always an area type (polygon or MultiPolygon). The result may be empty(for example, a negative buffer of a LineString) You can compute buffers with both positive and negative buffer distances. Buffers with a positive buffer distance always contain the input geometry Buffers with a negative buffer distance are always contained within the input Geometry. a negative buffer of a LineScring or a Point results in an empty Geometry. Figure 5-1- Positive and Negative Buffers Buffer distances of 0 are also supported. You can use this to perform an efficient union of multiple polygons 5.1 BASIC BUFFERING To compute a buffer for a given distance, call the buffer o method on the Geometry Geometry g Geometry buffer - g buffer(100.0)i 5.2 END CAP STYLES Buffer polygons can be computed with different line end cap styles. the end cap style determines how the linework for the buffer polygon is constructed at the ends of linestrings The following different kinds of end cap styles are supported Style Name Description VIVID Page 7 SOLUTIONS Document converted by PDF Moto freeware version GDBC/CTI-S JTS Topology Suite- Version 1 GeoConnections Developer's Guide CAP ROUND The usual round end caps CAP BUTT End caps are truncated flat at the line ends CAP SQUARE End caps are squared off at the buffer distance beyond the line ends The following diagrams illustrate the effects of specifying different end cap styles CAP ROUND CAP BUT CAP SQUARE Figure 5-2- Different End Cap styles To specify the buffer end cap style, the Bufferop class in the package coIn. vividsolutions its operation. buffer is used directly: geomery g BufferOp bufop= new Buffercp(g) bufop. setEndcapstyle(Buffercp CAP BUTT momery buffer bufop getResultGeometry(distance)i 5.3 SPECIFYING THE APPROXIMATION QUANTIZATION Since the exact buffer outline of a geometry usually contains circular sections, the buffer must be approximated by the linear Geometry supported by JTS. the degree of approximation may be controlled by the user. In JTs this is done by specifying the number of quadrant segments used to approximate a quarter-circle. Specify ing a larger number of segments results in a better approximation to the actual area but also results in a larger number of line segments in the computed polygon To specify a value for the quadrant segments, use the Geometry buffer method with a second argument Geometry g Geomery buffer g buffer(1000, 16) The default number of segments is 8. this gives less than a 2% maximum error in the distance of the computed curve approximation to the actual buffer curve. This error can be reduced to less than 1% by using a value of 12. the diagram below shows the effect of increasing the number of approximation curve segments. VIVID SOLUTION S Document converted by PDF Moto freeware version GDBC/CTI-S JTS Topology Suite- Version 1 eo connections Developer's Guide Quadrant Segments 3 Quadrant Segments =8 Quadrant Segments =20 (default Figure 5-3- Using Different Curve Approximation Levels 6. POLYGONIZATION Polygonization is the process of forming polygons from linework which encloses areas Linework to be formed into polygons must be fully noded that is, linestrings must not cross and must touch only at endpoints JTS provides the polygonizer class to perform Polygonization The polygonize takes a set of fully noded LineStrings and forms all the polygons which are enclosed by the lines. Polygonization errors such as dangling lines or cut lines can be identified and reported Collection lines new Arraylist()i lines. add(read("LINESTRING (0010 10)))i//isolated edge lines. add(read(lINESTRING (185 221 100 100) //dangling edge lines. add(read("lINeSTRING (185 221,88 275180316))); ines. add(read(tnestrtNg (185 221 292, 316)))i lines. add(read("lINeSTRING (18998,83 187, 185 221)))i lines. add(read(lINESTRING (18998, 325 168 185 221)))i polygonize. add(lines)i Collection polys polygonize. getPolygons()i Collection dangles polygonize. getDangles( Collection cuts polygonize. getCutEages()i If the set of lines is not correctly noded the polygonize will still operate on them, but the resulting polygonal Geometries will not be valid. The multiLinestring union technique can be used to node a set of Line strings(see 9. 1 Noding a Set Of Line strings on page 11) VIVID SOLUTION S Document converted by PDF Moto freeware version GDBC/CTI-S JTS Topology Suite- Version 1 eo connections Developer's Guide Input -a set of fully noded LineStrings Output - Polygons, dangling lines and cut lines Figure 6-1 -The polygonization Operation 7. MERGING A SET OF LINESTRINGS Sometimes a spatial operation such as # union will produce chains of small Linestrings The JTS LineBerger is a simple utility to sew these small linestrings together as shown below Input -a set of fully noded Linestrings Output - Merged LineStrings Figure 7-1 -The Line-Merging Operation The L,ineMerger assumes that the input Linestrings are noded (i. e. they do not cross only their endpoints can touch. See 9. 1 Noding A Set Of Line strings on page 11). Note that the output linestrings are also noded VIVID Page 10 SOLUTIONS

...展开详情
试读 12P JTS Developer Guide(JTS开发指南)
立即下载 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
wandong898 还是英文文档好贵啊,这个得写清楚。
2019-06-11
回复
乌托邦2号 英文文档,分还比较高,有点心疼分
2018-12-17
回复
u010162389 可以参考。
2018-09-15
回复
浓尘 还蛮清晰的,就是文档时英文的
2018-03-09
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
关注 私信
上传资源赚钱or赚积分
最新推荐
JTS Developer Guide(JTS开发指南) 50积分/C币 立即下载
1/12
JTS Developer Guide(JTS开发指南)第1页
JTS Developer Guide(JTS开发指南)第2页
JTS Developer Guide(JTS开发指南)第3页

试读结束, 可继续读1页

50积分/C币 立即下载