| Jacob & Nicol, thanks for your feedback. But I am still struggling. Just to clarify: I wonna reproject not individual layers, but my whole map. Jacob, does "For this, it is required that your layer has a projection object with the native projection of that layer." that mean that for each single layer I have to specify the original projection? (Geographic in my case) As Nicol stated I need to "recalculate" the extent, at least when using different units (going from DD to Meters). But then, I found that piece of code (slightly changed): $newproj=ms_newprojectionObj("proj=robin,lon_0=0,x_0=0,y_0=0"); $latlon=ms_newprojectionObj("proj=longlat,ellps=WGS84,datum=WGS84,no_defs"); $oldext=ms_newRectObj(); $oldext->setextent(-180,-90,180,90); //this is the extent of my map in geographic $oldext->project($latlon,$newproj); //reproject to Robinson $map->setextent($oldext->minx,$oldext->miny,$oldext->maxx,$oldext->maxy); //set the new map extent And another one going like this: $projInObj = ms_newProjectionObj( "+proj=tmerc ". "+lat_0=49 ". "+lon_0=-2 ". "+k=0.999601 ". "+x_0=400000 ". "+y_0=-100000 ". "+ellps=airy ". "+towgs84=375,-111,431,0,0,0,0"); with this info in the mapscript documentation... int setProjection(string proj_params, boolean bSetUnitsAndExtents) Set map projection and coordinate system. Parameters are given as a single string of comma-delimited PROJ.4 parameters. The argument : bSetUnitsAndExtents is used to automatically update the map units and extents based on the new projection. Possible values are MS_TRUE and MS_FALSE. By defualt it is set at MS_FALSE So, what should I use? And where is coming the $map -> setProjection into play? Thanks for any clarification. Stefan On Aug 24, 2006, at 7:59 AM, Delfos, Jacob wrote:
|
- Re: [UMN_MAPSERVER-USERS] Mapscript Re-Projection on-the-... Delfos, Jacob
- Re: [UMN_MAPSERVER-USERS] Mapscript Re-Projection on... Stefan Schwarzer
- Re: [UMN_MAPSERVER-USERS] Mapscript Re-Projection on... Delfos, Jacob
- Re: [UMN_MAPSERVER-USERS] Mapscript Re-Projectio... Stefan Schwarzer
- [UMN_MAPSERVER-USERS] Mapscript Re-Projectio... Stefan Schwarzer
- Re: [UMN_MAPSERVER-USERS] Mapscript Re-Projectio... Frank Warmerdam
