Tiff files with different projections in the same layer

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Tiff files with different projections in the same layer

paalkr
Hi!

I have several GeoTiff files with different projections parameters, they are all transverse mercator but the central meridian and the latitude of origin differs. The projection information is written in the tiff files, hence the files are real GeoTiffs. Is it possible to build a tileindex for these files without re projecting them to a common projection, and access them trough one single layer in a mapfile?

Regards
Pål Kristensen
Reply | Threaded
Open this post in threaded view
|

RE: Tiff files with different projections in the samelayer

Ed McNierney-4
Pål -

The problem is that your TILEINDEX shapefile is only in one projection, and there is no facility for recording per-file projection parameters in it.

I would instead recommend that you create one layer, and one TILEINDEX, for each distinct projection, and then create a GROUP that combines all these layers into a single logical layer you can turn on or off and treat as if it were a single layer.

     - Ed

P.S. I wonder if it *might* be possible to bundle these in one layer if you reprojected each image into a common projection, created a TILEINDEX for those files, then replaced those reprojected files with the originals.  The TILEINDEX is used to quickly identify candidate images for use in rendering the map request, and GDAL *might* respect the projection in the GeoTIFF once the file was opened.  But I've never tried that and I think the GROUP approach I described is much simpler and safer.

Ed McNierney
Chief Mapmaker
Demand Media / TopoZone.com
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: 978-251-4242, Fax: 978-251-1396
[hidden email]

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Pål Kristensen
Sent: Friday, March 14, 2008 11:21 AM
To: [hidden email]
Subject: [MAPSERVER-USERS] Tiff files with different projections in the samelayer


Hi!

I have several GeoTiff files with different projections parameters, they are
all transverse mercator but the central meridian and the latitude of origin
differs. The projection information is written in the tiff files, hence the
files are real GeoTiffs. Is it possible to build a tileindex for these files
without re projecting them to a common projection, and access them trough
one single layer in a mapfile?

Regards
Pål Kristensen
--
View this message in context: http://www.nabble.com/Tiff-files-with-different-projections-in-the-same-layer-tp16048268p16048268.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Tiff files with different projections in the samelayer

Rahkonen Jukka (Tike)
In reply to this post by paalkr
I fear that tileindex can contain only images sharing the same projection. But perhaps, if you do not have very many different projections, you could make own tileindex for each projection and put them under same GROUP.

Kind of a trick that might work is to reproject images to some common projection, not physically but by creating a virtual raster (.vrt).  Something like this:
C:\data>gdalwarp -of vrt -s_srs epsg:2392 -t_srs epsg:2393 saarijarvi.tif vrt_test.vrt
Followed by:
gdaltindex vrt_tindex.shp *.vrt

I have never tried that but somehow the idea fascinates me. I hope it works.

-Jukka Rahkonen.


-----Alkuperäinen viesti-----
Lähettäjä: [hidden email] puolesta: Pål Kristensen
Lähetetty: pe 14.3.2008 17:20
Vastaanottaja: [hidden email]
Aihe: [MAPSERVER-USERS] Tiff files with different projections in the samelayer
 

Hi!

I have several GeoTiff files with different projections parameters, they are
all transverse mercator but the central meridian and the latitude of origin
differs. The projection information is written in the tiff files, hence the
files are real GeoTiffs. Is it possible to build a tileindex for these files
without re projecting them to a common projection, and access them trough
one single layer in a mapfile?

Regards
Pål Kristensen
--
View this message in context: http://www.nabble.com/Tiff-files-with-different-projections-in-the-same-layer-tp16048268p16048268.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

RE: Tiff files with different projections in the samelayer

paalkr
In reply to this post by Ed McNierney-4
Hi!

Thanks for helping with this. The GROUP mechanism is what I normally would use, and have been doing in some other projects. The problem with this particular case is that every of the 200 tiff's has different projections. I tried to re project them to WGS84 UTMsone33 (EPSG:32633) with GDALWARP and it worked quite well, so I think the solution in this case will be to batch re project all the tiffs. GDALWARP used only approx 0,5 min on each raster so it's no big deal to re project them.

Thanks for the hints!

Regards,
Pål Kristensen


Ed McNierney wrote
Pål -

The problem is that your TILEINDEX shapefile is only in one projection, and there is no facility for recording per-file projection parameters in it.

I would instead recommend that you create one layer, and one TILEINDEX, for each distinct projection, and then create a GROUP that combines all these layers into a single logical layer you can turn on or off and treat as if it were a single layer.

     - Ed

P.S. I wonder if it *might* be possible to bundle these in one layer if you reprojected each image into a common projection, created a TILEINDEX for those files, then replaced those reprojected files with the originals.  The TILEINDEX is used to quickly identify candidate images for use in rendering the map request, and GDAL *might* respect the projection in the GeoTIFF once the file was opened.  But I've never tried that and I think the GROUP approach I described is much simpler and safer.

Ed McNierney
Chief Mapmaker
Demand Media / TopoZone.com
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: 978-251-4242, Fax: 978-251-1396
ed@topozone.com

-----Original Message-----
From: mapserver-users-bounces@lists.osgeo.org [mailto:mapserver-users-bounces@lists.osgeo.org] On Behalf Of Pål Kristensen
Sent: Friday, March 14, 2008 11:21 AM
To: mapserver-users@lists.osgeo.org
Subject: [MAPSERVER-USERS] Tiff files with different projections in the samelayer


Hi!

I have several GeoTiff files with different projections parameters, they are
all transverse mercator but the central meridian and the latitude of origin
differs. The projection information is written in the tiff files, hence the
files are real GeoTiffs. Is it possible to build a tileindex for these files
without re projecting them to a common projection, and access them trough
one single layer in a mapfile?

Regards
Pål Kristensen
--
View this message in context: http://www.nabble.com/Tiff-files-with-different-projections-in-the-same-layer-tp16048268p16048268.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users