Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have access to a database here (description of the columns are also available) containing spatial data in text format and with WGS84-EPSG:4326 coordinates.

I would like to only select data in my country (Czech Republic) and save them to our database. Is there any easy way to do this without need to import it to spatial DB and then filter it out?

I am thinking about very simple calculation using simple conditions etc. Is there a better solution than to draw a rectangle in QGIS covering whole country and then use it to define range for longitude and latitude and use it as condition for filtering?


share|improve this question
Just curious, what's stopping you from using a GIS or a spatial database btw? – R.K. Sep 26 '12 at 12:43
R.K.: just because we need to simply and automatically download it and put in a CSV file using a simple script. GIS etc. will come later for data processing and analyses. – Juhele Sep 26 '12 at 12:53
with php or python you can automatically download and create a csv file and put that in the [GIS]database. – Mapperz Sep 26 '12 at 13:38
up vote 4 down vote accepted

On a simple level, if you define a bounding box for the Czech Republic you can construct an SQL query to test if the X and Y coordinates are within the maximum and minimum coordinates of the bounding box.

The query would be something like:


Of course this will result in some data outwith the Czech Republic, as the country is not a perfect rectangle.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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