I am making an application in java using GMaps4JSF where the person will enter the address on the map I'll take this coordinate and consult on my postgis base regions in which region this point is inserted and return this information on the screen. It's very simple. Google Maps Api uses the Mercator projection (EPSG: 3857), the coordinate of the queried map will be returned in this projection? I must redesign my data to it does not need to do conversions.
Although the underlying tiles are projected to epsg:3857, the Maps API accepts Latitude/Longitude pairs in epsg:4326 (vs y/x coordinates in meters, which would be implied by 3857).
Therefore if you want to draw a polygon on the map, you would pass the API latitude/longitude and it will be projected appropriately to match the underlying data (note you may wish to specify geodesic:true in your overlay options in the API)
That said you didn't specify what projection your data in PostGIS is index as, so I can't say whether you need to change anything.
Expanding on what Mapperz noted, one way to do this is by creating views in postgresql replacing the geometry field with a calculated field that transforms the coordinate system of your data to a coordinate system that the Maps API can use, 4326 or 3857. Something like:
CREATE OR REPLACE VIEW vw_MY_VIEW AS SELECT ID_FIELD, st_transform(GEOMETRY_FIELD.geometry, 3857) AS geometry, FIELD3, FIELD4 FROM TABLE_NAME;
This would allow you to intersect the point geometry from the map, which is natively 3857, with the view you created, also in 3857.
Alternately you could transform the point geometry from the map into the table's arid in the intersect operation.
This prevents having to reproject and persist your data permanently to meet the needs of a dependency. Instead you can continue to use your postgis data in the coordinate system that best fits your needs.
Am not used to Java but I think the Google API's coordinate system can be transformed on render to suite the system of interest.There are two ways to go around this issue: 1. Make sure all the layers in your application are on the same projection. 2. Redefine the projection of one layer to suit another.Example: If your point layers is in EPSG:4326 and want it to overlay on the Google's 3857,you can transform the system to fit the Google's. Hope this helps!