- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下字符串
Line = [(-58.39323087479187, -34.64522852285068), (-58.39493519860744, -34.64593911202303), (-58.39540370387294, -34.64612018963881), (-58.39577715270643, -34.64624297063709), (-58.3961720086682, -34.64636735300267), (-58.39657393244798, -34.64649079664271), (-58.39686900560828, -34.64658786576401), (-58.39768408267521, -34.64688376919202), (-58.39804117638568, -34.64699057960223), (-58.39811749931905, -34.64700849164973), (-58.39828903137601, -34.64704378391358), (-58.39848415993365, -34.64708122410398), (-58.3986547387477, -34.64709449060737), (-58.3988514934597, -34.64709955836587), (-58.39897325079004, -34.6471023653607), (-58.39913887311855, -34.64708744614302), (-58.40078230339798, -34.64694668280777), (-58.4011366548087, -34.64692373544752), (-58.40140137506319, -34.64690660901691), (-58.40169294994597, -34.64689298223946), (-58.40188791399491, -34.64691373562576), (-58.40216794959328, -34.64695369573664), (-58.41441599275006, -34.64898345419851), (-58.41468645364731, -34.64902341675737), (-58.41491789917437, -34.6490522244158), (-58.41504783372419, -34.64906712767555), (-58.41517069354625, -34.64908171429391), (-58.41533660567228, -34.64909137548982), (-58.41610344894117, -34.64910924442286), (-58.41663883920926, -34.64911070715178), (-58.41691994816962, -34.64910623905278), (-58.41712925394172, -34.64908282123896), (-58.41735140092969, -34.64905175937751), (-58.4175040105956, -34.64901464682342), (-58.41778163827102, -34.64893890857992), (-58.41810776345819, -34.64882463807892), (-58.42014859446244, -34.64801074189261), (-58.42109129459963, -34.64768468167974), (-58.42150738131538, -34.64755870865789), (-58.42342555778116, -34.64704856595483), (-58.42380036444368, -34.64696522849173), (-58.42402399498763, -34.64692538456899), (-58.42422994553617, -34.64689682578112), (-58.42442882836995, -34.64688048716456), (-58.42466544132492, -34.64686749516407), (-58.42492895224804, -34.64686969903472), (-58.42519118859626, -34.64689581060387), (-58.42548633816839, -34.64693076251233), (-58.42574834123136, -34.64696690278817), (-58.42600734692162, -34.64703299983701), (-58.42633487929256, -34.64713342399471), (-58.42672363380665, -34.6472903832091), (-58.42701863504796, -34.64744017525714), (-58.42735477118806, -34.64764714102999), (-58.42758954729708, -34.64780944247776), (-58.42780426987807, -34.64798874926387), (-58.42805931284784, -34.64825160891823), (-58.42826384085686, -34.64851328718624), (-58.42836837245316, -34.64865441916345), (-58.42849097552769, -34.64886100909527), (-58.42863862000018, -34.64921981114054), (-58.43039902344795, -34.65411150588781), (-58.43058099211167, -34.65454759092934), (-58.43074440690579, -34.65487960245804), (-58.43091147516467, -34.65519055733962), (-58.43112803380347, -34.65554914847827), (-58.43260609566938, -34.65801519415205), (-58.43278567440816, -34.65827265019357), (-58.43296016110701, -34.65845540315134), (-58.43315011877778, -34.65865061801186), (-58.43335842356506, -34.65885169235345), (-58.43349821535271, -34.65894935913921), (-58.43369231539262, -34.65907745659961), (-58.43391244522258, -34.65921105679707), (-58.4342196854351, -34.65939138210857), (-58.43446159367213, -34.65950262175289), (-58.4354319679709, -34.65989668701516), (-58.44002778106239, -34.66183363815986), (-58.44218397209216, -34.66275027310008), (-58.46163757545956, -34.67090968101208), (-58.46246050330255, -34.67120817614321), (-58.46280547898094, -34.67132107658005), (-58.46307488578911, -34.67139608443851), (-58.46332241010779, -34.67144991252323), (-58.46353300409209, -34.67149541798045), (-58.46859653017688, -34.67249959570204), (-58.46908781436287, -34.67259411624501), (-58.46938034898276, -34.67267684368898), (-58.46981999535013, -34.67282189408634), (-58.47017709131737, -34.67296547046871), (-58.47422872212128, -34.67473003403723), (-58.47458907678709, -34.67490463353656), (-58.47485536868304, -34.67507001487545), (-58.47511721636123, -34.67527809815956), (-58.47561611823835, -34.67573966172805), (-58.47637678148585, -34.67650147966764), (-58.4772898411353, -34.677473083393), (-58.47756878106423, -34.67779366716631), (-58.47927838887487, -34.68008637250686), (-58.4796189824651, -34.68046368453628), (-58.4797836819284, -34.68061589623475), (-58.47997298162954, -34.68077149644261), (-58.48013854950542, -34.68087214089938), (-58.48033951807771, -34.68099482470753), (-58.48077178430249, -34.68117907983302), (-58.4809809942354, -34.68125468946911), (-58.48151812211091, -34.68141121492266), (-58.49074865351113, -34.68364996209967), (-58.49280644305118, -34.68416717487745), (-58.49323181266317, -34.68430677581161), (-58.4939040130434, -34.68450404480966), (-58.494446444632, -34.68469758388901), (-58.50679022633284, -34.68987115611775), (-58.50863040256832, -34.6906581855909), (-58.51021336002367, -34.69130911057548), (-58.51092048468821, -34.69162906732615), (-58.51128148474532, -34.69180116103016), (-58.51164513166684, -34.69197626961216), (-58.51190552938787, -34.6921423269721), (-58.51223224913973, -34.6923465503359), (-58.51266317587315, -34.69263696928233), (-58.51283797439013, -34.69275574911642), (-58.51343928772994, -34.69323891435921), (-58.51613617076313, -34.69565149779803), (-58.51639524277449, -34.6959621229764), (-58.51657880735801, -34.69623621532357), (-58.51668736518741, -34.69648714304233), (-58.51677990482248, -34.69677220564932), (-58.51681912473175, -34.69694815217243), (-58.51683540541565, -34.69728978685934), (-58.51682586767205, -34.69757721116119), (-58.51679226699013, -34.697818097686), (-58.51670205772855, -34.69812198637412), (-58.51657448656194, -34.69837726193614), (-58.51643210417134, -34.69861385564264), (-58.51621815101113, -34.69887195886386), (-58.5160233966457, -34.69905049204797), (-58.51546229204164, -34.69948099921363), (-58.51164101129704, -34.70237114559549)]
还有一点:
Point = (-58.503015,-34.704488)
另一方面,我有这段代码:
from shapely.geometry import LineString, Point, LinearRing
p = Point(Punto)
linea=LineString(line)
line1 = list(linea.coords)
print(linea.project(p))
np = linea.interpolate(linea.project(p))
a = p.distance(linea)
print(np)
print(a)
我知道构成最接近比较点的线的点是:(-58.51164101129704, -34.70237114559549)和距离(0.008881956060),但我需要点和连接点的线之间的距离。
请参阅附图以了解上下文。
假设红色圆圈是构成 LineString 的点,黑色圆圈是我必须测量距离的点。
正如您在图像中看到的,它位于两点之间,但我需要根据我用绿色绘制的线进行测量,因为它最接近黑点。
最佳答案
我正在考虑考虑与您的原始点最接近的 2 个点。您会将 A
作为原始点,将 B, C
作为直线上最近的 2 个点。做一个三角形ABC
,计算三角形ABC
从A
到底边BC
的高。这应该是最短的,除了边缘情况,让我回顾一下。
shortest_dist = height_of_triangle(top, base)
if shortest_dist > distance_between_top_and_either_points:
shortest_dist = distance_between_top_and_closest_point
如果您不明白我的逻辑,请告诉我。 :)
关于python - LineString 和 Point 之间的距离,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49279303/
来自 here线性/区域应该工作。但是下面的代码导致编译错误? #include #include #include #include #include #include #include
我对 mySQL 空间函数有疑问。我的目标是查明 LINESTRING 对象是否穿过 POLYGON 对象。为了确定我已经尝试用两个 LINESTRING 对象进行试验以确定它们是否交叉。 SET @
所以我在 PostgreSQL 数据库中有一列同时包含 POINT 对象和 LINESTRING 对象。现在我的最终目标是从这些对象中提取纬度和经度。对于 POINT 对象,我可以通过查询简单地做到这
我一直在 iOS 版谷歌地图中以自定义方式规划路线。 如何解析 LINESTRING 中传入的 JSON? 我的线路: "coordInfo": "LINESTRING (28.64675172929
我有 geojson 文件。此文件包含 LineString 列表。我想从此列表创建多边形。但是每个 LineString 都是一个特征,我不知道哪个 LineString 创建了具体的多边形。注意
我的数据集包含一个 LineString我想过滤掉这个 LineString 的各个线段.更准确地说,每一个街道段。 到目前为止,我已经从数据集中提取了各个点并将它们保存在一个单独的列表中。此外,我想
我有一个渲染 LineStrings 的图层,并尝试对线条应用发光效果。我创建的样式使用自定义渲染器来创建具有垂直于每个线段的渐变的笔划: const glow_style = new Style({
我正在使用 SQL Server 2008 和 Geometry 数据类型来存储英国道路列表,该列表是我从 Ordanance Survey STRATEGI 导入的。数据集。 每条道路被分成多行,每
我有一个渲染 LineStrings 的图层,并尝试对线条应用发光效果。我创建的样式使用自定义渲染器来创建具有垂直于每个线段的渐变的笔划: const glow_style = new Style({
我尝试使用最新的稳定 OpenLayers 库绘制宽度以米为单位的 polyLine(道路车道),但它没有正确的实际宽度(在 Google Maps 图层顶部检查)。 这是对我有用的代码片段: pol
很抱歉打扰你们,但我已经被他的问题困扰了半天。 我想使用 LineString 对象在 OpenLayers 中绘制折线,所以我从文档中复制了示例。它运行正常,但我在屏幕上看不到这条线 代码是这样的
我有一个 LineString 序列,例如 lineString1 和 lineString2 其中 lineString1.getEndPoint() == lineString2.getStart
我使用 LINESTRING() 将路线的 GPS 坐标存储在一行中。当我想处理这些数据时,我需要使用另一个函数,即 X()、Y()、ASTEXT()、 GEOMFROMTEXT()等 我在想,如果再
好的,所以我知道如何将数据从 php 格式转换为 geojson 格式,但我不明白如何将其转换为 lineString 类型这是代码,所以问题是如何将坐标数据转换为一个数组: include(
我有一个名为 locations 的表,其中包含这些行: id uuid NOT NULL, "deviceId" text COLLATE pg_catalog."default", "userId
在 PostGIS 中,您可以使用以下方法使两个几何相交: geometry ST_Intersection (geometry geomA, geometry geomB); 在我的例子中,geom
在使用 shapely 时,我遇到了一个奇怪的问题。有 2 个点 p1 和 p2,第一个属于多边形,第二个不属于。当我试图找到包含这 2 个点的 LineString 与多边形边界线的端点之间的交点时
我有一组 GPS 位置,我用 Mapbox 将其放在 map 上,然后在点之间画一条线。 有没有办法画一条沿着道路的平滑/智能线?而不是我在图纸上得到的? Single marker
我正在尝试创建两个数组的单个 LineString 对象。我已经尝试了多种方法,但我不断得到: >>> array = [(0,0),(1,0),(2,0),(3,0)][(1,3),(1.4,2),
我正在尝试在离其他坐标最近的点处拆分 Shapely LineString。我可以使用 project 和 interpolate 获得直线上的最近点,但此时我无法拆分直线,因为它不是顶点。 我需要沿
我是一名优秀的程序员,十分优秀!