Introducing SAMGEO Service API

Relying on SAM2 for geographic data generation.

Ref Data annotation tools
  • SAM2
  • ML
home-banner-icon

Data generation has become increasingly crucial across various industries. At GeoCompas, we specialize in producing high-quality geographic data and developing training datasets for Machine Learning applications. Our commitment is to continuously enhance our capabilities and optimize workflows, ensuring more efficient processes and accurate results.

As part of this initiative, we introduced the SAMGEO-API, developed in partnership with Earth Genome. Built on the powerful SAMGEO framework by Professor Qiusheng Wu, SAMGEO-API is a cutting-edge service that simplifies interactions with the SAM2 module. It offers seamless access to advanced features through intuitive API requests, streamlining workflows and enabling precise geospatial analysis. In addition, GeoCompas has enhanced existing frontend tools such as DS-Annotate and Magic Wand plugin for JOSM. These innovations empower users to confidently manage large-scale mapping projects or focus on specific areas, leveraging SAM2’s reliable predictions to drive efficiency and accuracy in geospatial workflows.

Earth Genome is working with Climate TRACE to identify locations globally of large scale cattle feeding operations. They engaged GeoCompas to refine point locations into precise footprints of the areas holding animals as part of the Global Cattle Feed Mapping project. The Geocompas data-team worked on mapping cattle fields across different regions of the world, using both manual methods and the SAMGEO-API. We observed that the SAMGEO-API performs well in open areas where cattle feedlots have uniform textures and colors. However, in areas with highly variable textures and terrain, the results may not always be reliable, and refining the results can sometimes take longer than manually mapping the area.

In addition to the results provided by SAMGEO-API, we customized the frontend such as DS-Annotate and Magic Wand plugin for JOSM tool to simplify geometries, such as reducing the number of nodes or filtering by area. The goal of these enhancements is to minimize unnecessary nodes in the predictions and make the editing process easier, particularly for cattle feedlot areas.

Based on our experience in other projects, we achieved consistently good results. The benefits of SAMGEO-API are particularly evident when dealing with complex geometries—tasks that would typically require significant time and effort if done manually. However, for simpler geometries, such as buildings or other basic square shapes, we recommend manual digitization to achieve higher accuracy and faster results.

Here are some practical examples demonstrating how to utilize SAMGEO-API through the interfaces.

DS-Annotate

DS-Annotate is a web tool we developed during the past years in collaboration with Development Seed, it allows you to easily upload your own TMS or WMS layers and start interacting intuitively.

DS-Annotate allows you to map any area and download the results as GeoJSON.

JOSM Magic-Wand Plugin

JOSM is a powerful tool that enables quick and efficient map editing. Integrating SAMGEO-API into JOSM through the Magic Wand plugin enhances the workflow, making it easier to rapidly digitize specific areas with precision and speed.

The plugin can be found in the JOSM plugin list. Once installed, you can interact with SAMGEO-API.

The Magic-Wand plugin for JOSM allows users to easily select areas for mapping and apply geometry simplification for more efficient editing.

The Magic-Wand plugin for JOSM runs the Auto SAM option, enabling the detection of all objects within the current view.

SAMGEO-API Deployment

The SAMGEO-API can be deployed on any GPU-enabled machine. As a starting point, we’ve deployed it on g4dn.xlarge in AWS, which performs exceptionally well for a few users interacting with the API simultaneously. For larger workloads or more users, instances like p3.2xlarge or g5.xlarge are excellent choices, offering enhanced performance and scalability.

We’re excited to see how this tool continues to drive innovation in geospatial applications. Want to learn more about the SAMGEO-API or mapping workflows? Reach out to us at info@geocompas.org. We’d love to hear your thoughts and explore ways to support you.