开发者

GIS to get information for specific bb box/zoom level

开发者 https://www.devze.com 2023-04-12 05:35 出处:网络
Please feel free to correct any miss used words in this post, as I\'m not familiar in such areas, I use words to the best of my knowledge but they\'re probably wrong.

Please feel free to correct any miss used words in this post, as I'm not familiar in such areas, I use words to the best of my knowledge but they're probably wrong.

So here's what I want to do:

Child abducting and trafficking is a quite serious problem back in China, a friend of mine was talking to me this afternoon, the idea of a separate app on iOS and Android to do this task, users can take pictures, upload along with their GPS location 开发者_开发问答to a db, and the app can also display information that's in the db, as annotations on a map.

And my question is:

In the app when user submit a new post, which includes photos, GPS location, any notes, to a database.

Then we user switch to map view, we'll have to get information for the current zoom level/bb box, so

how should I store those information in the db, in what format?

and

are there any open source tools that can parse the information for given bb box/zoom level and return a xml file so that I can take and use it to display the information?

-- I found GeoServer, are there better ones for my use? I really only need it to generate xml files based on bb box/zoom level.

I would imagine that host the tool (is it called geocoder?) on Google App Engine/Amazon Ec2 is the most ideal, don't know much for db, probably Amazon Simple DB?

Thanks!


There are a number of Open Source tools that could help - you could look at GeoDjango, for example, which can use the PostGIS geo database - but honestly, for this application, you don't need anything geo-specific:

  • You will be receiving GPS coordinates in latitude/longitude, so presumably you'll have a table in your database with two columns, latitude and longitude.

  • To do a bounding box lookup, all you need is the minimum/maximum for both longitude and latitude (which any web-based map will be able to give you). Once you have that, almost any SQL database will support a query like this:

    SELECT * FROM records 
        WHERE latitude >= $min_lat 
            AND latitude <= $max_lat
            AND longitude >=  $min_lon
            AND longitude <= $max_lon;
    

    This gives you a list of records that falls within your bounding box.

  • Now you can use whatever middleware you like - a CMS system like Django or Drupal, a custom PHP script, etc - to turn the resultset into XML or JSON format.

Geographic databases do a lot of things relational databases don't do easily, like find points within a radius or points within a set of polygons. But you don't need that for your application - any system with basic database-querying functions should give you what you need.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号