I'm in the process of publishing spatial data stored in a PostGIS database to a Google Maps based android app and am trying to put together a plan for rendering my data in the most efficient manner possible.

The portion of my dataset I'm concerned about consists of about 200,000 polygons that will be filtered by the user name, bounding box etc. I can see situations where I would like to display up to 1000 heavily simplified polygons when zoomed out, but I doubt that I will be displaying more than 20 on a screen without simplifying the data.

My current strategy is to query my database based on the filtering factors mentioned above, return the query as a GeoJSON and render the resulting data directly into Google Maps.

Is this an appropriate strategy or should I be looking at using another service to help render my data before it is loaded into Google Maps?

If it is an appropriate strategy I could use some advice on how to render GeoJSON polygons in the Google Maps android api.

I'm quite comfortable with the SQL end of this project but I'm not as experienced with JavaScript or the Google Maps android api v2.

  • 1
    Have you considered the user experience side of things - does the user really need to see up to 1,000 polygons on a single view, or would 100-200 suffice?
    – minus34
    Feb 19, 2014 at 3:20

2 Answers 2


I'm not familiar with the Android development environment, but I think I may have a solution. If you export your geometr(ies), 200,000 polygons, say, in Well-Known Text (WKT) format, you can use the open-source library Wicket to directly create Polygon() objects in Google Maps API. Here's a demo:


WKT is the base text representation of geometry in PostGIS. You can get the WKT representation of any geometry or geography type data in PostGIS using the ST_AsText() function.


Provided you've thinned the polygons appropriately and trimmed the unneeded decimal places by formatting the coordinates output from PostGIS, then geoJSON is as good as it gets for a straightforward solution.

Your Answer

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

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