[mapserver-users] Changing the "EXTENT" for a layer
Adrian Popa
adrian_gh.popa at romtelecom.ro
Wed Feb 25 04:17:27 PST 2009
Hello,
Thank you for your reply. I managed to find out the MapInfo layer is
using WGS 84 / UTM zone 35N (like you predicted).
I will try to adjust my mapfile for these projections. I guess I need
to reproject *every* layer.
Thanks again for your help. I'll contant all to let you know how it
worked out.
Cheers,
Adrian
Rahkonen Jukka wrote:
> Hi,
>
> Mapserver works without any knowledge about projection with one
> dataset if only the extents suit the data coordinates. That's the case
> with your ESRI layer. But you have two datasets which obviously are
> using different projections. To show them together either (or both)
> of them needs to be reprojected. And that is possible only if you
> know and tell Mapserver the projections for both datasets.
>
> What needs to be done is
> 1) Set at the MAP level the projection that you want Mapserver to use
> for output as well as map extents using values and units of the output
> projection.
> 2) Set at the LAYER level the projections for both of the datasets.
>
> To make is as simple as possible for the beginning I suggest to
> use projection epsg:4326 and a bit wider extents than you have now at
> MAP level. Thats because those extents are already working for you,
> and ESRI dataset most propably is in WGS84 projection. Thus you
> should use projection epsg:4326 also for your ESRI layer.
>
> Then there will be just the Mapinfo layer left. Defined by the the
> ogrinfo line PARAMETER["central_meridian",27] and coordinates it looks
> like it might be in UTM 35N projection (epsg:32635). Have a try with
> that first.
>
> -Jukka Rahkonen-
>
> ------------------------------------------------------------------------
> *L�hett�j�:* mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] *Puolesta *Adrian Popa
> *L�hetetty:* 25. helmikuuta 2009 9:25
> *Vastaanottaja:* mapserver-users at lists.osgeo.org
> *Aihe:* [mapserver-users] Changing the "EXTENT" for a layer
>
> Hello all!
>
> I'm trying to display some layers (ESRI Shapefile and MapInfo) in
> the same map. The ESRI shapefiles work just fine, and I've used
> them for a long time. The new MapInfo layer however has very
> different "Extent" values for its coordinates and does not overlap
> with the original layers (they should overlap, because they cover
> the same area).
>
> Here is some output from ogrinfo:
>
> 1. A layer that displays ok and for which the coordinates are
> longitude/latitude:
>
> [adrianp at server data]$ ogrinfo Limits.shp -so -al
> Had to open data source read-only.
> INFO: Open of `Limits.shp'
> using driver `ESRI Shapefile' successful.
>
> Layer name: Limits
> Geometry: Line String
> Feature Count: 8718
> *Extent: (20.261522, 43.618437) - (29.704897, 48.264780)*
> Layer SRS WKT:
> GEOGCS["GCS_WGS_1984",
> DATUM["WGS_1984",
> SPHEROID["WGS_1984",6378137.0,298.257223563]],
> PRIMEM["Greenwich",0.0],
> UNIT["Degree",0.0174532925199433]]
> OBJECTID_1: Integer (9.0)
> TIP: Integer (4.0)
> Shape_Leng: Real (19.11)
>
> 2. A layer which displays if I set the Extent parameter in the MAP
> file to the values returned by ogrinfo:
>
> [adrianp at server data]$ ogrinfo coverage.TAB -so -al
> Had to open data source read-only.
> INFO: Open of `coverage.TAB'
> using driver `MapInfo File' successful.
>
> Layer name: coverage
> Geometry: Unknown (any)
> Feature Count: 1
> *Extent: (550.002594, 4830850.004496) - (707800.001127,
> 5318099.996174)*
> Layer SRS WKT:
> PROJCS["unnamed",
> GEOGCS["unnamed",
> DATUM["WGS_1984",
> SPHEROID["WGS 84",6378137,298.257223563],
> TOWGS84[0,0,0,-0,-0,-0,0]],
> PRIMEM["Greenwich",0],
> UNIT["degree",0.0174532925199433]],
> PROJECTION["Transverse_Mercator"],
> PARAMETER["latitude_of_origin",0],
> PARAMETER["central_meridian",27],
> PARAMETER["scale_factor",0.9996],
> PARAMETER["false_easting",500000],
> PARAMETER["false_northing",0],
> UNIT["Meter",1.0]]
> LEGEND: String (50.0)
> THRESHOLD: Real (0.0)
> COLOR: String (20.0)
> Prediction_name: String (50.0)
>
>
> I don't know how the second layer was generated (perhaps the
> values in extent are not longitude/latitude values), but I would
> like to display both layers in the same coordinate system.
> If I consider the second set of values is longitude/latitude, they
> make no sense (unless the surface of Earth is the same as the
> surface of Jupiter!).
>
> My question is: can mapserver do the translation of coordinates
> (by adding/substracting a fixed value), or do I need to do this
> with another system?
> If the solution is external to mapserver, what's my next step
> (some manuals please!)?
>
> I haven't worked with projections; could this be the cause?
>
> Any help is appreciated, thanks!
> Adrian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090225/8dd871f8/attachment.htm>
More information about the MapServer-users
mailing list