Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Given latitude and longitude, how to find in what country those coordinates are?

Đang mở
#233 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với câu hỏi của issue về GeoJSON và EPSG:4326/JTS; không có tệp mã nguồn, bài kiểm thử hoặc điểm vào nào được nêu tên. Trước khi công việc có thể được xem là hoàn tất, dự án sẽ cần một triển khai đã được quyết định hoặc một câu trả lời được ghi lại cho việc tra cứu quốc gia, bao gồm hành vi chấp nhận được trong các trường hợp biên và phương pháp tối ưu hóa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

question

This is more of a question as I need help to figure out...

So as ti title says:

Given latitude and longitude, how to find in what country those coordinates are?

I have geojson file with country borders. Each country is represented with either Polygon or MultiPolygon. If I understand correctly, those coordinates that are inside geojson file are longitude and latitude in EPSG:4236 CRS. Because of that I cannot just check relation between Point (longitude, latitude) and Polygon because it might give error because operation/methods from this library and JTS does not take into account curvature of earth.

So my idea is first to convert all geometries from EPSG:4326 to Google Mercator, and then convert given longitude and latitude, and finally perform contains and intersect operations?

Am I on the right way? Or can I directly use geometries without transformation from one CRS to another (I am willing to tolerate some error, like some near border cases)?

Also for the optimization purposes, I would build quad tree and boundary box checks...

Ngôn ngữ chính
Java
Star
962
Fork
174
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của locationtech/spatial4j

Tất cả issue của locationtech/spatial4j

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.