You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: web/docs/developer/index.md
+15-28Lines changed: 15 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,18 @@
1
1
# JTS Topology Suite Developer’s Guide
2
2
3
-
### **Version 1.4**
4
-
5
-
### **Document Change Control**
6
-
7
-
* REVISION NUMBER: 1.4
8
-
* DATE OF ISSUE: October 17, 2003
9
-
* AUTHOR(S): Jonathan Aquino
10
-
* BRIEF DESCRIPTION OF CHANGE: Initial draft, created for JTS 1.4
11
-
12
-
# **1. OVERVIEW**
3
+
# OVERVIEW
13
4
14
5
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.
15
6
16
7
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.
17
8
18
-
## **1.1 OTHER RESOURCES**
9
+
## RESOURCES
19
10
20
11
**OpenGIS 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 spatial predicates and functions implemented by JTS.
21
12
**JTS Technical Specifications*. The design specification for the classes, methods and algorithms implemented in the JTS Topology Suite.
22
13
**JTS JavaDoc*. Documentation for all of the packages, classes and methods in JTS.
23
14
24
-
# **2. GETTING STARTED**
15
+
# GETTING STARTED
25
16
26
17
The most common JTS 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:
27
18
@@ -49,7 +40,7 @@ Other computations built into Geometries include: area, envelope, centroid, and
49
40
about what a Geometry can do, see the JavaDoc for Geometry in the `org.loctiontech.jts.geom`
50
41
package, as well as subsequent sections in this document.
51
42
52
-
# **3. COMPUTING SPATIAL RELATIONSHIPS**
43
+
# COMPUTING SPATIAL RELATIONSHIPS
53
44
54
45
An important application of JTS 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:
55
46
@@ -74,7 +65,7 @@ Most relationships of interest can be specified as a pattern which matches a set
74
65
75
66
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.
76
67
77
-
# **4. COMPUTING OVERLAY OPERATIONS**
68
+
# COMPUTING OVERLAY OPERATIONS
78
69
79
70
The previous section discussed functions that return true or false, like Intersects and Contains. We will now present the JTS **overlay operations**, some of which are illustrated in Figure 4-1 below.
80
71
@@ -100,7 +91,7 @@ Descriptions for the overlay operations are tabulated below.
100
91
101
92
As with the spatial relationships described in the previous section, these overlay operations have precise definitions given in the JTS Technical Specifications.
102
93
103
-
# **5. COMPUTING BUFFERS**
94
+
# COMPUTING BUFFERS
104
95
105
96
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 **Minkowski 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**.
106
97
@@ -123,7 +114,7 @@ or a `Point` results in an empty `Geometry`.
123
114
124
115
Buffer distances of 0 are also supported. You can use this to perform an efficient union of multiple polygons.
125
116
126
-
## **5.1 BASIC BUFFERING**
117
+
## BASIC BUFFERING
127
118
128
119
To compute a buffer for a given distance, call the `buffer()` method on the `Geometry`:
129
120
@@ -132,7 +123,7 @@ Geometry g = ...
132
123
Geometry buffer = g.buffer(100.0);
133
124
```
134
125
135
-
## **5.2 END CAP STYLES**
126
+
## END CAP STYLES
136
127
137
128
Buffer polygons can be computed with different line **end cap
138
129
styles**. The end cap style determines how the line work for the buffer
## **5.3 SPECIFYING THE APPROXIMATION QUANTIZATION**
158
+
## SPECIFYING THE APPROXIMATION QUANTIZATION
168
159
169
160
Since the exact buffer outline of a Geometry usually contains circular
170
161
sections, the buffer must be approximated by the linear Geometry
@@ -189,7 +180,7 @@ The default number of segments is 8. This gives less than a 2% maximum error in
189
180
190
181
**Figure 5-3 \- Using Different Curve Approximation Levels**
191
182
192
-
# **6. POLYGONIZATION**
183
+
# POLYGONIZATION
193
184
194
185
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.
195
186
@@ -232,11 +223,7 @@ Sometimes a spatial operation such as \#union will produce chains of small LineS
232
223
233
224
**Figure 7-1 – The Line-Merging Operation**
234
225
235
-
The `LineMerger` assumes that the input `LineStrings` are *noded* (i.e. they do not cross; only their
236
-
237
-
**TODO** fix this link
238
-
239
-
endpoints can touch. See *9.1 Noding A Set Of `LineStrings`* on page 11). Note that the output `LineStrings`
226
+
The `LineMerger` 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 `LineStrings`* on page 11). Note that the output `LineStrings`
240
227
are also noded.
241
228
242
229
If `LineStrings` to be merged do not have the same direction, the direction of the resulting `LineString`
By default JTS uses arrays of Coordinates to represent the points and lines of Geometries. There are some cases in which you might want Geometries to store their points using some other implementation. For example, to save memory you may want to use a more compact sequence implementation, such as an array of x’s and an array of y’s. Another possibility is to use a custom coordinate class to store extra information on each coordinate, such as measures for linear referencing.
257
244
@@ -273,9 +260,9 @@ A note on performance: If your `CoordinateSequence` is not based on an array of
273
260
marshalling and unmarshalling required for JTS to convert the user coordinates into arrays of JTS
274
261
coordinates.
275
262
276
-
# **9. TIPS & TECHNIQUES**
263
+
# TIPS & TECHNIQUES
277
264
278
-
## **9.1 NODING A SET OF LINESTRINGS**
265
+
## NODING A SET OF LINESTRINGS
279
266
280
267
Many spatial operations assume that their input data is **noded**, meaning that `LineStrings` never cross. For
281
268
example, the JTS `Polygonizer` and the JTS `LineMerger` described earlier assume that their input is noded.
@@ -301,7 +288,7 @@ for (int i = 1; i \< lineStrings.size(); i++) {
301
288
}
302
289
```
303
290
304
-
# **10. UNIONING MANY POLYGONS EFFICIENTLY**
291
+
# UNIONING MANY POLYGONS EFFICIENTLY
305
292
306
293
Calling `Polygon.union` repeatedly is one way to union several `Polygons`
307
294
together. But here’s a trick that can be significantly faster (seconds
0 commit comments