ee.Geometry.LineString
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tạo một ee.Geometry mô tả LineString.
Để thuận tiện, bạn có thể dùng varargs khi tất cả đối số đều là số. Điều này cho phép tạo LineString EPSG:4326 trắc địa khi có số lượng đối số chẵn, ví dụ: ee.Geometry.LineString(aLng, aLat, bLng, bLat, ...).
Cách sử dụng | Giá trị trả về |
---|
ee.Geometry.LineString(coords, proj, geodesic, maxError) | Geometry.LineString |
Đối số | Loại | Thông tin chi tiết |
---|
coords | List<Geometry>|List<List<Number>>|List<Number> | Một danh sách có ít nhất 2 điểm. Có thể là danh sách toạ độ ở định dạng GeoJSON "LineString", danh sách gồm ít nhất hai đối tượng ee.Geometry mô tả một điểm hoặc danh sách gồm ít nhất bốn số xác định toạ độ [x,y] của ít nhất hai điểm. |
proj | Dự kiến (không bắt buộc) | Phép chiếu của hình học này. Nếu không được chỉ định, giá trị mặc định sẽ là phép chiếu của ee.Geometry đầu vào hoặc EPSG:4326 nếu không có đầu vào ee.Geometry. |
geodesic | Boolean, không bắt buộc | Nếu là false, các cạnh sẽ thẳng trong phép chiếu. Nếu là true, các cạnh sẽ được uốn cong để đi theo đường ngắn nhất trên bề mặt Trái Đất. Giá trị mặc định là trạng thái trắc địa của các giá trị đầu vào hoặc true nếu các giá trị đầu vào là số. |
maxError | ErrorMargin (không bắt buộc) | Lỗi tối đa khi hình học đầu vào phải được chiếu lại thành một phép chiếu kết quả hoặc trạng thái trắc địa được yêu cầu rõ ràng. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eCreates a LineString geometry, which represents a line segment on Earth's surface.\u003c/p\u003e\n"],["\u003cp\u003eAccepts a list of coordinates, projection, geodesic setting, and error margin for construction.\u003c/p\u003e\n"],["\u003cp\u003eAllows convenient creation of geodesic lines using coordinate pairs (longitude, latitude).\u003c/p\u003e\n"],["\u003cp\u003eDefaults to EPSG:4326 projection if no input geometry's projection is specified.\u003c/p\u003e\n"],["\u003cp\u003eEnables both straight and curved line representations based on the \u003ccode\u003egeodesic\u003c/code\u003e parameter.\u003c/p\u003e\n"]]],[],null,["# ee.Geometry.LineString\n\n\u003cbr /\u003e\n\nConstructs an ee.Geometry describing a LineString.\n\n\u003cbr /\u003e\n\nFor convenience, varargs may be used when all arguments are numbers. This allows creating geodesic EPSG:4326 LineStrings given an even number of arguments, e.g. ee.Geometry.LineString(aLng, aLat, bLng, bLat, ...).\n\n| Usage | Returns |\n|--------------------------------------------------------------------------|---------------------|\n| `ee.Geometry.LineString(coords, `*proj* `, `*geodesic* `, `*maxError*`)` | Geometry.LineString |\n\n| Argument | Type | Details |\n|------------|----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `coords` | List\\\u003cGeometry\\\u003e\\|List\\\u003cList\\\u003cNumber\\\u003e\\\u003e\\|List\\\u003cNumber\\\u003e | A list of at least two points. May be a list of coordinates in the GeoJSON 'LineString' format, a list of at least two ee.Geometry objects describing a point, or a list of at least four numbers defining the \\[x,y\\] coordinates of at least two points. |\n| `proj` | Projection, optional | The projection of this geometry. If unspecified, the default is the projection of the input ee.Geometry, or EPSG:4326 if there are no ee.Geometry inputs. |\n| `geodesic` | Boolean, optional | If false, edges are straight in the projection. If true, edges are curved to follow the shortest path on the surface of the Earth. The default is the geodesic state of the inputs, or true if the inputs are numbers. |\n| `maxError` | ErrorMargin, optional | Max error when input geometry must be reprojected to an explicitly requested result projection or geodesic state. |"]]