Reading latitude longitude points from a BMP/PNG file?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
if you know where the data will be on the image then you can crop that part of the image and then pass it through an OCR library - such as tesseract.
If you don't it would be more problematic because you may have other pieces of data which once you have converted using ocr may look like valid lat long points.
I will be knowing the location of the points on the map, and that'll be an area
sized much smaller than a pea.
But, inside that area, I won't be able to tell the "exact" point.
Will that library help in that casE?
You should be able to use it to convert the data from an image to true text and progress from there. I've not used the library in a while but the concept remains the same: convert from image to text; then validate the text; if it looks reasonable then use the result as your data.
If you know the type of projection of the map, it should be possible to calculate latitude and longitude corresponding to any pixel in the image based on the geometry of the mapping. It might be tricky to compute the mapping for many projection types. The field of cartography must have plenty of such software.
--- rod.
If you know the type of projection of the map, it should be possible to calculate latitude and longitude corresponding to any pixel in the image based on the geometry of the mapping. It might be tricky to compute the mapping for many projection types. The field of cartography must have plenty of such software.
--- rod.
If he is using a static image, e.g. in a world map application then this is how I would do it.
I will be knowing the location of the points on the map, and that'll be an area sized much smaller than a pea.
But, inside that area, I won't be able to tell the "exact" point.
Will that library help in that casE?
I had to do this with a vector-type topological map in the past, and it was a bear. If you know the boundaries of the map section you're working with, you're in a better place, since from those, you can calculate the number of points in-between, and work out the position. The page I linked to has some Java examples of code to do what you're seeking, but there are other language implementations of those same formulas. Guessing you're wanting to do this on a web-page.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.