Top 5 Recent Articles
ARTICLES CATEGORIES
- Algorithms (22)
- All (399)
- Biography (1)
- Blog (44)
- Business Requirements (1)
- Commentary (1)
- Conversion (2)
- Customers (2)
- Data Models (1)
- Education (2)
- GeoRaptor (13)
- GPS (1)
- Image Processing (2)
- Import Export (8)
- Licensing (2)
- LiDAR (1)
- Linear Referencing (4)
- Manifold GIS (3)
- Mapping (1)
- MySQL Spatial (7)
- Networking and Routing (including Optimization) (5)
- Open Source (18)
- Oracle Spatial and Locator (194)
- Partitioning (1)
- PostGIS (36)
- Projections (1)
- Published Articles (1)
- qGIS (1)
- Recommendations (1)
- Services (1)
- Software Change Log (1)
- Source Code (37)
- Space Curves (9)
- Spatial Database Functions (109)
- Spatial DB comparison (1)
- Spatial XML Processing (11)
- SQL Server Spatial (92)
- Standards (3)
- Stored Procedure (17)
- Tessellation or Gridding (10)
- Tools (2)
- Topological Relationships (1)
- Training (2)
- Triangulation (2)
Find all segments of a LineString within distance of a point
Recently I was asked:
Is it possible to find all the line string with in certain distance from a point (lat, lon).
It is a pretty simple question (if I interpret it correctly).
Here is a solution for Oracle Spatial:
With Data As ( Select Sdo_Geometry('POINT (14.2253521142857 12.5352112685714)',4326) As Point, Sdo_Geometry('LINESTRING(14.22498795 12.53599561, 14.22520505 12.53554742, 14.22477786 12.53554041, 14.22519804 12.53534433,14.22473584 12.53509222, 14.22517003 12.53512723, 14.22517703 12.53465803, 14.22534511 12.5350572,14.22621348 12.53449696, 14.22545716 12.53525329, 14.22638856 12.53579252, 14.22534511 12.53543537,14.22549217 12.5362127, 14.22554819 12.5362127)',4326) As Line from dual ) Select Sdo_Geom.Sdo_Intersection( A.Line, Sdo_Geom.Sdo_Buffer(A.Point,25.0,0.05), 0.05 ).get_wkt() As iGeom from data a; IGEOM ----- MULTILINESTRING ((14.2255559643784 12.535310492623, 14.22545716 12.53525329, 14.2255681722437 12.535142276674), (14.2253486194644 12.5354365712192, 14.22534511 12.53543537, 14.2253452112491 12.5354359050129), (14.2254322946943 12.5350009519167, 14.22534511 12.5350572, 14.2253176625444 12.5349920155292), (14.2251777257262 12.5353538098784, 14.22519804 12.53534433, 14.2251554943788 12.5353211232497), (14.2251707497098 12.5350789841119, 14.22517003 12.53512723, 14.2251395974926 12.5351247876065))
Here is the input linestring and point and the result of the query:
Documentation
- MySQL Spatial General Functions
- Oracle LRS Objects
- Oracle Spatial Exporter (Java + pl/SQL)
- Oracle Spatial Object Functions
- Oracle Spatial Object Functions (Multi Page)
- PostGIS pl/pgSQL Functions
- SC4O Oracle Java Topology Suite (Java + pl/SQL)
- SQL Server Spatial General TSQL Functions
- SQL Server Spatial LRS TSQL Functions