[GIS] How to set up a background map in WGS84 projection for interactive map

geoserveropenlayers-2postgisqgisweb-mapping

I've started developing my own interactive map and I have some things which are not clear to me.

I heard that OSM, Google maps and all similar maps use Google Mercator projection. But if I use that map as my background map can I transform it to WGS84 because my other data is in WGS84 projection. Is it better to do it immediately in QGis or is it possible to change it later in some other step of creating web gis? (is it possible to do it using postgis, geoserver or openlayers?).

Is it even possible to transform it to WGS84 or it has to stay at Google Mercator?

And one more thing. What is actually the best way to add background map to my future web GIS application? Should I do it immediately in QGis (if so, is it possible to import it in GeoServer later because I can't have .shp file of it because its not shp file, it's just satellite or other type of data provided with QGis plugins.. and as far as I know, I can import only shp files in geoserver, or tables from postgis) .. or can I do it some other way?

Best Answer

Where are you getting your base map from? For example: if you are using a tile cache maintained by someone else (Google Maps or Open Street Map) then I would suggest reprojecting your data. Conversely, if you are going to download OSM and ingest it into PostgreSQL, you could serve your basemap as WGS84.

My sugegstion would be to (1) use someone else's basemap for now, (2) load your data into Geoserver (shapefiles) and (3) let GeoServer reproject. This will be slow, but will let get a working prototype quickly. Once you like the results, you could use GDAL to batch reproject your vector data, load it into PostgreSQL with PostGIS, and server everything in Google Mercator. This will take longer to get set up, but will be (likely) significantly faster to serve to your users.

More info on getting your data from shapefile into Geoserver here.

I would check out OpenLayers for some tutorials on how to get your data from GeoServer and from your tile cache service into a web browser. OpenGeo Tutorial