[mapserver-users] Georeferencing a raster without worldfile
Trond Michelsen
trondmm-mapserver+2017 at crusaders.no
Fri Dec 1 08:50:54 PST 2017
Thank you for the suggestion. Unfortunately, I forgot to mention that
they're png-files.
--
Trond Michelsen
On Fri, Dec 01, 2017 at 04:38:38PM +0000, Fawcett, David (MNIT) wrote:
> If these are .tif files, can you write the georeference info to internal metadata as a way to avoid a .tfw file?
>
> -----Original Message-----
> From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Trond Michelsen
> Sent: Friday, December 01, 2017 10:19 AM
> To: Mapserver <mapserver-users at lists.osgeo.org>
> Subject: [mapserver-users] Georeferencing a raster without worldfile
>
> Hi.
>
> I'm using mapserver 7.0.0
>
> I have about 250.000 raster images that I want to serve through mapserver. They are all 1195x1550 pixels, and they all cover the exact same area (UTM33N -75000,6450000,1120000,8000000). All images has a resolution of 1km per pixel.
>
> I also have a worldfile that works:
> --8<--
> 1000
> 0.0
> 0.0
> -1000
> -75000
> 8000000
> --8<--
>
> What I want to avoid, is to have one worldfile for each of the 250.000 files.
>
> I have tried to use a processing directive, like the documentation says:
>
> --8<--
> WORLDFILE=<file>
> Specifies an alternative world file (for georeferencing). If a
> path only is specified, the base name of the dataset will be
> appended. The suffix (.wld / .tfw / ...) can be omitted.
>
> Example:
>
> PROCESSING "WORLDFILE=/path/"
> or
> PROCESSING "WORLDFILE=/path/file.wld"
> or
> PROCESSING "WORLDFILE=/path/file"
> --8<--
>
> But adding
>
> PROCESSING "WORLDFILE=/path/to/my/worldfile.wld"
>
> to my mapfile has, as far as I can tell, absolutely no effect.
>
>
> The projection on the layer is defined like this:
>
> PROJECTION
> "+init=epsg:32633"
> END
>
>
> If I change that to
>
> PROJECTION
> "+init=epsg:32633 +units=km"
> END
>
> My layer will turn up at 0,0,1195000,1550000 in EPSG:32633
>
> In theory, if I added easting and northing to the projection definition, like this:
>
> PROJECTION
> "+init=epsg:32633 +units=km +x_0=-75000 +y_0=6450000"
> END
>
> It should position itself properly, but proj does not allow easting or northing to the UTM projections.
>
> The documetation also states:
>
> --8<--
> wms_extent
>
> For Rasters served through WMS, MapServer can now use the
> wms_extent metadata parameter to register the image. If a .wld
> file cannot be found, MapServer will then look for the wms_extent
> metadata parameter and use the extents of the image and the size
> of the image for georegistration.
> --8<--
>
> However, if I add
>
> METADATA
> "wms_extent" "-75000 6450000 1120000 8000000"
> END
>
> to the layer, it has no effect.
>
>
> So... What am I doing wrong? How do I get my files to show up where they're supposed to?
>
>
> --
> Trond Michelsen
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list