TurfsJoins pointsWithinPolygon => Need more informations
还没有人认领这个 Issue。
评估
调研方向
从 TurfJoins.pointsWithinPolygon 入手,将提供的 FeatureCollection 构造与该方法所期望的多边形坐标进行比较;检查所示的 Kotlin 服务代码,尤其是过滤和坐标顺序。使用相同的点和多边形重现空结果,并在确定原因且该方法返回预期的点,或记录所需的输入修正后,视为该 issue 已完成。
由索引模型根据 Issue 内容生成。
描述
Hello !
First of all, thank you for your work!
I have a service that transforms data into geojson.
I have points and polygons. I want to check if the points are in the polygons. For this, I use "TurfJoins.pointsWithinPolygon()".
But when I pass my two FeatureCollections as parameters, it returns an empty list. Maybe I forgot something?
After several hours of searching, I decide to turn to you. I thank you in advance for your help. I code in Kotlin
class PointWithinPolygonService @Autowired constructor (val tblPolygonRepository: TblPolygonRepository, val pointsService: PointsService) {
fun withinPolygon(): FeatureCollection {
val polygons = tblPolygonRepository.findAll()
val points = pointsService.getPoints()
val pointsFeatureCollection = FeatureCollection
.fromFeatures(points
.filter { it.gpsLongitude != null }
.map { Feature.fromGeometry(Point.fromLngLat(BigDecimal(it.gpsLongitude!!).setScale(4, RoundingMode.CEILING).toDouble(), BigDecimal(it.gpsLatitude!!).setScale(4, RoundingMode.CEILING).toDouble()))
})
val polygonsFeatureCollection = FeatureCollection
.fromFeature(Feature
.fromGeometry(Polygon
.fromLngLats(polygons
.map {it.getListCoordinates()?.map { it -> Point.fromLngLat(it.longitude, it.latitude) } }))
)
return TurfJoins.pointsWithinPolygon(pointsFeatureCollection, polygonsFeatureCollection)
}
}
- 主要语言
- Java
- 星标
- 438
- 派生
- 117
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mapbox/mapbox-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
mapbox/mapbox-java#1640 ·
-
难度 4/5 3-5 天 新手友好度 55/100
mapbox/mapbox-java#1635 ·
-
难度 5/5 一周以上 新手友好度 15/100
mapbox/mapbox-java#1619 ·
-
Mapbox-java incompatible with gson 2.13.0 and up - call to internal GSON classes that were renamed 未关闭
难度 2/5 1-3 小时 新手友好度 48/100
mapbox/mapbox-java#1614 · 2 条评论 · 1 个 reaction ·
-
难度 5/5 一周以上 新手友好度 20/100
mapbox/mapbox-java#1612 · 1 个 reaction ·
查看 mapbox/mapbox-java 的全部 Issue
相似的 Issue
-
certification
难度 1/5 1 小时以内 新手友好度 80/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's 未关闭bug ecr
难度 2/5 1-3 小时 新手友好度 75/100
-
Needs: Triage Type: Feature request
难度 2/5 1-3 小时 新手友好度 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 65/100
github/copilot-sdk#2760 ·