in my app I am parsing an XML from the web which gives me such coordinate info:

I am able to use my app to get a pair of float values like 14.871381 and 50.065968. I do not want any complicate processing (using simple C++ program running in CLI) - if possible the best would be if some free library or CLI utility could say whether this point (according to the coordinates) lies in a polygon (in my case a particular region - just one) - maybe like this:

Have a map with defined polygon (region/county) A Query: 14.871381 ; 50.065968 Reply: A or: Query: 14.871381 ; 50.065968 is in region A? Reply: True (or False or 1/0 or something simple)

Most important is to have really efficient and low demanding solution, no GUI needed (program runs in CLI) and it runs on weak HW (single-core Atom CPU) running Kubuntu linux and about 1-2 queries per second.

PS: my brother is able to help me with GIS related information but not with the programming...

  • maybe gis.stackexchange.com/questions/26519/… would help
    – radouxju
    Nov 2, 2014 at 19:43
  • @radouxju This is good workaround, but first its in Java - so not really lightweight solution. Moreover, I am speaking about much complicated areas, that should be defined probably in tens or thousands of points. This is map of Czech Republic, with marked areas (different colours) I am planning to work with: krajskeurady.cz/images/mapa.gif
    – HeliTux
    Nov 2, 2014 at 21:35

1 Answer 1


The problem you are referring at is called "Point in Polygon" - if you google it you'll find various solutions with various tools of various complexity. You can pick up what ever suits you best or create your own solution.

A simple C program can be found at stackexcange

  • Exactly what I was looking for and in C++ which I am using. Thank you.
    – HeliTux
    Nov 3, 2014 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.