Search code examples
androidlocationgeo

How to retrieve vegetation of a given location


This seems like a completely useless information but i would like to know if there is some kind of mechanism which lets me get the approximate vegetation of a location.

I want to know if I am inside a City, or in a desert, or if I'm currently in the woods, or on the see.

Also is there a chance to get the nearest lake of sea?

This seems a bit of an odd question...and I hope you understand what I'm looking for.

Thank you very much


Solution

  • This is difficult to do because of a lack of readily available data accessible from Android, but I think your best bet is to use a crowd-sourced dataset such as OpenStreetMap (OSM).

    You'd need to set up your own spatial database (e.g., PostGIS) and import OSM data into the database.

    OSM standardizes multiple vegetation label types, including:

    • natural=bare_rock
    • natural=fell
    • natural=glacier
    • landuse=grass
    • natural=grassland
    • natural=heath
    • natural=mud
    • natural=screen
    • natural=sand
    • natural=scrub
    • natural=tree
    • natural=wetland
    • natural=wood.

    See the OSM - Natural - Land Cover wiki page for more detail on OSM labels of vegetation.

    Then, you'd create a server-side API (hosted in a web server such as Tomcat or Glassfish) to receive the mobile phone's current location, do a spatial query via PostGIS to determine the polygon and natural land cover type (i.e., vegetation) the phone's location lies within, and return the vegetation type to the phone.

    Another option is to use ESRI shape files instead of OSM data, and load this data into the PostGIS database.